summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in56
-rw-r--r--aclocal.m4907
-rw-r--r--backend-po/README.ADD_NEW_LANGUAGE15
-rw-r--r--backend-po/README.INSTALL9
-rw-r--r--backend-po/README.UPDATE_LANGUAGE8
-rw-r--r--backend-po/de/sane-umax.mobin0 -> 10247 bytes
-rwxr-xr-xbackend-po/make_newbackend.po.in3
-rw-r--r--backend-po/newbackend.po544
-rw-r--r--backend-po/newbackend.po.in546
-rw-r--r--backend-po/newbackend.po.in.header2
-rw-r--r--backend-po/newbackend.po.in.in546
-rwxr-xr-xbackend-po/po.in2po8
-rwxr-xr-xbackend-po/remake_backend.po.in10
-rw-r--r--backend-po/umax.de.po852
-rw-r--r--backend-po/umax.de.po.in579
-rwxr-xr-xconfig.guess883
-rwxr-xr-xconfig.sub958
-rwxr-xr-xconfigure5569
-rw-r--r--configure.in301
-rw-r--r--doc/Makefile.in78
-rw-r--r--doc/autoenhance.jpgbin0 -> 1219 bytes
-rw-r--r--doc/brightness.jpgbin0 -> 726 bytes
-rw-r--r--doc/contrast.jpgbin0 -> 922 bytes
-rw-r--r--doc/default.jpgbin0 -> 747 bytes
-rw-r--r--doc/gamma.jpgbin0 -> 808 bytes
-rw-r--r--doc/negative.jpgbin0 -> 1267 bytes
-rw-r--r--doc/restore.jpgbin0 -> 837 bytes
-rw-r--r--doc/rgb-default.jpgbin0 -> 1095 bytes
-rw-r--r--doc/sane-backends-doc.html110
-rw-r--r--doc/sane-logo.jpgbin0 -> 14856 bytes
-rw-r--r--doc/sane-logo2.jpgbin0 -> 6908 bytes
-rw-r--r--doc/sane-pnm-doc.html39
-rw-r--r--doc/sane-pnm16-doc.html42
-rw-r--r--doc/sane-problems-doc.html116
-rw-r--r--doc/sane-scantips-doc.html48
-rw-r--r--doc/sane-xsane-advanced-doc.html35
-rw-r--r--doc/sane-xsane-advanced.jpgbin0 -> 13091 bytes
-rw-r--r--doc/sane-xsane-copy-doc.html40
-rw-r--r--doc/sane-xsane-copy.jpgbin0 -> 25812 bytes
-rw-r--r--doc/sane-xsane-doc.html232
-rw-r--r--doc/sane-xsane-enhancement-doc.html101
-rw-r--r--doc/sane-xsane-fax-doc.html39
-rw-r--r--doc/sane-xsane-fax-project.jpgbin0 -> 12185 bytes
-rw-r--r--doc/sane-xsane-fax.jpgbin0 -> 22366 bytes
-rw-r--r--doc/sane-xsane-gimp-doc.html60
-rw-r--r--doc/sane-xsane-gimp.jpgbin0 -> 21593 bytes
-rw-r--r--doc/sane-xsane-histogram-doc.html55
-rw-r--r--doc/sane-xsane-histogram.jpgbin0 -> 26450 bytes
-rw-r--r--doc/sane-xsane-main-doc.html40
-rw-r--r--doc/sane-xsane-pipette-black.jpgbin0 -> 1058 bytes
-rw-r--r--doc/sane-xsane-pipette-gray.jpgbin0 -> 1077 bytes
-rw-r--r--doc/sane-xsane-pipette-white.jpgbin0 -> 1065 bytes
-rw-r--r--doc/sane-xsane-preview-doc.html173
-rw-r--r--doc/sane-xsane-preview.jpgbin0 -> 42499 bytes
-rw-r--r--doc/sane-xsane-scan-doc.html92
-rw-r--r--doc/sane-xsane-setup-copy-doc.html96
-rw-r--r--doc/sane-xsane-setup-copy.jpgbin0 -> 36848 bytes
-rw-r--r--doc/sane-xsane-setup-display-doc.html99
-rw-r--r--doc/sane-xsane-setup-display.jpgbin0 -> 29270 bytes
-rw-r--r--doc/sane-xsane-setup-fax-doc.html104
-rw-r--r--doc/sane-xsane-setup-fax.jpgbin0 -> 26701 bytes
-rw-r--r--doc/sane-xsane-setup-save-doc.html92
-rw-r--r--doc/sane-xsane-setup-save.jpgbin0 -> 30881 bytes
-rw-r--r--doc/sane-xsane-standard-doc.html33
-rw-r--r--doc/sane-xsane-standard.jpgbin0 -> 16093 bytes
-rw-r--r--doc/sane-xsane-visible-area.jpgbin0 -> 847 bytes
-rw-r--r--doc/sane-xsane-zoom-in.jpgbin0 -> 1094 bytes
-rw-r--r--doc/sane-xsane-zoom-not.jpgbin0 -> 1150 bytes
-rw-r--r--doc/sane-xsane-zoom-out.jpgbin0 -> 1128 bytes
-rw-r--r--doc/sane-xsane-zoom-undo.jpgbin0 -> 1101 bytes
-rw-r--r--doc/sane-xsane.jpgbin0 -> 25412 bytes
-rw-r--r--doc/store.jpgbin0 -> 790 bytes
-rw-r--r--doc/xsane-logo.jpgbin0 -> 14048 bytes
-rw-r--r--doc/xsane-logo2.jpgbin0 -> 6898 bytes
-rw-r--r--doc/xsane.man199
-rw-r--r--frontend/Makefile.in85
-rw-r--r--frontend/cursor/cursor_pipette_black8
-rw-r--r--frontend/cursor/cursor_pipette_gray8
-rw-r--r--frontend/cursor/cursor_pipette_mask8
-rw-r--r--frontend/cursor/cursor_pipette_white8
-rw-r--r--frontend/xsane-back-gtk.c1426
-rw-r--r--frontend/xsane-back-gtk.h188
-rw-r--r--frontend/xsane-device-preferences.c699
-rw-r--r--frontend/xsane-device-preferences.c.old761
-rw-r--r--frontend/xsane-device-preferences.h42
-rw-r--r--frontend/xsane-front-gtk.c798
-rw-r--r--frontend/xsane-front-gtk.h73
-rw-r--r--frontend/xsane-gamma.c1541
-rw-r--r--frontend/xsane-gamma.h48
-rw-r--r--frontend/xsane-icons.c1751
-rw-r--r--frontend/xsane-icons.h87
-rw-r--r--frontend/xsane-logo.xpm372
-rw-r--r--frontend/xsane-preferences.c292
-rw-r--r--frontend/xsane-preferences.h122
-rw-r--r--frontend/xsane-preview.c3257
-rw-r--r--frontend/xsane-preview.h178
-rw-r--r--frontend/xsane-rc-io.c903
-rw-r--r--frontend/xsane-rc-io.h123
-rw-r--r--frontend/xsane-save.c975
-rw-r--r--frontend/xsane-save.h79
-rw-r--r--frontend/xsane-scan.c2369
-rw-r--r--frontend/xsane-scan.h35
-rw-r--r--frontend/xsane-setup.c1565
-rw-r--r--frontend/xsane-setup.h33
-rw-r--r--frontend/xsane-style.rc34
-rw-r--r--frontend/xsane-text.h417
-rw-r--r--frontend/xsane.c4794
-rw-r--r--frontend/xsane.h513
-rw-r--r--include/Makefile8
-rw-r--r--include/Makefile.in7
-rw-r--r--include/getopt.h129
-rw-r--r--include/lalloca.h47
-rw-r--r--include/sane/config.h.in342
-rw-r--r--include/sane/sanei_backend.h116
-rw-r--r--include/sane/sanei_config.h76
-rw-r--r--include/sane/sanei_signal.h50
-rw-r--r--include/sane/stamp-h1
-rwxr-xr-xinstall-sh250
-rw-r--r--intl/ChangeLog1086
-rw-r--r--intl/Makefile.in214
-rw-r--r--intl/VERSION1
-rw-r--r--intl/bindtextdom.c203
-rw-r--r--intl/cat-compat.c262
-rw-r--r--intl/dcgettext.c624
-rw-r--r--intl/dgettext.c59
-rw-r--r--intl/explodename.c188
-rw-r--r--intl/finddomain.c216
-rw-r--r--intl/gettext.c70
-rw-r--r--intl/gettext.h105
-rw-r--r--intl/gettextP.h89
-rw-r--r--intl/hash-string.h59
-rw-r--r--intl/intl-compat.c76
-rw-r--r--intl/l10nflist.c411
-rw-r--r--intl/libgettext.h182
-rw-r--r--intl/linux-msg.sed100
-rw-r--r--intl/loadinfo.h76
-rw-r--r--intl/loadmsgcat.c222
-rw-r--r--intl/localealias.c424
-rw-r--r--intl/po2tbl.sed60
-rw-r--r--intl/po2tbl.sed.in102
-rw-r--r--intl/textdomain.c108
-rw-r--r--intl/xopen-msg.sed104
-rw-r--r--lib/Makefile.in75
-rw-r--r--lib/alloca.c493
-rw-r--r--lib/getopt.c831
-rw-r--r--lib/getopt1.c180
-rw-r--r--lib/sigprocmask.c48
-rw-r--r--lib/snprintf.c532
-rw-r--r--lib/strdup.c38
-rw-r--r--lib/strndup.c39
-rw-r--r--lib/strsep.c49
-rw-r--r--lib/usleep.c60
-rwxr-xr-xmkinstalldirs36
-rw-r--r--po/Makefile.in92
-rw-r--r--po/Makefile.in.bak92
-rw-r--r--po/README.ADD_NEW_LANGUAGE69
-rw-r--r--po/README.UPDATE_LANGUAGE8
-rw-r--r--po/add-0.37.po.in56
-rw-r--r--po/add-0.38.po.in48
-rw-r--r--po/add-0.40.po.in40
-rw-r--r--po/add-0.44.po.in9
-rw-r--r--po/add-0.47.po.in5
-rw-r--r--po/cs.gmobin0 -> 24167 bytes
-rw-r--r--po/cs.po1594
-rw-r--r--po/cs.po.in1239
-rw-r--r--po/de.gmobin0 -> 24095 bytes
-rw-r--r--po/de.po1596
-rw-r--r--po/de.po.in1230
-rw-r--r--po/del-0.43.po.in2
-rw-r--r--po/del-0.44.po.in4
-rw-r--r--po/del-0.47.po.in3
-rw-r--r--po/fr.gmobin0 -> 17131 bytes
-rw-r--r--po/fr.po2137
-rw-r--r--po/fr.po.in1072
-rwxr-xr-xpo/make_newlanguage.po.in3
-rw-r--r--po/newlanguage.po.in1567
-rw-r--r--po/newlanguage.po.in.header2
-rw-r--r--po/newlanguage.po.in.in1211
-rwxr-xr-xpo/po.in2po8
-rwxr-xr-xpo/remake_language.po.in10
-rw-r--r--sanei/Makefile0
-rw-r--r--xsane-0.50.lsm17
-rw-r--r--xsane-convert-to-0.46.c85
-rw-r--r--xsane-convert-to-0.49.c65
-rw-r--r--xsane.AUTHOR2
-rw-r--r--xsane.CHANGES711
-rw-r--r--xsane.COPYING340
-rw-r--r--xsane.IMAGE4
-rw-r--r--xsane.INSTALL48
-rw-r--r--xsane.LANGUAGES14
-rw-r--r--xsane.NEWS19
-rw-r--r--xsane.OLDER_NEWS19
-rw-r--r--xsane.ONLINEHELP13
-rw-r--r--xsane.PROBLEMS64
-rw-r--r--xsane.TODO62
-rw-r--r--xsane.WIP4
196 files changed, 59323 insertions, 0 deletions
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..309b77a
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,56 @@
+SHELL = /bin/sh
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = .
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+MKDIR = $(top_srcdir)/mkinstalldirs
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+@SET_MAKE@
+
+SUBDIRS = lib @INTLSUB@ frontend @POSUB@ doc
+
+all: all-recursive
+
+
+install: install-recursive
+
+clean: clean-recursive
+
+distclean: clean distclean-recursive
+ rm -f *~ include/*~ include/sane/*~ *.log *.bak libtool
+ rm -f include/sane/config.h Makefile config.cache config.status
+ rm -f intl/Makefile
+
+depend: depend-recursive
+
+all-recursive install-recursive clean-recursive distclean-recursive \
+depend-recursive:
+ for subdir in $(SUBDIRS); do \
+ target=`echo $@ | sed s/-recursive//`; \
+ echo making $$target in $$subdir; \
+ (cd $$subdir && $(MAKE) $$target) \
+ || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+
+.PHONY: all clean depend \
+ all-recursive install-recursive clean-recursive depend-recursive
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..ae0266d
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,907 @@
+# Configure paths for GTK+
+# Owen Taylor 97-11-3
+
+dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
+dnl
+AC_DEFUN(AM_PATH_GTK,
+[dnl
+dnl Get the cflags and libraries from the gtk-config script
+dnl
+AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
+ gtk_config_prefix="$withval", gtk_config_prefix="")
+AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
+ gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
+AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
+ , enable_gtktest=yes)
+
+ if test x$gtk_config_exec_prefix != x ; then
+ gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
+ if test x${GTK_CONFIG+set} != xset ; then
+ GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
+ fi
+ fi
+ if test x$gtk_config_prefix != x ; then
+ gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
+ if test x${GTK_CONFIG+set} != xset ; then
+ GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
+ fi
+ fi
+
+ AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
+ min_gtk_version=ifelse([$1], ,0.99.7,$1)
+ AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
+ no_gtk=""
+ if test "$GTK_CONFIG" = "no" ; then
+ no_gtk=yes
+ else
+ GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
+ GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
+ gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ if test "x$enable_gtktest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GTK_CFLAGS"
+ LIBS="$LIBS $GTK_LIBS"
+dnl
+dnl Now check if the installed GTK is sufficiently new. (Also sanity
+dnl checks the results of gtk-config to some extent
+dnl
+ rm -f conf.gtktest
+ AC_TRY_RUN([
+#include <gtk/gtk.h>
+#include <stdio.h>
+
+int
+main ()
+{
+ int major, minor, micro;
+
+ system ("touch conf.gtktest");
+
+ if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_gtk_version");
+ exit(1);
+ }
+
+ if ((gtk_major_version != $gtk_config_major_version) ||
+ (gtk_minor_version != $gtk_config_minor_version) ||
+ (gtk_micro_version != $gtk_config_micro_version))
+ {
+ printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
+ $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
+ gtk_major_version, gtk_minor_version, gtk_micro_version);
+ printf ("*** was found! If gtk-config was correct, then it is best\n");
+ printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
+ printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+ printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+ printf("*** required on your system.\n");
+ printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
+ printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
+ printf("*** before re-running configure\n");
+ }
+ else
+ {
+ if ((gtk_major_version > major) ||
+ ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+ ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
+ gtk_major_version, gtk_minor_version, gtk_micro_version);
+ printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
+ major, minor, micro);
+ printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
+ printf("***\n");
+ printf("*** If you have already installed a sufficiently new version, this error\n");
+ printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
+ printf("*** being found. The easiest way to fix this is to remove the old version\n");
+ printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
+ printf("*** correct copy of gtk-config. (In this case, you will have to\n");
+ printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+ printf("*** so that the correct libraries are found at run-time))\n");
+ }
+ }
+ return 1;
+}
+],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_gtk" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test "$GTK_CONFIG" = "no" ; then
+ echo "*** The gtk-config script installed by GTK could not be found"
+ echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the GTK_CONFIG environment variable to the"
+ echo "*** full path to gtk-config."
+ else
+ if test -f conf.gtktest ; then
+ :
+ else
+ echo "*** Could not run GTK test program, checking why..."
+ CFLAGS="$CFLAGS $GTK_CFLAGS"
+ LIBS="$LIBS $GTK_LIBS"
+ AC_TRY_LINK([
+#include <gtk/gtk.h>
+#include <stdio.h>
+], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
+ [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding GTK or finding the wrong"
+ echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+ echo "***"
+ echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
+ echo "*** came with the system with the command"
+ echo "***"
+ echo "*** rpm --erase --nodeps gtk gtk-devel" ],
+ [ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means GTK was incorrectly installed"
+ echo "*** or that you have moved GTK since it was installed. In the latter case, you"
+ echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ GTK_CFLAGS=""
+ GTK_LIBS=""
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(GTK_CFLAGS)
+ AC_SUBST(GTK_LIBS)
+ rm -f conf.gtktest
+])
+
+
+######################################################################
+
+## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
+## Copyright (C) 1996-1998 Free Software Foundation, Inc.
+## Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+##
+## 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+# serial 24 AM_PROG_LIBTOOL
+AC_DEFUN(AM_PROG_LIBTOOL,
+[AC_REQUIRE([AM_ENABLE_SHARED])dnl
+AC_REQUIRE([AM_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_RANLIB])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AM_PROG_LD])dnl
+AC_REQUIRE([AM_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+dnl
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags=
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$silent" = yes && libtool_flags="$libtool_flags --silent"
+test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ CFLAGS="$CFLAGS -belf"
+ ;;
+esac
+
+# Actually configure libtool. ac_aux_dir is where install-sh is found.
+CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+])
+
+# AM_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AM_ENABLE_SHARED[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_SHARED,
+[define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(shared,
+changequote(<<, >>)dnl
+<< --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
+changequote([, ])dnl
+[ --enable-shared=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_shared=yes ;;
+no) enable_shared=no ;;
+*)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
+])
+
+# AM_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN(AM_DISABLE_SHARED,
+[AM_ENABLE_SHARED(no)])
+
+# AM_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN(AM_DISABLE_STATIC,
+[AM_ENABLE_STATIC(no)])
+
+# AM_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AM_ENABLE_STATIC[(DEFAULT)]
+# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
+# `yes'.
+AC_DEFUN(AM_ENABLE_STATIC,
+[define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(static,
+changequote(<<, >>)dnl
+<< --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
+changequote([, ])dnl
+[ --enable-static=PKGS only build shared libraries if the current package
+ appears as an element in the PKGS list],
+[p=${PACKAGE-default}
+case "$enableval" in
+yes) enable_static=yes ;;
+no) enable_static=no ;;
+*)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+ for pkg in $enableval; do
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$ac_save_ifs"
+ ;;
+esac],
+enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
+])
+
+
+# AM_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN(AM_PROG_LD,
+[AC_ARG_WITH(gnu-ld,
+[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])
+ac_prog=ld
+if test "$ac_cv_prog_gcc" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by GCC])
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
+ # Accept absolute paths.
+ /* | [A-Za-z]:\\*)
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(ac_cv_path_LD,
+[if test -z "$LD"; then
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog"; then
+ ac_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some GNU ld's only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ test "$with_gnu_ld" != no && break
+ else
+ test "$with_gnu_ld" != yes && break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+else
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_SUBST(LD)
+AM_PROG_LD_GNU
+])
+
+AC_DEFUN(AM_PROG_LD_GNU,
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+ ac_cv_prog_gnu_ld=yes
+else
+ ac_cv_prog_gnu_ld=no
+fi])
+])
+
+# AM_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN(AM_PROG_NM,
+[AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(ac_cv_path_NM,
+[case "$NM" in
+/* | [A-Za-z]:\\*)
+ ac_cv_path_NM="$NM" # Let the user override the test with a path.
+ ;;
+*)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/nm; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -B"
+ elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+ ac_cv_path_NM="$ac_dir/nm -p"
+ else
+ ac_cv_path_NM="$ac_dir/nm"
+ fi
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ ;;
+esac])
+NM="$ac_cv_path_NM"
+AC_MSG_RESULT([$NM])
+AC_SUBST(NM)
+])
+##### end of libtool.m4
+
+dnl AM_FUNC_ALLOCA
+AC_DEFUN(AM_FUNC_ALLOCA,
+[AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+test $ac_cv_func_alloca_works = no && LTALLOCA=alloca.lo
+AC_SUBST(LTALLOCA)dnl
+])
+
+# @defmac AC_PROG_CC_STDC
+# @maindex PROG_CC_STDC
+# @ovindex CC
+# If the C compiler in not in ANSI C mode by default, try to add an option
+# to output variable @code{CC} to make it so. This macro tries various
+# options that select ANSI C on some system or another. It considers the
+# compiler to be in ANSI C mode if it handles function prototypes correctly.
+#
+# If you use this macro, you should check after calling it whether the C
+# compiler has been set to accept ANSI C; if not, the shell variable
+# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
+# code in ANSI C, you can make an un-ANSIfied copy of it by using the
+# program @code{ansi2knr}, which comes with Ghostscript.
+# @end defmac
+
+AC_DEFUN(AM_PROG_CC_STDC,
+[AC_REQUIRE([AC_PROG_CC])
+AC_BEFORE([$0], [AC_C_INLINE])
+AC_BEFORE([$0], [AC_C_CONST])
+dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
+dnl a magic option to avoid problems with ANSI preprocessor commands
+dnl like #elif.
+dnl FIXME: can't do this because then AC_AIX won't work due to a
+dnl circular dependency.
+dnl AC_BEFORE([$0], [AC_PROG_CPP])
+AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
+AC_CACHE_VAL(am_cv_prog_cc_stdc,
+[am_cv_prog_cc_stdc=no
+ac_save_CC="$CC"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1
+# HP-UX -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__
+"
+do
+ CC="$ac_save_CC $ac_arg"
+ AC_TRY_COMPILE(
+[#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+} int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, i
+nt);
+int argc;
+char **argv;
+], [
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+],
+[am_cv_prog_cc_stdc="$ac_arg"; break])
+done
+CC="$ac_save_CC"
+])
+if test -z "$am_cv_prog_cc_stdc"; then
+ AC_MSG_RESULT([none needed])
+else
+ AC_MSG_RESULT($am_cv_prog_cc_stdc)
+fi
+case "x$am_cv_prog_cc_stdc" in
+ x|xno) ;;
+ *) CC="$CC $am_cv_prog_cc_stdc" ;;
+esac
+])
+
+
+
+
+dnl aclocal.m4 generated automatically by aclocal 1.2f
+
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+
+
+# progtest.m4 from gettext 0.32
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper@cygnus.com>, 1996.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN(AM_PATH_PROG_WITH_TEST,
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+ /*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+
+# lcmessage.m4 from gettext 0.32
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+AC_DEFUN(AM_LC_MESSAGES,
+ [if test $ac_cv_header_locale_h = yes; then
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES)
+ fi
+ fi])
+
+
+
+# gettext.m4 from gettext 0.32
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 3
+
+AC_DEFUN(AM_WITH_NLS,
+ [AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE(nls,
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT($USE_NLS)
+ AC_SUBST(USE_NLS)
+
+ USE_INCLUDED_LIBINTL=no
+
+ dnl If we use NLS figure out what method
+ if test "$USE_NLS" = "yes"; then
+ AC_DEFINE(ENABLE_NLS)
+ AC_MSG_CHECKING([whether included gettext is requested])
+ AC_ARG_WITH(included-gettext,
+ [ --with-included-gettext use the GNU gettext library included here],
+ nls_cv_force_use_gnu_gettext=$withval,
+ nls_cv_force_use_gnu_gettext=no)
+ AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ dnl User does not insist on using GNU NLS library. Figure out what
+ dnl to use. If gettext or catgets are available (in this order) we
+ dnl use this. Else we have to fall back to GNU NLS library.
+ dnl catgets is only used if permitted by option --with-catgets.
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+ CATOBJEXT=NONE
+
+ AC_CHECK_HEADER(libintl.h,
+ [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
+ [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
+ gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
+
+ if test "$gt_cv_func_gettext_libc" != "yes"; then
+ AC_CHECK_LIB(intl, bindtextdomain,
+ [AC_CACHE_CHECK([for gettext in libintl],
+ gt_cv_func_gettext_libintl,
+ [AC_TRY_LINK([], [return (int) gettext ("")],
+ gt_cv_func_gettext_libintl=yes,
+ gt_cv_func_gettext_libintl=no)])])
+ fi
+
+ if test "$gt_cv_func_gettext_libc" = "yes" \
+ || test "$gt_cv_func_gettext_libintl" = "yes"; then
+ AC_DEFINE(HAVE_GETTEXT)
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
+ if test "$MSGFMT" != "no"; then
+ AC_CHECK_FUNCS(dcgettext)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr],
+ [CATOBJEXT=.gmo
+ DATADIRNAME=share],
+ [CATOBJEXT=.mo
+ DATADIRNAME=lib])
+ INSTOBJEXT=.mo
+ fi
+ fi
+ ])
+
+ if test "$CATOBJEXT" = "NONE"; then
+ AC_MSG_CHECKING([whether catgets can be used])
+ AC_ARG_WITH(catgets,
+ [ --with-catgets use catgets functions if available],
+ nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
+ AC_MSG_RESULT($nls_cv_use_catgets)
+
+ if test "$nls_cv_use_catgets" = "yes"; then
+ dnl No gettext in C library. Try catgets next.
+ AC_CHECK_LIB(i, main)
+ AC_CHECK_FUNC(catgets,
+ [AC_DEFINE(HAVE_CATGETS)
+ INTLOBJS="\$(CATOBJS)"
+ AC_PATH_PROG(GENCAT, gencat, no)dnl
+ if test "$GENCAT" != "no"; then
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
+ if test "$GMSGFMT" = "no"; then
+ AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
+ fi
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ USE_INCLUDED_LIBINTL=yes
+ CATOBJEXT=.cat
+ INSTOBJEXT=.cat
+ DATADIRNAME=lib
+ INTLDEPS='$(top_builddir)/intl/libintl.a'
+ INTLLIBS=$INTLDEPS
+ LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+ nls_cv_header_intl=intl/libintl.h
+ nls_cv_header_libgt=intl/libgettext.h
+ fi])
+ fi
+ fi
+
+ if test "$CATOBJEXT" = "NONE"; then
+ dnl Neither gettext nor catgets in included in the C library.
+ dnl Fall back on GNU gettext library.
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions used to generate GNU NLS library.
+ INTLOBJS="\$(GETTOBJS)"
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ AC_SUBST(MSGFMT)
+ USE_INCLUDED_LIBINTL=yes
+ CATOBJEXT=.gmo
+ INSTOBJEXT=.mo
+ DATADIRNAME=share
+ INTLDEPS='$(top_builddir)/intl/libintl.a'
+ INTLLIBS=$INTLDEPS
+ LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+ nls_cv_header_intl=intl/libintl.h
+ nls_cv_header_libgt=intl/libgettext.h
+ fi
+
+ dnl Test whether we really found GNU xgettext.
+ if test "$XGETTEXT" != ":"; then
+ dnl If it is no GNU xgettext we define it as : so that the
+ dnl Makefiles still can work.
+ if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ : ;
+ else
+ AC_MSG_RESULT(
+ [found xgettext programs is not GNU xgettext; ignore it])
+ XGETTEXT=":"
+ fi
+ fi
+
+ # We need to process the po/ directory.
+ POSUB=po
+ else
+ DATADIRNAME=share
+ nls_cv_header_intl=intl/libintl.h
+ nls_cv_header_libgt=intl/libgettext.h
+ fi
+
+ # If this is used in GNU gettext we have to set USE_NLS to `yes'
+ # because some of the sources are only built for this goal.
+ if test "$PACKAGE" = gettext; then
+ USE_NLS=yes
+ USE_INCLUDED_LIBINTL=yes
+ fi
+
+ dnl These rules are solely for the distribution goal. While doing this
+ dnl we only have to keep exactly one list of the available catalogs
+ dnl in configure.in.
+ for lang in $ALL_LINGUAS; do
+ GMOFILES="$GMOFILES $lang.gmo"
+ POFILES="$POFILES $lang.po"
+ done
+
+ dnl Make all variables we use known to autoconf.
+ AC_SUBST(USE_INCLUDED_LIBINTL)
+ AC_SUBST(CATALOGS)
+ AC_SUBST(CATOBJEXT)
+ AC_SUBST(DATADIRNAME)
+ AC_SUBST(GMOFILES)
+ AC_SUBST(INSTOBJEXT)
+ AC_SUBST(INTLDEPS)
+ AC_SUBST(INTLLIBS)
+ AC_SUBST(INTLOBJS)
+ AC_SUBST(POFILES)
+ AC_SUBST(POSUB)
+ ])
+
+AC_DEFUN(AM_GNU_GETTEXT,
+ [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_PROG_RANLIB])dnl
+ AC_REQUIRE([AC_ISC_POSIX])dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_REQUIRE([AC_C_CONST])dnl
+ AC_REQUIRE([AC_C_INLINE])dnl
+ AC_REQUIRE([AC_TYPE_OFF_T])dnl
+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+ AC_REQUIRE([AC_FUNC_MMAP])dnl
+
+ AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
+unistd.h values.h sys/param.h])
+ AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next])
+
+ if test "${ac_cv_func_stpcpy+set}" != "set"; then
+ AC_CHECK_FUNCS(stpcpy)
+ fi
+ if test "${ac_cv_func_stpcpy}" = "yes"; then
+ AC_DEFINE(HAVE_STPCPY)
+ fi
+
+ AM_LC_MESSAGES
+ AM_WITH_NLS
+
+ if test "x$CATOBJEXT" != "x"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ AC_MSG_CHECKING(for catalogs to be installed)
+ NEW_LINGUAS=
+ for lang in ${LINGUAS=$ALL_LINGUAS}; do
+ case "$ALL_LINGUAS" in
+ *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+ esac
+ done
+ LINGUAS=$NEW_LINGUAS
+ AC_MSG_RESULT($LINGUAS)
+ fi
+
+ dnl Construct list of names of catalog files to be constructed.
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ dnl The reference to <locale.h> in the installed <libintl.h> file
+ dnl must be resolved because we cannot expect the users of this
+ dnl to define HAVE_LOCALE_H.
+ if test $ac_cv_header_locale_h = yes; then
+ INCLUDE_LOCALE_H="#include <locale.h>"
+ else
+ INCLUDE_LOCALE_H="\
+/* The system does not provide the header <locale.h>. Take care yourself. */"
+ fi
+ AC_SUBST(INCLUDE_LOCALE_H)
+
+ dnl Determine which catalog format we have (if any is needed)
+ dnl For now we know about two different formats:
+ dnl Linux libc-5 and the normal X/Open format
+ test -d intl || mkdir intl
+ if test "$CATOBJEXT" = ".cat"; then
+ AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
+
+ dnl Transform the SED scripts while copying because some dumb SEDs
+ dnl cannot handle comments.
+ sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
+ fi
+ dnl po2tbl.sed is always needed.
+ sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+ $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
+
+ dnl In the intl/Makefile.in we have a special dependency which makes
+ dnl only sense for gettext. We comment this out for non-gettext
+ dnl packages.
+ if test "$PACKAGE" = "gettext"; then
+ GT_NO="#NO#"
+ GT_YES=
+ else
+ GT_NO=
+ GT_YES="#YES#"
+ fi
+ AC_SUBST(GT_NO)
+ AC_SUBST(GT_YES)
+
+ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
+ dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
+ dnl Try to locate is.
+ MKINSTALLDIRS=
+ if test -z "$MKINSTALLDIRS"; then
+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+ fi
+ AC_SUBST(MKINSTALLDIRS)
+
+ dnl *** For now the libtool support in intl/Makefile is not for real.
+ l=
+ AC_SUBST(l)
+ ])
+
diff --git a/backend-po/README.ADD_NEW_LANGUAGE b/backend-po/README.ADD_NEW_LANGUAGE
new file mode 100644
index 0000000..5a016ca
--- /dev/null
+++ b/backend-po/README.ADD_NEW_LANGUAGE
@@ -0,0 +1,15 @@
+
+How to create a new backend translation:
+----------------------------------------
+If you want to add a new translation, newbackend.po.in or newbackend.po could
+be a good start!
+
+If you have translations to other languages or for other backends,
+please send them to the backend author and to me <Oliver.Rauch@Wolfsburg.DE>
+
+Thanks
+Oliver
+
+PS: The backend translation tables shall be included into the sane package,
+ it will be in this directory only temporary.
+
diff --git a/backend-po/README.INSTALL b/backend-po/README.INSTALL
new file mode 100644
index 0000000..e1562de
--- /dev/null
+++ b/backend-po/README.INSTALL
@@ -0,0 +1,9 @@
+
+How to install a new backend translation:
+-----------------------------------------
+You must copy the sane-*.mo files to the position where the xsane.mo files are
+placed. This can be e.g. /usr/local/share/locale/de/LC_MESSAGES for the german
+translations
+
+e.g.:
+cp de/sane-umax.mo /usr/local/share/locale/de/LC_MESSAGES
diff --git a/backend-po/README.UPDATE_LANGUAGE b/backend-po/README.UPDATE_LANGUAGE
new file mode 100644
index 0000000..1a18a6b
--- /dev/null
+++ b/backend-po/README.UPDATE_LANGUAGE
@@ -0,0 +1,8 @@
+To update the lines
+#original text: "*"
+in file.po.in call remake_language.po.in file[.po.in]
+
+To update file.po call
+po.in2po file
+
+
diff --git a/backend-po/de/sane-umax.mo b/backend-po/de/sane-umax.mo
new file mode 100644
index 0000000..9c0c8d7
--- /dev/null
+++ b/backend-po/de/sane-umax.mo
Binary files differ
diff --git a/backend-po/make_newbackend.po.in b/backend-po/make_newbackend.po.in
new file mode 100755
index 0000000..361fb97
--- /dev/null
+++ b/backend-po/make_newbackend.po.in
@@ -0,0 +1,3 @@
+gcc -E -P - <newbackend.po.in.in | sed -e "s/^_/msgid /g" - | cat newbackend.po.in.header - >newbackend.po.in
+
+
diff --git a/backend-po/newbackend.po b/backend-po/newbackend.po
new file mode 100644
index 0000000..23576e0
--- /dev/null
+++ b/backend-po/newbackend.po
@@ -0,0 +1,544 @@
+
+#nls translation file for backend "BACKENDNAME"
+#language: "LANGUAGE" (XYZ)
+
+
+#original text: "Number of options"
+msgid "Number of options"
+msgstr ""
+
+#original text: "Preview"
+msgid "Preview"
+msgstr ""
+
+#original text: "Force monochrome preview"
+msgid "Force monochrome preview"
+msgstr ""
+
+#original text: "Bit depth"
+msgid "Bit depth"
+msgstr ""
+
+#original text: "Scan mode"
+msgid "Scan mode"
+msgstr ""
+
+#original text: "Scan speed"
+msgid "Scan speed"
+msgstr ""
+
+#original text: "Scan source"
+msgid "Scan source"
+msgstr ""
+
+#original text: "Force backtracking"
+msgid "Force backtracking"
+msgstr ""
+
+#original text: "Top-left x"
+msgid "Top-left x"
+msgstr ""
+
+#original text: "Top-left y"
+msgid "Top-left y"
+msgstr ""
+
+#original text: "Bottom-right x"
+msgid "Bottom-right x"
+msgstr ""
+
+#original text: "Bottom-right y"
+msgid "Bottom-right y"
+msgstr ""
+
+#original text: "Scan resolution"
+msgid "Scan resolution"
+msgstr ""
+
+#original text: "X-resolution"
+msgid "X-resolution"
+msgstr ""
+
+#original text: "Y-resolution"
+msgid "Y-resolution"
+msgstr ""
+
+#original text: "Use custom gamma table"
+msgid "Use custom gamma table"
+msgstr ""
+
+#original text: "Image intensity"
+msgid "Image intensity"
+msgstr ""
+
+#original text: "Red intensity"
+msgid "Red intensity"
+msgstr ""
+
+#original text: "Green intensity"
+msgid "Green intensity"
+msgstr ""
+
+#original text: "Blue intensity"
+msgid "Blue intensity"
+msgstr ""
+
+#original text: "Brightness"
+msgid "Brightness"
+msgstr ""
+
+#original text: "Contrast"
+msgid "Contrast"
+msgstr ""
+
+#original text: "Grain size"
+msgid "Grain size"
+msgstr ""
+
+#original text: "Halftoning"
+msgid "Halftoning"
+msgstr ""
+
+#original text: "Black level"
+msgid "Black level"
+msgstr ""
+
+#original text: "White level"
+msgid "White level"
+msgstr ""
+
+#original text: "Shadow"
+msgid "Shadow"
+msgstr ""
+
+#original text: "Shadow for red"
+msgid "Shadow for red"
+msgstr ""
+
+#original text: "Shadow for green"
+msgid "Shadow for green"
+msgstr ""
+
+#original text: "Shadow for blue"
+msgid "Shadow for blue"
+msgstr ""
+
+#original text: "Highlight"
+msgid "Highlight"
+msgstr ""
+
+#original text: "Highlight for red"
+msgid "Highlight for red"
+msgstr ""
+
+#original text: "Highlight for green"
+msgid "Highlight for green"
+msgstr ""
+
+#original text: "Highlight for blue"
+msgid "Highlight for blue"
+msgstr ""
+
+#original text: "Hue"
+msgid "Hue"
+msgstr ""
+
+#original text: "Saturation"
+msgid "Saturation"
+msgstr ""
+
+#original text: "Filename"
+msgid "Filename"
+msgstr ""
+
+#original text: "Halftone pattern size"
+msgid "Halftone pattern size"
+msgstr ""
+
+#original text: "Halftone pattern"
+msgid "Halftone pattern"
+msgstr ""
+
+#original text: "Bind X and Y resolution"
+msgid "Bind X and Y resolution"
+msgstr ""
+
+#original text: "Negative"
+msgid "Negative"
+msgstr ""
+
+#original text: "Quality calibration"
+msgid "Quality calibration"
+msgstr ""
+
+#original text: "Double Optical Resolution"
+msgid "Double Optical Resolution"
+msgstr ""
+
+#original text: "Bind RGB"
+msgid "Bind RGB"
+msgstr ""
+
+#original text: "Threshold"
+msgid "Threshold"
+msgstr ""
+
+#original text: "Analog gamma correction"
+msgid "Analog gamma correction"
+msgstr ""
+
+#original text: "Analog gamma red"
+msgid "Analog gamma red"
+msgstr ""
+
+#original text: "Analog gamma green"
+msgid "Analog gamma green"
+msgstr ""
+
+#original text: "Analog gamma blue"
+msgid "Analog gamma blue"
+msgstr ""
+
+#original text: "Bind analog gamma"
+msgid "Bind analog gamma"
+msgstr ""
+
+#original text: "Smear"
+msgid "Smear"
+msgstr ""
+
+#original text: "10 bit-mode"
+msgid "10 bit-mode"
+msgstr ""
+
+#original text: "12 bit-mode"
+msgid "12 bit-mode"
+msgstr ""
+
+#original text: "Warmup lamp"
+msgid "Warmup lamp"
+msgstr ""
+
+#original text: "Preview patch"
+msgid "Preview patch"
+msgstr ""
+
+#original text: "Start-scan patch"
+msgid "Start-scan patch"
+msgstr ""
+
+#original text: "Cal. exposure-time"
+msgid "Cal. exposure-time"
+msgstr ""
+
+#original text: "Cal. exposure-time for red"
+msgid "Cal. exposure-time for red"
+msgstr ""
+
+#original text: "Cal. exposure-time for green"
+msgid "Cal. exposure-time for green"
+msgstr ""
+
+#original text: "Cal. exposure-time for blue"
+msgid "Cal. exposure-time for blue"
+msgstr ""
+
+#original text: "Scan exposure-time"
+msgid "Scan exposure-time"
+msgstr ""
+
+#original text: "Scan exposure-time for red"
+msgid "Scan exposure-time for red"
+msgstr ""
+
+#original text: "Scan exposure-time for green"
+msgid "Scan exposure-time for green"
+msgstr ""
+
+#original text: "Scan exposure-time for blue"
+msgid "Scan exposure-time for blue"
+msgstr ""
+
+#original text: "Set exposure-time"
+msgid "Set exposure-time"
+msgstr ""
+
+#original text: "Cal. lamp density"
+msgid "Cal. lamp density"
+msgstr ""
+
+#original text: "Scan lamp density"
+msgid "Scan lamp density"
+msgstr ""
+
+#original text: "Set lamp density"
+msgid "Set lamp density"
+msgstr ""
+
+#original text: "Request a preview-quality scan."
+msgid "Request a preview-quality scan."
+msgstr ""
+
+#original text: "Request that all previews are done in monochrome mode. On a three-pass " " scanner this cuts down the number of passes to one and on a one-pass " "scanner, it reduces the memory requirements and scan-time of the preview."
+msgid "Request that all previews are done in monochrome mode. On a three-pass " " scanner this cuts down the number of passes to one and on a one-pass " "scanner, it reduces the memory requirements and scan-time of the preview."
+msgstr ""
+
+#original text: "Number of bits per sample, typical values are 1 for \"line-art\" and 8 " "for multibit scans."
+msgid "Number of bits per sample, typical values are 1 for \"line-art\" and 8 " "for multibit scans."
+msgstr ""
+
+#original text: "Selects the scan mode (e.g., lineart,monochrome, or color)."
+msgid "Selects the scan mode (e.g., lineart,monochrome, or color)."
+msgstr ""
+
+#original text: "Determines the speed at which the scan proceeds."
+msgid "Determines the speed at which the scan proceeds."
+msgstr ""
+
+#original text: "Selects the scan source (such as a document-feeder)."
+msgid "Selects the scan source (such as a document-feeder)."
+msgstr ""
+
+#original text: "Controls whether backtracking is forced."
+msgid "Controls whether backtracking is forced."
+msgstr ""
+
+#original text: "Top-left x position of scan area."
+msgid "Top-left x position of scan area."
+msgstr ""
+
+#original text: "Top-left y position of scan area."
+msgid "Top-left y position of scan area."
+msgstr ""
+
+#original text: "Bottom-right x position of scan area."
+msgid "Bottom-right x position of scan area."
+msgstr ""
+
+#original text: "Bottom-right y position of scan area."
+msgid "Bottom-right y position of scan area."
+msgstr ""
+
+#original text: "Sets the resolution of the scanned image."
+msgid "Sets the resolution of the scanned image."
+msgstr ""
+
+#original text: "Sets the horizontal resolution of the scanned image."
+msgid "Sets the horizontal resolution of the scanned image."
+msgstr ""
+
+#original text: "Sets the vertical resolution of the scanned image."
+msgid "Sets the vertical resolution of the scanned image."
+msgstr ""
+
+#original text: "Determines whether a builtin or a custom gamma-table should be used."
+msgid "Determines whether a builtin or a custom gamma-table should be used."
+msgstr ""
+
+#original text: "Gamma-correction table. In color mode this option equally affects the " "red, green, and blue channels simultaneously (i.e., it is an intensity " "gamma table)."
+msgid "Gamma-correction table. In color mode this option equally affects the " "red, green, and blue channels simultaneously (i.e., it is an intensity " "gamma table)."
+msgstr ""
+
+#original text: "Gamma-correction table for the red band."
+msgid "Gamma-correction table for the red band."
+msgstr ""
+
+#original text: "Gamma-correction table for the green band."
+msgid "Gamma-correction table for the green band."
+msgstr ""
+
+#original text: "Gamma-correction table for the blue band."
+msgid "Gamma-correction table for the blue band."
+msgstr ""
+
+#original text: "Controls the brightness of the acquired image."
+msgid "Controls the brightness of the acquired image."
+msgstr ""
+
+#original text: "Controls the contrast of the acquired image."
+msgid "Controls the contrast of the acquired image."
+msgstr ""
+
+#original text: "Selects the \"graininess\" of the acquired image. Smaller values " "result in sharper images."
+msgid "Selects the \"graininess\" of the acquired image. Smaller values " "result in sharper images."
+msgstr ""
+
+#original text: "Selects whether the acquired image should be halftoned (dithered)."
+msgid "Selects whether the acquired image should be halftoned (dithered)."
+msgstr ""
+
+#original text: "Selects what radiance level should be considered \"black\"."
+msgid "Selects what radiance level should be considered \"black\"."
+msgstr ""
+
+#original text: "Selects what radiance level should be considered \"white\"."
+msgid "Selects what radiance level should be considered \"white\"."
+msgstr ""
+
+#original text: "Selects what radiance level should be considered \"black\"."
+msgid "Selects what radiance level should be considered \"black\"."
+msgstr ""
+
+#original text: "Selects what red radiance level should be considered \"black\"."
+msgid "Selects what red radiance level should be considered \"black\"."
+msgstr ""
+
+#original text: "Selects what green radiance level should be considered \"black\"."
+msgid "Selects what green radiance level should be considered \"black\"."
+msgstr ""
+
+#original text: "Selects what blue radiance level should be considered \"black\"."
+msgid "Selects what blue radiance level should be considered \"black\"."
+msgstr ""
+
+#original text: "Selects what radiance level should be considered \"white\"."
+msgid "Selects what radiance level should be considered \"white\"."
+msgstr ""
+
+#original text: "Selects what red radiance level should be considered \"full red\"."
+msgid "Selects what red radiance level should be considered \"full red\"."
+msgstr ""
+
+#original text: "Selects what green radiance level should be considered \"full green\"."
+msgid "Selects what green radiance level should be considered \"full green\"."
+msgstr ""
+
+#original text: "Selects what blue radiance level should be considered \"full blue\"."
+msgid "Selects what blue radiance level should be considered \"full blue\"."
+msgstr ""
+
+#original text: "Controls the \"hue\" (blue-level) of the acquired image."
+msgid "Controls the \"hue\" (blue-level) of the acquired image."
+msgstr ""
+
+#original text: "The saturation level controls the amount of \"blooming\" that occurs when " "acquiring an image with a camera. Larger values cause more blooming."
+msgid "The saturation level controls the amount of \"blooming\" that occurs when " "acquiring an image with a camera. Larger values cause more blooming."
+msgstr ""
+
+#original text: "The filename of the image to be loaded."
+msgid "The filename of the image to be loaded."
+msgstr ""
+
+#original text: "Sets the size of the halftoning (dithering) pattern used when scanning " "halftoned images."
+msgid "Sets the size of the halftoning (dithering) pattern used when scanning " "halftoned images."
+msgstr ""
+
+#original text: "Defines the halftoning (dithering) pattern for scanning halftoned images."
+msgid "Defines the halftoning (dithering) pattern for scanning halftoned images."
+msgstr ""
+
+#original text: "Use same values for X and Y resolution"
+msgid "Use same values for X and Y resolution"
+msgstr ""
+
+#original text: "Swap black and white"
+msgid "Swap black and white"
+msgstr ""
+
+#original text: "Do a quality white-calibration"
+msgid "Do a quality white-calibration"
+msgstr ""
+
+#original text: "Use lens that doubles optical resolution"
+msgid "Use lens that doubles optical resolution"
+msgstr ""
+
+#original text: "In RGB-mode use same values for each color"
+msgid "In RGB-mode use same values for each color"
+msgstr ""
+
+#original text: "Select minimum-brightness to get a white point"
+msgid "Select minimum-brightness to get a white point"
+msgstr ""
+
+#original text: "Analog gamma-correction"
+msgid "Analog gamma-correction"
+msgstr ""
+
+#original text: "Analog gamma-correction for red"
+msgid "Analog gamma-correction for red"
+msgstr ""
+
+#original text: "Analog gamma-correction for green"
+msgid "Analog gamma-correction for green"
+msgstr ""
+
+#original text: "Analog gamma-correction for blue"
+msgid "Analog gamma-correction for blue"
+msgstr ""
+
+#original text: "In RGB-mode use same values for each color"
+msgid "In RGB-mode use same values for each color"
+msgstr ""
+
+#original text: "Don't care about image smearing problem"
+msgid "Don't care about image smearing problem"
+msgstr ""
+
+#original text: "Output with 10 bits instead of 8 bits"
+msgid "Output with 10 bits instead of 8 bits"
+msgstr ""
+
+#original text: "Output with 12 bits instead of 8 bits"
+msgid "Output with 12 bits instead of 8 bits"
+msgstr ""
+
+#original text: "Warmup lamp before scanning"
+msgid "Warmup lamp before scanning"
+msgstr ""
+
+#original text: "Set preview-bit in rgb-mode"
+msgid "Set preview-bit in rgb-mode"
+msgstr ""
+
+#original text: "Use special start-scan bits"
+msgid "Use special start-scan bits"
+msgstr ""
+
+#original text: "Define exposure-time for calibration"
+msgid "Define exposure-time for calibration"
+msgstr ""
+
+#original text: "Define exposure-time for red calibration"
+msgid "Define exposure-time for red calibration"
+msgstr ""
+
+#original text: "Define exposure-time for green calibration"
+msgid "Define exposure-time for green calibration"
+msgstr ""
+
+#original text: "Define exposure-time for blue calibration"
+msgid "Define exposure-time for blue calibration"
+msgstr ""
+
+#original text: "Define exposure-time for scan"
+msgid "Define exposure-time for scan"
+msgstr ""
+
+#original text: "Define exposure-time for red scan"
+msgid "Define exposure-time for red scan"
+msgstr ""
+
+#original text: "Define exposure-time for green scan"
+msgid "Define exposure-time for green scan"
+msgstr ""
+
+#original text: "Define exposure-time for blue scan"
+msgid "Define exposure-time for blue scan"
+msgstr ""
+
+#original text: "Enable selection of exposure-time"
+msgid "Enable selection of exposure-time"
+msgstr ""
+
+#original text: "Define lamp density for calibration"
+msgid "Define lamp density for calibration"
+msgstr ""
+
+#original text: "Define lamp density for scan"
+msgid "Define lamp density for scan"
+msgstr ""
+
+#original text: "Enable selection of lamp density"
+msgid "Enable selection of lamp density"
+msgstr ""
diff --git a/backend-po/newbackend.po.in b/backend-po/newbackend.po.in
new file mode 100644
index 0000000..5c01bfb
--- /dev/null
+++ b/backend-po/newbackend.po.in
@@ -0,0 +1,546 @@
+#include "/usr/local/include/sane/saneopts.h"
+#define _(x) x
+
+#nls translation file for backend "BACKENDNAME"
+#language: "LANGUAGE" (XYZ)
+
+
+#original text: "Number of options"
+msgid SANE_TITLE_NUM_OPTIONS
+msgstr ""
+
+#original text: "Preview"
+msgid SANE_TITLE_PREVIEW
+msgstr ""
+
+#original text: "Force monochrome preview"
+msgid SANE_TITLE_GRAY_PREVIEW
+msgstr ""
+
+#original text: "Bit depth"
+msgid SANE_TITLE_BIT_DEPTH
+msgstr ""
+
+#original text: "Scan mode"
+msgid SANE_TITLE_SCAN_MODE
+msgstr ""
+
+#original text: "Scan speed"
+msgid SANE_TITLE_SCAN_SPEED
+msgstr ""
+
+#original text: "Scan source"
+msgid SANE_TITLE_SCAN_SOURCE
+msgstr ""
+
+#original text: "Force backtracking"
+msgid SANE_TITLE_BACKTRACK
+msgstr ""
+
+#original text: "Top-left x"
+msgid SANE_TITLE_SCAN_TL_X
+msgstr ""
+
+#original text: "Top-left y"
+msgid SANE_TITLE_SCAN_TL_Y
+msgstr ""
+
+#original text: "Bottom-right x"
+msgid SANE_TITLE_SCAN_BR_X
+msgstr ""
+
+#original text: "Bottom-right y"
+msgid SANE_TITLE_SCAN_BR_Y
+msgstr ""
+
+#original text: "Scan resolution"
+msgid SANE_TITLE_SCAN_RESOLUTION
+msgstr ""
+
+#original text: "X-resolution"
+msgid SANE_TITLE_SCAN_X_RESOLUTION
+msgstr ""
+
+#original text: "Y-resolution"
+msgid SANE_TITLE_SCAN_Y_RESOLUTION
+msgstr ""
+
+#original text: "Use custom gamma table"
+msgid SANE_TITLE_CUSTOM_GAMMA
+msgstr ""
+
+#original text: "Image intensity"
+msgid SANE_TITLE_GAMMA_VECTOR
+msgstr ""
+
+#original text: "Red intensity"
+msgid SANE_TITLE_GAMMA_VECTOR_R
+msgstr ""
+
+#original text: "Green intensity"
+msgid SANE_TITLE_GAMMA_VECTOR_G
+msgstr ""
+
+#original text: "Blue intensity"
+msgid SANE_TITLE_GAMMA_VECTOR_B
+msgstr ""
+
+#original text: "Brightness"
+msgid SANE_TITLE_BRIGHTNESS
+msgstr ""
+
+#original text: "Contrast"
+msgid SANE_TITLE_CONTRAST
+msgstr ""
+
+#original text: "Grain size"
+msgid SANE_TITLE_GRAIN_SIZE
+msgstr ""
+
+#original text: "Halftoning"
+msgid SANE_TITLE_HALFTONE
+msgstr ""
+
+#original text: "Black level"
+msgid SANE_TITLE_BLACK_LEVEL
+msgstr ""
+
+#original text: "White level"
+msgid SANE_TITLE_WHITE_LEVEL
+msgstr ""
+
+#original text: "Shadow"
+msgid SANE_TITLE_SHADOW
+msgstr ""
+
+#original text: "Shadow for red"
+msgid SANE_TITLE_SHADOW_R
+msgstr ""
+
+#original text: "Shadow for green"
+msgid SANE_TITLE_SHADOW_G
+msgstr ""
+
+#original text: "Shadow for blue"
+msgid SANE_TITLE_SHADOW_B
+msgstr ""
+
+#original text: "Highlight"
+msgid SANE_TITLE_HIGHLIGHT
+msgstr ""
+
+#original text: "Highlight for red"
+msgid SANE_TITLE_HIGHLIGHT_R
+msgstr ""
+
+#original text: "Highlight for green"
+msgid SANE_TITLE_HIGHLIGHT_G
+msgstr ""
+
+#original text: "Highlight for blue"
+msgid SANE_TITLE_HIGHLIGHT_B
+msgstr ""
+
+#original text: "Hue"
+msgid SANE_TITLE_HUE
+msgstr ""
+
+#original text: "Saturation"
+msgid SANE_TITLE_SATURATION
+msgstr ""
+
+#original text: "Filename"
+msgid SANE_TITLE_FILE
+msgstr ""
+
+#original text: "Halftone pattern size"
+msgid SANE_TITLE_HALFTONE_DIMENSION
+msgstr ""
+
+#original text: "Halftone pattern"
+msgid SANE_TITLE_HALFTONE_PATTERN
+msgstr ""
+
+#original text: "Bind X and Y resolution"
+msgid SANE_TITLE_RESOLUTION_BIND
+msgstr ""
+
+#original text: "Negative"
+msgid SANE_TITLE_NEGATIVE
+msgstr ""
+
+#original text: "Quality calibration"
+msgid SANE_TITLE_QUALITY_CAL
+msgstr ""
+
+#original text: "Double Optical Resolution"
+msgid SANE_TITLE_DOR
+msgstr ""
+
+#original text: "Bind RGB"
+msgid SANE_TITLE_RGB_BIND
+msgstr ""
+
+#original text: "Threshold"
+msgid SANE_TITLE_THRESHOLD
+msgstr ""
+
+#original text: "Analog gamma correction"
+msgid SANE_TITLE_ANALOG_GAMMA
+msgstr ""
+
+#original text: "Analog gamma red"
+msgid SANE_TITLE_ANALOG_GAMMA_R
+msgstr ""
+
+#original text: "Analog gamma green"
+msgid SANE_TITLE_ANALOG_GAMMA_G
+msgstr ""
+
+#original text: "Analog gamma blue"
+msgid SANE_TITLE_ANALOG_GAMMA_B
+msgstr ""
+
+#original text: "Bind analog gamma"
+msgid SANE_TITLE_ANALOG_GAMMA_BIND
+msgstr ""
+
+#original text: "Smear"
+msgid SANE_TITLE_SMEAR
+msgstr ""
+
+#original text: "10 bit-mode"
+msgid SANE_TITLE_TEN_BIT_MODE
+msgstr ""
+
+#original text: "12 bit-mode"
+msgid SANE_TITLE_TWELVE_BIT_MODE
+msgstr ""
+
+#original text: "Warmup lamp"
+msgid SANE_TITLE_WARMUP
+msgstr ""
+
+#original text: "Preview patch"
+msgid SANE_TITLE_RGB_PREVIEW_PATCH
+msgstr ""
+
+#original text: "Start-scan patch"
+msgid SANE_TITLE_START_SCAN_PATCH
+msgstr ""
+
+#original text: "Cal. exposure-time"
+msgid SANE_TITLE_CAL_EXPOS_TIME
+msgstr ""
+
+#original text: "Cal. exposure-time for red"
+msgid SANE_TITLE_CAL_EXPOS_TIME_R
+msgstr ""
+
+#original text: "Cal. exposure-time for green"
+msgid SANE_TITLE_CAL_EXPOS_TIME_G
+msgstr ""
+
+#original text: "Cal. exposure-time for blue"
+msgid SANE_TITLE_CAL_EXPOS_TIME_B
+msgstr ""
+
+#original text: "Scan exposure-time"
+msgid SANE_TITLE_SCAN_EXPOS_TIME
+msgstr ""
+
+#original text: "Scan exposure-time for red"
+msgid SANE_TITLE_SCAN_EXPOS_TIME_R
+msgstr ""
+
+#original text: "Scan exposure-time for green"
+msgid SANE_TITLE_SCAN_EXPOS_TIME_G
+msgstr ""
+
+#original text: "Scan exposure-time for blue"
+msgid SANE_TITLE_SCAN_EXPOS_TIME_B
+msgstr ""
+
+#original text: "Set exposure-time"
+msgid SANE_TITLE_SELECT_EXPOSURE_TIME
+msgstr ""
+
+#original text: "Cal. lamp density"
+msgid SANE_TITLE_CAL_LAMP_DEN
+msgstr ""
+
+#original text: "Scan lamp density"
+msgid SANE_TITLE_SCAN_LAMP_DEN
+msgstr ""
+
+#original text: "Set lamp density"
+msgid SANE_TITLE_SELECT_LAMP_DENSITY
+msgstr ""
+
+#original text: "Request a preview-quality scan."
+msgid SANE_DESC_PREVIEW
+msgstr ""
+
+#original text: "Request that all previews are done in monochrome mode. On a three-pass " " scanner this cuts down the number of passes to one and on a one-pass " "scanner, it reduces the memory requirements and scan-time of the preview."
+msgid SANE_DESC_GRAY_PREVIEW
+msgstr ""
+
+#original text: "Number of bits per sample, typical values are 1 for \"line-art\" and 8 " "for multibit scans."
+msgid SANE_DESC_BIT_DEPTH
+msgstr ""
+
+#original text: "Selects the scan mode (e.g., lineart,monochrome, or color)."
+msgid SANE_DESC_SCAN_MODE
+msgstr ""
+
+#original text: "Determines the speed at which the scan proceeds."
+msgid SANE_DESC_SCAN_SPEED
+msgstr ""
+
+#original text: "Selects the scan source (such as a document-feeder)."
+msgid SANE_DESC_SCAN_SOURCE
+msgstr ""
+
+#original text: "Controls whether backtracking is forced."
+msgid SANE_DESC_BACKTRACK
+msgstr ""
+
+#original text: "Top-left x position of scan area."
+msgid SANE_DESC_SCAN_TL_X
+msgstr ""
+
+#original text: "Top-left y position of scan area."
+msgid SANE_DESC_SCAN_TL_Y
+msgstr ""
+
+#original text: "Bottom-right x position of scan area."
+msgid SANE_DESC_SCAN_BR_X
+msgstr ""
+
+#original text: "Bottom-right y position of scan area."
+msgid SANE_DESC_SCAN_BR_Y
+msgstr ""
+
+#original text: "Sets the resolution of the scanned image."
+msgid SANE_DESC_SCAN_RESOLUTION
+msgstr ""
+
+#original text: "Sets the horizontal resolution of the scanned image."
+msgid SANE_DESC_SCAN_X_RESOLUTION
+msgstr ""
+
+#original text: "Sets the vertical resolution of the scanned image."
+msgid SANE_DESC_SCAN_Y_RESOLUTION
+msgstr ""
+
+#original text: "Determines whether a builtin or a custom gamma-table should be used."
+msgid SANE_DESC_CUSTOM_GAMMA
+msgstr ""
+
+#original text: "Gamma-correction table. In color mode this option equally affects the " "red, green, and blue channels simultaneously (i.e., it is an intensity " "gamma table)."
+msgid SANE_DESC_GAMMA_VECTOR
+msgstr ""
+
+#original text: "Gamma-correction table for the red band."
+msgid SANE_DESC_GAMMA_VECTOR_R
+msgstr ""
+
+#original text: "Gamma-correction table for the green band."
+msgid SANE_DESC_GAMMA_VECTOR_G
+msgstr ""
+
+#original text: "Gamma-correction table for the blue band."
+msgid SANE_DESC_GAMMA_VECTOR_B
+msgstr ""
+
+#original text: "Controls the brightness of the acquired image."
+msgid SANE_DESC_BRIGHTNESS
+msgstr ""
+
+#original text: "Controls the contrast of the acquired image."
+msgid SANE_DESC_CONTRAST
+msgstr ""
+
+#original text: "Selects the \"graininess\" of the acquired image. Smaller values " "result in sharper images."
+msgid SANE_DESC_GRAIN_SIZE
+msgstr ""
+
+#original text: "Selects whether the acquired image should be halftoned (dithered)."
+msgid SANE_DESC_HALFTONE
+msgstr ""
+
+#original text: "Selects what radiance level should be considered \"black\"."
+msgid SANE_DESC_BLACK_LEVEL
+msgstr ""
+
+#original text: "Selects what radiance level should be considered \"white\"."
+msgid SANE_DESC_WHITE_LEVEL
+msgstr ""
+
+#original text: "Selects what radiance level should be considered \"black\"."
+msgid SANE_DESC_SHADOW
+msgstr ""
+
+#original text: "Selects what red radiance level should be considered \"black\"."
+msgid SANE_DESC_SHADOW_R
+msgstr ""
+
+#original text: "Selects what green radiance level should be considered \"black\"."
+msgid SANE_DESC_SHADOW_G
+msgstr ""
+
+#original text: "Selects what blue radiance level should be considered \"black\"."
+msgid SANE_DESC_SHADOW_B
+msgstr ""
+
+#original text: "Selects what radiance level should be considered \"white\"."
+msgid SANE_DESC_HIGHLIGHT
+msgstr ""
+
+#original text: "Selects what red radiance level should be considered \"full red\"."
+msgid SANE_DESC_HIGHLIGHT_R
+msgstr ""
+
+#original text: "Selects what green radiance level should be considered \"full green\"."
+msgid SANE_DESC_HIGHLIGHT_G
+msgstr ""
+
+#original text: "Selects what blue radiance level should be considered \"full blue\"."
+msgid SANE_DESC_HIGHLIGHT_B
+msgstr ""
+
+#original text: "Controls the \"hue\" (blue-level) of the acquired image."
+msgid SANE_DESC_HUE
+msgstr ""
+
+#original text: "The saturation level controls the amount of \"blooming\" that occurs when " "acquiring an image with a camera. Larger values cause more blooming."
+msgid SANE_DESC_SATURATION
+msgstr ""
+
+#original text: "The filename of the image to be loaded."
+msgid SANE_DESC_FILE
+msgstr ""
+
+#original text: "Sets the size of the halftoning (dithering) pattern used when scanning " "halftoned images."
+msgid SANE_DESC_HALFTONE_DIMENSION
+msgstr ""
+
+#original text: "Defines the halftoning (dithering) pattern for scanning halftoned images."
+msgid SANE_DESC_HALFTONE_PATTERN
+msgstr ""
+
+#original text: "Use same values for X and Y resolution"
+msgid SANE_DESC_RESOLUTION_BIND
+msgstr ""
+
+#original text: "Swap black and white"
+msgid SANE_DESC_NEGATIVE
+msgstr ""
+
+#original text: "Do a quality white-calibration"
+msgid SANE_DESC_QUALITY_CAL
+msgstr ""
+
+#original text: "Use lens that doubles optical resolution"
+msgid SANE_DESC_DOR
+msgstr ""
+
+#original text: "In RGB-mode use same values for each color"
+msgid SANE_DESC_RGB_BIND
+msgstr ""
+
+#original text: "Select minimum-brightness to get a white point"
+msgid SANE_DESC_THRESHOLD
+msgstr ""
+
+#original text: "Analog gamma-correction"
+msgid SANE_DESC_ANALOG_GAMMA
+msgstr ""
+
+#original text: "Analog gamma-correction for red"
+msgid SANE_DESC_ANALOG_GAMMA_R
+msgstr ""
+
+#original text: "Analog gamma-correction for green"
+msgid SANE_DESC_ANALOG_GAMMA_G
+msgstr ""
+
+#original text: "Analog gamma-correction for blue"
+msgid SANE_DESC_ANALOG_GAMMA_B
+msgstr ""
+
+#original text: "In RGB-mode use same values for each color"
+msgid SANE_DESC_ANALOG_GAMMA_BIND
+msgstr ""
+
+#original text: "Don't care about image smearing problem"
+msgid SANE_DESC_SMEAR
+msgstr ""
+
+#original text: "Output with 10 bits instead of 8 bits"
+msgid SANE_DESC_TEN_BIT_MODE
+msgstr ""
+
+#original text: "Output with 12 bits instead of 8 bits"
+msgid SANE_DESC_TWELVE_BIT_MODE
+msgstr ""
+
+#original text: "Warmup lamp before scanning"
+msgid SANE_DESC_WARMUP
+msgstr ""
+
+#original text: "Set preview-bit in rgb-mode"
+msgid SANE_DESC_RGB_PREVIEW_PATCH
+msgstr ""
+
+#original text: "Use special start-scan bits"
+msgid SANE_DESC_START_SCAN_PATCH
+msgstr ""
+
+#original text: "Define exposure-time for calibration"
+msgid SANE_DESC_CAL_EXPOS_TIME
+msgstr ""
+
+#original text: "Define exposure-time for red calibration"
+msgid SANE_DESC_CAL_EXPOS_TIME_R
+msgstr ""
+
+#original text: "Define exposure-time for green calibration"
+msgid SANE_DESC_CAL_EXPOS_TIME_G
+msgstr ""
+
+#original text: "Define exposure-time for blue calibration"
+msgid SANE_DESC_CAL_EXPOS_TIME_B
+msgstr ""
+
+#original text: "Define exposure-time for scan"
+msgid SANE_DESC_SCAN_EXPOS_TIME
+msgstr ""
+
+#original text: "Define exposure-time for red scan"
+msgid SANE_DESC_SCAN_EXPOS_TIME_R
+msgstr ""
+
+#original text: "Define exposure-time for green scan"
+msgid SANE_DESC_SCAN_EXPOS_TIME_G
+msgstr ""
+
+#original text: "Define exposure-time for blue scan"
+msgid SANE_DESC_SCAN_EXPOS_TIME_B
+msgstr ""
+
+#original text: "Enable selection of exposure-time"
+msgid SANE_DESC_SELECT_EXPOSURE_TIME
+msgstr ""
+
+#original text: "Define lamp density for calibration"
+msgid SANE_DESC_CAL_LAMP_DEN
+msgstr ""
+
+#original text: "Define lamp density for scan"
+msgid SANE_DESC_SCAN_LAMP_DEN
+msgstr ""
+
+#original text: "Enable selection of lamp density"
+msgid SANE_DESC_SELECT_LAMP_DENSITY
+msgstr ""
diff --git a/backend-po/newbackend.po.in.header b/backend-po/newbackend.po.in.header
new file mode 100644
index 0000000..e3a7c87
--- /dev/null
+++ b/backend-po/newbackend.po.in.header
@@ -0,0 +1,2 @@
+#include "/usr/local/include/sane/saneopts.h"
+#define _(x) x
diff --git a/backend-po/newbackend.po.in.in b/backend-po/newbackend.po.in.in
new file mode 100644
index 0000000..3a09643
--- /dev/null
+++ b/backend-po/newbackend.po.in.in
@@ -0,0 +1,546 @@
+#include "/usr/local/include/sane/saneopts.h"
+#define _(x) x
+
+# nls translation file for backend "BACKENDNAME"
+# language: "LANGUAGE" (XYZ)
+
+
+#original text: SANE_TITLE_NUM_OPTIONS
+_SANE_TITLE_NUM_OPTIONS
+msgstr ""
+
+#original text: SANE_TITLE_PREVIEW
+_SANE_TITLE_PREVIEW
+msgstr ""
+
+#original text: SANE_TITLE_GRAY_PREVIEW
+_SANE_TITLE_GRAY_PREVIEW
+msgstr ""
+
+#original text: SANE_TITLE_BIT_DEPTH
+_SANE_TITLE_BIT_DEPTH
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_MODE
+_SANE_TITLE_SCAN_MODE
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_SPEED
+_SANE_TITLE_SCAN_SPEED
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_SOURCE
+_SANE_TITLE_SCAN_SOURCE
+msgstr ""
+
+#original text: SANE_TITLE_BACKTRACK
+_SANE_TITLE_BACKTRACK
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_TL_X
+_SANE_TITLE_SCAN_TL_X
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_TL_Y
+_SANE_TITLE_SCAN_TL_Y
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_BR_X
+_SANE_TITLE_SCAN_BR_X
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_BR_Y
+_SANE_TITLE_SCAN_BR_Y
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_RESOLUTION
+_SANE_TITLE_SCAN_RESOLUTION
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_X_RESOLUTION
+_SANE_TITLE_SCAN_X_RESOLUTION
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_Y_RESOLUTION
+_SANE_TITLE_SCAN_Y_RESOLUTION
+msgstr ""
+
+#original text: SANE_TITLE_CUSTOM_GAMMA
+_SANE_TITLE_CUSTOM_GAMMA
+msgstr ""
+
+#original text: SANE_TITLE_GAMMA_VECTOR
+_SANE_TITLE_GAMMA_VECTOR
+msgstr ""
+
+#original text: SANE_TITLE_GAMMA_VECTOR_R
+_SANE_TITLE_GAMMA_VECTOR_R
+msgstr ""
+
+#original text: SANE_TITLE_GAMMA_VECTOR_G
+_SANE_TITLE_GAMMA_VECTOR_G
+msgstr ""
+
+#original text: SANE_TITLE_GAMMA_VECTOR_B
+_SANE_TITLE_GAMMA_VECTOR_B
+msgstr ""
+
+#original text: SANE_TITLE_BRIGHTNESS
+_SANE_TITLE_BRIGHTNESS
+msgstr ""
+
+#original text: SANE_TITLE_CONTRAST
+_SANE_TITLE_CONTRAST
+msgstr ""
+
+#original text: SANE_TITLE_GRAIN_SIZE
+_SANE_TITLE_GRAIN_SIZE
+msgstr ""
+
+#original text: SANE_TITLE_HALFTONE
+_SANE_TITLE_HALFTONE
+msgstr ""
+
+#original text: SANE_TITLE_BLACK_LEVEL
+_SANE_TITLE_BLACK_LEVEL
+msgstr ""
+
+#original text: SANE_TITLE_WHITE_LEVEL
+_SANE_TITLE_WHITE_LEVEL
+msgstr ""
+
+#original text: SANE_TITLE_SHADOW
+_SANE_TITLE_SHADOW
+msgstr ""
+
+#original text: SANE_TITLE_SHADOW_R
+_SANE_TITLE_SHADOW_R
+msgstr ""
+
+#original text: SANE_TITLE_SHADOW_G
+_SANE_TITLE_SHADOW_G
+msgstr ""
+
+#original text: SANE_TITLE_SHADOW_B
+_SANE_TITLE_SHADOW_B
+msgstr ""
+
+#original text: SANE_TITLE_HIGHLIGHT
+_SANE_TITLE_HIGHLIGHT
+msgstr ""
+
+#original text: SANE_TITLE_HIGHLIGHT_R
+_SANE_TITLE_HIGHLIGHT_R
+msgstr ""
+
+#original text: SANE_TITLE_HIGHLIGHT_G
+_SANE_TITLE_HIGHLIGHT_G
+msgstr ""
+
+#original text: SANE_TITLE_HIGHLIGHT_B
+_SANE_TITLE_HIGHLIGHT_B
+msgstr ""
+
+#original text: SANE_TITLE_HUE
+_SANE_TITLE_HUE
+msgstr ""
+
+#original text: SANE_TITLE_SATURATION
+_SANE_TITLE_SATURATION
+msgstr ""
+
+#original text: SANE_TITLE_FILE
+_SANE_TITLE_FILE
+msgstr ""
+
+#original text: SANE_TITLE_HALFTONE_DIMENSION
+_SANE_TITLE_HALFTONE_DIMENSION
+msgstr ""
+
+#original text: SANE_TITLE_HALFTONE_PATTERN
+_SANE_TITLE_HALFTONE_PATTERN
+msgstr ""
+
+#original text: SANE_TITLE_RESOLUTION_BIND
+_SANE_TITLE_RESOLUTION_BIND
+msgstr ""
+
+#original text: SANE_TITLE_NEGATIVE
+_SANE_TITLE_NEGATIVE
+msgstr ""
+
+#original text: SANE_TITLE_QUALITY_CAL
+_SANE_TITLE_QUALITY_CAL
+msgstr ""
+
+#original text: SANE_TITLE_DOR
+_SANE_TITLE_DOR
+msgstr ""
+
+#original text: SANE_TITLE_RGB_BIND
+_SANE_TITLE_RGB_BIND
+msgstr ""
+
+#original text: SANE_TITLE_THRESHOLD
+_SANE_TITLE_THRESHOLD
+msgstr ""
+
+#original text: SANE_TITLE_ANALOG_GAMMA
+_SANE_TITLE_ANALOG_GAMMA
+msgstr ""
+
+#original text: SANE_TITLE_ANALOG_GAMMA_R
+_SANE_TITLE_ANALOG_GAMMA_R
+msgstr ""
+
+#original text: SANE_TITLE_ANALOG_GAMMA_G
+_SANE_TITLE_ANALOG_GAMMA_G
+msgstr ""
+
+#original text: SANE_TITLE_ANALOG_GAMMA_B
+_SANE_TITLE_ANALOG_GAMMA_B
+msgstr ""
+
+#original text: SANE_TITLE_ANALOG_GAMMA_BIND
+_SANE_TITLE_ANALOG_GAMMA_BIND
+msgstr ""
+
+#original text: SANE_TITLE_SMEAR
+_SANE_TITLE_SMEAR
+msgstr ""
+
+#original text: SANE_TITLE_TEN_BIT_MODE
+_SANE_TITLE_TEN_BIT_MODE
+msgstr ""
+
+#original text: SANE_TITLE_TWELVE_BIT_MODE
+_SANE_TITLE_TWELVE_BIT_MODE
+msgstr ""
+
+#original text: SANE_TITLE_WARMUP
+_SANE_TITLE_WARMUP
+msgstr ""
+
+#original text: SANE_TITLE_RGB_PREVIEW_PATCH
+_SANE_TITLE_RGB_PREVIEW_PATCH
+msgstr ""
+
+#original text: SANE_TITLE_START_SCAN_PATCH
+_SANE_TITLE_START_SCAN_PATCH
+msgstr ""
+
+#original text: SANE_TITLE_CAL_EXPOS_TIME
+_SANE_TITLE_CAL_EXPOS_TIME
+msgstr ""
+
+#original text: SANE_TITLE_CAL_EXPOS_TIME_R
+_SANE_TITLE_CAL_EXPOS_TIME_R
+msgstr ""
+
+#original text: SANE_TITLE_CAL_EXPOS_TIME_G
+_SANE_TITLE_CAL_EXPOS_TIME_G
+msgstr ""
+
+#original text: SANE_TITLE_CAL_EXPOS_TIME_B
+_SANE_TITLE_CAL_EXPOS_TIME_B
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_EXPOS_TIME
+_SANE_TITLE_SCAN_EXPOS_TIME
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_EXPOS_TIME_R
+_SANE_TITLE_SCAN_EXPOS_TIME_R
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_EXPOS_TIME_G
+_SANE_TITLE_SCAN_EXPOS_TIME_G
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_EXPOS_TIME_B
+_SANE_TITLE_SCAN_EXPOS_TIME_B
+msgstr ""
+
+#original text: SANE_TITLE_SELECT_EXPOSURE_TIME
+_SANE_TITLE_SELECT_EXPOSURE_TIME
+msgstr ""
+
+#original text: SANE_TITLE_CAL_LAMP_DEN
+_SANE_TITLE_CAL_LAMP_DEN
+msgstr ""
+
+#original text: SANE_TITLE_SCAN_LAMP_DEN
+_SANE_TITLE_SCAN_LAMP_DEN
+msgstr ""
+
+#original text: SANE_TITLE_SELECT_LAMP_DENSITY
+_SANE_TITLE_SELECT_LAMP_DENSITY
+msgstr ""
+
+#original text: SANE_DESC_PREVIEW
+_SANE_DESC_PREVIEW
+msgstr ""
+
+#original text: SANE_DESC_GRAY_PREVIEW
+_SANE_DESC_GRAY_PREVIEW
+msgstr ""
+
+#original text: SANE_DESC_BIT_DEPTH
+_SANE_DESC_BIT_DEPTH
+msgstr ""
+
+#original text: SANE_DESC_SCAN_MODE
+_SANE_DESC_SCAN_MODE
+msgstr ""
+
+#original text: SANE_DESC_SCAN_SPEED
+_SANE_DESC_SCAN_SPEED
+msgstr ""
+
+#original text: SANE_DESC_SCAN_SOURCE
+_SANE_DESC_SCAN_SOURCE
+msgstr ""
+
+#original text: SANE_DESC_BACKTRACK
+_SANE_DESC_BACKTRACK
+msgstr ""
+
+#original text: SANE_DESC_SCAN_TL_X
+_SANE_DESC_SCAN_TL_X
+msgstr ""
+
+#original text: SANE_DESC_SCAN_TL_Y
+_SANE_DESC_SCAN_TL_Y
+msgstr ""
+
+#original text: SANE_DESC_SCAN_BR_X
+_SANE_DESC_SCAN_BR_X
+msgstr ""
+
+#original text: SANE_DESC_SCAN_BR_Y
+_SANE_DESC_SCAN_BR_Y
+msgstr ""
+
+#original text: SANE_DESC_SCAN_RESOLUTION
+_SANE_DESC_SCAN_RESOLUTION
+msgstr ""
+
+#original text: SANE_DESC_SCAN_X_RESOLUTION
+_SANE_DESC_SCAN_X_RESOLUTION
+msgstr ""
+
+#original text: SANE_DESC_SCAN_Y_RESOLUTION
+_SANE_DESC_SCAN_Y_RESOLUTION
+msgstr ""
+
+#original text: SANE_DESC_CUSTOM_GAMMA
+_SANE_DESC_CUSTOM_GAMMA
+msgstr ""
+
+#original text: SANE_DESC_GAMMA_VECTOR
+_SANE_DESC_GAMMA_VECTOR
+msgstr ""
+
+#original text: SANE_DESC_GAMMA_VECTOR_R
+_SANE_DESC_GAMMA_VECTOR_R
+msgstr ""
+
+#original text: SANE_DESC_GAMMA_VECTOR_G
+_SANE_DESC_GAMMA_VECTOR_G
+msgstr ""
+
+#original text: SANE_DESC_GAMMA_VECTOR_B
+_SANE_DESC_GAMMA_VECTOR_B
+msgstr ""
+
+#original text: SANE_DESC_BRIGHTNESS
+_SANE_DESC_BRIGHTNESS
+msgstr ""
+
+#original text: SANE_DESC_CONTRAST
+_SANE_DESC_CONTRAST
+msgstr ""
+
+#original text: SANE_DESC_GRAIN_SIZE
+_SANE_DESC_GRAIN_SIZE
+msgstr ""
+
+#original text: SANE_DESC_HALFTONE
+_SANE_DESC_HALFTONE
+msgstr ""
+
+#original text: SANE_DESC_BLACK_LEVEL
+_SANE_DESC_BLACK_LEVEL
+msgstr ""
+
+#original text: SANE_DESC_WHITE_LEVEL
+_SANE_DESC_WHITE_LEVEL
+msgstr ""
+
+#original text: SANE_DESC_SHADOW
+_SANE_DESC_SHADOW
+msgstr ""
+
+#original text: SANE_DESC_SHADOW_R
+_SANE_DESC_SHADOW_R
+msgstr ""
+
+#original text: SANE_DESC_SHADOW_G
+_SANE_DESC_SHADOW_G
+msgstr ""
+
+#original text: SANE_DESC_SHADOW_B
+_SANE_DESC_SHADOW_B
+msgstr ""
+
+#original text: SANE_DESC_HIGHLIGHT
+_SANE_DESC_HIGHLIGHT
+msgstr ""
+
+#original text: SANE_DESC_HIGHLIGHT_R
+_SANE_DESC_HIGHLIGHT_R
+msgstr ""
+
+#original text: SANE_DESC_HIGHLIGHT_G
+_SANE_DESC_HIGHLIGHT_G
+msgstr ""
+
+#original text: SANE_DESC_HIGHLIGHT_B
+_SANE_DESC_HIGHLIGHT_B
+msgstr ""
+
+#original text: SANE_DESC_HUE
+_SANE_DESC_HUE
+msgstr ""
+
+#original text: SANE_DESC_SATURATION
+_SANE_DESC_SATURATION
+msgstr ""
+
+#original text: SANE_DESC_FILE
+_SANE_DESC_FILE
+msgstr ""
+
+#original text: SANE_DESC_HALFTONE_DIMENSION
+_SANE_DESC_HALFTONE_DIMENSION
+msgstr ""
+
+#original text: SANE_DESC_HALFTONE_PATTERN
+_SANE_DESC_HALFTONE_PATTERN
+msgstr ""
+
+#original text: SANE_DESC_RESOLUTION_BIND
+_SANE_DESC_RESOLUTION_BIND
+msgstr ""
+
+#original text: SANE_DESC_NEGATIVE
+_SANE_DESC_NEGATIVE
+msgstr ""
+
+#original text: SANE_DESC_QUALITY_CAL
+_SANE_DESC_QUALITY_CAL
+msgstr ""
+
+#original text: SANE_DESC_DOR
+_SANE_DESC_DOR
+msgstr ""
+
+#original text: SANE_DESC_RGB_BIND
+_SANE_DESC_RGB_BIND
+msgstr ""
+
+#original text: SANE_DESC_THRESHOLD
+_SANE_DESC_THRESHOLD
+msgstr ""
+
+#original text: SANE_DESC_ANALOG_GAMMA
+_SANE_DESC_ANALOG_GAMMA
+msgstr ""
+
+#original text: SANE_DESC_ANALOG_GAMMA_R
+_SANE_DESC_ANALOG_GAMMA_R
+msgstr ""
+
+#original text: SANE_DESC_ANALOG_GAMMA_G
+_SANE_DESC_ANALOG_GAMMA_G
+msgstr ""
+
+#original text: SANE_DESC_ANALOG_GAMMA_B
+_SANE_DESC_ANALOG_GAMMA_B
+msgstr ""
+
+#original text: SANE_DESC_ANALOG_GAMMA_BIND
+_SANE_DESC_ANALOG_GAMMA_BIND
+msgstr ""
+
+#original text: SANE_DESC_SMEAR
+_SANE_DESC_SMEAR
+msgstr ""
+
+#original text: SANE_DESC_TEN_BIT_MODE
+_SANE_DESC_TEN_BIT_MODE
+msgstr ""
+
+#original text: SANE_DESC_TWELVE_BIT_MODE
+_SANE_DESC_TWELVE_BIT_MODE
+msgstr ""
+
+#original text: SANE_DESC_WARMUP
+_SANE_DESC_WARMUP
+msgstr ""
+
+#original text: SANE_DESC_RGB_PREVIEW_PATCH
+_SANE_DESC_RGB_PREVIEW_PATCH
+msgstr ""
+
+#original text: SANE_DESC_START_SCAN_PATCH
+_SANE_DESC_START_SCAN_PATCH
+msgstr ""
+
+#original text: SANE_DESC_CAL_EXPOS_TIME
+_SANE_DESC_CAL_EXPOS_TIME
+msgstr ""
+
+#original text: SANE_DESC_CAL_EXPOS_TIME_R
+_SANE_DESC_CAL_EXPOS_TIME_R
+msgstr ""
+
+#original text: SANE_DESC_CAL_EXPOS_TIME_G
+_SANE_DESC_CAL_EXPOS_TIME_G
+msgstr ""
+
+#original text: SANE_DESC_CAL_EXPOS_TIME_B
+_SANE_DESC_CAL_EXPOS_TIME_B
+msgstr ""
+
+#original text: SANE_DESC_SCAN_EXPOS_TIME
+_SANE_DESC_SCAN_EXPOS_TIME
+msgstr ""
+
+#original text: SANE_DESC_SCAN_EXPOS_TIME_R
+_SANE_DESC_SCAN_EXPOS_TIME_R
+msgstr ""
+
+#original text: SANE_DESC_SCAN_EXPOS_TIME_G
+_SANE_DESC_SCAN_EXPOS_TIME_G
+msgstr ""
+
+#original text: SANE_DESC_SCAN_EXPOS_TIME_B
+_SANE_DESC_SCAN_EXPOS_TIME_B
+msgstr ""
+
+#original text: SANE_DESC_SELECT_EXPOSURE_TIME
+_SANE_DESC_SELECT_EXPOSURE_TIME
+msgstr ""
+
+#original text: SANE_DESC_CAL_LAMP_DEN
+_SANE_DESC_CAL_LAMP_DEN
+msgstr ""
+
+#original text: SANE_DESC_SCAN_LAMP_DEN
+_SANE_DESC_SCAN_LAMP_DEN
+msgstr ""
+
+#original text: SANE_DESC_SELECT_LAMP_DENSITY
+_SANE_DESC_SELECT_LAMP_DENSITY
+msgstr ""
diff --git a/backend-po/po.in2po b/backend-po/po.in2po
new file mode 100755
index 0000000..f202c20
--- /dev/null
+++ b/backend-po/po.in2po
@@ -0,0 +1,8 @@
+if [ $# != 1 ]
+then
+echo "Usage: po.in2po language-abrevation"
+echo "eg: po.in2po fr"
+exit -1
+fi
+gcc -E -P - <$1.po.in >$1.po
+
diff --git a/backend-po/remake_backend.po.in b/backend-po/remake_backend.po.in
new file mode 100755
index 0000000..b215c7f
--- /dev/null
+++ b/backend-po/remake_backend.po.in
@@ -0,0 +1,10 @@
+if [ $# != 1 ]
+then
+echo "Usage: remake_backend.po.in file[.po.in]"
+exit -1
+fi
+cat $1.po.in | sed -e "/#original text/D" -e "/msgid/P" -e "s/msgid /_/g" - | sed -e "s/msgid/#original text:/g" >$1.po.in.tmp
+gcc -E -P - <$1.po.in.tmp | sed -e "s/^_/msgid /g" - | cat newbackend.po.in.header - >$1.po.in
+rm $1.po.in.tmp
+
+
diff --git a/backend-po/umax.de.po b/backend-po/umax.de.po
new file mode 100644
index 0000000..86e9d9b
--- /dev/null
+++ b/backend-po/umax.de.po
@@ -0,0 +1,852 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#nls translation file for backend umax
+#language: german (de)
+
+#original text: "Number of options"
+msgid "Number of options"
+msgstr "Anzahl der Optionen"
+
+#original text: "Preview"
+msgid "Preview"
+msgstr "Vorschau"
+
+#original text: "Force monochrome preview"
+msgid "Force monochrome preview"
+msgstr "Vorschauscan in grau"
+
+#original text: "Bit depth"
+msgid "Bit depth"
+msgstr "Bittiefe"
+
+#original text: "Scan mode"
+msgid "Scan mode"
+msgstr "Scan Modus"
+
+#original text: "Scan speed"
+msgid "Scan speed"
+msgstr "Scangeschwindigkeit"
+
+#original text: "Scan source"
+msgid "Scan source"
+msgstr "Scanquelle"
+
+#original text: "Force backtracking"
+msgid "Force backtracking"
+msgstr ""
+
+#original text: "Top-left x"
+msgid "Top-left x"
+msgstr "links"
+
+#original text: "Top-left y"
+msgid "Top-left y"
+msgstr "oben"
+
+#original text: "Bottom-right x"
+msgid "Bottom-right x"
+msgstr "rechts"
+
+#original text: "Bottom-right y"
+msgid "Bottom-right y"
+msgstr "unten"
+
+#original text: "Scan resolution"
+msgid "Scan resolution"
+msgstr "Scanauflösung"
+
+#original text: "X-resolution"
+msgid "X-resolution"
+msgstr "X-Auflösung"
+
+#original text: "Y-resolution"
+msgid "Y-resolution"
+msgstr "Y-Auflösung"
+
+#original text: "Use custom gamma table"
+msgid "Use custom gamma table"
+msgstr "Benutze scannerinterne Gammakorrektur"
+
+#original text: "Image intensity"
+msgid "Image intensity"
+msgstr "Bildintensität"
+
+#original text: "Red intensity"
+msgid "Red intensity"
+msgstr "Intensität Rot"
+
+#original text: "Green intensity"
+msgid "Green intensity"
+msgstr "Intensität Grün"
+
+#original text: "Blue intensity"
+msgid "Blue intensity"
+msgstr "Intensität Blau"
+
+#original text: "Brightness"
+msgid "Brightness"
+msgstr "Helligkeit"
+
+#original text: "Contrast"
+msgid "Contrast"
+msgstr "Kontrast"
+
+#original text: "Grain size"
+msgid "Grain size"
+msgstr ""
+
+#original text: "Halftoning"
+msgid "Halftoning"
+msgstr ""
+
+#original text: "Black level"
+msgid "Black level"
+msgstr "Wert für Schwarz"
+
+#original text: "White level"
+msgid "White level"
+msgstr "Wert für Weiß"
+
+#original text: "Shadow"
+msgid "Shadow"
+msgstr "Schatten"
+
+#original text: "Shadow for red"
+msgid "Shadow for red"
+msgstr "Schatten Rot"
+
+#original text: "Shadow for green"
+msgid "Shadow for green"
+msgstr "Schatten Grün"
+
+#original text: "Shadow for blue"
+msgid "Shadow for blue"
+msgstr "Schatten Blau"
+
+#original text: "Highlight"
+msgid "Highlight"
+msgstr "Licht"
+
+#original text: "Highlight for red"
+msgid "Highlight for red"
+msgstr "Licht Rot"
+
+#original text: "Highlight for green"
+msgid "Highlight for green"
+msgstr "Licht Grün"
+
+#original text: "Highlight for blue"
+msgid "Highlight for blue"
+msgstr "Licht Blau"
+
+#original text: "Hue"
+msgid "Hue"
+msgstr ""
+
+#original text: "Saturation"
+msgid "Saturation"
+msgstr "Sättigung"
+
+#original text: "Filename"
+msgid "Filename"
+msgstr "Datiename"
+
+#original text: "Halftone pattern size"
+msgid "Halftone pattern size"
+msgstr "Halbton Matrix Größe"
+
+#original text: "Halftone pattern"
+msgid "Halftone pattern"
+msgstr "Halbton Matrix"
+
+#original text: "Bind X and Y resolution"
+msgid "Bind X and Y resolution"
+msgstr "verbinde X und Y Auflösung"
+
+#original text: "Negative"
+msgid "Negative"
+msgstr "Negativ"
+
+#original text: "Quality calibration"
+msgid "Quality calibration"
+msgstr "Qualitäts Weißabgleich"
+
+#original text: "Double Optical Resolution"
+msgid "Double Optical Resolution"
+msgstr "Verdoppelte optische Auflösung"
+
+#original text: "Bind RGB"
+msgid "Bind RGB"
+msgstr "Verbinde RGB"
+
+#original text: "Threshold"
+msgid "Threshold"
+msgstr "Grenzwert"
+
+#original text: "Analog gamma correction"
+msgid "Analog gamma correction"
+msgstr "Analoge Gammakorrektur"
+
+#original text: "Analog gamma red"
+msgid "Analog gamma red"
+msgstr "Analoger Gammawert Rot"
+
+#original text: "Analog gamma green"
+msgid "Analog gamma green"
+msgstr "Analoger Gammawert Grün"
+
+#original text: "Analog gamma blue"
+msgid "Analog gamma blue"
+msgstr "Analoger Gammawert Blau"
+
+#original text: "Bind analog gamma"
+msgid "Bind analog gamma"
+msgstr "Verbinde analoge Gammawerte"
+
+#original text: "Smear"
+msgid "Smear"
+msgstr "Schmieren"
+
+#original text: "10 bit-mode"
+msgid "10 bit-mode"
+msgstr ""
+
+#original text: "12 bit-mode"
+msgid "12 bit-mode"
+msgstr ""
+
+#original text: "Warmup lamp"
+msgid "Warmup lamp"
+msgstr "Lampe aufwärmen"
+
+#original text: "Preview patch"
+msgid "Preview patch"
+msgstr ""
+
+#original text: "Start-scan patch"
+msgid "Start-scan patch"
+msgstr ""
+
+#original text: "Cal. exposure-time"
+msgid "Cal. exposure-time"
+msgstr "Beleuchtungszeit zum Kalibrieren"
+
+#original text: "Cal. exposure-time for red"
+msgid "Cal. exposure-time for red"
+msgstr "Beleuchtungszeit zum Kalibrieren von Rot"
+
+#original text: "Cal. exposure-time for green"
+msgid "Cal. exposure-time for green"
+msgstr "Beleuchtungszeit zum Kalibrieren von Grün"
+
+#original text: "Cal. exposure-time for blue"
+msgid "Cal. exposure-time for blue"
+msgstr "Beleuchtungszeit zum Kalibrieren von Blau"
+
+#original text: "Scan exposure-time"
+msgid "Scan exposure-time"
+msgstr "Beleuchtungszeit zum Scannen"
+
+#original text: "Scan exposure-time for red"
+msgid "Scan exposure-time for red"
+msgstr "Beleuchtungszeit zum Scannen von Rot"
+
+#original text: "Scan exposure-time for green"
+msgid "Scan exposure-time for green"
+msgstr "Beleuchtungszeit zum Scannen von Grün"
+
+#original text: "Scan exposure-time for blue"
+msgid "Scan exposure-time for blue"
+msgstr "Beleuchtungszeit zum Scannen von Blau"
+
+#original text: "Set exposure-time"
+msgid "Set exposure-time"
+msgstr "Definiere Beleuchtungszeit"
+
+#original text: "Cal. lamp density"
+msgid "Cal. lamp density"
+msgstr "Lichtwert für Kalibrierung"
+
+#original text: "Scan lamp density"
+msgid "Scan lamp density"
+msgstr "Lichtwert beim Scannen"
+
+#original text: "Set lamp density"
+msgid "Set lamp density"
+msgstr "Definiere Lichtwert"
+
+
+
+
+#original text: "Request a preview-quality scan."
+msgid "Request a preview-quality scan."
+msgstr "Erbitte Scan in Vorschauqualität"
+
+#original text: "Request that all previews are done in monochrome mode. On a three-pass " " scanner this cuts down the number of passes to one and on a one-pass " "scanner, it reduces the memory requirements and scan-time of the preview."
+msgid "Request that all previews are done in monochrome mode. On a three-pass " " scanner this cuts down the number of passes to one and on a one-pass " "scanner, it reduces the memory requirements and scan-time of the preview."
+msgstr ""
+
+#original text: "Number of bits per sample, typical values are 1 for \"line-art\" and 8 " "for multibit scans."
+msgid "Number of bits per sample, typical values are 1 for \"line-art\" and 8 " "for multibit scans."
+msgstr "Anzahl der Bits pro Farbwert, typische Werte seind 1 für lineart- und 8 für multibit-Scans"
+
+#original text: "Selects the scan mode (e.g., lineart,monochrome, or color)."
+msgid "Selects the scan mode (e.g., lineart,monochrome, or color)."
+msgstr "Wählt den Scanmode (z.B. Lineart, Grau oder Farbe)"
+
+#original text: "Determines the speed at which the scan proceeds."
+msgid "Determines the speed at which the scan proceeds."
+msgstr "Bestimmt die Scangeschwindigkeit"
+
+#original text: "Selects the scan source (such as a document-feeder)."
+msgid "Selects the scan source (such as a document-feeder)."
+msgstr "Bestimmt die Scanquelle (wie Dokumenteneinzug)"
+
+#original text: "Controls whether backtracking is forced."
+msgid "Controls whether backtracking is forced."
+msgstr ""
+
+#original text: "Top-left x position of scan area."
+msgid "Top-left x position of scan area."
+msgstr "linke Kante des zu scannenden Bereichs"
+
+#original text: "Top-left y position of scan area."
+msgid "Top-left y position of scan area."
+msgstr "Obere Kante des zu scannenden Bereichs"
+
+#original text: "Bottom-right x position of scan area."
+msgid "Bottom-right x position of scan area."
+msgstr "rechte Kante des zu scannenden Bereichs"
+
+#original text: "Bottom-right y position of scan area."
+msgid "Bottom-right y position of scan area."
+msgstr "untere Kante des zu scannenden Bereichs"
+
+#original text: "Sets the resolution of the scanned image."
+msgid "Sets the resolution of the scanned image."
+msgstr "Bestimmt die Auflösung des Bildes"
+
+#original text: "Sets the horizontal resolution of the scanned image."
+msgid "Sets the horizontal resolution of the scanned image."
+msgstr "Bestimmt die horizontale Auflösung des Bildes"
+
+#original text: "Sets the vertical resolution of the scanned image."
+msgid "Sets the vertical resolution of the scanned image."
+msgstr "Bestimmt die vertikale Auflösung des Bildes"
+
+#original text: "Determines whether a builtin or a custom gamma-table should be used."
+msgid "Determines whether a builtin or a custom gamma-table should be used."
+msgstr "Bestimmt ob die scannerinterne Gammakorrektur verwendet wird"
+
+#original text: "Gamma-correction table. In color mode this option equally affects the " "red, green, and blue channels simultaneously (i.e., it is an intensity " "gamma table)."
+msgid "Gamma-correction table. In color mode this option equally affects the " "red, green, and blue channels simultaneously (i.e., it is an intensity " "gamma table)."
+msgstr "Gamma Tabelle"
+
+#original text: "Gamma-correction table for the red band."
+msgid "Gamma-correction table for the red band."
+msgstr "Gamma Tabelle für rote Komponente"
+
+#original text: "Gamma-correction table for the green band."
+msgid "Gamma-correction table for the green band."
+msgstr "Gamma Tabelle für grüne Komponente"
+
+#original text: "Gamma-correction table for the blue band."
+msgid "Gamma-correction table for the blue band."
+msgstr "Gamma Tabelle für blaue Komponente"
+
+#original text: "Controls the brightness of the acquired image."
+msgid "Controls the brightness of the acquired image."
+msgstr "Kontrolliert die Helligkeit des Bildes"
+
+#original text: "Controls the contrast of the acquired image."
+msgid "Controls the contrast of the acquired image."
+msgstr "Kontrolliert den Kontrast des Bildes"
+
+#original text: "Selects the \"graininess\" of the acquired image. Smaller values " "result in sharper images."
+msgid "Selects the \"graininess\" of the acquired image. Smaller values " "result in sharper images."
+msgstr ""
+
+#original text: "Selects whether the acquired image should be halftoned (dithered)."
+msgid "Selects whether the acquired image should be halftoned (dithered)."
+msgstr ""
+
+#original text: "Selects what radiance level should be considered \"black\"."
+msgid "Selects what radiance level should be considered \"black\"."
+msgstr "Bestimmt, welcher Helligkeitswert als Schwarz angesehen werden soll"
+
+#original text: "Selects what radiance level should be considered \"white\"."
+msgid "Selects what radiance level should be considered \"white\"."
+msgstr "Bestimmt, welcher Helligkeitswert als Weiß angesehen werden soll"
+
+#original text: "Selects what radiance level should be considered \"black\"."
+msgid "Selects what radiance level should be considered \"black\"."
+msgstr "Bestimmt, welcher Helligkeitswert als Schwarz angesehen werden soll"
+
+#original text: "Selects what red radiance level should be considered \"black\"."
+msgid "Selects what red radiance level should be considered \"black\"."
+msgstr "Bestimmt, welcher Helligkeitswert der roten Komponente als Schwarz angesehen werden soll"
+
+#original text: "Selects what green radiance level should be considered \"black\"."
+msgid "Selects what green radiance level should be considered \"black\"."
+msgstr "Bestimmt, welcher Helligkeitswert der grünen Komponente als Schwarz angesehen werden soll"
+
+#original text: "Selects what blue radiance level should be considered \"black\"."
+msgid "Selects what blue radiance level should be considered \"black\"."
+msgstr "Bestimmt, welcher Helligkeitswert der blauen Komponente als Schwarz angesehen werden soll"
+
+#original text: "Selects what radiance level should be considered \"white\"."
+msgid "Selects what radiance level should be considered \"white\"."
+msgstr "Bestimmt, welcher Helligkeitswert als Weiß angesehen werden soll"
+
+#original text: "Selects what red radiance level should be considered \"full red\"."
+msgid "Selects what red radiance level should be considered \"full red\"."
+msgstr "Bestimmt, welcher Helligkeitswert der roten Komponente als Weiß angesehen werden soll"
+
+#original text: "Selects what green radiance level should be considered \"full green\"."
+msgid "Selects what green radiance level should be considered \"full green\"."
+msgstr "Bestimmt, welcher Helligkeitswert der grünen Komponente als Weiß angesehen werden soll"
+
+#original text: "Selects what blue radiance level should be considered \"full blue\"."
+msgid "Selects what blue radiance level should be considered \"full blue\"."
+msgstr "Bestimmt, welcher Helligkeitswert der blauen Komponente als Weiß angesehen werden soll"
+
+#original text: "Controls the \"hue\" (blue-level) of the acquired image."
+msgid "Controls the \"hue\" (blue-level) of the acquired image."
+msgstr ""
+
+#original text: "The saturation level controls the amount of \"blooming\" that occurs when " "acquiring an image with a camera. Larger values cause more blooming."
+msgid "The saturation level controls the amount of \"blooming\" that occurs when " "acquiring an image with a camera. Larger values cause more blooming."
+msgstr ""
+
+#original text: "The filename of the image to be loaded."
+msgid "The filename of the image to be loaded."
+msgstr "Der Dateiname des zu ladenden Bildes"
+
+#original text: "Sets the size of the halftoning (dithering) pattern used when scanning " "halftoned images."
+msgid "Sets the size of the halftoning (dithering) pattern used when scanning " "halftoned images."
+msgstr ""
+
+#original text: "Defines the halftoning (dithering) pattern for scanning halftoned images."
+msgid "Defines the halftoning (dithering) pattern for scanning halftoned images."
+msgstr ""
+
+#original text: "Use same values for X and Y resolution"
+msgid "Use same values for X and Y resolution"
+msgstr "Benutze die gleichen Auflösungen für X und Y"
+
+#original text: "Swap black and white"
+msgid "Swap black and white"
+msgstr "Invertiere die Farben, z.B. tausche Schwarz gegen Weiß"
+
+#original text: "Do a quality white-calibration"
+msgid "Do a quality white-calibration"
+msgstr "Führe einen Qualitätsweißabgleich durch"
+
+#original text: "Use lens that doubles optical resolution"
+msgid "Use lens that doubles optical resolution"
+msgstr "Benutze die Linse, mit der die optische Auflösung verdoppelt wird"
+
+#original text: "In RGB-mode use same values for each color"
+msgid "In RGB-mode use same values for each color"
+msgstr "Benutze die gleichen Wert für alle Farben im RGB Modus"
+
+#original text: "Select minimum-brightness to get a white point"
+msgid "Select minimum-brightness to get a white point"
+msgstr "Wähle die minimale Helligkeit, die als Weiß betrachtet werden soll"
+
+#original text: "Analog gamma-correction"
+msgid "Analog gamma-correction"
+msgstr "analoge Gammakorrektur"
+
+#original text: "Analog gamma-correction for red"
+msgid "Analog gamma-correction for red"
+msgstr "analoge Gammakorrektur für Rot"
+
+#original text: "Analog gamma-correction for green"
+msgid "Analog gamma-correction for green"
+msgstr "analoge Gammakorrektur für Grün"
+
+#original text: "Analog gamma-correction for blue"
+msgid "Analog gamma-correction for blue"
+msgstr "analoge Gammakorrektur für Blau"
+
+#original text: "In RGB-mode use same values for each color"
+msgid "In RGB-mode use same values for each color"
+msgstr ""
+
+#original text: "Don't care about image smearing problem"
+msgid "Don't care about image smearing problem"
+msgstr "Ignoriere das Problem des Verschmierens des Bildes"
+
+#original text: "Output with 10 bits instead of 8 bits"
+msgid "Output with 10 bits instead of 8 bits"
+msgstr ""
+
+#original text: "Output with 12 bits instead of 8 bits"
+msgid "Output with 12 bits instead of 8 bits"
+msgstr ""
+
+#original text: "Warmup lamp before scanning"
+msgid "Warmup lamp before scanning"
+msgstr "Wärme die Lampe vorm Scannen auf"
+
+#original text: "Set preview-bit in rgb-mode"
+msgid "Set preview-bit in rgb-mode"
+msgstr "Setzt das Vorschaubit im Farbmodus"
+
+#original text: "Use special start-scan bits"
+msgid "Use special start-scan bits"
+msgstr "Benutze besondere Einstellungen beim Start des Scans"
+
+#original text: "Define exposure-time for calibration"
+msgid "Define exposure-time for calibration"
+msgstr "Bestimmt die Beleuchtungszeit für die Kalibrierung"
+
+#original text: "Define exposure-time for red calibration"
+msgid "Define exposure-time for red calibration"
+msgstr "Bestimmt die Beleuchtungszeit für die Kalibrierung der roten Komponente"
+
+#original text: "Define exposure-time for green calibration"
+msgid "Define exposure-time for green calibration"
+msgstr "Bestimmt die Beleuchtungszeit für die Kalibrierung der grünen Komponente"
+
+#original text: "Define exposure-time for blue calibration"
+msgid "Define exposure-time for blue calibration"
+msgstr "Bestimmt die Beleuchtungszeit für die Kalibrierung der blauen Komponente"
+
+#original text: "Define exposure-time for scan"
+msgid "Define exposure-time for scan"
+msgstr "Bestimmt die Beleuchtungszeit für den Scan"
+
+#original text: "Define exposure-time for red scan"
+msgid "Define exposure-time for red scan"
+msgstr "Bestimmt die Beleuchtungszeit für den Scan der roten Komponente"
+
+#original text: "Define exposure-time for green scan"
+msgid "Define exposure-time for green scan"
+msgstr "Bestimmt die Beleuchtungszeit für den Scan der grünen Komponente"
+
+#original text: "Define exposure-time for blue scan"
+msgid "Define exposure-time for blue scan"
+msgstr "Bestimmt die Beleuchtungszeit für den Scan der blauen Komponente"
+
+#original text: "Enable selection of exposure-time"
+msgid "Enable selection of exposure-time"
+msgstr "Ermögliche Einstellung der Beleuchtungszeiten"
+
+#original text: "Define lamp density for calibration"
+msgid "Define lamp density for calibration"
+msgstr "Definiere die Lichtwerte beim Kalibrieren"
+
+#original text: "Define lamp density for scan"
+msgid "Define lamp density for scan"
+msgstr "Definiere die Lichtwerte beim Scannen"
+
+#original text: "Enable selection of lamp density"
+msgid "Enable selection of lamp density"
+msgstr "Ermögliche Auswahl der Lichtwerte"
+
+msgid "Geometry"
+msgstr "Geometrie"
+
+msgid "Enhancement"
+msgstr "Farbverbesserung"
+
+msgid "Scan Mode"
+msgstr "Scan Modus"
+
+msgid "Color"
+msgstr "Farbe"
+
+msgid "Gray"
+msgstr "Graustufen"
+
+msgid "Halftone"
+msgstr "Halbton"
+
+msgid "Lineart"
+msgstr "Strichzeichnung"
+
+msgid "Flatbed"
+msgstr "Flachbett"
+
+msgid "Transparency"
+msgstr "Durchlicht"
+
+msgid "Automatic Document Feeder"
+msgstr "Autom. Dokumenteneinzug"
+
diff --git a/backend-po/umax.de.po.in b/backend-po/umax.de.po.in
new file mode 100644
index 0000000..940f18c
--- /dev/null
+++ b/backend-po/umax.de.po.in
@@ -0,0 +1,579 @@
+#include "/usr/local/include/sane/saneopts.h"
+#define _(x) x
+
+#nls translation file for backend umax
+#language: german (de)
+
+#original text: "Number of options"
+msgid SANE_TITLE_NUM_OPTIONS
+msgstr "Anzahl der Optionen"
+
+#original text: "Preview"
+msgid SANE_TITLE_PREVIEW
+msgstr "Vorschau"
+
+#original text: "Force monochrome preview"
+msgid SANE_TITLE_GRAY_PREVIEW
+msgstr "Vorschauscan in grau"
+
+#original text: "Bit depth"
+msgid SANE_TITLE_BIT_DEPTH
+msgstr "Bittiefe"
+
+#original text: "Scan mode"
+msgid SANE_TITLE_SCAN_MODE
+msgstr "Scan Modus"
+
+#original text: "Scan speed"
+msgid SANE_TITLE_SCAN_SPEED
+msgstr "Scangeschwindigkeit"
+
+#original text: "Scan source"
+msgid SANE_TITLE_SCAN_SOURCE
+msgstr "Scanquelle"
+
+#original text: "Force backtracking"
+msgid SANE_TITLE_BACKTRACK
+msgstr ""
+
+#original text: "Top-left x"
+msgid SANE_TITLE_SCAN_TL_X
+msgstr "links"
+
+#original text: "Top-left y"
+msgid SANE_TITLE_SCAN_TL_Y
+msgstr "oben"
+
+#original text: "Bottom-right x"
+msgid SANE_TITLE_SCAN_BR_X
+msgstr "rechts"
+
+#original text: "Bottom-right y"
+msgid SANE_TITLE_SCAN_BR_Y
+msgstr "unten"
+
+#original text: "Scan resolution"
+msgid SANE_TITLE_SCAN_RESOLUTION
+msgstr "Scanauflösung"
+
+#original text: "X-resolution"
+msgid SANE_TITLE_SCAN_X_RESOLUTION
+msgstr "X-Auflösung"
+
+#original text: "Y-resolution"
+msgid SANE_TITLE_SCAN_Y_RESOLUTION
+msgstr "Y-Auflösung"
+
+#original text: "Use custom gamma table"
+msgid SANE_TITLE_CUSTOM_GAMMA
+msgstr "Benutze scannerinterne Gammakorrektur"
+
+#original text: "Image intensity"
+msgid SANE_TITLE_GAMMA_VECTOR
+msgstr "Bildintensität"
+
+#original text: "Red intensity"
+msgid SANE_TITLE_GAMMA_VECTOR_R
+msgstr "Intensität Rot"
+
+#original text: "Green intensity"
+msgid SANE_TITLE_GAMMA_VECTOR_G
+msgstr "Intensität Grün"
+
+#original text: "Blue intensity"
+msgid SANE_TITLE_GAMMA_VECTOR_B
+msgstr "Intensität Blau"
+
+#original text: "Brightness"
+msgid SANE_TITLE_BRIGHTNESS
+msgstr "Helligkeit"
+
+#original text: "Contrast"
+msgid SANE_TITLE_CONTRAST
+msgstr "Kontrast"
+
+#original text: "Grain size"
+msgid SANE_TITLE_GRAIN_SIZE
+msgstr ""
+
+#original text: "Halftoning"
+msgid SANE_TITLE_HALFTONE
+msgstr ""
+
+#original text: "Black level"
+msgid SANE_TITLE_BLACK_LEVEL
+msgstr "Wert für Schwarz"
+
+#original text: "White level"
+msgid SANE_TITLE_WHITE_LEVEL
+msgstr "Wert für Weiß"
+
+#original text: "Shadow"
+msgid SANE_TITLE_SHADOW
+msgstr "Schatten"
+
+#original text: "Shadow for red"
+msgid SANE_TITLE_SHADOW_R
+msgstr "Schatten Rot"
+
+#original text: "Shadow for green"
+msgid SANE_TITLE_SHADOW_G
+msgstr "Schatten Grün"
+
+#original text: "Shadow for blue"
+msgid SANE_TITLE_SHADOW_B
+msgstr "Schatten Blau"
+
+#original text: "Highlight"
+msgid SANE_TITLE_HIGHLIGHT
+msgstr "Licht"
+
+#original text: "Highlight for red"
+msgid SANE_TITLE_HIGHLIGHT_R
+msgstr "Licht Rot"
+
+#original text: "Highlight for green"
+msgid SANE_TITLE_HIGHLIGHT_G
+msgstr "Licht Grün"
+
+#original text: "Highlight for blue"
+msgid SANE_TITLE_HIGHLIGHT_B
+msgstr "Licht Blau"
+
+#original text: "Hue"
+msgid SANE_TITLE_HUE
+msgstr ""
+
+#original text: "Saturation"
+msgid SANE_TITLE_SATURATION
+msgstr "Sättigung"
+
+#original text: "Filename"
+msgid SANE_TITLE_FILE
+msgstr "Datiename"
+
+#original text: "Halftone pattern size"
+msgid SANE_TITLE_HALFTONE_DIMENSION
+msgstr "Halbton Matrix Größe"
+
+#original text: "Halftone pattern"
+msgid SANE_TITLE_HALFTONE_PATTERN
+msgstr "Halbton Matrix"
+
+#original text: "Bind X and Y resolution"
+msgid SANE_TITLE_RESOLUTION_BIND
+msgstr "verbinde X und Y Auflösung"
+
+#original text: "Negative"
+msgid SANE_TITLE_NEGATIVE
+msgstr "Negativ"
+
+#original text: "Quality calibration"
+msgid SANE_TITLE_QUALITY_CAL
+msgstr "Qualitäts Weißabgleich"
+
+#original text: "Double Optical Resolution"
+msgid SANE_TITLE_DOR
+msgstr "Verdoppelte optische Auflösung"
+
+#original text: "Bind RGB"
+msgid SANE_TITLE_RGB_BIND
+msgstr "Verbinde RGB"
+
+#original text: "Threshold"
+msgid SANE_TITLE_THRESHOLD
+msgstr "Grenzwert"
+
+#original text: "Analog gamma correction"
+msgid SANE_TITLE_ANALOG_GAMMA
+msgstr "Analoge Gammakorrektur"
+
+#original text: "Analog gamma red"
+msgid SANE_TITLE_ANALOG_GAMMA_R
+msgstr "Analoger Gammawert Rot"
+
+#original text: "Analog gamma green"
+msgid SANE_TITLE_ANALOG_GAMMA_G
+msgstr "Analoger Gammawert Grün"
+
+#original text: "Analog gamma blue"
+msgid SANE_TITLE_ANALOG_GAMMA_B
+msgstr "Analoger Gammawert Blau"
+
+#original text: "Bind analog gamma"
+msgid SANE_TITLE_ANALOG_GAMMA_BIND
+msgstr "Verbinde analoge Gammawerte"
+
+#original text: "Smear"
+msgid SANE_TITLE_SMEAR
+msgstr "Schmieren"
+
+#original text: "10 bit-mode"
+msgid SANE_TITLE_TEN_BIT_MODE
+msgstr ""
+
+#original text: "12 bit-mode"
+msgid SANE_TITLE_TWELVE_BIT_MODE
+msgstr ""
+
+#original text: "Warmup lamp"
+msgid SANE_TITLE_WARMUP
+msgstr "Lampe aufwärmen"
+
+#original text: "Preview patch"
+msgid SANE_TITLE_RGB_PREVIEW_PATCH
+msgstr ""
+
+#original text: "Start-scan patch"
+msgid SANE_TITLE_START_SCAN_PATCH
+msgstr ""
+
+#original text: "Cal. exposure-time"
+msgid SANE_TITLE_CAL_EXPOS_TIME
+msgstr "Beleuchtungszeit zum Kalibrieren"
+
+#original text: "Cal. exposure-time for red"
+msgid SANE_TITLE_CAL_EXPOS_TIME_R
+msgstr "Beleuchtungszeit zum Kalibrieren von Rot"
+
+#original text: "Cal. exposure-time for green"
+msgid SANE_TITLE_CAL_EXPOS_TIME_G
+msgstr "Beleuchtungszeit zum Kalibrieren von Grün"
+
+#original text: "Cal. exposure-time for blue"
+msgid SANE_TITLE_CAL_EXPOS_TIME_B
+msgstr "Beleuchtungszeit zum Kalibrieren von Blau"
+
+#original text: "Scan exposure-time"
+msgid SANE_TITLE_SCAN_EXPOS_TIME
+msgstr "Beleuchtungszeit zum Scannen"
+
+#original text: "Scan exposure-time for red"
+msgid SANE_TITLE_SCAN_EXPOS_TIME_R
+msgstr "Beleuchtungszeit zum Scannen von Rot"
+
+#original text: "Scan exposure-time for green"
+msgid SANE_TITLE_SCAN_EXPOS_TIME_G
+msgstr "Beleuchtungszeit zum Scannen von Grün"
+
+#original text: "Scan exposure-time for blue"
+msgid SANE_TITLE_SCAN_EXPOS_TIME_B
+msgstr "Beleuchtungszeit zum Scannen von Blau"
+
+#original text: "Set exposure-time"
+msgid SANE_TITLE_SELECT_EXPOSURE_TIME
+msgstr "Definiere Beleuchtungszeit"
+
+#original text: "Cal. lamp density"
+msgid SANE_TITLE_CAL_LAMP_DEN
+msgstr "Lichtwert für Kalibrierung"
+
+#original text: "Scan lamp density"
+msgid SANE_TITLE_SCAN_LAMP_DEN
+msgstr "Lichtwert beim Scannen"
+
+#original text: "Set lamp density"
+msgid SANE_TITLE_SELECT_LAMP_DENSITY
+msgstr "Definiere Lichtwert"
+
+
+
+
+#original text: "Request a preview-quality scan."
+msgid SANE_DESC_PREVIEW
+msgstr "Erbitte Scan in Vorschauqualität"
+
+#original text: "Request that all previews are done in monochrome mode. On a three-pass " " scanner this cuts down the number of passes to one and on a one-pass " "scanner, it reduces the memory requirements and scan-time of the preview."
+msgid SANE_DESC_GRAY_PREVIEW
+msgstr ""
+
+#original text: "Number of bits per sample, typical values are 1 for \"line-art\" and 8 " "for multibit scans."
+msgid SANE_DESC_BIT_DEPTH
+msgstr "Anzahl der Bits pro Farbwert, typische Werte seind 1 für lineart- und 8 für multibit-Scans"
+
+#original text: "Selects the scan mode (e.g., lineart,monochrome, or color)."
+msgid SANE_DESC_SCAN_MODE
+msgstr "Wählt den Scanmode (z.B. Lineart, Grau oder Farbe)"
+
+#original text: "Determines the speed at which the scan proceeds."
+msgid SANE_DESC_SCAN_SPEED
+msgstr "Bestimmt die Scangeschwindigkeit"
+
+#original text: "Selects the scan source (such as a document-feeder)."
+msgid SANE_DESC_SCAN_SOURCE
+msgstr "Bestimmt die Scanquelle (wie Dokumenteneinzug)"
+
+#original text: "Controls whether backtracking is forced."
+msgid SANE_DESC_BACKTRACK
+msgstr ""
+
+#original text: "Top-left x position of scan area."
+msgid SANE_DESC_SCAN_TL_X
+msgstr "linke Kante des zu scannenden Bereichs"
+
+#original text: "Top-left y position of scan area."
+msgid SANE_DESC_SCAN_TL_Y
+msgstr "Obere Kante des zu scannenden Bereichs"
+
+#original text: "Bottom-right x position of scan area."
+msgid SANE_DESC_SCAN_BR_X
+msgstr "rechte Kante des zu scannenden Bereichs"
+
+#original text: "Bottom-right y position of scan area."
+msgid SANE_DESC_SCAN_BR_Y
+msgstr "untere Kante des zu scannenden Bereichs"
+
+#original text: "Sets the resolution of the scanned image."
+msgid SANE_DESC_SCAN_RESOLUTION
+msgstr "Bestimmt die Auflösung des Bildes"
+
+#original text: "Sets the horizontal resolution of the scanned image."
+msgid SANE_DESC_SCAN_X_RESOLUTION
+msgstr "Bestimmt die horizontale Auflösung des Bildes"
+
+#original text: "Sets the vertical resolution of the scanned image."
+msgid SANE_DESC_SCAN_Y_RESOLUTION
+msgstr "Bestimmt die vertikale Auflösung des Bildes"
+
+#original text: "Determines whether a builtin or a custom gamma-table should be used."
+msgid SANE_DESC_CUSTOM_GAMMA
+msgstr "Bestimmt ob die scannerinterne Gammakorrektur verwendet wird"
+
+#original text: "Gamma-correction table. In color mode this option equally affects the " "red, green, and blue channels simultaneously (i.e., it is an intensity " "gamma table)."
+msgid SANE_DESC_GAMMA_VECTOR
+msgstr "Gamma Tabelle"
+
+#original text: "Gamma-correction table for the red band."
+msgid SANE_DESC_GAMMA_VECTOR_R
+msgstr "Gamma Tabelle für rote Komponente"
+
+#original text: "Gamma-correction table for the green band."
+msgid SANE_DESC_GAMMA_VECTOR_G
+msgstr "Gamma Tabelle für grüne Komponente"
+
+#original text: "Gamma-correction table for the blue band."
+msgid SANE_DESC_GAMMA_VECTOR_B
+msgstr "Gamma Tabelle für blaue Komponente"
+
+#original text: "Controls the brightness of the acquired image."
+msgid SANE_DESC_BRIGHTNESS
+msgstr "Kontrolliert die Helligkeit des Bildes"
+
+#original text: "Controls the contrast of the acquired image."
+msgid SANE_DESC_CONTRAST
+msgstr "Kontrolliert den Kontrast des Bildes"
+
+#original text: "Selects the \"graininess\" of the acquired image. Smaller values " "result in sharper images."
+msgid SANE_DESC_GRAIN_SIZE
+msgstr ""
+
+#original text: "Selects whether the acquired image should be halftoned (dithered)."
+msgid SANE_DESC_HALFTONE
+msgstr ""
+
+#original text: "Selects what radiance level should be considered \"black\"."
+msgid SANE_DESC_BLACK_LEVEL
+msgstr "Bestimmt, welcher Helligkeitswert als Schwarz angesehen werden soll"
+
+#original text: "Selects what radiance level should be considered \"white\"."
+msgid SANE_DESC_WHITE_LEVEL
+msgstr "Bestimmt, welcher Helligkeitswert als Weiß angesehen werden soll"
+
+#original text: "Selects what radiance level should be considered \"black\"."
+msgid SANE_DESC_SHADOW
+msgstr "Bestimmt, welcher Helligkeitswert als Schwarz angesehen werden soll"
+
+#original text: "Selects what red radiance level should be considered \"black\"."
+msgid SANE_DESC_SHADOW_R
+msgstr "Bestimmt, welcher Helligkeitswert der roten Komponente als Schwarz angesehen werden soll"
+
+#original text: "Selects what green radiance level should be considered \"black\"."
+msgid SANE_DESC_SHADOW_G
+msgstr "Bestimmt, welcher Helligkeitswert der grünen Komponente als Schwarz angesehen werden soll"
+
+#original text: "Selects what blue radiance level should be considered \"black\"."
+msgid SANE_DESC_SHADOW_B
+msgstr "Bestimmt, welcher Helligkeitswert der blauen Komponente als Schwarz angesehen werden soll"
+
+#original text: "Selects what radiance level should be considered \"white\"."
+msgid SANE_DESC_HIGHLIGHT
+msgstr "Bestimmt, welcher Helligkeitswert als Weiß angesehen werden soll"
+
+#original text: "Selects what red radiance level should be considered \"full red\"."
+msgid SANE_DESC_HIGHLIGHT_R
+msgstr "Bestimmt, welcher Helligkeitswert der roten Komponente als Weiß angesehen werden soll"
+
+#original text: "Selects what green radiance level should be considered \"full green\"."
+msgid SANE_DESC_HIGHLIGHT_G
+msgstr "Bestimmt, welcher Helligkeitswert der grünen Komponente als Weiß angesehen werden soll"
+
+#original text: "Selects what blue radiance level should be considered \"full blue\"."
+msgid SANE_DESC_HIGHLIGHT_B
+msgstr "Bestimmt, welcher Helligkeitswert der blauen Komponente als Weiß angesehen werden soll"
+
+#original text: "Controls the \"hue\" (blue-level) of the acquired image."
+msgid SANE_DESC_HUE
+msgstr ""
+
+#original text: "The saturation level controls the amount of \"blooming\" that occurs when " "acquiring an image with a camera. Larger values cause more blooming."
+msgid SANE_DESC_SATURATION
+msgstr ""
+
+#original text: "The filename of the image to be loaded."
+msgid SANE_DESC_FILE
+msgstr "Der Dateiname des zu ladenden Bildes"
+
+#original text: "Sets the size of the halftoning (dithering) pattern used when scanning " "halftoned images."
+msgid SANE_DESC_HALFTONE_DIMENSION
+msgstr ""
+
+#original text: "Defines the halftoning (dithering) pattern for scanning halftoned images."
+msgid SANE_DESC_HALFTONE_PATTERN
+msgstr ""
+
+#original text: "Use same values for X and Y resolution"
+msgid SANE_DESC_RESOLUTION_BIND
+msgstr "Benutze die gleichen Auflösungen für X und Y"
+
+#original text: "Swap black and white"
+msgid SANE_DESC_NEGATIVE
+msgstr "Invertiere die Farben, z.B. tausche Schwarz gegen Weiß"
+
+#original text: "Do a quality white-calibration"
+msgid SANE_DESC_QUALITY_CAL
+msgstr "Führe einen Qualitätsweißabgleich durch"
+
+#original text: "Use lens that doubles optical resolution"
+msgid SANE_DESC_DOR
+msgstr "Benutze die Linse, mit der die optische Auflösung verdoppelt wird"
+
+#original text: "In RGB-mode use same values for each color"
+msgid SANE_DESC_RGB_BIND
+msgstr "Benutze die gleichen Wert für alle Farben im RGB Modus"
+
+#original text: "Select minimum-brightness to get a white point"
+msgid SANE_DESC_THRESHOLD
+msgstr "Wähle die minimale Helligkeit, die als Weiß betrachtet werden soll"
+
+#original text: "Analog gamma-correction"
+msgid SANE_DESC_ANALOG_GAMMA
+msgstr "analoge Gammakorrektur"
+
+#original text: "Analog gamma-correction for red"
+msgid SANE_DESC_ANALOG_GAMMA_R
+msgstr "analoge Gammakorrektur für Rot"
+
+#original text: "Analog gamma-correction for green"
+msgid SANE_DESC_ANALOG_GAMMA_G
+msgstr "analoge Gammakorrektur für Grün"
+
+#original text: "Analog gamma-correction for blue"
+msgid SANE_DESC_ANALOG_GAMMA_B
+msgstr "analoge Gammakorrektur für Blau"
+
+#original text: "In RGB-mode use same values for each color"
+msgid SANE_DESC_ANALOG_GAMMA_BIND
+msgstr ""
+
+#original text: "Don't care about image smearing problem"
+msgid SANE_DESC_SMEAR
+msgstr "Ignoriere das Problem des Verschmierens des Bildes"
+
+#original text: "Output with 10 bits instead of 8 bits"
+msgid SANE_DESC_TEN_BIT_MODE
+msgstr ""
+
+#original text: "Output with 12 bits instead of 8 bits"
+msgid SANE_DESC_TWELVE_BIT_MODE
+msgstr ""
+
+#original text: "Warmup lamp before scanning"
+msgid SANE_DESC_WARMUP
+msgstr "Wärme die Lampe vorm Scannen auf"
+
+#original text: "Set preview-bit in rgb-mode"
+msgid SANE_DESC_RGB_PREVIEW_PATCH
+msgstr "Setzt das Vorschaubit im Farbmodus"
+
+#original text: "Use special start-scan bits"
+msgid SANE_DESC_START_SCAN_PATCH
+msgstr "Benutze besondere Einstellungen beim Start des Scans"
+
+#original text: "Define exposure-time for calibration"
+msgid SANE_DESC_CAL_EXPOS_TIME
+msgstr "Bestimmt die Beleuchtungszeit für die Kalibrierung"
+
+#original text: "Define exposure-time for red calibration"
+msgid SANE_DESC_CAL_EXPOS_TIME_R
+msgstr "Bestimmt die Beleuchtungszeit für die Kalibrierung der roten Komponente"
+
+#original text: "Define exposure-time for green calibration"
+msgid SANE_DESC_CAL_EXPOS_TIME_G
+msgstr "Bestimmt die Beleuchtungszeit für die Kalibrierung der grünen Komponente"
+
+#original text: "Define exposure-time for blue calibration"
+msgid SANE_DESC_CAL_EXPOS_TIME_B
+msgstr "Bestimmt die Beleuchtungszeit für die Kalibrierung der blauen Komponente"
+
+#original text: "Define exposure-time for scan"
+msgid SANE_DESC_SCAN_EXPOS_TIME
+msgstr "Bestimmt die Beleuchtungszeit für den Scan"
+
+#original text: "Define exposure-time for red scan"
+msgid SANE_DESC_SCAN_EXPOS_TIME_R
+msgstr "Bestimmt die Beleuchtungszeit für den Scan der roten Komponente"
+
+#original text: "Define exposure-time for green scan"
+msgid SANE_DESC_SCAN_EXPOS_TIME_G
+msgstr "Bestimmt die Beleuchtungszeit für den Scan der grünen Komponente"
+
+#original text: "Define exposure-time for blue scan"
+msgid SANE_DESC_SCAN_EXPOS_TIME_B
+msgstr "Bestimmt die Beleuchtungszeit für den Scan der blauen Komponente"
+
+#original text: "Enable selection of exposure-time"
+msgid SANE_DESC_SELECT_EXPOSURE_TIME
+msgstr "Ermögliche Einstellung der Beleuchtungszeiten"
+
+#original text: "Define lamp density for calibration"
+msgid SANE_DESC_CAL_LAMP_DEN
+msgstr "Definiere die Lichtwerte beim Kalibrieren"
+
+#original text: "Define lamp density for scan"
+msgid SANE_DESC_SCAN_LAMP_DEN
+msgstr "Definiere die Lichtwerte beim Scannen"
+
+#original text: "Enable selection of lamp density"
+msgid SANE_DESC_SELECT_LAMP_DENSITY
+msgstr "Ermögliche Auswahl der Lichtwerte"
+
+msgid "Geometry"
+msgstr "Geometrie"
+
+msgid "Enhancement"
+msgstr "Farbverbesserung"
+
+msgid "Scan Mode"
+msgstr "Scan Modus"
+
+msgid "Color"
+msgstr "Farbe"
+
+msgid "Gray"
+msgstr "Graustufen"
+
+msgid "Halftone"
+msgstr "Halbton"
+
+msgid "Lineart"
+msgstr "Strichzeichnung"
+
+msgid "Flatbed"
+msgstr "Flachbett"
+
+msgid "Transparency"
+msgstr "Durchlicht"
+
+msgid "Automatic Document Feeder"
+msgstr "Autom. Dokumenteneinzug"
+
diff --git a/config.guess b/config.guess
new file mode 100755
index 0000000..413ed41
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,883 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+#
+# This file 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Written by Per Bothner <bothner@cygnus.com>.
+# The master version of this file is at the FSF in /home/gd/gnu/lib.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit system type (host/target name).
+#
+# Only a few systems have been added to this list; please add others
+# (but try to keep the structure clean).
+#
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 8/24/94.)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ cat <<EOF >dummy.s
+ .globl main
+ .ent main
+main:
+ .frame \$30,0,\$26,0
+ .prologue 0
+ .long 0x47e03d80 # implver $0
+ lda \$2,259
+ .long 0x47e20c21 # amask $2,$1
+ srl \$1,8,\$2
+ sll \$2,2,\$2
+ sll \$0,3,\$0
+ addl \$1,\$0,\$0
+ addl \$2,\$0,\$0
+ ret \$31,(\$26),1
+ .end main
+EOF
+ ${CC-cc} dummy.s -o dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ ./dummy
+ case "$?" in
+ 7)
+ UNAME_MACHINE="alpha"
+ ;;
+ 15)
+ UNAME_MACHINE="alphaev5"
+ ;;
+ 14)
+ UNAME_MACHINE="alphaev56"
+ ;;
+ 10)
+ UNAME_MACHINE="alphapca56"
+ ;;
+ 16)
+ UNAME_MACHINE="alphaev6"
+ ;;
+ esac
+ fi
+ rm -f dummy.s dummy
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-cbm-sysv4
+ exit 0;;
+ amiga:NetBSD:*:*)
+ echo m68k-cbm-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc64:OpenBSD:*:*)
+ echo mips64el-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hkmips:OpenBSD:*:*)
+ echo mips-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mips-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ arm32:NetBSD:*:*)
+ echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
+ SR2?01:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ NILE:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:NetBSD:*:*)
+ echo m68k-atari-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3*:NetBSD:*:*)
+ echo m68k-sun-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3*:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:NetBSD:*:*)
+ echo m68k-apple-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ 2020:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ sed 's/^ //' << EOF >dummy.c
+ int main (argc, argv) int argc; char **argv; {
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ ${CC-cc} dummy.c -o dummy \
+ && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
+ -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i?86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ sed 's/^ //' << EOF >dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:4)
+ if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=4.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[3478]??:HP-UX:*:*)
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;
+ 9000/8?? ) HP_ARCH=hppa1.0 ;;
+ esac
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
+ sed 's/^ //' << EOF >dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ i?86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*X-MP:*:*:*)
+ echo xmp-cray-unicos
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE}
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE}
+ exit 0 ;;
+ CRAY-2:*:*:*)
+ echo cray2-cray-unicos
+ exit 0 ;;
+ F300:UNIX_System_V:*:*)
+ FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ F301:UNIX_System_V:*:*)
+ echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
+ exit 0 ;;
+ hp3[0-9][05]:NetBSD:*:*)
+ echo m68k-hp-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ i?86:BSD/386:*:* | *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit 0 ;;
+ *:NetBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo i386-pc-cygwin32
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo i386-pc-mingw32
+ exit 0 ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin32
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ *:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us.
+ ld_help_string=`ld --help 2>&1`
+ ld_supported_emulations=`echo $ld_help_string \
+ | sed -ne '/supported emulations:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported emulations: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_emulations" in
+ i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;;
+ i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;;
+ sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+ m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
+ elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;;
+ esac
+
+ if test "${UNAME_MACHINE}" = "alpha" ; then
+ sed 's/^ //' <<EOF >dummy.s
+ .globl main
+ .ent main
+ main:
+ .frame \$30,0,\$26,0
+ .prologue 0
+ .long 0x47e03d80 # implver $0
+ lda \$2,259
+ .long 0x47e20c21 # amask $2,$1
+ srl \$1,8,\$2
+ sll \$2,2,\$2
+ sll \$0,3,\$0
+ addl \$1,\$0,\$0
+ addl \$2,\$0,\$0
+ ret \$31,(\$26),1
+ .end main
+EOF
+ LIBC=""
+ ${CC-cc} dummy.s -o dummy 2>/dev/null
+ if test "$?" = 0 ; then
+ ./dummy
+ case "$?" in
+ 7)
+ UNAME_MACHINE="alpha"
+ ;;
+ 15)
+ UNAME_MACHINE="alphaev5"
+ ;;
+ 14)
+ UNAME_MACHINE="alphaev56"
+ ;;
+ 10)
+ UNAME_MACHINE="alphapca56"
+ ;;
+ 16)
+ UNAME_MACHINE="alphaev6"
+ ;;
+ esac
+
+ objdump --private-headers dummy | \
+ grep ld.so.1 > /dev/null
+ if test "$?" = 0 ; then
+ LIBC="libc1"
+ fi
+ fi
+ rm -f dummy.s dummy
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
+ elif test "${UNAME_MACHINE}" = "mips" ; then
+ cat >dummy.c <<EOF
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+#ifdef __MIPSEB__
+ printf ("%s-unknown-linux-gnu\n", argv[1]);
+#endif
+#ifdef __MIPSEL__
+ printf ("%sel-unknown-linux-gnu\n", argv[1]);
+#endif
+ return 0;
+}
+EOF
+ ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ else
+ # Either a pre-BFD a.out linker (linux-gnuoldld)
+ # or one that does not give us useful --help.
+ # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
+ # If ld does not provide *any* "supported emulations:"
+ # that means it is gnuoldld.
+ echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
+ test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
+
+ case "${UNAME_MACHINE}" in
+ i?86)
+ VENDOR=pc;
+ ;;
+ *)
+ VENDOR=unknown;
+ ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ cat >dummy.c <<EOF
+#include <features.h>
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+#ifdef __ELF__
+# ifdef __GLIBC__
+# if __GLIBC__ >= 2
+ printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+# else
+ printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+# endif
+# else
+ printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+# endif
+#else
+ printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
+#endif
+ return 0;
+}
+EOF
+ ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ fi ;;
+# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
+# are messed up and put the nodename in both sysname and nodename.
+ i?86:DYNIX/ptx:4*:*)
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i?86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit 0 ;;
+ i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ i?86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ pc:*:*:*)
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+ m68*:LynxOS:2.*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ i?86:LynxOS:2.*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+ PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit 0 ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+ news*:NEWS-OS:*:6*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+cat >dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+ printf ("vax-dec-bsd\n"); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
+rm -f dummy.c dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+#echo '(Unable to guess system type)' 1>&2
+
+exit 1
diff --git a/config.sub b/config.sub
new file mode 100755
index 0000000..55704e9
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,958 @@
+#! /bin/sh
+# Configuration validation subroutine script, version 1.1.
+# Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file 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 2 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., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+if [ x$1 = x ]
+then
+ echo Configuration name missing. 1>&2
+ echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+ echo "or $0 ALIAS" 1>&2
+ echo where ALIAS is a recognized configuration type. 1>&2
+ exit 1
+fi
+
+# First pass through any local machine types.
+case $1 in
+ *local*)
+ echo $1
+ exit 0
+ ;;
+ *)
+ ;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ linux-gnu*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple)
+ os=
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+ | arme[lb] | pyramid | mn10200 | mn10300 \
+ | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
+ | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
+ | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
+ | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
+ | mipstx39 | mipstx39el \
+ | sparc | sparclet | sparclite | sparc64 | v850)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i[3456]86)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
+ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
+ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
+ | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
+ | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
+ | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
+ | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
+ | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
+ | sparc64-* | mips64-* | mipsel-* \
+ | mips64el-* | mips64orion-* | mips64orionel-* \
+ | mipstx39-* | mipstx39el-* \
+ | f301-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-cbm
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-cbm
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-cbm
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ cray2)
+ basic_machine=cray2-cray
+ os=-unicos
+ ;;
+ [ctj]90-cray)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i[3456]86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i[3456]86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i[3456]86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i[3456]86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ mipsel*-linux*)
+ basic_machine=mipsel-unknown
+ os=-linux-gnu
+ ;;
+ mips*-linux*)
+ basic_machine=mips-unknown
+ os=-linux-gnu
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5)
+ basic_machine=i586-intel
+ ;;
+ pentiumpro | p6)
+ basic_machine=i686-intel
+ ;;
+ pentium-* | p5-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ k5)
+ # We don't have specific support for AMD's K5 yet, so just call it a Pentium
+ basic_machine=i586-amd
+ ;;
+ nexen)
+ # We don't have specific support for Nexgen yet, so just call it a Pentium
+ basic_machine=i586-nexgen
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=rs6000-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ xmp)
+ basic_machine=xmp-cray
+ os=-unicos
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ mips)
+ if [ x$os = x-linux-gnu ]; then
+ basic_machine=mips-unknown
+ else
+ basic_machine=mips-mips
+ fi
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sparc)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -uxpv*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ # For sys5.3 apollo
+ -sys5.3)
+ os=-sysv3
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f301-fujitsu)
+ os=-uxpv
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -vxsim* | -vxworks*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
diff --git a/configure b/configure
new file mode 100755
index 0000000..f5834f8
--- /dev/null
+++ b/configure
@@ -0,0 +1,5569 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+ --enable-intl-patch add -lintl to check for sane"
+ac_help="$ac_help
+ --disable-gimp do not include GIMP plugin mode"
+ac_help="$ac_help
+ --disable-jpeg do not include JPEG support"
+ac_help="$ac_help
+ --disable-png do not include PNG support"
+ac_help="$ac_help
+ --disable-tiff do not include TIFF support"
+ac_help="$ac_help
+ --disable-nls do not use Native Language Support"
+ac_help="$ac_help
+ --with-included-gettext use the GNU gettext library included here"
+ac_help="$ac_help
+ --with-catgets use catgets functions if available"
+ac_help="$ac_help
+ --with-x use the X Window System"
+ac_help="$ac_help
+ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)"
+ac_help="$ac_help
+ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)"
+ac_help="$ac_help
+ --disable-gtktest Do not try to compile and run a test GTK program"
+ac_help="$ac_help
+
+Used environment variables that can be set by user:
+ CFLAGS, CPPFLAGS, LDFLAGS, LIBS"
+ac_help="$ac_help
+
+To add include or library paths call:
+ [env] CPPFLAGS=\"-I/path/to/foo/include\" LDFLAGS=\"-L/path/to/foo/libs\" ./configure"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=include/sane/config.h.in
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+# AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required.
+# AC_ARG_PROGRAM
+
+# version code:
+V_MAJOR=0
+V_MINOR=50
+
+PACKAGE=xsane
+
+BINPROGS="xsane"
+
+# languages
+ALL_LINGUAS="de fr cs"
+
+SANE_V_MAJOR=1
+VERSION=${V_MAJOR}.${V_MINOR}
+PACKAGE_VERSION="$PACKAGE-$VERSION"
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+cat >> confdefs.h <<EOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+EOF
+
+
+
+
+
+
+
+echo $ac_n "checking whether libintl patch is requested""... $ac_c" 1>&6
+echo "configure:594: checking whether libintl patch is requested" >&5
+# Check whether --enable-intl-patch or --disable-intl-patch was given.
+if test "${enable_intl_patch+set}" = set; then
+ enableval="$enable_intl_patch"
+ ADD_LIBINTL=$enableval
+else
+ ADD_LIBINTL=no
+fi
+
+echo "$ac_t""$ADD_LIBINTL" 1>&6
+
+echo $ac_n "checking whether GIMP plugin is requested""... $ac_c" 1>&6
+echo "configure:606: checking whether GIMP plugin is requested" >&5
+# Check whether --enable-gimp or --disable-gimp was given.
+if test "${enable_gimp+set}" = set; then
+ enableval="$enable_gimp"
+ USE_GIMP=$enableval
+else
+ USE_GIMP=yes
+fi
+
+echo "$ac_t""$USE_GIMP" 1>&6
+
+echo $ac_n "checking whether JPEG support is requested""... $ac_c" 1>&6
+echo "configure:618: checking whether JPEG support is requested" >&5
+# Check whether --enable-jpeg or --disable-jpeg was given.
+if test "${enable_jpeg+set}" = set; then
+ enableval="$enable_jpeg"
+ USE_JPEG=$enableval
+else
+ USE_JPEG=yes
+fi
+
+echo "$ac_t""$USE_JPEG" 1>&6
+
+echo $ac_n "checking whether PNG support is requested""... $ac_c" 1>&6
+echo "configure:630: checking whether PNG support is requested" >&5
+# Check whether --enable-png or --disable-png was given.
+if test "${enable_png+set}" = set; then
+ enableval="$enable_png"
+ USE_PNG=$enableval
+else
+ USE_PNG=yes
+fi
+
+echo "$ac_t""$USE_PNG" 1>&6
+
+echo $ac_n "checking whether TIFF support is requested""... $ac_c" 1>&6
+echo "configure:642: checking whether TIFF support is requested" >&5
+# Check whether --enable-tiff or --disable-tiff was given.
+if test "${enable_tiff+set}" = set; then
+ enableval="$enable_tiff"
+ USE_TIFF=$enableval
+else
+ USE_TIFF=yes
+fi
+
+echo "$ac_t""$USE_TIFF" 1>&6
+
+
+# Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:657: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="gcc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:687: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_prog_rejected=no
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# -gt 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" "$@"
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test -z "$CC"; then
+ case "`uname -s`" in
+ *win32* | *WIN32*)
+ # Extract the first word of "cl", so it can be a program name with args.
+set dummy cl; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:738: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_CC="cl"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+ echo "$ac_t""$CC" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ ;;
+ esac
+ fi
+ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:770: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 781 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ ac_cv_prog_cc_works=yes
+ # If we can't run a trivial program, we are probably using a cross compiler.
+ if (./conftest; exit) 2>/dev/null; then
+ ac_cv_prog_cc_cross=no
+ else
+ ac_cv_prog_cc_cross=yes
+ fi
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:812: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:817: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+ ac_cv_prog_gcc=yes
+else
+ ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+
+ac_test_CFLAGS="${CFLAGS+set}"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS=
+echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:845: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ ac_cv_prog_cc_g=yes
+else
+ ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:877: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 892 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 909 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:915: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 926 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:932: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+echo $ac_n "checking for AIX""... $ac_c" 1>&6
+echo "configure:957: checking for AIX" >&5
+cat > conftest.$ac_ext <<EOF
+#line 959 "configure"
+#include "confdefs.h"
+#ifdef _AIX
+ yes
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "yes" >/dev/null 2>&1; then
+ rm -rf conftest*
+ echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
+#define _ALL_SOURCE 1
+EOF
+
+else
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+
+ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
+echo "configure:982: checking for minix/config.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 987 "configure"
+#include "confdefs.h"
+#include <minix/config.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ MINIX=yes
+else
+ echo "$ac_t""no" 1>&6
+MINIX=
+fi
+
+if test "$MINIX" = yes; then
+ cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define _POSIX_1_SOURCE 2
+EOF
+
+ cat >> confdefs.h <<\EOF
+#define _MINIX 1
+EOF
+
+fi
+
+echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
+echo "configure:1030: checking for POSIXized ISC" >&5
+if test -d /etc/conf/kconfig.d &&
+ grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
+then
+ echo "$ac_t""yes" 1>&6
+ ISC=yes # If later tests want to check for ISC.
+ cat >> confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+ if test "$GCC" = yes; then
+ CC="$CC -posix"
+ else
+ CC="$CC -Xp"
+ fi
+else
+ echo "$ac_t""no" 1>&6
+ ISC=
+fi
+
+
+
+
+echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
+echo "configure:1054: checking for ${CC-cc} option to accept ANSI C" >&5
+if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ am_cv_prog_cc_stdc=no
+ac_save_CC="$CC"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1
+# HP-UX -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__
+"
+do
+ CC="$ac_save_CC $ac_arg"
+ cat > conftest.$ac_ext <<EOF
+#line 1070 "configure"
+#include "confdefs.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+} int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, i
+nt);
+int argc;
+char **argv;
+
+int main() {
+
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+
+; return 0; }
+EOF
+if { (eval echo configure:1107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ am_cv_prog_cc_stdc="$ac_arg"; break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+CC="$ac_save_CC"
+
+fi
+
+if test -z "$am_cv_prog_cc_stdc"; then
+ echo "$ac_t""none needed" 1>&6
+else
+ echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
+fi
+case "x$am_cv_prog_cc_stdc" in
+ x|xno) ;;
+ *) CC="$CC $am_cv_prog_cc_stdc" ;;
+esac
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:1161: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
+ for ac_dir in $PATH; do
+ # Account for people who put trailing slashes in PATH elements.
+ case "$ac_dir/" in
+ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if test -f $ac_dir/$ac_prog; then
+ if test $ac_prog = install &&
+ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+ IFS="$ac_save_IFS"
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL="$ac_cv_path_install"
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL="$ac_install_sh"
+ fi
+fi
+echo "$ac_t""$INSTALL" 1>&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:1214: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1241: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 1256 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1262: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 1273 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -nologo -E"
+ cat > conftest.$ac_ext <<EOF
+#line 1290 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+if test $ac_cv_prog_gcc = yes; then
+ echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
+echo "configure:1322: checking whether ${CC-cc} needs -traditional" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat > conftest.$ac_ext <<EOF
+#line 1328 "configure"
+#include "confdefs.h"
+#include <sgtty.h>
+Autoconf TIOCGETP
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "$ac_pattern" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_prog_gcc_traditional=yes
+else
+ rm -rf conftest*
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat > conftest.$ac_ext <<EOF
+#line 1346 "configure"
+#include "confdefs.h"
+#include <termio.h>
+Autoconf TCGETA
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "$ac_pattern" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+
+INCLUDES="${INCLUDES} -I/usr/local/include"
+CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
+if test "${ac_cv_prog_gcc}" = "yes"; then
+ CFLAGS="${CFLAGS} -Wall"
+fi
+
+echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
+echo "configure:1375: checking for ANSI C header files" >&5
+if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1380 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ ac_cv_header_stdc=yes
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1405 "configure"
+#include "confdefs.h"
+#include <string.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+cat > conftest.$ac_ext <<EOF
+#line 1423 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ rm -rf conftest*
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+if test "$cross_compiling" = yes; then
+ :
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1444 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+if { (eval echo configure:1455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_header_stdc=no
+fi
+rm -fr conftest*
+fi
+
+fi
+fi
+
+echo "$ac_t""$ac_cv_header_stdc" 1>&6
+if test $ac_cv_header_stdc = yes; then
+ cat >> confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+for ac_hdr in fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \
+ sys/time.h sys/scanio.h sys/socket.h sys/io.h asm/io.h gscdds.h sys/hw.h \
+ bsd/dev/scsireg.h io/cam/cam.h camlib.h sys/types.h zlib.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1484: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1489 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking for working const""... $ac_c" 1>&6
+echo "configure:1522: checking for working const" >&5
+if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1527 "configure"
+#include "confdefs.h"
+
+int main() {
+
+/* Ultrix mips cc rejects this. */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *ccp;
+char **p;
+/* NEC SVR4.0.2 mips cc rejects this. */
+struct point {int x, y;};
+static struct point const zero = {0,0};
+/* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in an arm
+ of an if-expression whose if-part is not a constant expression */
+const char *g = "string";
+ccp = &g + (g ? g-g : 0);
+/* HPUX 7.0 cc rejects these. */
+++ccp;
+p = (char**) ccp;
+ccp = (char const *const *) p;
+{ /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+}
+{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+}
+{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+}
+{ /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+}
+{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+}
+
+; return 0; }
+EOF
+if { (eval echo configure:1576: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_const=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_c_const=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_c_const" 1>&6
+if test $ac_cv_c_const = no; then
+ cat >> confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+echo $ac_n "checking for inline""... $ac_c" 1>&6
+echo "configure:1597: checking for inline" >&5
+if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat > conftest.$ac_ext <<EOF
+#line 1604 "configure"
+#include "confdefs.h"
+
+int main() {
+} $ac_kw foo() {
+; return 0; }
+EOF
+if { (eval echo configure:1611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+
+fi
+
+echo "$ac_t""$ac_cv_c_inline" 1>&6
+case "$ac_cv_c_inline" in
+ inline | yes) ;;
+ no) cat >> confdefs.h <<\EOF
+#define inline
+EOF
+ ;;
+ *) cat >> confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
+echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
+echo "configure:1637: checking return type of signal handlers" >&5
+if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1642 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int main() {
+int i;
+; return 0; }
+EOF
+if { (eval echo configure:1659: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_type_signal=void
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_type_signal=int
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_type_signal" 1>&6
+cat >> confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
+
+
+echo $ac_n "checking for size_t""... $ac_c" 1>&6
+echo "configure:1678: checking for size_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1683 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_size_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_size_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_size_t" 1>&6
+if test $ac_cv_type_size_t = no; then
+ cat >> confdefs.h <<\EOF
+#define size_t unsigned
+EOF
+
+fi
+
+echo $ac_n "checking for pid_t""... $ac_c" 1>&6
+echo "configure:1711: checking for pid_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1716 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_pid_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_pid_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_pid_t" 1>&6
+if test $ac_cv_type_pid_t = no; then
+ cat >> confdefs.h <<\EOF
+#define pid_t int
+EOF
+
+fi
+
+echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
+echo "configure:1744: checking for ssize_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1749 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_ssize_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_ssize_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
+if test $ac_cv_type_ssize_t = no; then
+ cat >> confdefs.h <<\EOF
+#define ssize_t long
+EOF
+
+fi
+
+echo $ac_n "checking for u_char""... $ac_c" 1>&6
+echo "configure:1777: checking for u_char" >&5
+if eval "test \"`echo '$''{'ac_cv_type_u_char'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1782 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])u_char[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_u_char=yes
+else
+ rm -rf conftest*
+ ac_cv_type_u_char=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_u_char" 1>&6
+if test $ac_cv_type_u_char = no; then
+ cat >> confdefs.h <<\EOF
+#define u_char unsigned char
+EOF
+
+fi
+
+echo $ac_n "checking for u_int""... $ac_c" 1>&6
+echo "configure:1810: checking for u_int" >&5
+if eval "test \"`echo '$''{'ac_cv_type_u_int'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1815 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])u_int[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_u_int=yes
+else
+ rm -rf conftest*
+ ac_cv_type_u_int=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_u_int" 1>&6
+if test $ac_cv_type_u_int = no; then
+ cat >> confdefs.h <<\EOF
+#define u_int unsigned int
+EOF
+
+fi
+
+echo $ac_n "checking for u_long""... $ac_c" 1>&6
+echo "configure:1843: checking for u_long" >&5
+if eval "test \"`echo '$''{'ac_cv_type_u_long'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1848 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])u_long[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_u_long=yes
+else
+ rm -rf conftest*
+ ac_cv_type_u_long=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_u_long" 1>&6
+if test $ac_cv_type_u_long = no; then
+ cat >> confdefs.h <<\EOF
+#define u_long unsigned long
+EOF
+
+fi
+
+
+echo $ac_n "checking for scsireq_enter in -lscsi""... $ac_c" 1>&6
+echo "configure:1877: checking for scsireq_enter in -lscsi" >&5
+ac_lib_var=`echo scsi'_'scsireq_enter | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lscsi $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1885 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char scsireq_enter();
+
+int main() {
+scsireq_enter()
+; return 0; }
+EOF
+if { (eval echo configure:1896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo scsi | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lscsi $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+ # FreeBSD needs this
+echo $ac_n "checking for cam_open_device in -lcam""... $ac_c" 1>&6
+echo "configure:1924: checking for cam_open_device in -lcam" >&5
+ac_lib_var=`echo cam'_'cam_open_device | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lcam $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1932 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char cam_open_device();
+
+int main() {
+cam_open_device()
+; return 0; }
+EOF
+if { (eval echo configure:1943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo cam | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lcam $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+ # FreeBSD 3+ needs this
+
+echo $ac_n "checking for sqrt in -lm""... $ac_c" 1>&6
+echo "configure:1972: checking for sqrt in -lm" >&5
+ac_lib_var=`echo m'_'sqrt | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1980 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sqrt();
+
+int main() {
+sqrt()
+; return 0; }
+EOF
+if { (eval echo configure:1991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lm $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for deflateInit_ in -lz""... $ac_c" 1>&6
+echo "configure:2019: checking for deflateInit_ in -lz" >&5
+ac_lib_var=`echo z'_'deflateInit_ | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lz $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2027 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char deflateInit_();
+
+int main() {
+deflateInit_()
+; return 0; }
+EOF
+if { (eval echo configure:2038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lz $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+if test "${USE_JPEG}" = "yes"; then
+ echo $ac_n "checking for jpeg_start_decompress in -ljpeg""... $ac_c" 1>&6
+echo "configure:2068: checking for jpeg_start_decompress in -ljpeg" >&5
+ac_lib_var=`echo jpeg'_'jpeg_start_decompress | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ljpeg $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2076 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char jpeg_start_decompress();
+
+int main() {
+jpeg_start_decompress()
+; return 0; }
+EOF
+if { (eval echo configure:2087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo jpeg | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-ljpeg $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+# tiff test must stand after test for zlib
+if test "${USE_TIFF}" = "yes"; then
+ echo $ac_n "checking for TIFFOpen in -ltiff""... $ac_c" 1>&6
+echo "configure:2119: checking for TIFFOpen in -ltiff" >&5
+ac_lib_var=`echo tiff'_'TIFFOpen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ltiff $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2127 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char TIFFOpen();
+
+int main() {
+TIFFOpen()
+; return 0; }
+EOF
+if { (eval echo configure:2138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo tiff | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-ltiff $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
+echo "configure:2170: checking for working alloca.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2175 "configure"
+#include "confdefs.h"
+#include <alloca.h>
+int main() {
+char *p = alloca(2 * sizeof(int));
+; return 0; }
+EOF
+if { (eval echo configure:2182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_header_alloca_h=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_header_alloca_h=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
+if test $ac_cv_header_alloca_h = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ALLOCA_H 1
+EOF
+
+fi
+
+echo $ac_n "checking for alloca""... $ac_c" 1>&6
+echo "configure:2203: checking for alloca" >&5
+if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2208 "configure"
+#include "confdefs.h"
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+int main() {
+char *p = (char *) alloca(1);
+; return 0; }
+EOF
+if { (eval echo configure:2236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_func_alloca_works=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_func_alloca_works=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
+if test $ac_cv_func_alloca_works = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_ALLOCA 1
+EOF
+
+fi
+
+if test $ac_cv_func_alloca_works = no; then
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+ # that cause trouble. Some versions do not even contain alloca or
+ # contain a buggy version. If you still want to use their alloca,
+ # use ar to extract alloca.o from them instead of compiling alloca.c.
+ ALLOCA=alloca.${ac_objext}
+ cat >> confdefs.h <<\EOF
+#define C_ALLOCA 1
+EOF
+
+
+echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
+echo "configure:2268: checking whether alloca needs Cray hooks" >&5
+if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2273 "configure"
+#include "confdefs.h"
+#if defined(CRAY) && ! defined(CRAY2)
+webecray
+#else
+wenotbecray
+#endif
+
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "webecray" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_os_cray=yes
+else
+ rm -rf conftest*
+ ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_os_cray" 1>&6
+if test $ac_cv_os_cray = yes; then
+for ac_func in _getb67 GETB67 getb67; do
+ echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2298: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2303 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<EOF
+#define CRAY_STACKSEG_END $ac_func
+EOF
+
+ break
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+done
+fi
+
+echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
+echo "configure:2353: checking stack direction for C alloca" >&5
+if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_c_stack_direction=0
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2361 "configure"
+#include "confdefs.h"
+find_stack_direction ()
+{
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+}
+main ()
+{
+ exit (find_stack_direction() < 0);
+}
+EOF
+if { (eval echo configure:2380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_c_stack_direction=1
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_c_stack_direction=-1
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
+cat >> confdefs.h <<EOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+EOF
+
+fi
+
+test $ac_cv_func_alloca_works = no && LTALLOCA=alloca.lo
+
+for ac_hdr in unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2407: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2412 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in getpagesize
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2446: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2451 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+echo $ac_n "checking for working mmap""... $ac_c" 1>&6
+echo "configure:2499: checking for working mmap" >&5
+if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_mmap_fixed_mapped=no
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2507 "configure"
+#include "confdefs.h"
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+ Here is a matrix of mmap possibilities:
+ mmap private not fixed
+ mmap private fixed at somewhere currently unmapped
+ mmap private fixed at somewhere already mapped
+ mmap shared not fixed
+ mmap shared fixed at somewhere currently unmapped
+ mmap shared fixed at somewhere already mapped
+ For private mappings, we should verify that changes cannot be read()
+ back from the file, nor mmap's back from the file at a different
+ address. (There have been systems where private was not correctly
+ implemented like the infamous i386 svr4.0, and systems where the
+ VM page cache was not coherent with the filesystem buffer cache
+ like early versions of FreeBSD and possibly contemporary NetBSD.)
+ For shared mappings, we should conversely verify that changes get
+ propogated back to all the places they're supposed to be.
+
+ Grep wants private fixed already mapped.
+ The main things grep needs to know about mmap are:
+ * does it exist and is it safe to write into the mmap'd area
+ * how to use it (BSD variants) */
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+
+/* This mess was copied from the GNU getpagesize.h. */
+#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+
+/* Assume that all systems that can run configure have sys/param.h. */
+# ifndef HAVE_SYS_PARAM_H
+# define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+# define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+# ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+# define getpagesize() EXEC_PAGESIZE
+# else /* no EXEC_PAGESIZE */
+# ifdef NBPG
+# define getpagesize() NBPG * CLSIZE
+# ifndef CLSIZE
+# define CLSIZE 1
+# endif /* no CLSIZE */
+# else /* no NBPG */
+# ifdef NBPC
+# define getpagesize() NBPC
+# else /* no NBPC */
+# ifdef PAGESIZE
+# define getpagesize() PAGESIZE
+# endif /* PAGESIZE */
+# endif /* no NBPC */
+# endif /* no NBPG */
+# endif /* no EXEC_PAGESIZE */
+# else /* no HAVE_SYS_PARAM_H */
+# define getpagesize() 8192 /* punt totally */
+# endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+#ifdef __cplusplus
+extern "C" { void *malloc(unsigned); }
+#else
+char *malloc();
+#endif
+
+int
+main()
+{
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
+
+ pagesize = getpagesize();
+
+ /*
+ * First, make a file with some known garbage in it.
+ */
+ data = malloc(pagesize);
+ if (!data)
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ *(data + i) = rand();
+ umask(0);
+ fd = creat("conftestmmap", 0600);
+ if (fd < 0)
+ exit(1);
+ if (write(fd, data, pagesize) != pagesize)
+ exit(1);
+ close(fd);
+
+ /*
+ * Next, try to mmap the file at a fixed address which
+ * already has something else allocated at it. If we can,
+ * also make sure that we see the same garbage.
+ */
+ fd = open("conftestmmap", O_RDWR);
+ if (fd < 0)
+ exit(1);
+ data2 = malloc(2 * pagesize);
+ if (!data2)
+ exit(1);
+ data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+ if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data2 + i))
+ exit(1);
+
+ /*
+ * Finally, make sure that changes to the mapped area
+ * do not percolate back to the file as seen by read().
+ * (This is a bug on some variants of i386 svr4.0.)
+ */
+ for (i = 0; i < pagesize; ++i)
+ *(data2 + i) = *(data2 + i) + 1;
+ data3 = malloc(pagesize);
+ if (!data3)
+ exit(1);
+ if (read(fd, data3, pagesize) != pagesize)
+ exit(1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data3 + i))
+ exit(1);
+ close(fd);
+ unlink("conftestmmap");
+ exit(0);
+}
+
+EOF
+if { (eval echo configure:2647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ ac_cv_func_mmap_fixed_mapped=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -fr conftest*
+fi
+
+fi
+
+echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_MMAP 1
+EOF
+
+fi
+
+for ac_func in atexit mkdir sigprocmask strdup strndup strftime strstr strsep strtod snprintf usleep strcasecmp strncasecmp
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2672: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2677 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+for ac_hdr in dlfcn.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2729: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2734 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "configure:2760: checking for dlopen in -ldl" >&5
+ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2768 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen();
+
+int main() {
+dlopen()
+; return 0; }
+EOF
+if { (eval echo configure:2779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-ldl $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+ for ac_func in dlopen
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2808: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2813 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ enable_dynamic=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+for ac_hdr in dl.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2870: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2875 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
+echo "configure:2901: checking for shl_load in -ldld" >&5
+ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-ldld $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 2909 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load();
+
+int main() {
+shl_load()
+; return 0; }
+EOF
+if { (eval echo configure:2920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo dld | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-ldld $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+ for ac_func in shl_load
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:2949: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2954 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+ enable_dynamic=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+# Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3010: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_RANLIB="ranlib"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+ echo "$ac_t""$RANLIB" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking for off_t""... $ac_c" 1>&6
+echo "configure:3038: checking for off_t" >&5
+if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3043 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
+ rm -rf conftest*
+ ac_cv_type_off_t=yes
+else
+ rm -rf conftest*
+ ac_cv_type_off_t=no
+fi
+rm -f conftest*
+
+fi
+echo "$ac_t""$ac_cv_type_off_t" 1>&6
+if test $ac_cv_type_off_t = no; then
+ cat >> confdefs.h <<\EOF
+#define off_t long
+EOF
+
+fi
+
+
+ for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
+unistd.h values.h sys/param.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:3076: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3081 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3116: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3121 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+ if test "${ac_cv_func_stpcpy+set}" != "set"; then
+ for ac_func in stpcpy
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3173: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3178 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ fi
+ if test "${ac_cv_func_stpcpy}" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_STPCPY 1
+EOF
+
+ fi
+
+ if test $ac_cv_header_locale_h = yes; then
+ echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
+echo "configure:3235: checking for LC_MESSAGES" >&5
+if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3240 "configure"
+#include "confdefs.h"
+#include <locale.h>
+int main() {
+return LC_MESSAGES
+; return 0; }
+EOF
+if { (eval echo configure:3247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ am_cv_val_LC_MESSAGES=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ am_cv_val_LC_MESSAGES=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_LC_MESSAGES 1
+EOF
+
+ fi
+ fi
+ echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
+echo "configure:3268: checking whether NLS is requested" >&5
+ # Check whether --enable-nls or --disable-nls was given.
+if test "${enable_nls+set}" = set; then
+ enableval="$enable_nls"
+ USE_NLS=$enableval
+else
+ USE_NLS=yes
+fi
+
+ echo "$ac_t""$USE_NLS" 1>&6
+
+
+ USE_INCLUDED_LIBINTL=no
+
+ if test "$USE_NLS" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define ENABLE_NLS 1
+EOF
+
+ echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
+echo "configure:3288: checking whether included gettext is requested" >&5
+ # Check whether --with-included-gettext or --without-included-gettext was given.
+if test "${with_included_gettext+set}" = set; then
+ withval="$with_included_gettext"
+ nls_cv_force_use_gnu_gettext=$withval
+else
+ nls_cv_force_use_gnu_gettext=no
+fi
+
+ echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+ CATOBJEXT=NONE
+
+ ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
+echo "configure:3307: checking for libintl.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3312 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
+echo "configure:3334: checking for gettext in libc" >&5
+if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3339 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+int main() {
+return (int) gettext ("")
+; return 0; }
+EOF
+if { (eval echo configure:3346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ gt_cv_func_gettext_libc=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gt_cv_func_gettext_libc=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
+
+ if test "$gt_cv_func_gettext_libc" != "yes"; then
+ echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
+echo "configure:3362: checking for bindtextdomain in -lintl" >&5
+ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lintl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3370 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char bindtextdomain();
+
+int main() {
+bindtextdomain()
+; return 0; }
+EOF
+if { (eval echo configure:3381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
+echo "configure:3397: checking for gettext in libintl" >&5
+if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3402 "configure"
+#include "confdefs.h"
+
+int main() {
+return (int) gettext ("")
+; return 0; }
+EOF
+if { (eval echo configure:3409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ gt_cv_func_gettext_libintl=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ gt_cv_func_gettext_libintl=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+
+ if test "$gt_cv_func_gettext_libc" = "yes" \
+ || test "$gt_cv_func_gettext_libintl" = "yes"; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_GETTEXT 1
+EOF
+
+ # Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3437: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$MSGFMT" in
+ /*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test -n "$MSGFMT"; then
+ echo "$ac_t""$MSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ if test "$MSGFMT" != "no"; then
+ for ac_func in dcgettext
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3471: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3476 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3526: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$GMSGFMT" in
+ /*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT="$ac_cv_path_GMSGFMT"
+if test -n "$GMSGFMT"; then
+ echo "$ac_t""$GMSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ # Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3562: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$XGETTEXT" in
+ /*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test -n "$XGETTEXT"; then
+ echo "$ac_t""$XGETTEXT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ cat > conftest.$ac_ext <<EOF
+#line 3594 "configure"
+#include "confdefs.h"
+
+int main() {
+extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr
+; return 0; }
+EOF
+if { (eval echo configure:3602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ CATOBJEXT=.gmo
+ DATADIRNAME=share
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CATOBJEXT=.mo
+ DATADIRNAME=lib
+fi
+rm -f conftest*
+ INSTOBJEXT=.mo
+ fi
+ fi
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ if test "$CATOBJEXT" = "NONE"; then
+ echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
+echo "configure:3625: checking whether catgets can be used" >&5
+ # Check whether --with-catgets or --without-catgets was given.
+if test "${with_catgets+set}" = set; then
+ withval="$with_catgets"
+ nls_cv_use_catgets=$withval
+else
+ nls_cv_use_catgets=no
+fi
+
+ echo "$ac_t""$nls_cv_use_catgets" 1>&6
+
+ if test "$nls_cv_use_catgets" = "yes"; then
+ echo $ac_n "checking for main in -li""... $ac_c" 1>&6
+echo "configure:3638: checking for main in -li" >&5
+ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-li $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3646 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:3653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo i | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-li $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ echo $ac_n "checking for catgets""... $ac_c" 1>&6
+echo "configure:3681: checking for catgets" >&5
+if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3686 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char catgets(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char catgets();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_catgets) || defined (__stub___catgets)
+choke me
+#else
+catgets();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_catgets=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_catgets=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ cat >> confdefs.h <<\EOF
+#define HAVE_CATGETS 1
+EOF
+
+ INTLOBJS="\$(CATOBJS)"
+ # Extract the first word of "gencat", so it can be a program name with args.
+set dummy gencat; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3731: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$GENCAT" in
+ /*)
+ ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GENCAT="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GENCAT" && ac_cv_path_GENCAT="no"
+ ;;
+esac
+fi
+GENCAT="$ac_cv_path_GENCAT"
+if test -n "$GENCAT"; then
+ echo "$ac_t""$GENCAT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+ if test "$GENCAT" != "no"; then
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3767: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$GMSGFMT" in
+ /*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no"
+ ;;
+esac
+fi
+GMSGFMT="$ac_cv_path_GMSGFMT"
+if test -n "$GMSGFMT"; then
+ echo "$ac_t""$GMSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "$GMSGFMT" = "no"; then
+ # Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3804: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$GMSGFMT" in
+ /*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
+ ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no"
+ ;;
+esac
+fi
+GMSGFMT="$ac_cv_path_GMSGFMT"
+if test -n "$GMSGFMT"; then
+ echo "$ac_t""$GMSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+ # Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3839: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$XGETTEXT" in
+ /*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test -n "$XGETTEXT"; then
+ echo "$ac_t""$XGETTEXT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ USE_INCLUDED_LIBINTL=yes
+ CATOBJEXT=.cat
+ INSTOBJEXT=.cat
+ DATADIRNAME=lib
+ INTLDEPS='$(top_builddir)/intl/libintl.a'
+ INTLLIBS=$INTLDEPS
+ LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+ nls_cv_header_intl=intl/libintl.h
+ nls_cv_header_libgt=intl/libgettext.h
+ fi
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ fi
+ fi
+
+ if test "$CATOBJEXT" = "NONE"; then
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ INTLOBJS="\$(GETTOBJS)"
+ # Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3897: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$MSGFMT" in
+ /*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test -n "$MSGFMT"; then
+ echo "$ac_t""$MSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3931: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$GMSGFMT" in
+ /*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT="$ac_cv_path_GMSGFMT"
+if test -n "$GMSGFMT"; then
+ echo "$ac_t""$GMSGFMT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ # Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3967: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$XGETTEXT" in
+ /*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test -n "$XGETTEXT"; then
+ echo "$ac_t""$XGETTEXT" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+ USE_INCLUDED_LIBINTL=yes
+ CATOBJEXT=.gmo
+ INSTOBJEXT=.mo
+ DATADIRNAME=share
+ INTLDEPS='$(top_builddir)/intl/libintl.a'
+ INTLLIBS=$INTLDEPS
+ LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+ nls_cv_header_intl=intl/libintl.h
+ nls_cv_header_libgt=intl/libgettext.h
+ fi
+
+ if test "$XGETTEXT" != ":"; then
+ if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ : ;
+ else
+ echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
+ XGETTEXT=":"
+ fi
+ fi
+
+ # We need to process the po/ directory.
+ POSUB=po
+ else
+ DATADIRNAME=share
+ nls_cv_header_intl=intl/libintl.h
+ nls_cv_header_libgt=intl/libgettext.h
+ fi
+
+ # If this is used in GNU gettext we have to set USE_NLS to `yes'
+ # because some of the sources are only built for this goal.
+ if test "$PACKAGE" = gettext; then
+ USE_NLS=yes
+ USE_INCLUDED_LIBINTL=yes
+ fi
+
+ for lang in $ALL_LINGUAS; do
+ GMOFILES="$GMOFILES $lang.gmo"
+ POFILES="$POFILES $lang.po"
+ done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ if test "x$CATOBJEXT" != "x"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
+echo "configure:4057: checking for catalogs to be installed" >&5
+ NEW_LINGUAS=
+ for lang in ${LINGUAS=$ALL_LINGUAS}; do
+ case "$ALL_LINGUAS" in
+ *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+ esac
+ done
+ LINGUAS=$NEW_LINGUAS
+ echo "$ac_t""$LINGUAS" 1>&6
+ fi
+
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ if test $ac_cv_header_locale_h = yes; then
+ INCLUDE_LOCALE_H="#include <locale.h>"
+ else
+ INCLUDE_LOCALE_H="\
+/* The system does not provide the header <locale.h>. Take care yourself. */"
+ fi
+
+
+ test -d intl || mkdir intl
+ if test "$CATOBJEXT" = ".cat"; then
+ ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
+echo "configure:4085: checking for linux/version.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4090 "configure"
+#include "confdefs.h"
+#include <linux/version.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ msgformat=linux
+else
+ echo "$ac_t""no" 1>&6
+msgformat=xopen
+fi
+
+
+ sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
+ fi
+ sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+ $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
+
+ if test "$PACKAGE" = "gettext"; then
+ GT_NO="#NO#"
+ GT_YES=
+ else
+ GT_NO=
+ GT_YES="#YES#"
+ fi
+
+
+
+ MKINSTALLDIRS=
+ if test -z "$MKINSTALLDIRS"; then
+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+ fi
+
+
+ l=
+
+
+
+
+if test "$USE_NLS" = yes; then
+ if test "$USE_INCLUDED_LIBINTL" = yes; then
+ CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl"
+ INTLSUB=intl
+ fi
+fi
+
+
+
+#### Choose a window system.
+
+# If we find X, set shell vars x_includes and x_libraries to the
+# paths, otherwise set no_x=yes.
+# Uses ac_ vars as temps to allow command line to override cache and checks.
+# --without-x overrides everything else, but does not touch the cache.
+echo $ac_n "checking for X""... $ac_c" 1>&6
+echo "configure:4160: checking for X" >&5
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+ withval="$with_x"
+ :
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+ # The user explicitly disabled X.
+ have_x=disabled
+else
+ if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+ # Both variables are already set.
+ have_x=yes
+ else
+if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=NO ac_x_libraries=NO
+rm -fr conftestdir
+if mkdir conftestdir; then
+ cd conftestdir
+ # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+ cat > Imakefile <<'EOF'
+acfindx:
+ @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+EOF
+ if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+ # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+ eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+ for ac_extension in a so sl; do
+ if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+ test -f $ac_im_libdir/libX11.$ac_extension; then
+ ac_im_usrlibdir=$ac_im_libdir; break
+ fi
+ done
+ # Screen out bogus values from the imake configuration. They are
+ # bogus both because they are the default anyway, and because
+ # using them would break gcc on systems where it needs fixed includes.
+ case "$ac_im_incroot" in
+ /usr/include) ;;
+ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
+ esac
+ case "$ac_im_usrlibdir" in
+ /usr/lib | /lib) ;;
+ *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
+ esac
+ fi
+ cd ..
+ rm -fr conftestdir
+fi
+
+if test "$ac_x_includes" = NO; then
+ # Guess where to find include files, by looking for this one X11 .h file.
+ test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+ # First, try using that file with no special directory specified.
+cat > conftest.$ac_ext <<EOF
+#line 4222 "configure"
+#include "confdefs.h"
+#include <$x_direct_test_include>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4227: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ # Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ for ac_dir in \
+ /usr/X11/include \
+ /usr/X11R6/include \
+ /usr/X11R5/include \
+ /usr/X11R4/include \
+ \
+ /usr/include/X11 \
+ /usr/include/X11R6 \
+ /usr/include/X11R5 \
+ /usr/include/X11R4 \
+ \
+ /usr/local/X11/include \
+ /usr/local/X11R6/include \
+ /usr/local/X11R5/include \
+ /usr/local/X11R4/include \
+ \
+ /usr/local/include/X11 \
+ /usr/local/include/X11R6 \
+ /usr/local/include/X11R5 \
+ /usr/local/include/X11R4 \
+ \
+ /usr/X386/include \
+ /usr/x386/include \
+ /usr/XFree86/include/X11 \
+ \
+ /usr/include \
+ /usr/local/include \
+ /usr/unsupported/include \
+ /usr/athena/include \
+ /usr/local/x11r5/include \
+ /usr/lpp/Xamples/include \
+ \
+ /usr/openwin/include \
+ /usr/openwin/share/include \
+ ; \
+ do
+ if test -r "$ac_dir/$x_direct_test_include"; then
+ ac_x_includes=$ac_dir
+ break
+ fi
+ done
+fi
+rm -f conftest*
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+ # Check for the libraries.
+
+ test -z "$x_direct_test_library" && x_direct_test_library=Xt
+ test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ ac_save_LIBS="$LIBS"
+ LIBS="-l$x_direct_test_library $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4296 "configure"
+#include "confdefs.h"
+
+int main() {
+${x_direct_test_function}()
+; return 0; }
+EOF
+if { (eval echo configure:4303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
+ /usr/X11/lib \
+ /usr/X11R6/lib \
+ /usr/X11R5/lib \
+ /usr/X11R4/lib \
+ \
+ /usr/lib/X11 \
+ /usr/lib/X11R6 \
+ /usr/lib/X11R5 \
+ /usr/lib/X11R4 \
+ \
+ /usr/local/X11/lib \
+ /usr/local/X11R6/lib \
+ /usr/local/X11R5/lib \
+ /usr/local/X11R4/lib \
+ \
+ /usr/local/lib/X11 \
+ /usr/local/lib/X11R6 \
+ /usr/local/lib/X11R5 \
+ /usr/local/lib/X11R4 \
+ \
+ /usr/X386/lib \
+ /usr/x386/lib \
+ /usr/XFree86/lib/X11 \
+ \
+ /usr/lib \
+ /usr/local/lib \
+ /usr/unsupported/lib \
+ /usr/athena/lib \
+ /usr/local/x11r5/lib \
+ /usr/lpp/Xamples/lib \
+ /lib/usr/lib/X11 \
+ \
+ /usr/openwin/lib \
+ /usr/openwin/share/lib \
+ ; \
+do
+ for ac_extension in a so sl; do
+ if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+ ac_x_libraries=$ac_dir
+ break 2
+ fi
+ done
+done
+fi
+rm -f conftest*
+fi # $ac_x_libraries = NO
+
+if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then
+ # Didn't find X anywhere. Cache the known absence of X.
+ ac_cv_have_x="have_x=no"
+else
+ # Record where we found X for the cache.
+ ac_cv_have_x="have_x=yes \
+ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+ fi
+ eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+ echo "$ac_t""$have_x" 1>&6
+ no_x=yes
+else
+ # If each of the values was on the command line, it overrides each guess.
+ test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+ # Update the cache value to reflect the command line values.
+ ac_cv_have_x="have_x=yes \
+ ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+ echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6
+fi
+
+if test "$no_x" = yes; then
+ window_system=none
+else
+ window_system=x11
+fi
+
+# Check whether --with-gtk-prefix or --without-gtk-prefix was given.
+if test "${with_gtk_prefix+set}" = set; then
+ withval="$with_gtk_prefix"
+ gtk_config_prefix="$withval"
+else
+ gtk_config_prefix=""
+fi
+
+# Check whether --with-gtk-exec-prefix or --without-gtk-exec-prefix was given.
+if test "${with_gtk_exec_prefix+set}" = set; then
+ withval="$with_gtk_exec_prefix"
+ gtk_config_exec_prefix="$withval"
+else
+ gtk_config_exec_prefix=""
+fi
+
+# Check whether --enable-gtktest or --disable-gtktest was given.
+if test "${enable_gtktest+set}" = set; then
+ enableval="$enable_gtktest"
+ :
+else
+ enable_gtktest=yes
+fi
+
+
+ if test x$gtk_config_exec_prefix != x ; then
+ gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
+ if test x${GTK_CONFIG+set} != xset ; then
+ GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
+ fi
+ fi
+ if test x$gtk_config_prefix != x ; then
+ gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
+ if test x${GTK_CONFIG+set} != xset ; then
+ GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
+ fi
+ fi
+
+ # Extract the first word of "gtk-config", so it can be a program name with args.
+set dummy gtk-config; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:4436: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ case "$GTK_CONFIG" in
+ /*)
+ ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path.
+ ;;
+ ?:/*)
+ ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a dos path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_path_GTK_CONFIG="$ac_dir/$ac_word"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no"
+ ;;
+esac
+fi
+GTK_CONFIG="$ac_cv_path_GTK_CONFIG"
+if test -n "$GTK_CONFIG"; then
+ echo "$ac_t""$GTK_CONFIG" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ min_gtk_version=1.2.0
+ echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6
+echo "configure:4471: checking for GTK - version >= $min_gtk_version" >&5
+ no_gtk=""
+ if test "$GTK_CONFIG" = "no" ; then
+ no_gtk=yes
+ else
+ GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
+ GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
+ gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
+ gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
+ gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
+ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
+ if test "x$enable_gtktest" = "xyes" ; then
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $GTK_CFLAGS"
+ LIBS="$LIBS $GTK_LIBS"
+ rm -f conf.gtktest
+ if test "$cross_compiling" = yes; then
+ echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4494 "configure"
+#include "confdefs.h"
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+
+int
+main ()
+{
+ int major, minor, micro;
+
+ system ("touch conf.gtktest");
+
+ if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_gtk_version");
+ exit(1);
+ }
+
+ if ((gtk_major_version != $gtk_config_major_version) ||
+ (gtk_minor_version != $gtk_config_minor_version) ||
+ (gtk_micro_version != $gtk_config_micro_version))
+ {
+ printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
+ $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
+ gtk_major_version, gtk_minor_version, gtk_micro_version);
+ printf ("*** was found! If gtk-config was correct, then it is best\n");
+ printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
+ printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+ printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+ printf("*** required on your system.\n");
+ printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
+ printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
+ printf("*** before re-running configure\n");
+ }
+ else
+ {
+ if ((gtk_major_version > major) ||
+ ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+ ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
+ gtk_major_version, gtk_minor_version, gtk_micro_version);
+ printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
+ major, minor, micro);
+ printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
+ printf("***\n");
+ printf("*** If you have already installed a sufficiently new version, this error\n");
+ printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
+ printf("*** being found. The easiest way to fix this is to remove the old version\n");
+ printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
+ printf("*** correct copy of gtk-config. (In this case, you will have to\n");
+ printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+ printf("*** so that the correct libraries are found at run-time))\n");
+ }
+ }
+ return 1;
+}
+
+EOF
+if { (eval echo configure:4557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+ :
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -fr conftest*
+ no_gtk=yes
+fi
+rm -fr conftest*
+fi
+
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ if test "x$no_gtk" = x ; then
+ echo "$ac_t""yes" 1>&6
+ HAVE_GTK=yes
+ else
+ echo "$ac_t""no" 1>&6
+ if test "$GTK_CONFIG" = "no" ; then
+ echo "*** The gtk-config script installed by GTK could not be found"
+ echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the GTK_CONFIG environment variable to the"
+ echo "*** full path to gtk-config."
+ else
+ if test -f conf.gtktest ; then
+ :
+ else
+ echo "*** Could not run GTK test program, checking why..."
+ CFLAGS="$CFLAGS $GTK_CFLAGS"
+ LIBS="$LIBS $GTK_LIBS"
+ cat > conftest.$ac_ext <<EOF
+#line 4591 "configure"
+#include "confdefs.h"
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+
+int main() {
+ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version));
+; return 0; }
+EOF
+if { (eval echo configure:4601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding GTK or finding the wrong"
+ echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+ echo "***"
+ echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
+ echo "*** came with the system with the command"
+ echo "***"
+ echo "*** rpm --erase --nodeps gtk gtk-devel"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "*** The test program failed to compile or link. See the file config.log for the"
+ echo "*** exact error that occured. This usually means GTK was incorrectly installed"
+ echo "*** or that you have moved GTK since it was installed. In the latter case, you"
+ echo "*** may want to edit the gtk-config script: $GTK_CONFIG"
+fi
+rm -f conftest*
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+ fi
+ GTK_CFLAGS=""
+ GTK_LIBS=""
+ :
+ fi
+
+
+ rm -f conf.gtktest
+
+
+# Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
+# for the tests that follow. We set it back to REAL_CFLAGS later on.
+
+# According to Owen Taylor, GTK_CFLAGS is _guaranteed_ to contain
+# -D and -I flags only, i.e., it really is GTK_CPPFLAGS...
+saved_CPPFLAGS="${CPPFLAGS}"
+saved_LIBS="${LIBS}"
+CPPFLAGS="${CPPFLAGS} ${GTK_CFLAGS}"
+LIBS="${LIBS} ${GTK_LIBS}"
+
+if test "${USE_GIMP}" = "yes"; then
+ for ac_hdr in libgimp/gimp.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4655: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4660 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ GIMP_LIBS="-lgimp"
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ for ac_hdr in libgimp/gimpfeatures.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4695: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4700 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+fi
+
+LIBS="${saved_LIBS}"
+CPPFLAGS="${saved_CPPFLAGS}"
+
+
+# png test must stand after test for zlib
+# png test must stand behind X11-check because it is located in
+# the X11 directory on some systems
+# so we have to use x_includes and x_libraries to test for png
+# and all following checks (=sane)
+# saved_CPPFLAGS is still up to date
+CPPFLAGS="${CPPFLAGS} -I${x_includes}"
+if test "${USE_PNG}" = "yes"; then
+ for ac_hdr in png.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4749: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4754 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ echo $ac_n "checking for png_create_info_struct in -lpng""... $ac_c" 1>&6
+echo "configure:4780: checking for png_create_info_struct in -lpng" >&5
+ac_lib_var=`echo png'_'png_create_info_struct | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lpng -L${x_libraries} $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4788 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char png_create_info_struct();
+
+int main() {
+png_create_info_struct()
+; return 0; }
+EOF
+if { (eval echo configure:4799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo png | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lpng $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+ if test "${ac_cv_lib_png_png_create_info_struct}" = "yes"; then
+# remove libpng because if we do not remove it all following
+# checks could need x_libraries and x_includes
+ LIBS=`echo $LIBS | sed -e 's/-lpng//'`
+ PNG_LIB="-lpng"
+ fi
+fi
+CPPFLAGS="${saved_CPPFLAGS}"
+
+# check for sane must stand after check for dl
+# check must stand at end of list because of the missing libintl in libsane.so
+# check needs x_libraries and x_includes because they may be needed by png
+if test "${ADD_LIBINTL}" = "no"; then
+ for ac_hdr in sane/sane.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4848: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4853 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ echo $ac_n "checking for sane_init in -lsane""... $ac_c" 1>&6
+echo "configure:4879: checking for sane_init in -lsane" >&5
+ac_lib_var=`echo sane'_'sane_init | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsane $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4887 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sane_init();
+
+int main() {
+sane_init()
+; return 0; }
+EOF
+if { (eval echo configure:4898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo sane | sed -e 's/^a-zA-Z0-9_/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lsane $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+else
+ for ac_hdr in sane/sane.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4935: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4940 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+ echo $ac_n "checking for sane_init in -lsane""... $ac_c" 1>&6
+echo "configure:4966: checking for sane_init in -lsane" >&5
+ac_lib_var=`echo sane'_'sane_init | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsane -lintl $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4974 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sane_init();
+
+int main() {
+sane_init()
+; return 0; }
+EOF
+if { (eval echo configure:4985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo sane | sed -e 's/^a-zA-Z0-9_/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lsane $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+fi
+
+
+# this should be after all checks
+# add libpng again
+LIBS="${PNG_LIB} ${LIBS}"
+
+
+
+
+
+
+CPPFLAGS="${CPPFLAGS} \
+ -DPATH_SANE_DATA_DIR=\$(sanedatadir) \
+ -DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR} -DSANE_V_MAJOR=${SANE_V_MAJOR}"
+
+if test "${ac_cv_lib_sane_sane_init}" != "yes"; then
+ echo "****************************************************************"
+ echo "ERROR: SANE is needed for compiling xsane"
+ echo " - if you installed SANE as rpm make sure you also included"
+ echo " sane-devel"
+ echo " - if SANE is installed, try ./configure -enable-intl-patch"
+ echo "****************************************************************"
+ rm -f $cache_file
+ exit -1
+fi
+
+if test "${HAVE_GTK}" = "no"; then
+ echo "****************************************************************"
+ echo "ERROR: GTK-1.2.0 or newer is needed for compiling xsane"
+ echo " if you installed gtk as rpm make sure you also included"
+ echo " gtk-devel"
+ echo "****************************************************************"
+ rm -f $cache_file
+ exit -1
+fi
+
+
+
+
+
+
+# Check whether --enable-foo1 or --disable-foo1 was given.
+if test "${enable_foo1+set}" = set; then
+ enableval="$enable_foo1"
+ :
+fi
+
+
+# Check whether --enable-foo2 or --disable-foo2 was given.
+if test "${enable_foo2+set}" = set; then
+ enableval="$enable_foo2"
+ :
+fi
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "Makefile intl/Makefile po/Makefile lib/Makefile
+ frontend/Makefile include/Makefile doc/Makefile include/sane/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@PACKAGE_VERSION@%$PACKAGE_VERSION%g
+s%@SANE_MAJOR@%$SANE_MAJOR%g
+s%@CC@%$CC%g
+s%@CPP@%$CPP%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@ALLOCA@%$ALLOCA%g
+s%@LTALLOCA@%$LTALLOCA%g
+s%@RANLIB@%$RANLIB%g
+s%@USE_NLS@%$USE_NLS%g
+s%@MSGFMT@%$MSGFMT%g
+s%@GMSGFMT@%$GMSGFMT%g
+s%@XGETTEXT@%$XGETTEXT%g
+s%@GENCAT@%$GENCAT%g
+s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
+s%@CATALOGS@%$CATALOGS%g
+s%@CATOBJEXT@%$CATOBJEXT%g
+s%@DATADIRNAME@%$DATADIRNAME%g
+s%@GMOFILES@%$GMOFILES%g
+s%@INSTOBJEXT@%$INSTOBJEXT%g
+s%@INTLDEPS@%$INTLDEPS%g
+s%@INTLLIBS@%$INTLLIBS%g
+s%@INTLOBJS@%$INTLOBJS%g
+s%@POFILES@%$POFILES%g
+s%@POSUB@%$POSUB%g
+s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
+s%@GT_NO@%$GT_NO%g
+s%@GT_YES@%$GT_YES%g
+s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
+s%@l@%$l%g
+s%@INTLSUB@%$INTLSUB%g
+s%@GTK_CONFIG@%$GTK_CONFIG%g
+s%@GTK_CFLAGS@%$GTK_CFLAGS%g
+s%@GTK_LIBS@%$GTK_LIBS%g
+s%@INCLUDES@%$INCLUDES%g
+s%@BINPROGS@%$BINPROGS%g
+s%@GIMP_LIBS@%$GIMP_LIBS%g
+s%@V_MAJOR@%$V_MAJOR%g
+s%@V_MINOR@%$V_MINOR%g
+s%@DLL_PRELOAD@%$DLL_PRELOAD%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile intl/Makefile po/Makefile lib/Makefile
+ frontend/Makefile include/Makefile doc/Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+ case "$ac_given_INSTALL" in
+ [/$]*) INSTALL="$ac_given_INSTALL" ;;
+ *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+ esac
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="include/sane/config.h"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+ac_sources="$nls_cv_header_libgt"
+ac_dests="$nls_cv_header_intl"
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+srcdir=$ac_given_srcdir
+while test -n "$ac_sources"; do
+ set $ac_dests; ac_dest=$1; shift; ac_dests=$*
+ set $ac_sources; ac_source=$1; shift; ac_sources=$*
+
+ echo "linking $srcdir/$ac_source to $ac_dest"
+
+ if test ! -r $srcdir/$ac_source; then
+ { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
+ fi
+ rm -f $ac_dest
+
+ # Make relative symlinks.
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
+ # The dest file is in a subdirectory.
+ test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
+ ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dest_dir_suffix.
+ ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dest_dir_suffix= ac_dots=
+ fi
+
+ case "$srcdir" in
+ [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
+ *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
+ esac
+
+ # Make a symlink if possible; otherwise try a hard link.
+ if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
+ ln $srcdir/$ac_source $ac_dest; then :
+ else
+ { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
+ fi
+done
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+
+echo "****************************************************************"
+echo "* *"
+echo "* XSANE configure status: *"
+echo "* ----------------------- *"
+
+if test "${USE_NLS}" = "yes"; then
+ if test "$USE_INCLUDED_LIBINTL" = yes; then
+ echo "* - NLS activated (package internal) *"
+ else
+ echo "* - NLS activated (external) *"
+ fi
+else
+ echo "* - NLS deactivated *"
+fi
+
+if test "${GIMP_LIBS}set" != "set"; then
+ echo "* - GIMP plugin activated *"
+else
+ echo "* - GIMP plugin deactivated *"
+fi
+
+if test "${ac_cv_lib_jpeg_jpeg_start_decompress}" = "yes"; then
+ echo "* - JPEG support activated *"
+else
+ echo "* - JPEG support deactivated *"
+fi
+
+if test "${ac_cv_lib_tiff_TIFFOpen}" = "yes"; then
+ echo "* - TIFF support activated *"
+else
+ echo "* - TIFF support deactivated *"
+fi
+
+if test "${ac_cv_lib_png_png_create_info_struct}" = "yes"; then
+ echo "* - PNG support activated *"
+else
+ echo "* - PNG support deactivated *"
+fi
+
+echo "* *"
+echo "****************************************************************"
+echo "* *"
+echo "* To compile XSANE: *"
+echo "* ----------------- *"
+echo "* enter as normal user: *"
+echo "* make *"
+echo "* and as root: *"
+echo "* make install *"
+echo "* *"
+echo "* ------------------------------------------------------------ *"
+echo "* ... PLEASE READ SANE DOCUMENTATION BEFORE STARTING XSANE ... *"
+echo "* ------------------------------------------------------------ *"
+echo "****************************************************************"
+cat xsane.NEWS
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..c06eb0a
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,301 @@
+dnl Process this file with autoconf to produce a configure script. -*-sh-*-
+AC_INIT(include/sane/config.h.in)
+AC_CONFIG_HEADER(include/sane/config.h)
+# AC_PREREQ(2.10)dnl dnl Minimum Autoconf version required.
+# AC_ARG_PROGRAM
+
+# version code:
+V_MAJOR=0
+V_MINOR=50
+
+PACKAGE=xsane
+
+BINPROGS="xsane"
+
+# languages
+ALL_LINGUAS="de fr cs"
+
+SANE_V_MAJOR=1
+VERSION=${V_MAJOR}.${V_MINOR}
+PACKAGE_VERSION="$PACKAGE-$VERSION"
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION")
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+AC_SUBST(PACKAGE_VERSION)
+AC_SUBST(SANE_MAJOR)
+
+dnl Check args
+
+dnl Check for intl patch selection
+AC_MSG_CHECKING([whether libintl patch is requested])
+dnl Default is disabled libintl patch
+AC_ARG_ENABLE(intl-patch, [ --enable-intl-patch add -lintl to check for sane], ADD_LIBINTL=$enableval, ADD_LIBINTL=no)
+AC_MSG_RESULT($ADD_LIBINTL)
+
+dnl Check for gimp plugin support
+AC_MSG_CHECKING([whether GIMP plugin is requested])
+dnl Default is enabled GIMP plugin
+AC_ARG_ENABLE(gimp, [ --disable-gimp do not include GIMP plugin mode], USE_GIMP=$enableval, USE_GIMP=yes)
+AC_MSG_RESULT($USE_GIMP)
+
+dnl Check for jpeg support
+AC_MSG_CHECKING([whether JPEG support is requested])
+dnl Default is enabled JPEG
+AC_ARG_ENABLE(jpeg, [ --disable-jpeg do not include JPEG support], USE_JPEG=$enableval, USE_JPEG=yes)
+AC_MSG_RESULT($USE_JPEG)
+
+dnl Check for png support
+AC_MSG_CHECKING([whether PNG support is requested])
+dnl Default is enabled PNG
+AC_ARG_ENABLE(png, [ --disable-png do not include PNG support], USE_PNG=$enableval, USE_PNG=yes)
+AC_MSG_RESULT($USE_PNG)
+
+dnl Check for tiff support
+AC_MSG_CHECKING([whether TIFF support is requested])
+dnl Default is enabled TIFF
+AC_ARG_ENABLE(tiff, [ --disable-tiff do not include TIFF support], USE_TIFF=$enableval, USE_TIFF=yes)
+AC_MSG_RESULT($USE_TIFF)
+
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_AIX
+AC_MINIX
+AC_ISC_POSIX
+AM_PROG_CC_STDC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_CPP
+AC_PROG_GCC_TRADITIONAL
+
+INCLUDES="${INCLUDES} -I/usr/local/include"
+CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"
+if test "${ac_cv_prog_gcc}" = "yes"; then
+ CFLAGS="${CFLAGS} -Wall"
+fi
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \
+ sys/time.h sys/scanio.h sys/socket.h sys/io.h asm/io.h gscdds.h sys/hw.h \
+ bsd/dev/scsireg.h io/cam/cam.h camlib.h sys/types.h zlib.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_SIGNAL
+AC_TYPE_SIZE_T
+AC_TYPE_PID_T
+AC_CHECK_TYPE(ssize_t, long)
+AC_CHECK_TYPE(u_char, unsigned char)
+AC_CHECK_TYPE(u_int, unsigned int)
+AC_CHECK_TYPE(u_long, unsigned long)
+
+dnl The following libs have to be included because they are forgotten in the sane libs
+AC_CHECK_LIB(scsi, scsireq_enter) # FreeBSD needs this
+AC_CHECK_LIB(cam, cam_open_device) # FreeBSD 3+ needs this
+dnl AC_CHECK_LIB(intl,gettext)
+
+dnl Checks for libraries.
+AC_CHECK_LIB(m, sqrt)
+AC_CHECK_LIB(z, deflateInit_)
+
+if test "${USE_JPEG}" = "yes"; then
+ AC_CHECK_LIB(jpeg, jpeg_start_decompress)
+fi
+
+# tiff test must stand after test for zlib
+if test "${USE_TIFF}" = "yes"; then
+ AC_CHECK_LIB(tiff, TIFFOpen)
+fi
+
+dnl Checks for library functions.
+AM_FUNC_ALLOCA
+AC_FUNC_MMAP
+AC_CHECK_FUNCS(atexit mkdir sigprocmask strdup strndup strftime strstr strsep strtod snprintf usleep strcasecmp strncasecmp)
+
+dnl standard dll handling
+AC_CHECK_HEADERS(dlfcn.h, [AC_CHECK_LIB(dl,dlopen) AC_CHECK_FUNCS(dlopen, enable_dynamic=yes,)],)
+
+dnl HP/UX DLL handling
+AC_CHECK_HEADERS(dl.h, [AC_CHECK_LIB(dld,shl_load) AC_CHECK_FUNCS(shl_load, enable_dynamic=yes,)],)
+
+dnl Check for NLS/gettext
+AM_GNU_GETTEXT
+AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+
+if test "$USE_NLS" = yes; then
+ if test "$USE_INCLUDED_LIBINTL" = yes; then
+ CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/intl"
+ INTLSUB=intl
+ fi
+fi
+
+AC_SUBST(INTLSUB)
+
+#### Choose a window system.
+
+AC_PATH_X
+if test "$no_x" = yes; then
+ window_system=none
+else
+ window_system=x11
+fi
+
+AM_PATH_GTK(1.2.0, HAVE_GTK=yes, )
+
+# Change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
+# for the tests that follow. We set it back to REAL_CFLAGS later on.
+
+# According to Owen Taylor, GTK_CFLAGS is _guaranteed_ to contain
+# -D and -I flags only, i.e., it really is GTK_CPPFLAGS...
+saved_CPPFLAGS="${CPPFLAGS}"
+saved_LIBS="${LIBS}"
+CPPFLAGS="${CPPFLAGS} ${GTK_CFLAGS}"
+LIBS="${LIBS} ${GTK_LIBS}"
+
+if test "${USE_GIMP}" = "yes"; then
+ AC_CHECK_HEADERS(libgimp/gimp.h, GIMP_LIBS="-lgimp")
+ AC_CHECK_HEADERS(libgimp/gimpfeatures.h)
+fi
+
+LIBS="${saved_LIBS}"
+CPPFLAGS="${saved_CPPFLAGS}"
+
+
+# png test must stand after test for zlib
+# png test must stand behind X11-check because it is located in
+# the X11 directory on some systems
+# so we have to use x_includes and x_libraries to test for png
+# and all following checks (=sane)
+# saved_CPPFLAGS is still up to date
+CPPFLAGS="${CPPFLAGS} -I${x_includes}"
+if test "${USE_PNG}" = "yes"; then
+ AC_CHECK_HEADERS(png.h, [AC_CHECK_LIB(png, png_create_info_struct,,, -L${x_libraries})])
+ if test "${ac_cv_lib_png_png_create_info_struct}" = "yes"; then
+# remove libpng because if we do not remove it all following
+# checks could need x_libraries and x_includes
+ LIBS=`echo $LIBS | sed -e 's/-lpng//'`
+ PNG_LIB="-lpng"
+ fi
+fi
+CPPFLAGS="${saved_CPPFLAGS}"
+
+# check for sane must stand after check for dl
+# check must stand at end of list because of the missing libintl in libsane.so
+# check needs x_libraries and x_includes because they may be needed by png
+dnl Check for sane lib
+if test "${ADD_LIBINTL}" = "no"; then
+ AC_CHECK_HEADERS(sane/sane.h, AC_CHECK_LIB(sane,sane_init))
+else
+ AC_CHECK_HEADERS(sane/sane.h, AC_CHECK_LIB(sane,sane_init,,, -lintl))
+fi
+
+
+# this should be after all checks
+# add libpng again
+LIBS="${PNG_LIB} ${LIBS}"
+
+AC_SUBST(INCLUDES)
+AC_SUBST(BINPROGS)
+AC_SUBST(GTK_CFLAGS)
+AC_SUBST(GTK_LIBS)
+AC_SUBST(GIMP_LIBS)
+CPPFLAGS="${CPPFLAGS} \
+ -DPATH_SANE_DATA_DIR=\$(sanedatadir) \
+ -DV_MAJOR=${V_MAJOR} -DV_MINOR=${V_MINOR} -DSANE_V_MAJOR=${SANE_V_MAJOR}"
+
+dnl Print error message if sane or gtk is missing
+if test "${ac_cv_lib_sane_sane_init}" != "yes"; then
+ echo "****************************************************************"
+ echo "ERROR: SANE is needed for compiling xsane"
+ echo " - if you installed SANE as rpm make sure you also included"
+ echo " sane-devel"
+ echo " - if SANE is installed, try ./configure -enable-intl-patch"
+ echo "****************************************************************"
+ rm -f $cache_file
+ exit -1
+fi
+
+if test "${HAVE_GTK}" = "no"; then
+ echo "****************************************************************"
+ echo "ERROR: GTK-1.2.0 or newer is needed for compiling xsane"
+ echo " if you installed gtk as rpm make sure you also included"
+ echo " gtk-devel"
+ echo "****************************************************************"
+ rm -f $cache_file
+ exit -1
+fi
+
+
+AC_SUBST(V_MAJOR)
+AC_SUBST(V_MINOR)
+AC_SUBST(DLL_PRELOAD)
+
+AC_ARG_ENABLE(foo1, [
+Used environment variables that can be set by user:
+ CFLAGS, CPPFLAGS, LDFLAGS, LIBS])
+
+AC_ARG_ENABLE(foo2, [
+To add include or library paths call:
+ [env] CPPFLAGS=\"-I/path/to/foo/include\" LDFLAGS=\"-L/path/to/foo/libs\" ./configure])
+
+AC_OUTPUT([Makefile intl/Makefile po/Makefile lib/Makefile
+ frontend/Makefile include/Makefile doc/Makefile],)
+
+echo "****************************************************************"
+echo "* *"
+echo "* XSANE configure status: *"
+echo "* ----------------------- *"
+
+if test "${USE_NLS}" = "yes"; then
+ if test "$USE_INCLUDED_LIBINTL" = yes; then
+ echo "* - NLS activated (package internal) *"
+ else
+ echo "* - NLS activated (external) *"
+ fi
+else
+ echo "* - NLS deactivated *"
+fi
+
+if test "${GIMP_LIBS}set" != "set"; then
+ echo "* - GIMP plugin activated *"
+else
+ echo "* - GIMP plugin deactivated *"
+fi
+
+if test "${ac_cv_lib_jpeg_jpeg_start_decompress}" = "yes"; then
+ echo "* - JPEG support activated *"
+else
+ echo "* - JPEG support deactivated *"
+fi
+
+if test "${ac_cv_lib_tiff_TIFFOpen}" = "yes"; then
+ echo "* - TIFF support activated *"
+else
+ echo "* - TIFF support deactivated *"
+fi
+
+if test "${ac_cv_lib_png_png_create_info_struct}" = "yes"; then
+ echo "* - PNG support activated *"
+else
+ echo "* - PNG support deactivated *"
+fi
+
+echo "* *"
+echo "****************************************************************"
+echo "* *"
+echo "* To compile XSANE: *"
+echo "* ----------------- *"
+echo "* enter as normal user: *"
+echo "* make *"
+echo "* and as root: *"
+echo "* make install *"
+echo "* *"
+echo "* ------------------------------------------------------------ *"
+echo "* ... PLEASE READ SANE DOCUMENTATION BEFORE STARTING XSANE ... *"
+echo "* ------------------------------------------------------------ *"
+echo "****************************************************************"
+cat xsane.NEWS
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644
index 0000000..0099667
--- /dev/null
+++ b/doc/Makefile.in
@@ -0,0 +1,78 @@
+SHELL = /bin/sh
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+configdir = ${sysconfdir}/sane.d
+sanedatadir = ${datadir}/sane
+
+MKDIR = $(top_srcdir)/mkinstalldirs
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+@SET_MAKE@
+
+SECT1 = xsane.1
+MANPAGES = $(SECT1)
+LATEX = TEXINPUTS=$(srcdir):$$TEXINPUTS latex
+DLH = TEXINPUTS=$(srcdir):$$TEXINPUTS dlh
+MAN2HTML= nroff -man |\
+ man2html -compress -title $${page} -cgiurl '$$title.$$section.html'|\
+ sed 's,<BODY>,<BODY BGCOLOR=\#FFFFFF TEXT=\#000000><H1 ALIGN=CENTER><IMG SRC="../sane.jpg" HEIGHT=117 WIDTH=346></H1>,'
+
+all: $(MANPAGES)
+
+%.1: %.man
+ sed -e 's|@DATADIR@|$(datadir)|g' \
+ -e 's|@CONFIGDIR@|$(configdir)|g' \
+ -e 's|@LIBDIR@|$(libdir)|g' \
+ -e 's|@BINDIR@|$(bindir)|g' \
+ -e 's|@SBINDIR@|$(sbindir)|g' $^ >$@
+
+install: $(MANPAGES)
+ $(MKDIR) $(mandir)/man1
+ @for page in $(SECT1); do \
+ echo installing $${page} in $(mandir)/man1/$${page}...; \
+ $(INSTALL_DATA) $${page} $(mandir)/man1/$${page} || exit 1; \
+ done
+ $(MKDIR) $(datadir)
+ $(INSTALL_DATA) $(srcdir)/sane-*-doc.html $(sanedatadir)/
+ $(INSTALL_DATA) $(srcdir)/*.jpg $(sanedatadir)/
+
+docs: ps html
+
+html-man: $(MANPAGES)
+ @for page in $(MANPAGES); do \
+ echo "translating $${page} to $${page}.html..."; \
+ cat $${page} | $(MAN2HTML) > $${page}.html; \
+ done
+
+
+clean:
+ rm -f *.toc *.aux *.log *.cp *.fn *.tp *.vr *.pg *.ky *.blg *.idx *.cb
+ rm -f *.ilg
+
+distclean: clean
+ rm -f $(MANPAGES)
+ rm -f Makefile *~
+
+depend:
+
+.PHONY: all install depend clean ps html htmlman sane-backends-html
diff --git a/doc/autoenhance.jpg b/doc/autoenhance.jpg
new file mode 100644
index 0000000..0be20e2
--- /dev/null
+++ b/doc/autoenhance.jpg
Binary files differ
diff --git a/doc/brightness.jpg b/doc/brightness.jpg
new file mode 100644
index 0000000..0a382d3
--- /dev/null
+++ b/doc/brightness.jpg
Binary files differ
diff --git a/doc/contrast.jpg b/doc/contrast.jpg
new file mode 100644
index 0000000..b8d0435
--- /dev/null
+++ b/doc/contrast.jpg
Binary files differ
diff --git a/doc/default.jpg b/doc/default.jpg
new file mode 100644
index 0000000..56602f8
--- /dev/null
+++ b/doc/default.jpg
Binary files differ
diff --git a/doc/gamma.jpg b/doc/gamma.jpg
new file mode 100644
index 0000000..bf24033
--- /dev/null
+++ b/doc/gamma.jpg
Binary files differ
diff --git a/doc/negative.jpg b/doc/negative.jpg
new file mode 100644
index 0000000..be4bec1
--- /dev/null
+++ b/doc/negative.jpg
Binary files differ
diff --git a/doc/restore.jpg b/doc/restore.jpg
new file mode 100644
index 0000000..754871b
--- /dev/null
+++ b/doc/restore.jpg
Binary files differ
diff --git a/doc/rgb-default.jpg b/doc/rgb-default.jpg
new file mode 100644
index 0000000..b04a539
--- /dev/null
+++ b/doc/rgb-default.jpg
Binary files differ
diff --git a/doc/sane-backends-doc.html b/doc/sane-backends-doc.html
new file mode 100644
index 0000000..b36058d
--- /dev/null
+++ b/doc/sane-backends-doc.html
@@ -0,0 +1,110 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.5 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="List of all available backend documentations">
+ <title>SANE-Backends</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="sane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<blockquote>
+<h1>
+<font color="#000000">Index of sane backends</font></h1>
+&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<blockquote>
+<blockquote>
+<blockquote>
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-abaton-doc.html">sane-abaton</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-agfafocus-doc.html">sane-agfafocus</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-apple-doc.html">sane-apple</a></font></li>
+
+<li>
+<font color="#000000">sane-artec</font></li>
+
+<li>
+<font color="#000000">sane-canon</font></li>
+
+<li>
+<font color="#000000">sane-coolscan</font></li>
+
+<li>
+<font color="#000000">sane-dc210</font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-dc25-doc.html">sane-dc25</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-dll-doc.html">sane-dll</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-dmc-doc.html">sane-dmc</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-epson-doc.html">sane-epson</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-hp-doc.html">sane-hp</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-microtek-doc.html">sane-microtek</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-microtek2-doc.html">sane-microtek2</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-mustek-doc.html">sane-mustek</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-net-doc.html">sane-net</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-pint-doc.html">sane-pint</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-pnm-doc.html">sane-pnm</a></font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-qcam-doc.html">sane-qcam</a></font></li>
+
+<li>
+<font color="#000000">sane-s9036</font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-st400-doc.html">sane-st400</a>
+(backend not included into sane)</font></li>
+
+<li>
+<font color="#000000">sane-sharp</font></li>
+
+<li>
+<font color="#000000">sane-snapscan</font></li>
+
+<li>
+<font color="#000000">sane-tamarack</font></li>
+
+<li>
+<font color="#000000"><a href="/usr/local/share/sane/sane-umax-doc.html">sane-umax</a></font></li>
+</blockquote>
+</blockquote>
+</blockquote>
+
+</body>
+</html>
diff --git a/doc/sane-logo.jpg b/doc/sane-logo.jpg
new file mode 100644
index 0000000..218babf
--- /dev/null
+++ b/doc/sane-logo.jpg
Binary files differ
diff --git a/doc/sane-logo2.jpg b/doc/sane-logo2.jpg
new file mode 100644
index 0000000..e0f604f
--- /dev/null
+++ b/doc/sane-logo2.jpg
Binary files differ
diff --git a/doc/sane-pnm-doc.html b/doc/sane-pnm-doc.html
new file mode 100644
index 0000000..9a02d4d
--- /dev/null
+++ b/doc/sane-pnm-doc.html
@@ -0,0 +1,39 @@
+<HTML>
+<HEAD>
+ <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+ <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (X11; I; Linux 2.0.36 i586) [Netscape]">
+ <META NAME="Author" CONTENT="Oliver Rauch">
+ <META NAME="Description" CONTENT="scan, photocopy and fax frontend for SANE">
+ <TITLE>SANE - XSane frontend</TITLE>
+</HEAD>
+<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EF" VLINK="#51188E" ALINK="#FF0000">
+
+<BLOCKQUOTE>
+<CENTER>
+<H3>
+<IMG SRC="sane-logo.jpg" HEIGHT=300 WIDTH=256 ALIGN=TEXTTOP></H3></CENTER>
+
+<CENTER>
+<H1>
+PNM BACKEND</H1></CENTER>
+
+<CENTER>
+<H1>
+
+<HR WIDTH="100%"></H1></CENTER>
+</BLOCKQUOTE>
+
+<BLOCKQUOTE>
+<CENTER><FONT SIZE=+1>The PNM backend is a backend for testing SANE frontends.
+It is not planned to give the user any useful functions!</FONT></CENTER>
+
+<CENTER><FONT SIZE=+1></FONT>&nbsp;</CENTER>
+
+<CENTER><FONT SIZE=+1></FONT></CENTER>
+
+<CENTER>
+<HR WIDTH="100%"></CENTER>
+</BLOCKQUOTE>
+
+</BODY>
+</HTML>
diff --git a/doc/sane-pnm16-doc.html b/doc/sane-pnm16-doc.html
new file mode 100644
index 0000000..e6bc487
--- /dev/null
+++ b/doc/sane-pnm16-doc.html
@@ -0,0 +1,42 @@
+<HTML>
+<HEAD>
+ <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+ <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (X11; I; Linux 2.0.36 i586) [Netscape]">
+ <META NAME="Author" CONTENT="Oliver Rauch">
+ <META NAME="Description" CONTENT="scan, photocopy and fax frontend for SANE">
+ <TITLE>SANE - XSane frontend</TITLE>
+</HEAD>
+<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EF" VLINK="#51188E" ALINK="#FF0000">
+
+<BLOCKQUOTE>
+<CENTER>
+<H3>
+<IMG SRC="sane-logo.jpg" HEIGHT=300 WIDTH=256 ALIGN=TEXTTOP></H3></CENTER>
+
+<CENTER>
+<H1>
+PNM16 BACKEND</H1></CENTER>
+
+<CENTER>
+<H1>
+
+<HR WIDTH="100%"></H1></CENTER>
+</BLOCKQUOTE>
+
+<BLOCKQUOTE>
+<CENTER><FONT SIZE=+1>The PNM16 backend is a backend for testing SANE frontends.
+It is not planned to give the user any useful functions!</FONT></CENTER>
+
+<CENTER><FONT SIZE=+1>It reads a pnm image and converts it into a 8-16
+bits/sample image.</FONT></CENTER>
+
+<CENTER><FONT SIZE=+1></FONT>&nbsp;</CENTER>
+
+<CENTER><FONT SIZE=+1></FONT></CENTER>
+
+<CENTER>
+<HR WIDTH="100%"></CENTER>
+</BLOCKQUOTE>
+
+</BODY>
+</HTML>
diff --git a/doc/sane-problems-doc.html b/doc/sane-problems-doc.html
new file mode 100644
index 0000000..085118b
--- /dev/null
+++ b/doc/sane-problems-doc.html
@@ -0,0 +1,116 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="List of all available backend documentations">
+ <title>SANE-Backends</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="sane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<blockquote>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<h1>
+<font color="#000000">SANE Problems</font></h1>
+</blockquote>
+
+<br>&nbsp;
+<br>&nbsp;
+<blockquote><b><font color="#000000"><font size=+1>If you have any problems
+with SANE or XSane please read this before you write any mails.</font></font></b></blockquote>
+
+<blockquote>
+<blockquote>
+<li>
+<b><font color="#000000">The SANE frontend (like xsane or xscanimage) does
+not start or aborts with a segmentation fault.</font></b></li>
+
+<p><br><font color="#000000">Edit /usr/local/etc/sane.d/dll.conf (or /usr/etc/sane.d/dll.conf)
+and comment out all but the backend you need. To do this add a "#" at the
+beginning of the relevant lines.</font><font color="#000000"></font>
+<p><font color="#000000">If that does not help try to find out where the
+error occurs:</font>
+<br><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gdb
+xscanimage</font>
+<br><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r
+&lt;enter></font>
+<br><font color="#000000">after the frontend returned:</font>
+<br><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; backtrace
+&lt;enter></font>
+<br>&nbsp;
+<li>
+<b><font color="#000000">The scanner starts the scan but it stops while
+scanning</font></b></li>
+
+<li>
+<b><font color="#000000">The scsi bus or the whole system freezes</font></b></li>
+
+<li>
+<b><font color="#000000">The image is corrupted</font></b></li>
+
+<p><br><font color="#000000">In general there are three different reasons
+that can cause such erros:</font>
+<blockquote>
+<li>
+<font color="#000000">In most cases it is a problem with your scsi bus.
+Please check the following points:</font></li>
+
+<blockquote>
+<li>
+<font color="#000000">The scsi bus has to be a chain (one line) that is
+terminated on both ends. If possible the scanner should be on one end of
+the chain because the connectors on most scsi scanners are not specified
+for the scsi-2 standard.</font></li>
+
+<li>
+<font color="#000000">If you do not use any ultra-scsi-devices and your
+scsi controller is a fast scsi controller you can use passive terminators.
+If one or more devices are ultra-scsi-devices you have to use active terminators.</font></li>
+
+<li>
+<font color="#000000">If the scsi controller is at an end of the scsi chain
+the termination of the controller has to be enabled. Otherwise it has to
+be disabled. If you use a fast scsi controller and you have one or more
+ultra-scsi-devices connected, you must not use the built in termination
+of the scsi controller (because it is a passive terminator), you have to
+use an active terminator instead.</font></li>
+
+<li>
+<font color="#000000">The length of the scsi chain is limitted. If you
+use no ultra-scsi-devices the whole length of the chain must not exceed
+3 meters. If there are one or more ultra-scsi-devices in the scsi chain
+the length of the chain must not exceed 1.5 meters.&nbsp; If there are
+only 3 devices (2 devices + controller) the length of the chain may be
+up to 3 meters, but if you have any problems you should try to reduce the
+length.</font></li>
+</blockquote>
+
+<li>
+<font color="#000000">The driver for your scsi controller does not work
+like expected. Update your scsi driver if you do not have the most recent
+version.</font></li>
+
+<br><font color="#000000">If that does not help try it with an other type
+of scsi card.</font>
+<br>&nbsp;
+<li>
+<font color="#000000">May be your scanner/firmware does not work correct
+with the backend you use. Update the backend version or contact the author
+of the backend.</font></li>
+</blockquote>
+<font color="#000000"></font>
+<br>&nbsp;
+<li>
+<b>Please read the documentation of the backend you use</b></li>
+</blockquote>
+<font color="#000000">If you tested everything above and you still need
+help: contact the backend/frontend author or to the <a href="mailto: sane-devel@mostang.com">sane
+mailling list</a> (you must be subscribed to the list).</font></blockquote>
+
+</body>
+</html>
diff --git a/doc/sane-scantips-doc.html b/doc/sane-scantips-doc.html
new file mode 100644
index 0000000..9a4e45d
--- /dev/null
+++ b/doc/sane-scantips-doc.html
@@ -0,0 +1,48 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.5 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="List of all available backend documentations">
+ <title>SANE-Backends</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="sane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<blockquote>
+<h1>
+<font color="#000000">Scantips - links to the web</font></h1>
+&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<h4>
+If you are looking for some tips about scanning, desktoppublishing etc,
+take a look at these links:</h4>
+
+<blockquote>
+<blockquote>
+<li>
+<font color="#000000"><a href="http://www.scantips.com/">http://www.scantips.com/</a></font></li>
+
+<li>
+<font color="#000000"><a href="http://www.infomedia.net/scan/">http://www.infomedia.net/scan/</a></font></li>
+
+<li>
+<font color="#000000"><a href="http://www.hsdesign.com/scanning/">http://www.hsdesign.com/scanning/</a></font></li>
+
+<li>
+<font color="#000000"><a href="http://desktoppublishing.com/">http://desktoppublishing.com/</a></font></li>
+</blockquote>
+</blockquote>
+
+</body>
+</html>
diff --git a/doc/sane-xsane-advanced-doc.html b/doc/sane-xsane-advanced-doc.html
new file mode 100644
index 0000000..b294836
--- /dev/null
+++ b/doc/sane-xsane-advanced-doc.html
@@ -0,0 +1,35 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Advanced options</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<br>&nbsp;
+<blockquote>
+<h1>
+<u><font color="#009900">Advanced options window</font></u></h1>
+&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<center><img SRC="sane-xsane-advanced.jpg" height=238 width=291></center>
+
+<hr WIDTH="100%">
+<center><a href="sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-advanced.jpg b/doc/sane-xsane-advanced.jpg
new file mode 100644
index 0000000..309aa72
--- /dev/null
+++ b/doc/sane-xsane-advanced.jpg
Binary files differ
diff --git a/doc/sane-xsane-copy-doc.html b/doc/sane-xsane-copy-doc.html
new file mode 100644
index 0000000..e0f0b07
--- /dev/null
+++ b/doc/sane-xsane-copy-doc.html
@@ -0,0 +1,40 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Copy mode</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<blockquote>&nbsp;
+<h1>
+<u><font color="#009900">Copy mode</font></u></h1>
+</blockquote>
+
+<blockquote>&nbsp;In Copy mode, the scanned image is converted to postscript.
+The postscript file is piped as standard input to the command listed after
+the printer symbol.
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<center><img SRC="sane-xsane-copy.jpg" height=416 width=270></center>
+
+<blockquote>&nbsp;
+<br>The options of the printer and the printer command can be set in the
+menu
+<a href="sane-xsane-setup-printer-doc.html">Preferences/Setup</a></blockquote>
+
+<hr WIDTH="100%">
+<center><a href="sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-copy.jpg b/doc/sane-xsane-copy.jpg
new file mode 100644
index 0000000..13c1cd9
--- /dev/null
+++ b/doc/sane-xsane-copy.jpg
Binary files differ
diff --git a/doc/sane-xsane-doc.html b/doc/sane-xsane-doc.html
new file mode 100644
index 0000000..9956e12
--- /dev/null
+++ b/doc/sane-xsane-doc.html
@@ -0,0 +1,232 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Documentation index</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<blockquote>
+<h1>
+<br>
+<BR></h1>
+
+<h1>
+</h1>
+
+<h1>
+</h1>
+
+<h1>
+<br>
+<u><font color="#009900">Index of xsane documentation</font></u></h1>
+
+<blockquote>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+</blockquote>
+
+<blockquote>
+<li>
+<font color="#000000"><font size=+1>Xsane modes:</font></font></li>
+
+<blockquote>
+<blockquote>
+<li>
+<font color="#000000"><a href="sane-xsane-scan-doc.html">Scan mode</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-copy-doc.html">Copy mode</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-fax-doc.html">Fax mode</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-gimp-doc.html">Gimp plugin</a></font></li>
+</blockquote>
+</blockquote>
+
+<li>
+<font color="#000000"><font size=+1>Scanner option windows:</font></font></li>
+
+<blockquote>
+<blockquote>
+<li>
+<font color="#000000"><a href="sane-xsane-standard-doc.html">Standard options
+window</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-advanced-doc.html">Advanced options
+window</a></font></li>
+</blockquote>
+</blockquote>
+
+<li>
+<font color="#000000"><font size=+1><a href="sane-xsane-preview-doc.html">Preview</a></font></font></li>
+
+<blockquote>
+<blockquote>
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#PIPETTE_WHITE">Pipette
+white</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#PIPETTE_GRAY">Pipette
+gray</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#PIPETTE_BLACK">Pipette
+black</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#UNZOOM">Unzoom</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#ZOOM_OUT">Zoom
+out</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#ZOOM_IN">Zoom
+in</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#UNDO_ZOOM">Undo
+zoom</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#SELECT_VISIBLE_AREA">Select
+visible area</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#SELECT_SCAN_AREA">Select
+scanarea</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#MOVE_SCAN_AREA">Move
+scanarea</a></font></li>
+
+<br>&nbsp;</blockquote>
+</blockquote>
+
+<li>
+<font color="#000000"><font size=+1><a href="sane-xsane-enhancement-doc.html">Enhancement
+functions</a>:</font></font></li>
+
+<blockquote>
+<blockquote>
+<li>
+<font color="#000000"><a href="sane-xsane-enhancement-doc.html#GAMMA">Gamma
+correction</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-enhancement-doc.html#BRIGHTNESS">Brightness</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-enhancement-doc.html#CONTRAST">Contrast</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-enhancement-doc.html#RGB_DEFAULT">RGB
+default</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-enhancement-doc.html#NEGATIVE">Negative</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-enhancement-doc.html#AUTOENHANCEMENT">Autoenhancement</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-enhancement-doc.html#ENHANCEMENT_DEFAULT">Enhancement
+default</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-enhancement-doc.html#RESTORE_ENHANCEMENT">Restore
+enhancement</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-enhancement-doc.html#STORE_ENHANCEMENT">Store
+enhancement</a></font></li>
+
+<br>&nbsp;
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#PIPETTE_WHITE">Pipette
+white</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#PIPETTE_GRAY">Pipette
+gray</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-preview-doc.html#PIPETTE_BLACK">Pipette
+black</a></font></li>
+
+<br>&nbsp;
+<li>
+<font color="#000000"><a href="sane-xsane-histogram-doc.html">Histogram
+window</a></font></li>
+
+<li>
+<font color="#000000">Highlight/White point</font></li>
+
+<li>
+<font color="#000000">Shadow/Black point</font></li>
+
+<li>
+<font color="#000000">Gamma/Gray point</font></li>
+</blockquote>
+</blockquote>
+
+<li>
+<font color="#000000"><font size=+1>Setup:</font></font></li>
+
+<blockquote>
+<blockquote>
+<li>
+<font color="#000000"><a href="sane-xsane-setup-copy-doc.html">Copy setup</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-setup-display-doc.html">Display
+setup</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-setup-save-doc.html">Saving setup</a></font></li>
+
+<li>
+<font color="#000000"><a href="sane-xsane-setup-fax-doc.html">Fax setup</a></font></li>
+</blockquote>
+</blockquote>
+
+<li>
+<font color="#000000"><font size=+1>Supported functions:</font></font></li>
+
+<blockquote>
+<blockquote>
+<li>
+<font color="#000000">Support for 9-16 bits/sample</font></li>
+
+<li>
+<font color="#000000">Output formats</font></li>
+
+<li>
+<font color="#000000">Automatic filename generation</font></li>
+
+<li>
+<font color="#000000">Automatic Document Feeder</font></li>
+</blockquote>
+</blockquote>
+</blockquote>
+
+<hr WIDTH="100%">
+<blockquote><font size=+1>Author: <a href="mailto:Oliver.Rauch@Wolfsburg.DE">Oliver
+Rauch</a></font>
+<p><font size=+1><a href="http://www.wolfsburg.de/~rauch/sane/sane-xsane.html">Homepage
+of xsane</a></font></blockquote>
+
+</body>
+</html>
diff --git a/doc/sane-xsane-enhancement-doc.html b/doc/sane-xsane-enhancement-doc.html
new file mode 100644
index 0000000..32c1d05
--- /dev/null
+++ b/doc/sane-xsane-enhancement-doc.html
@@ -0,0 +1,101 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Enhancement</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<br>&nbsp;
+<blockquote>
+<h1>
+<u><font color="#009900">Enhancement</font></u></h1>
+XSane uses a gamma table to do the following enhancement functions. If
+the scanner supports a custom gamma table (and the option is enabled) XSane
+uses the scanner internal gamma table with the scanner's maximum bit depth.</blockquote>
+
+<center><img SRC="sane-xsane.jpg" height=416 width=270></center>
+
+<blockquote>&nbsp;
+<dt>
+<img SRC="gamma.jpg" height=21 width=22><a NAME="GAMMA"></a><b> Gamma correction:</b></dt>
+
+<blockquote>The gamma correction is a non linear correction. Black keeps
+black and white keeps white
+<blockquote>if the gamma value is greater than 1.0 the gray intensities
+are brightned
+<br>if the gamma value is smaller than 1.0 the gray intensities are darkend</blockquote>
+</blockquote>
+
+<dt>
+<img SRC="brightness.jpg" height=21 width=22><a NAME="BRIGHTNESS"></a><b> Brightness:</b></dt>
+
+<blockquote>positive values increase the brightness of the image. All values
+are increased by the same value. 100% means a shift of the half value range
+(on 8 bits (256 values) this means a shift of 128).</blockquote>
+
+<dt>
+<img SRC="contrast.jpg" height=21 width=22><a NAME="CONTRAST"></a><b> Contrast:</b></dt>
+
+<blockquote>positive values increase the contrast of the image. Medium
+gray keeps medium gray (8 bits: 128)
+<blockquote>-100% means that all colors become medium gray
+<br>+100% means that the difference between a value and medium gray is
+doubled</blockquote>
+</blockquote>
+
+<dt>
+<img SRC="rgb-default.jpg" height=26 width=26><a NAME="RGB_DEFAULT"></a><b> RGB default:</b></dt>
+
+<blockquote>if RGB default is activated, all values for the color components
+(red, green and blue) are set to the default values (gamma=1.0, brightness=0%,
+contrast=0%). If you deactivate it, you can set different enhancement values
+for each color.</blockquote>
+
+<dt>
+<img SRC="negative.jpg" height=26 width=26><a NAME="NEGATIVE"></a><b> Negative:</b></dt>
+
+<blockquote>This option inverts the intensities (black &lt;-> white).
+It is for scanning negatives.
+<p>Negatives do not only have inverted colors, it also is necessary
+to do a color correction for each color component because the negatives
+have very different color ranges for each color.</blockquote>
+
+<dt>
+<img SRC="autoenhance.jpg" height=26 width=26><a NAME="AUTO_ENHANCEMENT"></a><b> Autoenhancement:</b></dt>
+
+<blockquote>If you press this button XSane tries to set good values
+for brightness, contrast and gamma correction independance of the selected
+part in the preview window. This does work quiet well for brightness and
+contrast, but the gamma correction normally has to be corrected manually.</b>
+<br>If RGB default is disabled, the components for each color are set
+individually.</blockquote>
+
+<img SRC="default.jpg" height=26 width=26><a NAME="ENHANCEMENT_DEFAULT"></a><b> Enhancement default:</b>
+<blockquote>Sets the enhancement values to default: gamma=1.0, brightness=0%,
+contrast=0%.</blockquote>
+
+<dt>
+<img SRC="restore.jpg" height=26 width=26><a NAME="RESTORE_ENHANCEMENT"></a><b> Restore enhancement:</b></dt>
+
+<blockquote>Restores the enhancement values from preferences.</blockquote>
+
+<dt>
+<img SRC="store.jpg" height=26 width=26><a NAME="MEMORY_ENHANCEMENT"></a><b> Store enhancement (Memory):</b></dt>
+
+<blockquote>tore selected enhancement values to preferences.</blockquote>
+</blockquote>
+
+<center>
+<hr WIDTH="100%">
+<br><b><a href="../../c/sane/xsane/doc/sane-xsane-doc.html">INDEX</a></b></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-fax-doc.html b/doc/sane-xsane-fax-doc.html
new file mode 100644
index 0000000..5eaf593
--- /dev/null
+++ b/doc/sane-xsane-fax-doc.html
@@ -0,0 +1,39 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Fax mode</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+
+<blockquote>
+<h3>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></h3>
+&nbsp;</blockquote>
+
+<blockquote>
+<h1>
+<u><font color="#009900">Fax mode</font></u></h1>
+This mode is a Frontend for SANE and for a faxprogram like hylafax or mgetty+sendfax
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<center><img SRC="sane-xsane-fax.jpg" height=380 width=270>&nbsp;&nbsp;&nbsp;<img SRC="sane-xsane-fax-project.jpg" height=260 width=208></center>
+
+<p><br>
+<blockquote>You need to have a faxprogram like hylafax(1) or mgetty+sendfax(8)
+installed. The faxcommand and the options must be specified in the menu
+<a href="sane-xsane-setup-doc.html">Preferences/Setup</a>.</blockquote>
+
+<hr WIDTH="100%">
+<center><a href="sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-fax-project.jpg b/doc/sane-xsane-fax-project.jpg
new file mode 100644
index 0000000..03048b8
--- /dev/null
+++ b/doc/sane-xsane-fax-project.jpg
Binary files differ
diff --git a/doc/sane-xsane-fax.jpg b/doc/sane-xsane-fax.jpg
new file mode 100644
index 0000000..60d1065
--- /dev/null
+++ b/doc/sane-xsane-fax.jpg
Binary files differ
diff --git a/doc/sane-xsane-gimp-doc.html b/doc/sane-xsane-gimp-doc.html
new file mode 100644
index 0000000..7c4a49e
--- /dev/null
+++ b/doc/sane-xsane-gimp-doc.html
@@ -0,0 +1,60 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Gimp plugin</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<blockquote>
+<h1>
+<u><font color="#009900">Xsane as Gimp plugin</font></u></h1>
+<font color="#000000">If xsane is started as Gimp plugin, the scanned image
+automatically is transfered to the Gimp.</font>
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<center><img SRC="sane-xsane-gimp.jpg" height=350 width=270></center>
+
+<blockquote>&nbsp;
+<p>To start xsane as a gimp plugin, you have to set a symbolic link from
+the xsane binary to a GIMP plug-ins directory. If xsane is located in /usr/local/bin&nbsp;
+and you use-gimp-1.0.x do:
+<blockquote>
+<pre>ln -s /usr/local/bin/xsane ~/.gimp/plug-ins/</pre>
+</blockquote>
+if you use gimp-1.1.x, you have to do:
+<blockquote>
+<pre>ln -s /usr/local/bin/xsane ~/.gimp-1.1/plug-ins/</pre>
+</blockquote>
+You can start xsane from the GIMP menu <i>Xtns/Xsane </i>if GIMP-version
+&lt; 1.1.9, since GIMP-version-1.1.9 you can start xsane from the GIMP
+menu<i> File/Acquire.</i> It contains short-cuts to the SANE devices that
+were available at the time xsane was queried.</blockquote>
+
+<blockquote>Note that gimp(1) caches these short-cuts in ~/.gimp/pluginrc.
+Thus, when the list of&nbsp; available devices changes (e.g., a new scanner
+is installed or the device of the scanner has changed),&nbsp; then it is
+typically desirable to rebuild this cache. To do this, you can either&nbsp;
+touch(1) the xsane binary (e.g.,"touch&nbsp; /usr/local/bin/xsane") or
+delete the plugin cache (e.g.,&nbsp; "rm&nbsp; ~/.gimp/pluginrc"). Either
+way, invoking gimp(1) afterwards will cause the pluginrc to be rebuilt.
+<p>If xsane is started as GIMP plugin it always sends the scanned image
+to the GIMP, copy- or fax- mode can not selected when xsane runs as GIMP
+plugin!</blockquote>
+
+<center>
+<p><br>
+<hr WIDTH="100%"><a href="sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-gimp.jpg b/doc/sane-xsane-gimp.jpg
new file mode 100644
index 0000000..f183d42
--- /dev/null
+++ b/doc/sane-xsane-gimp.jpg
Binary files differ
diff --git a/doc/sane-xsane-histogram-doc.html b/doc/sane-xsane-histogram-doc.html
new file mode 100644
index 0000000..736bde9
--- /dev/null
+++ b/doc/sane-xsane-histogram-doc.html
@@ -0,0 +1,55 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Histogram</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<blockquote>
+<h1>
+<u><font color="#009900">Histogram window</font></u></h1>
+&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<center><img SRC="sane-xsane-histogram.jpg" height=362 width=278></center>
+
+<p><br>
+<blockquote>
+<blockquote>The histogram shows the color density of the area that is selected
+in the preview window. The top histogram represents the scanned raw image,
+the bottom histogram represents the enhanced image. In grayscale mode,
+there are three sliders in the gray range. The black slider defines the
+black point, the white silder the white point and the gray slider the gray
+point (gamma). If the <i>rgb default button</i> (in the xsane main window)
+is not selected in color mode there are also sliders in the red, the green
+and the blue range. In this case a move of a slider of the gray range also
+moves the sliders of the color ranges.
+<p>The <i>I</i>, <i>R</i>, <i>G</i> and <i>B</i> buttons define if the
+<i>intensity</i>, <i>red</i>, <i>green</i> and/or <i>blue</i> histogram
+components are shown.
+<p>The curve-type button defines if the histogram curves are shown with
+pixels or with lines.
+<p>The <i>LOG</i> button defines if the densities are displayed linear
+or logarithmical.</blockquote>
+</blockquote>
+
+<hr WIDTH="100%">
+<center><a href="sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-histogram.jpg b/doc/sane-xsane-histogram.jpg
new file mode 100644
index 0000000..a13a912
--- /dev/null
+++ b/doc/sane-xsane-histogram.jpg
Binary files differ
diff --git a/doc/sane-xsane-main-doc.html b/doc/sane-xsane-main-doc.html
new file mode 100644
index 0000000..b3f0a42
--- /dev/null
+++ b/doc/sane-xsane-main-doc.html
@@ -0,0 +1,40 @@
+<HTML>
+<HEAD>
+ <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
+ <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (X11; I; Linux 2.0.36 i586) [Netscape]">
+ <META NAME="Author" CONTENT="Oliver Rauch">
+ <META NAME="Description" CONTENT="scan, photocopy and fax frontend for SANE">
+ <TITLE>SANE - XSane frontend</TITLE>
+</HEAD>
+<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EF" VLINK="#51188E" ALINK="#FF0000">
+
+<CENTER>&nbsp;</CENTER>
+
+<CENTER>
+<DD>
+<IMG SRC="xsane-logo.jpg" HEIGHT=300 WIDTH=256></DD></CENTER>
+
+<CENTER>
+<DD>
+<FONT SIZE=+2>&nbsp;a scanner-frontend for -><A HREF="http://www.mostang.com/sane">SANE</A>.</FONT></DD></CENTER>
+
+<CENTER>
+<DD>
+<FONT SIZE=+2>&nbsp;</FONT></DD></CENTER>
+
+<CENTER>
+<HR WIDTH="100%"></CENTER>
+
+<CENTER>&nbsp;</CENTER>
+
+<BLOCKQUOTE>
+<H1>
+<U><FONT COLOR="#009900">The main window</FONT></U></H1>
+&nbsp;
+<CENTER><IMG SRC="sane-xsane.jpg" HEIGHT=443 WIDTH=306></CENTER>
+
+<CENTER>&nbsp;</CENTER>
+</BLOCKQUOTE>
+
+</BODY>
+</HTML>
diff --git a/doc/sane-xsane-pipette-black.jpg b/doc/sane-xsane-pipette-black.jpg
new file mode 100644
index 0000000..8508f14
--- /dev/null
+++ b/doc/sane-xsane-pipette-black.jpg
Binary files differ
diff --git a/doc/sane-xsane-pipette-gray.jpg b/doc/sane-xsane-pipette-gray.jpg
new file mode 100644
index 0000000..72211f3
--- /dev/null
+++ b/doc/sane-xsane-pipette-gray.jpg
Binary files differ
diff --git a/doc/sane-xsane-pipette-white.jpg b/doc/sane-xsane-pipette-white.jpg
new file mode 100644
index 0000000..b8b8b0f
--- /dev/null
+++ b/doc/sane-xsane-pipette-white.jpg
Binary files differ
diff --git a/doc/sane-xsane-preview-doc.html b/doc/sane-xsane-preview-doc.html
new file mode 100644
index 0000000..996d21d
--- /dev/null
+++ b/doc/sane-xsane-preview-doc.html
@@ -0,0 +1,173 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Preview</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+
+<blockquote>
+<h3>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></h3>
+&nbsp;
+<p>&nbsp;</blockquote>
+
+<blockquote>
+<h1>
+<u><font color="#009900">Preview window</font></u></h1>
+The preview window is to select an area that you want to scan. You can
+resize the preview window and zoom into the scan area.
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<center><img SRC="sane-xsane-preview.jpg" height=643 width=407></center>
+
+<p><br>
+<blockquote>&nbsp;
+<br>With the smaller, black dashed frame in the preview you select the
+area that shall be scanned. The larger, red dashed frame is only available
+in COPY-mode, it shows the size of the page of the selected printer relative
+to the zoom scale.</blockquote>
+
+<blockquote><img SRC="sane-xsane-pipette-white.jpg" height=26 width=27><a NAME="PIPETTE_WHITE"></a><b><u>Pipette
+white:</u></b>
+<blockquote>Use mouse pointer and click a point that shall be white. If
+you use the left mouse button only the intensity is used to calculate the
+white point. If <i>RGB default</i> (main window) is not activated you can
+use the middle mouse button to define the white point for each color component.
+You can abort the selection by pressing the right mouse button.</blockquote>
+
+<dt>
+<img SRC="sane-xsane-pipette-gray.jpg" height=26 width=28>&nbsp;<a NAME="PIPETTE_GRAY"></a><b><u>Pipette
+gray:</u></b></dt>
+
+<blockquote>
+<dt>
+Use mouse pointer and click a point that shall be medium gray. If you use
+the left mouse button only the intensity is used to calculate the white
+point. If <i>RGB default</i> (main window) is not activated you can use
+the middle mouse button to define the white point for each color component.
+You can abort the selection by pressing the right mouse button.</dt>
+</blockquote>
+
+<dt>
+<img SRC="sane-xsane-pipette-black.jpg" height=26 width=26>&nbsp;<a NAME="PIPETTE_BLACK"></a><b><u>Pipette
+black:</u></b></dt>
+
+<blockquote>
+<dt>
+Use mouse pointer and click a point that shall be black. If you use the
+left mouse button only the intensity is used to calculate the white point.
+If <i>RGB default</i> (main window) is not activated you can use the middle
+mouse button to define the white point for each color component. You can
+abort the selection by pressing the right mouse button.</dt>
+</blockquote>
+
+<dt>
+<img SRC="sane-xsane-zoom-not.jpg" height=26 width=26>&nbsp;<a NAME="UNZOOM"></a><b><u>Unzoom:</u></b></dt>
+
+<blockquote>
+<dt>
+Use full scan area.</dt>
+</blockquote>
+
+<dt>
+<img SRC="sane-xsane-zoom-out.jpg" height=27 width=27>&nbsp;<a NAME="ZOOM_OUT"></a><b><u>Zoom
+out:</u></b></dt>
+
+<blockquote>
+<dt>
+Increase preview area by 20%.</dt>
+</blockquote>
+
+<dt>
+<img SRC="sane-xsane-zoom-in.jpg" height=26 width=26>&nbsp;<a NAME="ZOOM_IN"></a><b><u>Zoom
+in:</u></b></dt>
+
+<blockquote>
+<dt>
+Zoom into selected area.</dt>
+</blockquote>
+
+<dt>
+<img SRC="sane-xsane-zoom-undo.jpg" height=26 width=26>&nbsp;<a NAME="UNDO_ZOOM"></a><b><u>Undo
+zoom:</u></b></dt>
+
+<blockquote>
+<dt>
+Undo last zoom.</dt>
+</blockquote>
+
+<dt>
+<img SRC="sane-xsane-visible-area.jpg" height=26 width=26>&nbsp;<a NAME="SELECT_VISIBLE_AREA"></a><b><u>Select
+visible area:</u></b></dt>
+
+<blockquote>
+<dt>
+Select the visible area in the preview window for scanning.</dt>
+</blockquote>
+
+<dt>
+<b><u>Acquire Preview:</u></b></dt>
+
+<blockquote>
+<dt>
+Start preview scan. If you resized the preview window, the new preview
+is done with updated resolution.</dt>
+</blockquote>
+
+<dt>
+<b><u>Cancel Preview:</u></b></dt>
+
+<blockquote>
+<dt>
+Cancel a preview scan.</dt>
+
+<dt>
+</dt>
+</blockquote>
+
+<dt>
+<a NAME="SELECT_SCAN_AREA"></a><b><u>Left mouse button:</u></b></dt>
+
+<blockquote>
+<dt>
+<u>Select scan area:</u> Press (&amp;hold) left mouse button to define
+one edge, move the mouse so that the area you want to scan is in the frame
+and release the button.<br>
+<BR></dt>
+
+<dt>
+<u>Edit scan area:</u> Move the pointer over an edge of the existing selection,
+the mouse pointer changes. Now press (&amp;hold)&nbsp; the left mouse button,
+you can move the draged edge of the scanarea, then release the left mouse
+button.</dt>
+</blockquote>
+
+<dt>
+<a NAME="MOVE_SCAN_AREA"></a><b><u>Right and middle mouse button:</u></b></dt>
+
+<blockquote>
+<dt>
+If you press (&amp;hold) the right or the middle mouse button in the selection
+frame you can move the selection frame without resizing it.</dt>
+</blockquote>
+</blockquote>
+
+<blockquote>
+<blockquote>
+<blockquote>&nbsp;</blockquote>
+</blockquote>
+</blockquote>
+
+<hr WIDTH="100%">
+<center><a href="sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-preview.jpg b/doc/sane-xsane-preview.jpg
new file mode 100644
index 0000000..892e8d8
--- /dev/null
+++ b/doc/sane-xsane-preview.jpg
Binary files differ
diff --git a/doc/sane-xsane-scan-doc.html b/doc/sane-xsane-scan-doc.html
new file mode 100644
index 0000000..6995bf9
--- /dev/null
+++ b/doc/sane-xsane-scan-doc.html
@@ -0,0 +1,92 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Scan mode</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<br>&nbsp;
+<blockquote>
+<h1>
+<u><font color="#009900">Scan mode (stand alone)</font></u></h1>
+The scan mode is to scan an image and save it to a file.
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<center><img SRC="sane-xsane.jpg" height=416 width=270></center>
+
+<blockquote>&nbsp;</blockquote>
+
+<h3>
+<u><font color="#009900">Supported output formats:</font></u></h3>
+
+<blockquote>You can select the output format by the filename extension
+(menu = "by ext") or by selecting the file format in the menu. Possible
+are: <i>pnm, png, ps, jpeg, raw </i>and<i> tiff.</i></blockquote>
+
+<blockquote><i>Pnm</i> and <i>ps</i> (and raw) are always available. The
+other formats are only available if necessary libraries are present (at
+compilation time AND while xsane is executed). For <i>png</i> you need
+libpng and libz, for <i>jpeg</i> you need jpeglib, for <i>tiff</i> you
+need libtiff.</blockquote>
+
+<blockquote>The <i>raw</i> format is a 16 bit format comparable to 16 bit
+binary <i>pnm</i> format that is not defined, for <i>pnm</i> the 16 bit
+format only is defined as ascii mode which generates huge and slow files.</blockquote>
+
+<blockquote><b>The supported output formats depend on the bit depth of
+the scanned image:</b>
+<h4>
+<u><font color="#990000">1 bit/pixel black/white mode:</font></u></h4>
+
+<blockquote><font color="#000099">pnm = pbm, png</font>
+<br><font color="#000099">ps, jpeg and tiff are converted to 8 bit grayscale
+mode.</font></blockquote>
+
+<h4>
+<u><font color="#990000">8 bits/pixel grayscale mode:</font></u></h4>
+
+<blockquote><font color="#000099">pnm = pgm, png, ps, jpeg and tiff</font></blockquote>
+
+<h4>
+<u><font color="#990000">16 bits/pixel grayscale mode (9-16 bits):</font></u></h4>
+
+<blockquote><font color="#000099">pnm (ascii), png and raw</font></blockquote>
+
+<h4>
+<u><font color="#990000">24 bits/pixel RGB-color mode (8 bits/color):</font></u></h4>
+
+<blockquote><font color="#000099">pnm = ppm, png, ps, jpeg and tiff</font></blockquote>
+
+<h4>
+<u><font color="#990000">48 bits/pixel RGB-color mode (9-16 bits/color):</font></u></h4>
+
+<blockquote><font color="#000099">pnm (ascii), png and raw</font></blockquote>
+
+<h4>
+<u><font color="#990000">32 bits/pixel RGBA-color mode (8 bits/color):</font></u></h4>
+
+<blockquote><font color="#000099">rgba (raw) and png with alpha channel</font></blockquote>
+
+<h4>
+<u><font color="#990000">64 bits/pixel RGBA-color mode (9-16 bits/color):</font></u></h4>
+
+<blockquote><font color="#000099">rgba (raw) and png with alpha channel</font></blockquote>
+</blockquote>
+
+<center>
+<hr WIDTH="100%">
+<br><a href="/usr/local/share/sane/sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+<br>
+</body>
+</html>
diff --git a/doc/sane-xsane-setup-copy-doc.html b/doc/sane-xsane-setup-copy-doc.html
new file mode 100644
index 0000000..bbd36b6
--- /dev/null
+++ b/doc/sane-xsane-setup-copy-doc.html
@@ -0,0 +1,96 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Setup</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<dd>
+</dd>
+
+<dd>
+</dd>
+
+<dd>
+</dd>
+
+<blockquote>
+<h1>
+<u><font color="#009900">Copy setup</font></u></h1>
+&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<center><img SRC="sane-xsane-setup-copy.jpg" height=501 width=391></center>
+
+<blockquote>
+<h4>
+NAME:</h4>
+</blockquote>
+
+<blockquote>
+<blockquote>Define the name for the following printer definition.</blockquote>
+
+<h4>
+COMMAND:</h4>
+
+<blockquote>Enter the command with which you print files. The command has
+to read the file from the standard input. If you use the bsd printing system,
+this is "lpr -", if you use the old printing system, this should be "lp
+-".</blockquote>
+</blockquote>
+
+<blockquote>
+<h4>
+COPY NUMBER OPTION:</h4>
+</blockquote>
+
+<blockquote>
+<blockquote>Enter the option of the printer command with wich the number
+of copies are specified. This option is the last option passed to the printerrcommand
+so if you specify a ";#" the option is ignored.</blockquote>
+
+<h4>
+RESOLUTION:</h4>
+
+<blockquote>With <i>resolution</i> you specify the resolution that shall
+be used for printing. It is not always necessary to set this value to the
+resolution of the printer. Especally in grayscale and color mode it normally
+is good to set this value to the half or the quarter of the printer resolution
+because the printer needs a greater resolution to do the dithering. This
+value does not effect a change of the image size, the image size only depends
+on the given zoom factor.</blockquote>
+
+<h4>
+PRINT AREA (WIDTH, HEIGHT, LEFT OFFSET, BOTTOM OFFSET):</h4>
+
+<blockquote>Each printer has it's own area size and position where it is
+able to print.</blockquote>
+
+<h4>
+PRINTER GAMMA VALUES:</h4>
+
+<blockquote>Addidtional gamma value for printing. The <i>Printer gamma
+value</i> is used for grayscale and as common value for color mode. The
+red, green and blue values are for color correction.</blockquote>
+</blockquote>
+
+<hr WIDTH="100%">
+<center><a href="sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-setup-copy.jpg b/doc/sane-xsane-setup-copy.jpg
new file mode 100644
index 0000000..abe3d35
--- /dev/null
+++ b/doc/sane-xsane-setup-copy.jpg
Binary files differ
diff --git a/doc/sane-xsane-setup-display-doc.html b/doc/sane-xsane-setup-display-doc.html
new file mode 100644
index 0000000..948e4d1
--- /dev/null
+++ b/doc/sane-xsane-setup-display-doc.html
@@ -0,0 +1,99 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Setup</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<dd>
+</dd>
+
+<dd>
+</dd>
+
+<dd>
+</dd>
+
+<dd>
+</dd>
+
+<dd>
+</dd>
+
+<blockquote>
+<h1>
+<u><font color="#009900">Display setup</font></u></h1>
+</blockquote>
+
+<blockquote>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<h3>
+<font color="#009900"></font></h3>
+<font color="#009900"></font>
+<center>
+<p><br><img SRC="sane-xsane-setup-display.jpg" height=501 width=391></center>
+
+<p><br>
+<blockquote>
+<h4>
+MAIN WINDOW SIZE FIXED:</h4>
+</blockquote>
+
+<blockquote>
+<blockquote>Select if the main window size shall be fixed (the window size
+is defined by xsane) or it shall be a resizable with scrollbars if necessary.
+The change of this option will take effect at the next start of xsane.
+The option can be overwritten by the command line options --Fixed/-F or
+--Resizeable/-R.</blockquote>
+</blockquote>
+
+<blockquote>
+<h4>
+PRESERVE PREVIEW IMAGE:</h4>
+</blockquote>
+
+<blockquote>
+<blockquote>Preserve the preview image for the next program start. The
+last preview image is displayed on the next program start, you don`t need
+to redo the preview scan.</blockquote>
+
+<h4>
+USE PRIVATE COLORMAP:</h4>
+
+<blockquote>If enabled and if the X server runs in 8 bit mode (256 colors)
+then the preview uses an own color map.</blockquote>
+
+<h4>
+PREVIEW GAMMA:</h4>
+
+<blockquote>Set the gamma correction value for the preview image. This
+is to get correct colors on your monitor.</blockquote>
+
+<h4>
+HELPFILE VIEWER:</h4>
+
+<blockquote>Enter a program to show the helpfiles. It must be a html-viewer.
+If you enter the keywrod "netscape-remote", xsane uses a already running
+netscape to show the onlinehelp. If you run kde, you may want to enter
+"kdehelp" here.</blockquote>
+</blockquote>
+
+<hr WIDTH="100%">
+<center><a href="sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-setup-display.jpg b/doc/sane-xsane-setup-display.jpg
new file mode 100644
index 0000000..e7d9d92
--- /dev/null
+++ b/doc/sane-xsane-setup-display.jpg
Binary files differ
diff --git a/doc/sane-xsane-setup-fax-doc.html b/doc/sane-xsane-setup-fax-doc.html
new file mode 100644
index 0000000..a5d3953
--- /dev/null
+++ b/doc/sane-xsane-setup-fax-doc.html
@@ -0,0 +1,104 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Setup</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<blockquote>
+<h1>
+<u><font color="#009900">Fax setup</font></u></h1>
+&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<center><img SRC="sane-xsane-setup-fax.jpg" height=501 width=391></center>
+
+<p><br>
+<blockquote>
+<h4>
+COMMAND:</h4>
+
+<blockquote>Enter command to send/spool faxfiles.
+<dd>
+<b>hylafax: "sendfax"</b></dd>
+
+<dd>
+<b>mgetty+sendfax: "faxspool"</b></dd>
+</blockquote>
+
+<h4>
+RECEIVER OPTION:</h4>
+
+<blockquote>Option to set receiver phone number or address.
+<dd>
+<b>hylafax: "-d"</b></dd>
+
+<dd>
+<b>mgetty+sendfax: leave free</b></dd>
+</blockquote>
+
+<h4>
+POSTSCRIPTFILE OPTION:</h4>
+
+<blockquote>If there is an option that must be set before the filenames
+of the faxfile or if it is necessary to specify an option for files in
+postscript format, enter this option - otherwise let this field free.
+<dd>
+<b>hylafax: leave free</b></dd>
+
+<dd>
+<b>mgetty+sendfax: leave free</b></dd>
+</blockquote>
+
+<h4>
+NORMAL MODE OPTION:</h4>
+
+<blockquote>If there is an option to set normal mode (98lpi) then enter
+this option - otherwise let this field free.
+<dd>
+<b>hylafax: "-l"</b></dd>
+
+<dd>
+<b>mgetty+sendfax: "-n"</b></dd>
+</blockquote>
+
+<h4>
+FINE MODE OPTION:</h4>
+
+<blockquote>If there is an option to set fine mode (196lpi) then enter
+this option - otherwise let this field free.
+<dd>
+<b>hylafax: "-m"</b></dd>
+
+<dd>
+<b>mgetty+sendfax: leave free</b></dd>
+</blockquote>
+
+<h4>
+VIEWER:</h4>
+
+<blockquote>Enter a program to show the postscript fax files on the screen.
+<br>E.g. this can be "ghostscript" or "xv".</blockquote>
+</blockquote>
+
+<hr WIDTH="100%">
+<center><a href="sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-setup-fax.jpg b/doc/sane-xsane-setup-fax.jpg
new file mode 100644
index 0000000..f2e66de
--- /dev/null
+++ b/doc/sane-xsane-setup-fax.jpg
Binary files differ
diff --git a/doc/sane-xsane-setup-save-doc.html b/doc/sane-xsane-setup-save-doc.html
new file mode 100644
index 0000000..5e8cb2d
--- /dev/null
+++ b/doc/sane-xsane-setup-save-doc.html
@@ -0,0 +1,92 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Setup</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<dd>
+</dd>
+
+<dd>
+</dd>
+
+<dd>
+</dd>
+
+<dd>
+</dd>
+
+<blockquote>
+<h1>
+<u><font color="#009900">Saving setup</font></u></h1>
+&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<blockquote>&nbsp;</blockquote>
+
+<h3>
+<font color="#009900"></font></h3>
+<font color="#009900"></font>
+<center>
+<p><br><img SRC="sane-xsane-setup-save.jpg" height=501 width=391></center>
+
+<p><br>
+<blockquote>
+<h4>
+OVERWRITE WARNING:</h4>
+</blockquote>
+
+<blockquote>
+<blockquote>If enabled, a warning comes up before an existing file is overwritten.</blockquote>
+
+<h4>
+INCREASE FILENAME COUNTER:</h4>
+
+<blockquote>If enabled, the number in the filename of the following form
+is automatically increased after a scan is completed:
+<blockquote><i>image-001.ext</i></blockquote>
+The number of digits is free and will not be changed, in case of an overflow,
+a warning is printed and the counter becomes 0.</blockquote>
+
+<blockquote>If an automatic document feeder is used the filename should
+contain a counter and this option should be enabled.</blockquote>
+
+<h4>
+SKIP EXISTING NUMBERS:</h4>
+
+<blockquote>If <i>increase filename counter</i> is enabled, filenames that
+already exist are skipped!</blockquote>
+
+<h4>
+JPEG IMAGE QUALITY:</h4>
+
+<blockquote>If the image is saved in <i>jpeg</i> format this value defines
+the quality of the image. Low values mean low quality and low file size,
+high values mean high quality and high file size.</blockquote>
+
+<h4>
+PNG IMAGE COMPRESSION:</h4>
+
+<blockquote>If the image is saved in <i>png</i> format this value defines
+the compression level. The quality of the image keeps the same, low values
+mean low compression, large files and low compression time. High values
+mean high compression, smaller files and high compression time.</blockquote>
+</blockquote>
+
+<hr WIDTH="100%">
+<center><a href="sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-setup-save.jpg b/doc/sane-xsane-setup-save.jpg
new file mode 100644
index 0000000..07b6a22
--- /dev/null
+++ b/doc/sane-xsane-setup-save.jpg
Binary files differ
diff --git a/doc/sane-xsane-standard-doc.html b/doc/sane-xsane-standard-doc.html
new file mode 100644
index 0000000..3a09d7e
--- /dev/null
+++ b/doc/sane-xsane-standard-doc.html
@@ -0,0 +1,33 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.6 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
+ <meta name="Author" content="Oliver Rauch">
+ <meta name="Description" content="scan, photocopy and fax frontend for SANE">
+ <title>XSane - Standard options</title>
+</head>
+<body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
+&nbsp;
+<dd>
+<img SRC="xsane-logo2.jpg" height=150 width=128 align=LEFT></dd>
+
+<blockquote>
+<h1>
+<u><font color="#009900">Standard options window</font></u></h1>
+&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;</blockquote>
+
+<center><img SRC="sane-xsane-standard.jpg" height=275 width=307>
+<br>
+<hr WIDTH="100%">
+<br><a href="sane-xsane-doc.html">INDEX</a></center>
+
+<p><br>
+</body>
+</html>
diff --git a/doc/sane-xsane-standard.jpg b/doc/sane-xsane-standard.jpg
new file mode 100644
index 0000000..13be214
--- /dev/null
+++ b/doc/sane-xsane-standard.jpg
Binary files differ
diff --git a/doc/sane-xsane-visible-area.jpg b/doc/sane-xsane-visible-area.jpg
new file mode 100644
index 0000000..117a5ba
--- /dev/null
+++ b/doc/sane-xsane-visible-area.jpg
Binary files differ
diff --git a/doc/sane-xsane-zoom-in.jpg b/doc/sane-xsane-zoom-in.jpg
new file mode 100644
index 0000000..dc73335
--- /dev/null
+++ b/doc/sane-xsane-zoom-in.jpg
Binary files differ
diff --git a/doc/sane-xsane-zoom-not.jpg b/doc/sane-xsane-zoom-not.jpg
new file mode 100644
index 0000000..b239646
--- /dev/null
+++ b/doc/sane-xsane-zoom-not.jpg
Binary files differ
diff --git a/doc/sane-xsane-zoom-out.jpg b/doc/sane-xsane-zoom-out.jpg
new file mode 100644
index 0000000..9e20fc1
--- /dev/null
+++ b/doc/sane-xsane-zoom-out.jpg
Binary files differ
diff --git a/doc/sane-xsane-zoom-undo.jpg b/doc/sane-xsane-zoom-undo.jpg
new file mode 100644
index 0000000..11e0890
--- /dev/null
+++ b/doc/sane-xsane-zoom-undo.jpg
Binary files differ
diff --git a/doc/sane-xsane.jpg b/doc/sane-xsane.jpg
new file mode 100644
index 0000000..31c37af
--- /dev/null
+++ b/doc/sane-xsane.jpg
Binary files differ
diff --git a/doc/store.jpg b/doc/store.jpg
new file mode 100644
index 0000000..e1223df
--- /dev/null
+++ b/doc/store.jpg
Binary files differ
diff --git a/doc/xsane-logo.jpg b/doc/xsane-logo.jpg
new file mode 100644
index 0000000..596f3da
--- /dev/null
+++ b/doc/xsane-logo.jpg
Binary files differ
diff --git a/doc/xsane-logo2.jpg b/doc/xsane-logo2.jpg
new file mode 100644
index 0000000..133c3c7
--- /dev/null
+++ b/doc/xsane-logo2.jpg
Binary files differ
diff --git a/doc/xsane.man b/doc/xsane.man
new file mode 100644
index 0000000..8e69216
--- /dev/null
+++ b/doc/xsane.man
@@ -0,0 +1,199 @@
+.TH xsane 1 "02 Aug 1999"
+.IX xsane
+.SH NAME
+xsane - scanner frontend for SANE
+.SH SYNOPSIS
+.B xsane
+.RB [ --version | -v ]
+.RB [ --device-settings
+.IR file
+.RB | -d
+.IR file ]
+.RB [ --scan | -s ]
+.RB [ --copy | -c ]
+.RB [ --fax | -f ]
+.RB [ --no-mode-selection | -n ]
+.RB [ --Fixed | -F ]
+.RB [ --Scrolled | -S ]
+.RB [ --display
+.IR d ]
+.RB [ --no-xshm ]
+.RB [ --sync ]
+.RB [ --debug-level
+.IR n ]
+.RI [ devicename ]
+.SH DESCRIPTION
+.B xsane
+provides a graphical user-interface to control an image
+acquisition device such as a flatbed scanner. It allows
+previewing and scanning invidual images and can be invoked either
+directly from the command-line or through The GIMP image manipulation
+program. In the former case,
+.B xsane
+acts as a stand-alone program that saves acquired images in a suitable
+PNM format (PBM for black-and-white images, PGM for grayscale images,
+and PPM for color images) or converts the image to JPEG, PNG, PS or TIFF.
+In the latter case, the images are directly passed to The GIMP for further
+processing.
+
+.B xsane
+accesses image acquisition devices through the SANE (Scanner Access
+Now Easy) interface. The list of available devices depends on
+installed hardware and configuration. When invoked without an
+explicit devicename argument,
+.B xsane
+presents a dialog listing all known and available devices. To access
+an available device that is not known to the system, the devicename
+must be specified explicitly.
+.SH RUNNING UNDER THE GIMP
+To run
+.B xsane
+under the
+.BR gimp (1),
+simply set a symbolic link from the xsane-binary to one of the
+.BR gimp (1)
+plug-ins directories. For example, the command
+.PP
+.RS
+ln -s @BINDIR@/xsane ~/.gimp/plug-ins/
+.RE
+.PP
+adds a symlink for the
+.B xsane
+binary to the user's plug-ins directory. After creating this symlink,
+.B xsane
+will be queried by
+.BR gimp (1)
+the next time it's invoked. From then on,
+.B xsane
+can be invoked through "Xtns->XSane->Device dialog..." menu entry.
+
+You'll also find that the "Xtns->XSane" menu contains short-cuts
+to the SANE devices that were available at the time the
+.B xsane
+was queried.
+Note that
+.BR gimp (1)
+caches these short-cuts in ~/.gimp/pluginrc. Thus, when the list of
+available devices changes (e.g., a new scanner is installed or the
+device of the scanner has changed), then it is typically desirable
+to rebuild this cache. To do this, you can either
+.BR touch (1)
+the
+.B xsane
+binary (e.g., "touch @BINDIR@/xsane") or delete the plugin cache
+(e.g., "rm ~/.gimp/pluginrc"). Either way, invoking
+.BR gimp (1)
+afterwards will cause the pluginrc to be rebuilt.
+.SH OPTIONS
+.PP
+If the
+.B --version
+or
+.B -v
+flag is given xsane prints a version information and exits.
+.PP
+The
+.B --scan
+or
+.B -s
+flag forces xsane to start in scan mode.
+.PP
+The
+.B --fax
+or
+.B -f
+flag forces xsane to start in fax mode.
+.PP
+The
+.B --copy
+or
+.B -c
+flag forces xsane to start in fax mode.
+.PP
+The
+.B --no-mode-selection
+or
+.B -n
+flag disables the menu for xsane mode selection (scan, copy, fax).
+.PP
+The
+.B --device-settings
+or
+.B -d
+flag reads the next option as default filename
+for device settings. The extension ".drc" must not
+be included.
+.PP
+If the
+.B --Fixed
+or
+.B -F
+flag is given then xsane uses a fixed, non resizable main window.
+The flag overwrites the preferences value.
+.PP
+If the
+.B --Scrolled
+or
+.B -S
+flag is given then xsane uses a scrolled, resizable main window.
+The flag overwrites the preferences value.
+.PP
+The
+.B --display
+flag selects the X11 display used to present the graphical user-interface
+(see
+.BR X (1)
+for details).
+.PP
+The
+.B --no-xshm
+flag requests not to use shared memory images. Shared memory images
+usually enhance performance but cause problems with some buggy X11
+servers. Unless your X11 server dies when running this program, there
+is no need or advantage to specify this flag.
+.PP
+The
+.B --sync
+flag requests a synchronous connection with the X11 server. This is for
+debugging purposes only.
+.SH FILES
+.TP
+.I $HOME/.sane/xsane/xsane.rc
+This files holds the user preferences. Normally, this file should not
+be manipulated directly. Instead, the user should customize the
+program through the "Preferences" menu.
+.TP
+.I $HOME/.sane/xsane/devicename.rc
+For each device, there is one rc-file that holds the saved settings
+for that particular device. Normally, this file should not be
+manipulated directly. Instead, the user should use the
+.B xsane
+interface to select appropriate values and then save the device
+settings using the "Preferences->Save Device Settings" menubar entry.
+.TP
+.I $HOME/.sane/preview-devicename.ppm
+After acquiring a preview,
+.B xsane
+normally saves the preview image in this device-specific file. Thus,
+next time the program is started up, the program can present the old
+preview image. This feature can be turned off through the
+"Preferences->Preview Options..." dialog.
+.TP
+.I @DATADIR@/sane-style.rc
+This system-wide file controls the aspects of the user-interface such
+as colors and fonts. It is a GTK style file and provides fine control
+over the visual aspects of the user-interface.
+.TP
+.I $HOME/.sane/sane-style.rc
+This file serves the same purpose as the system-wide style file. If
+present, it takes precedence over the system wide style file.
+.SH "SEE ALSO"
+gimp(1), xscanimage(1), scanimage(1),
+sane\-dll(5), sane\-net(5), sane-scsi(5),
+sane\-abaton(5), sane\-agfafocus(5), sane\-apple(5), sane\-dc25(5),
+sane\-dmc(5), sane\-epson(5), sane\-hp(5), sane\-microtek(5),
+sane\-microtek2(5), sane\-mustek(5), sane\-pint(5), sane\-pnm(5),
+sane\-qcam(5), sane\-umax(5)
+.SH AUTHOR
+Oliver Rauch (Oliver.Rauch@Wolfsburg.DE)
diff --git a/frontend/Makefile.in b/frontend/Makefile.in
new file mode 100644
index 0000000..439369d
--- /dev/null
+++ b/frontend/Makefile.in
@@ -0,0 +1,85 @@
+SHELL = /bin/sh
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+configdir = ${sysconfdir}/sane.d
+sanedatadir = ${datadir}/sane
+
+MKINSTALLDIRS = @MKINSTALLDIRS@
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+CC = @CC@
+INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include \
+ @GTK_CFLAGS@ @INCLUDES@ \
+ -DLOCALEDIR=\""$(datadir)/locale"\"
+DEFS = @DEFS@
+CPPFLAGS = @CPPFLAGS@
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @INTLLIBS@ @LIBS@
+GTK_LIBS = @GTK_LIBS@
+GIMP_LIBS = @GIMP_LIBS@
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(LDFLAGS) -o $@
+
+BINPROGS = @BINPROGS@
+
+@SET_MAKE@
+
+PROGRAMS = $(BINPROGS)
+LIBLIB = ../lib/liblib.a
+
+XSANE_OBJS = xsane-back-gtk.o xsane-front-gtk.o xsane-gamma.o xsane-preview.o \
+ xsane-rc-io.o xsane-device-preferences.o xsane-preferences.o \
+ xsane-setup.o xsane-save.o xsane-scan.o xsane-icons.o xsane.o
+
+
+.c.o:
+ $(COMPILE) $<
+
+all: $(PROGRAMS)
+
+install: $(PROGRAMS)
+ $(MKINSTALLDIRS) $(bindir) $(sbindir) $(datadir) $(sanedatadir) $(sanedatadir)/xsane
+ @for program in $(BINPROGS); do \
+ $(INSTALL_PROGRAM) $${program} $(bindir)/$${program}; \
+ done
+ $(INSTALL_DATA) $(srcdir)/xsane-style.rc $(sanedatadir)/xsane/xsane-style.rc
+ $(INSTALL_DATA) $(srcdir)/xsane-logo.xpm $(sanedatadir)/xsane-logo.xpm
+
+xsane: $(XSANE_OBJS) $(LIBLIB)
+ $(LINK) $(XSANE_OBJS) \
+ $(LIBLIB) $(GIMP_LIBS) $(GTK_LIBS) $(LIBS)
+
+
+clean:
+ rm -f *.o *~ .*~ *.bak
+ rm -rf .libs
+
+distclean: clean
+ rm -f Makefile $(PROGRAMS)
+
+depend:
+ makedepend $(INCLUDES) *.c
+
+.PHONY: all install depend clean distclean
diff --git a/frontend/cursor/cursor_pipette_black b/frontend/cursor/cursor_pipette_black
new file mode 100644
index 0000000..9fc4d56
--- /dev/null
+++ b/frontend/cursor/cursor_pipette_black
@@ -0,0 +1,8 @@
+#define cursor_pipette_black_width 16
+#define cursor_pipette_black_height 16
+#define cursor_pipette_black_x_hot 1
+#define cursor_pipette_black_y_hot 14
+static unsigned char cursor_pipette_black_bits[] = {
+ 0x00, 0x70, 0x00, 0xf8, 0x80, 0xff, 0x00, 0xfe, 0x00, 0x7d, 0x80, 0x38,
+ 0x40, 0x18, 0xe0, 0x17, 0xf0, 0x13, 0xf8, 0x01, 0xfc, 0x00, 0x7c, 0x00,
+ 0x3e, 0x00, 0x0f, 0x00, 0x04, 0x00, 0x00, 0x00};
diff --git a/frontend/cursor/cursor_pipette_gray b/frontend/cursor/cursor_pipette_gray
new file mode 100644
index 0000000..7cbea80
--- /dev/null
+++ b/frontend/cursor/cursor_pipette_gray
@@ -0,0 +1,8 @@
+#define cursor_pipette_gray_width 16
+#define cursor_pipette_gray_height 16
+#define cursor_pipette_gray_x_hot 1
+#define cursor_pipette_gray_y_hot 14
+static unsigned char cursor_pipette_gray_bits[] = {
+ 0x00, 0x70, 0x00, 0xf8, 0x80, 0xff, 0x00, 0xfe, 0x00, 0x7d, 0x80, 0x38,
+ 0x40, 0x18, 0x20, 0x14, 0x10, 0x12, 0xf8, 0x01, 0xfc, 0x00, 0x7c, 0x00,
+ 0x3e, 0x00, 0x0f, 0x00, 0x04, 0x00, 0x00, 0x00};
diff --git a/frontend/cursor/cursor_pipette_mask b/frontend/cursor/cursor_pipette_mask
new file mode 100644
index 0000000..36c7757
--- /dev/null
+++ b/frontend/cursor/cursor_pipette_mask
@@ -0,0 +1,8 @@
+#define cursor_pipette_mask_width 16
+#define cursor_pipette_mask_height 16
+#define cursor_pipette_mask_x_hot 1
+#define cursor_pipette_mask_y_hot 14
+static unsigned char cursor_pipette_mask_bits[] = {
+ 0x00, 0x70, 0x00, 0xf8, 0x80, 0xff, 0x00, 0xfe, 0x00, 0x7f, 0x80, 0x3f,
+ 0xc0, 0x1f, 0xe0, 0x17, 0xf0, 0x13, 0xf8, 0x01, 0xfc, 0x00, 0x7c, 0x00,
+ 0x3e, 0x00, 0x0f, 0x00, 0x04, 0x00, 0x00, 0x00};
diff --git a/frontend/cursor/cursor_pipette_white b/frontend/cursor/cursor_pipette_white
new file mode 100644
index 0000000..9952441
--- /dev/null
+++ b/frontend/cursor/cursor_pipette_white
@@ -0,0 +1,8 @@
+#define cursor_pipette_white_width 16
+#define cursor_pipette_white_height 16
+#define cursor_pipette_white_x_hot 1
+#define cursor_pipette_white_y_hot 14
+static unsigned char cursor_pipette_white_bits[] = {
+ 0x00, 0x70, 0x00, 0xf8, 0x80, 0xff, 0x00, 0xfe, 0x00, 0x7d, 0x80, 0x38,
+ 0x40, 0x18, 0x20, 0x14, 0x10, 0x12, 0x08, 0x01, 0x84, 0x00, 0x44, 0x00,
+ 0x32, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00};
diff --git a/frontend/xsane-back-gtk.c b/frontend/xsane-back-gtk.c
new file mode 100644
index 0000000..8bde762
--- /dev/null
+++ b/frontend/xsane-back-gtk.c
@@ -0,0 +1,1426 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-back-gtk.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+#include "xsane.h"
+#include "xsane-back-gtk.h"
+#include "xsane-preferences.h"
+#include "xsane-text.h"
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+/* extern declarations */
+extern void xsane_panel_build(GSGDialog *dialog);
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+/* forward declarations: */
+static void xsane_back_gtk_panel_rebuild(GSGDialog *dialog);
+void xsane_set_sensitivity(SANE_Int sensitivity);
+void xsane_set_window_icon(GtkWidget *gtk_window, gchar **xpm_d);
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+const char *xsane_back_gtk_unit_string(SANE_Unit unit)
+{
+ double d;
+
+ switch (unit)
+ {
+ case SANE_UNIT_NONE: return "none";
+ case SANE_UNIT_PIXEL: return "pixel";
+ case SANE_UNIT_BIT: return "bit";
+ case SANE_UNIT_DPI: return "dpi";
+ case SANE_UNIT_PERCENT: return "%";
+ case SANE_UNIT_MM:
+ d = preferences.length_unit;
+ if (d > 9.9 && d < 10.1)
+ {
+ return "cm";
+ }
+ else if (d > 25.3 && d < 25.5)
+ {
+ return "in";
+ }
+ return "mm";
+ case SANE_UNIT_MICROSECOND: return "\265s";
+ }
+ return 0;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_set_tooltip(GtkTooltips *tooltips, GtkWidget *widget, const char *desc)
+{
+ if (desc && desc[0])
+ {
+ gtk_tooltips_set_tip(tooltips, widget, desc, 0);
+ }
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+int xsane_back_gtk_make_path(size_t buf_size, char *buf,
+ const char *prog_name,
+ const char *dir_name,
+ const char *prefix, const char *dev_name,
+ const char *postfix,
+ int location)
+{
+ struct passwd *pw;
+ size_t len, extra;
+ int i;
+
+ if (location == XSANE_PATH_LOCAL_SANE) /* make path to local file */
+ {
+ pw = getpwuid(getuid()); /* get homedirectory */
+ if (!pw)
+ {
+ snprintf(buf, buf_size, "%s %s", ERR_HOME_DIR, strerror(errno));
+ xsane_back_gtk_error(buf, FALSE);
+ return -1;
+ }
+
+ snprintf(buf, buf_size, "%s/.sane", pw->pw_dir);
+ mkdir(buf, 0777); /* ensure ~/.sane directory exists */
+ }
+ else if (location == XSANE_PATH_SYSTEM) /* make path to system file */
+ {
+ snprintf(buf, buf_size, "%s", STRINGIFY(PATH_SANE_DATA_DIR));
+ }
+ else /* make path to temporary file */
+ {
+ snprintf(buf, buf_size, "%s", PATH_SANE_TMP);
+ }
+
+ len = strlen(buf);
+
+ if (prog_name)
+ {
+ extra = strlen(prog_name);
+ if (len + extra + 1 >= buf_size)
+ {
+ goto filename_too_long;
+ }
+
+ buf[len++] = '/';
+ memcpy(buf + len, prog_name, extra);
+ len += extra;
+ buf[len] = '\0';
+ mkdir(buf, 0777); /* ensure ~/.sane/PROG_NAME directory exists */
+ }
+ if (len >= buf_size)
+ {
+ goto filename_too_long;
+ }
+
+ buf[len++] = '/';
+
+
+ if (dir_name)
+ {
+ extra = strlen(dir_name);
+ if (len + extra + 1 >= buf_size)
+ {
+ goto filename_too_long;
+ }
+
+ buf[len++] = '/';
+ memcpy(buf + len, dir_name, extra);
+ len += extra;
+ buf[len] = '\0';
+ mkdir(buf, 0777); /* ensure DIR_NAME directory exists */
+ }
+
+ if (len >= buf_size)
+ {
+ goto filename_too_long;
+ }
+
+ buf[len++] = '/';
+
+
+ if (prefix)
+ {
+ extra = strlen(prefix);
+ if (len + extra >= buf_size)
+ {
+ goto filename_too_long;
+ }
+
+ memcpy(buf + len, prefix, extra);
+ len += extra;
+ }
+
+ if (location == XSANE_PATH_TMP) /* system tmp dir, add uid */
+ {
+ char uid_prefix[256];
+ uid_t uid;
+
+ uid = getuid();
+ snprintf(uid_prefix, sizeof(uid_prefix), "%d-", uid);
+
+ extra = strlen(uid_prefix);
+ if (len + extra >= buf_size)
+ {
+ goto filename_too_long;
+ }
+
+ memcpy(buf + len, uid_prefix, extra);
+ len += extra;
+ }
+
+ if (dev_name)
+ {
+ /* Turn devicename into valid filename by replacing slashes by "_", "_" gets "__", spaces are erased */
+
+ for (i = 0; dev_name[i]; ++i)
+ {
+ if (len + 2 >= buf_size)
+ {
+ goto filename_too_long;
+ }
+
+ switch (dev_name[i])
+ {
+ case '/': /* "/" -> "_" */
+ buf[len++] = '_';
+ break;
+
+ case ' ': /* erase " " */
+ break;
+
+ case '_': /* "_" -> "__" */
+ buf[len++] = '_';
+ /* fall through */
+ default:
+ buf[len++] = dev_name[i];
+ break;
+ }
+ }
+ }
+
+ if (postfix)
+ {
+ extra = strlen(postfix);
+ if (len + extra >= buf_size)
+ {
+ goto filename_too_long;
+ }
+ memcpy(buf + len, postfix, extra);
+ len += extra;
+ }
+ if (len >= buf_size)
+ goto filename_too_long;
+
+ buf[len++] = '\0';
+ return 0;
+
+filename_too_long:
+ xsane_back_gtk_error(ERR_FILENAME_TOO_LONG, FALSE);
+ errno = E2BIG;
+ return -1;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_set_option(GSGDialog * dialog, int opt_num, void *val, SANE_Action action)
+{
+ SANE_Status status;
+ SANE_Int info;
+ char buf[256];
+
+ status = sane_control_option(dialog->dev, opt_num, action, val, &info);
+ if (status != SANE_STATUS_GOOD)
+ {
+ snprintf(buf, sizeof(buf), "%s %s: %s.", ERR_SET_OPTION, sane_get_option_descriptor(dialog->dev, opt_num)->name,
+ XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(buf, FALSE);
+ return;
+ }
+
+ if ((info & SANE_INFO_RELOAD_PARAMS) && dialog->param_change_callback)
+ {
+ (*dialog->param_change_callback) (dialog, dialog->param_change_arg);
+ }
+
+ if (info & SANE_INFO_RELOAD_OPTIONS)
+ {
+ xsane_back_gtk_panel_rebuild(dialog);
+ if (dialog->option_reload_callback)
+ {
+ (*dialog->option_reload_callback) (dialog, dialog->option_reload_arg);
+ }
+ }
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_close_dialog_callback(GtkWidget * widget, gpointer data)
+{
+ gtk_widget_destroy(data);
+ xsane_back_gtk_message_dialog_active = 0;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static gint decision_flag;
+static GtkWidget *decision_dialog;
+
+void xsane_back_gtk_decision_callback(GtkWidget * widget, gpointer data)
+{
+ gtk_widget_destroy(decision_dialog);
+ xsane_back_gtk_message_dialog_active = 0;
+ decision_flag = (long) data;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+gint xsane_back_gtk_decision(gchar *title, gchar **xpm_d, gchar *message, gchar *oktext, gchar *rejecttext, gint wait)
+{
+ GtkWidget *main_vbox, *hbox, *label, *button;
+ GdkPixmap *pixmap;
+ GdkBitmap *mask;
+ GtkWidget *pixmapwidget;
+
+ if (xsane_back_gtk_message_dialog_active)
+ {
+ fprintf(stderr, "%s: %s\n", title, message);
+ return TRUE;
+ }
+ xsane_back_gtk_message_dialog_active = 1;
+ decision_dialog = gtk_window_new(GTK_WINDOW_DIALOG);
+ gtk_window_set_position(GTK_WINDOW(decision_dialog), GTK_WIN_POS_MOUSE);
+ gtk_window_set_title(GTK_WINDOW(decision_dialog), title);
+ gtk_signal_connect(GTK_OBJECT(decision_dialog), "delete_event",
+ GTK_SIGNAL_FUNC(xsane_back_gtk_decision_callback), (void *) -1); /* -1 = cancel */
+
+ xsane_set_window_icon(decision_dialog, 0);
+
+ /* create the main vbox */
+ main_vbox = gtk_vbox_new(TRUE, 5);
+ gtk_container_set_border_width(GTK_CONTAINER(main_vbox), 5);
+ gtk_widget_show(main_vbox);
+
+ gtk_container_add(GTK_CONTAINER(decision_dialog), main_vbox);
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 4);
+ gtk_box_pack_start(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 0);
+
+ /* the info icon */
+ if (xpm_d)
+ {
+ pixmap = gdk_pixmap_create_from_xpm_d(decision_dialog->window, &mask, xsane.bg_trans, xpm_d);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 10);
+ gtk_widget_show(pixmapwidget);
+ gdk_pixmap_unref(pixmap);
+ }
+
+ /* the message */
+ label = gtk_label_new(message);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+ gtk_widget_show(label);
+
+ gtk_widget_show(hbox);
+
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 4);
+ gtk_box_pack_start(GTK_BOX(main_vbox), hbox, FALSE, FALSE, 0);
+
+ /* the confirmation button */
+ button = gtk_button_new_with_label(oktext);
+ GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_back_gtk_decision_callback, (void *) 1 /* confirm */);
+ gtk_container_add(GTK_CONTAINER(hbox), button);
+ gtk_widget_grab_default(button);
+ gtk_widget_show(button);
+
+
+ if (rejecttext) /* the rejection button */
+ {
+ button = gtk_button_new_with_label(rejecttext);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_back_gtk_decision_callback, (void *) -1 /* reject */);
+ gtk_container_add(GTK_CONTAINER(hbox), button);
+ gtk_widget_show(button);
+ }
+ gtk_widget_show(hbox);
+
+ gtk_widget_show(decision_dialog);
+
+ if (!wait)
+ {
+ return TRUE;
+ }
+
+ decision_flag = 0;
+
+ while (decision_flag == 0)
+ {
+ gtk_main_iteration();
+ }
+
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ if (decision_flag == 1)
+ {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_message(gchar *title, gchar **icon_xpm, gchar *message, gint wait)
+{
+ xsane_back_gtk_decision(title, icon_xpm, message, ERR_BUTTON_OK, 0 /* no reject text */, wait);
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_error(gchar *error, gint wait)
+{
+ if (wait)
+ {
+ SANE_Int old_sensitivity = xsane.sensitivity;
+
+ xsane_set_sensitivity(FALSE);
+ xsane_back_gtk_message(ERR_HEADER_ERROR, (gchar**) error_xpm, error, wait);
+ xsane_set_sensitivity(old_sensitivity);
+ }
+ else
+ {
+ xsane_back_gtk_message(ERR_HEADER_ERROR, (gchar **) error_xpm, error, wait);
+ }
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_warning(gchar *warning, gint wait)
+{
+ if (wait)
+ {
+ SANE_Int old_sensitivity = xsane.sensitivity;
+
+ xsane_set_sensitivity(FALSE);
+ xsane_back_gtk_message(ERR_HEADER_WARNING, (gchar**) warning_xpm, warning, wait);
+ xsane_set_sensitivity(old_sensitivity);
+ }
+ else
+ {
+ xsane_back_gtk_message(ERR_HEADER_WARNING, (gchar**) warning_xpm, warning, wait);
+ }
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_back_gtk_get_filename_button_clicked(GtkWidget *w, gpointer data)
+{
+ int *clicked = data;
+ *clicked = 1;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+int xsane_back_gtk_get_filename(const char *label, const char *default_name, size_t max_len, char *filename, int show_fileopts)
+{
+ int cancel = 0, ok = 0, destroy = 0;
+ GtkWidget *fileselection;
+
+ fileselection = gtk_file_selection_new((char *) label);
+
+ gtk_signal_connect(GTK_OBJECT(fileselection),
+ "destroy", GTK_SIGNAL_FUNC(xsane_back_gtk_get_filename_button_clicked), &destroy);
+ gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fileselection)->cancel_button),
+ "clicked", (GtkSignalFunc) xsane_back_gtk_get_filename_button_clicked, &cancel);
+ gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fileselection)->ok_button),
+ "clicked", (GtkSignalFunc) xsane_back_gtk_get_filename_button_clicked, &ok);
+ if (default_name)
+ {
+ gtk_file_selection_set_filename(GTK_FILE_SELECTION(fileselection), (char *) default_name);
+ }
+
+ if (show_fileopts)
+ {
+ gtk_file_selection_show_fileop_buttons(GTK_FILE_SELECTION(fileselection));
+ }
+ else
+ {
+ gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(fileselection));
+ }
+
+ gtk_widget_show(fileselection);
+
+ while (!cancel && !ok && !destroy)
+ {
+ if (!gtk_events_pending())
+ {
+ usleep(100000);
+ }
+ gtk_main_iteration();
+ }
+
+ if (ok)
+ {
+ size_t len, cwd_len;
+ char *cwd;
+
+ strncpy(filename, gtk_file_selection_get_filename(GTK_FILE_SELECTION(fileselection)), max_len - 1);
+ filename[max_len - 1] = '\0';
+
+ len = strlen(filename);
+ cwd = alloca(len + 2);
+ getcwd(cwd, len + 1);
+ cwd_len = strlen(cwd);
+ cwd[cwd_len++] = '/';
+ cwd[cwd_len] = '\0';
+ if (strncmp(filename, cwd, cwd_len) == 0)
+ {
+ memcpy(filename, filename + cwd_len, len - cwd_len + 1);
+ }
+ }
+
+ if (!destroy)
+ {
+ gtk_widget_destroy(fileselection);
+ }
+
+ return ok ? 0 : -1;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static gint xsane_back_gtk_autobutton_update(GtkWidget *widget, GSGDialogElement *elem)
+{
+ GSGDialog *dialog = elem->dialog;
+ int opt_num = elem - dialog->element;
+ const SANE_Option_Descriptor *opt;
+ SANE_Status status;
+ SANE_Word val;
+ char buf[256];
+
+ opt = sane_get_option_descriptor(dialog->dev, opt_num);
+ if (GTK_TOGGLE_BUTTON(widget)->active)
+ {
+ xsane_back_gtk_set_option(dialog, opt_num, 0, SANE_ACTION_SET_AUTO);
+ }
+ else
+ {
+ status = sane_control_option(dialog->dev, opt_num, SANE_ACTION_GET_VALUE, &val, 0);
+ if (status != SANE_STATUS_GOOD)
+ {
+ snprintf(buf, sizeof(buf), "%s %s: %s.", ERR_GET_OPTION, opt->name, XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(buf, FALSE);
+ }
+ xsane_back_gtk_set_option(dialog, opt_num, &val, SANE_ACTION_SET_VALUE);
+ }
+ return FALSE;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_back_gtk_autobutton_new(GtkWidget *parent, GSGDialogElement *elem,
+ GtkWidget *label, GtkTooltips *tooltips)
+{
+ GtkWidget *button, *alignment;
+
+ button = gtk_check_button_new();
+ gtk_container_set_border_width(GTK_CONTAINER(button), 0);
+ gtk_widget_set_usize(button, 20, 20);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_back_gtk_autobutton_update, elem);
+ xsane_back_gtk_set_tooltip(tooltips, button, "Turns on automatic mode.");
+
+ alignment = gtk_alignment_new(0.0, 1.0, 0.5, 0.5);
+ gtk_container_add(GTK_CONTAINER(alignment), button);
+
+ gtk_box_pack_end(GTK_BOX(parent), label, FALSE, FALSE, 0);
+ gtk_box_pack_end(GTK_BOX(parent), alignment, FALSE, FALSE, 2);
+
+ gtk_widget_show(alignment);
+ gtk_widget_show(button);
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static gint xsane_back_gtk_button_update(GtkWidget * widget, GSGDialogElement * elem)
+{
+ GSGDialog *dialog = elem->dialog;
+ int opt_num = elem - dialog->element;
+ const SANE_Option_Descriptor *opt;
+ SANE_Word val = SANE_FALSE;
+
+ opt = sane_get_option_descriptor(dialog->dev, opt_num);
+ if (GTK_TOGGLE_BUTTON(widget)->active)
+ {
+ val = SANE_TRUE;
+ }
+ xsane_back_gtk_set_option(dialog, opt_num, &val, SANE_ACTION_SET_VALUE);
+
+ return FALSE;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_button_new(GtkWidget * parent, const char *name, SANE_Word val,
+ GSGDialogElement * elem, GtkTooltips *tooltips, const char *desc, SANE_Int settable)
+{
+ GtkWidget *button;
+
+ button = gtk_check_button_new_with_label((char *) name);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), val);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_back_gtk_button_update, elem);
+ gtk_box_pack_start(GTK_BOX(parent), button, FALSE, TRUE, 0);
+ gtk_widget_show(button);
+ xsane_back_gtk_set_tooltip(tooltips, button, desc);
+
+ gtk_widget_set_sensitive(button, settable);
+
+ elem->widget = button;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_back_gtk_scale_update(GtkAdjustment * adj_data, GSGDialogElement * elem)
+{
+ const SANE_Option_Descriptor *opt;
+ GSGDialog *dialog = elem->dialog;
+ SANE_Word val, new_val;
+ int opt_num;
+ double d;
+
+ opt_num = elem - dialog->element;
+ opt = sane_get_option_descriptor(dialog->dev, opt_num);
+ switch(opt->type)
+ {
+ case SANE_TYPE_INT:
+ val = adj_data->value + 0.5;
+ break;
+
+ case SANE_TYPE_FIXED:
+ d = adj_data->value;
+ if (opt->unit == SANE_UNIT_MM)
+ {
+ d *= preferences.length_unit;
+ }
+ val = SANE_FIX(d);
+ break;
+
+ default:
+ fprintf(stderr, "xsane_back_gtk_scale_update: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ return;
+ }
+
+ xsane_back_gtk_set_option(dialog, opt_num, &val, SANE_ACTION_SET_VALUE);
+ sane_control_option(dialog->dev, opt_num, SANE_ACTION_GET_VALUE, &new_val, 0);
+ if (new_val != val)
+ {
+ val = new_val;
+ goto value_changed;
+ }
+ return; /* value didn't change */
+
+value_changed:
+ switch(opt->type)
+ {
+ case SANE_TYPE_INT:
+ adj_data->value = val;
+ break;
+
+ case SANE_TYPE_FIXED:
+ d = SANE_UNFIX(val);
+ if (opt->unit == SANE_UNIT_MM)
+ {
+ d /= preferences.length_unit;
+ }
+ adj_data->value = d;
+ break;
+
+ default:
+ break;
+ }
+ /* Let widget know that value changed _again_. This must converge
+ quickly---otherwise things would get very slow very quickly (as
+ in "infinite recursion"): */
+ gtk_signal_emit_by_name(GTK_OBJECT(adj_data), "value_changed");
+ return;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_scale_new(GtkWidget * parent, const char *name, gfloat val,
+ gfloat min, gfloat max, gfloat quant, int automatic,
+ GSGDialogElement * elem, GtkTooltips *tooltips, const char *desc, SANE_Int settable)
+{
+ GtkWidget *hbox, *label, *scale;
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 0);
+ gtk_box_pack_start(GTK_BOX(parent), hbox, FALSE, FALSE, 0);
+
+ label = gtk_label_new((char *) name);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+
+ elem->data = gtk_adjustment_new(val, min, max, quant, 1.0, 0.0);
+ scale = gtk_hscale_new(GTK_ADJUSTMENT(elem->data));
+ xsane_back_gtk_set_tooltip(tooltips, scale, desc);
+ gtk_widget_set_usize(scale, 150, 0);
+
+ if (automatic)
+ {
+ xsane_back_gtk_autobutton_new(hbox, elem, scale, tooltips);
+ }
+ else
+ {
+ gtk_box_pack_end(GTK_BOX(hbox), scale, FALSE, FALSE, 0); /* make scales fixed */
+/* gtk_box_pack_end(GTK_BOX(hbox), scale, TRUE, TRUE, 0); */ /* make scales sizeable */
+ }
+
+ gtk_range_set_update_policy(GTK_RANGE(scale), GTK_UPDATE_CONTINUOUS);
+ gtk_scale_set_value_pos(GTK_SCALE(scale), GTK_POS_TOP);
+ if (quant - (int) quant == 0.0)
+ {
+ gtk_scale_set_digits(GTK_SCALE(scale), 0);
+ }
+ else
+ {
+ /* one place behind decimal point */
+ gtk_scale_set_digits(GTK_SCALE(scale), 1);
+ }
+
+ gtk_signal_connect(elem->data, "value_changed", (GtkSignalFunc) xsane_back_gtk_scale_update, elem);
+
+ gtk_widget_show(label);
+ gtk_widget_show(scale);
+ gtk_widget_show(hbox);
+
+ gtk_widget_set_sensitive(scale, settable);
+
+ elem->widget = scale;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_push_button_callback(GtkWidget * widget, gpointer data)
+{
+ GSGDialogElement *elem = data;
+ GSGDialog *dialog = elem->dialog;
+ int opt_num;
+
+ opt_num = elem - dialog->element;
+ xsane_back_gtk_set_option(dialog, opt_num, 0, SANE_ACTION_SET_VALUE);
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static int xsane_back_gtk_option_menu_lookup(GSGMenuItem menu_items[], const char *string)
+{
+ int i;
+
+ for (i = 0; strcmp(menu_items[i].label, string) != 0; ++i);
+
+ return i;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_back_gtk_option_menu_callback(GtkWidget * widget, gpointer data)
+{
+ GSGMenuItem *menu_item = data;
+ GSGDialogElement *elem = menu_item->elem;
+ const SANE_Option_Descriptor *opt;
+ GSGDialog *dialog = elem->dialog;
+ int opt_num;
+ double dval;
+ SANE_Word val;
+ void *valp = &val;
+
+ opt_num = elem - dialog->element;
+ opt = sane_get_option_descriptor(dialog->dev, opt_num);
+ switch(opt->type)
+ {
+ case SANE_TYPE_INT:
+ sscanf(menu_item->label, "%d", &val);
+ break;
+
+ case SANE_TYPE_FIXED:
+ sscanf(menu_item->label, "%lg", &dval);
+ val = SANE_FIX(dval);
+ break;
+
+ case SANE_TYPE_STRING:
+ valp = menu_item->label;
+ break;
+
+ default:
+ fprintf(stderr, "xsane_back_gtk_option_menu_callback: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ break;
+ }
+ xsane_back_gtk_set_option(dialog, opt_num, valp, SANE_ACTION_SET_VALUE);
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_option_menu_new(GtkWidget *parent, const char *name, char *str_list[],
+ const char *val, GSGDialogElement * elem,
+ GtkTooltips *tooltips, const char *desc, SANE_Int settable)
+{
+ GtkWidget *hbox, *label, *option_menu, *menu, *item;
+ GSGMenuItem *menu_items;
+ int i, num_items;
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 0);
+ gtk_box_pack_start(GTK_BOX(parent), hbox, FALSE, FALSE, 0);
+
+ label = gtk_label_new((char *) name);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+
+ for (num_items = 0; str_list[num_items]; ++num_items);
+ menu_items = malloc(num_items * sizeof(menu_items[0]));
+
+ menu = gtk_menu_new();
+ for (i = 0; i < num_items; ++i)
+ {
+ item = gtk_menu_item_new_with_label(_BGT(str_list[i]));
+ gtk_container_add(GTK_CONTAINER(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_back_gtk_option_menu_callback, menu_items + i);
+
+ gtk_widget_show(item);
+
+ menu_items[i].label = str_list[i];
+ menu_items[i].elem = elem;
+ menu_items[i].index = i;
+ }
+
+ option_menu = gtk_option_menu_new();
+ gtk_box_pack_end(GTK_BOX(hbox), option_menu, FALSE, FALSE, 2);
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu);
+ gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), xsane_back_gtk_option_menu_lookup(menu_items, val));
+ xsane_back_gtk_set_tooltip(tooltips, option_menu, desc);
+
+ gtk_widget_show(label);
+ gtk_widget_show(option_menu);
+ gtk_widget_show(hbox);
+
+ gtk_widget_set_sensitive(option_menu, settable);
+
+ elem->widget = option_menu;
+ elem->menu_size = num_items;
+ elem->menu = menu_items;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_back_gtk_text_entry_callback(GtkWidget *w, gpointer data)
+{
+ GSGDialogElement *elem = data;
+ const SANE_Option_Descriptor *opt;
+ GSGDialog *dialog = elem->dialog;
+ gchar *text;
+ int opt_num;
+ char *buf;
+
+ opt_num = elem - dialog->element;
+ opt = sane_get_option_descriptor(dialog->dev, opt_num);
+
+ buf = alloca(opt->size);
+ buf[0] = '\0';
+
+ text = gtk_entry_get_text(GTK_ENTRY(elem->widget));
+ if (text)
+ {
+ strncpy(buf, text, opt->size);
+ }
+ buf[opt->size - 1] = '\0';
+
+ xsane_back_gtk_set_option(dialog, opt_num, buf, SANE_ACTION_SET_VALUE);
+
+ if (strcmp(buf, text) != 0) /* the backend modified the option value; update widget: */
+ {
+ gtk_entry_set_text(GTK_ENTRY(elem->widget), buf);
+ }
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_text_entry_new(GtkWidget * parent, const char *name, const char *val, GSGDialogElement *elem,
+ GtkTooltips *tooltips, const char *desc, SANE_Int settable)
+{
+ GtkWidget *hbox, *text, *label;
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 0);
+ gtk_box_pack_start(GTK_BOX(parent), hbox, FALSE, FALSE, 0);
+
+ label = gtk_label_new((char *) name);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+
+ text = gtk_entry_new();
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) val);
+/* gtk_box_pack_start(GTK_BOX(hbox), text, FALSE, TRUE, 0); */ /* text entry fixed */
+ gtk_box_pack_start(GTK_BOX(hbox), text, TRUE, TRUE, 0); /* text entry sizeable */
+ gtk_signal_connect(GTK_OBJECT(text), "changed", (GtkSignalFunc) xsane_back_gtk_text_entry_callback, elem);
+ xsane_back_gtk_set_tooltip(tooltips, text, desc);
+
+ gtk_widget_show(hbox);
+ gtk_widget_show(label);
+ gtk_widget_show(text);
+
+ gtk_widget_set_sensitive(text, settable);
+
+ elem->widget = text;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+GtkWidget *xsane_back_gtk_group_new(GtkWidget *parent, const char * title)
+{
+ GtkWidget * frame, * vbox;
+
+ frame = gtk_frame_new((char *) title);
+ gtk_container_set_border_width(GTK_CONTAINER(frame), 4);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
+ gtk_box_pack_start(GTK_BOX(parent), frame, FALSE, FALSE, 0);
+
+ vbox = gtk_vbox_new(FALSE, 4);
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), 2);
+ gtk_container_add(GTK_CONTAINER(frame), vbox);
+ gtk_widget_show(vbox);
+ return vbox;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+#if 0
+static GtkWidget* xsane_back_gtk_curve_new(GSGDialog *dialog, int optnum)
+{
+ const SANE_Option_Descriptor * opt;
+ gfloat fmin, fmax, val, *vector;
+ SANE_Word *optval, min, max;
+ GtkWidget *curve, *gamma;
+ SANE_Status status;
+ SANE_Handle dev;
+ int i, optlen;
+
+ gamma = gtk_gamma_curve_new();
+ curve = GTK_GAMMA_CURVE(gamma)->curve;
+ dev = dialog->dev;
+
+ opt = sane_get_option_descriptor(dev, optnum);
+ optlen = opt->size / sizeof(SANE_Word);
+ vector = alloca(optlen * (sizeof(vector[0]) + sizeof(optval[0])));
+ optval = (SANE_Word *) (vector + optlen);
+
+ min = max = 0;
+ switch(opt->constraint_type)
+ {
+ case SANE_CONSTRAINT_RANGE:
+ min = opt->constraint.range->min;
+ max = opt->constraint.range->max;
+ break;
+
+ case SANE_CONSTRAINT_WORD_LIST:
+ if (opt->constraint.word_list[0] > 1)
+ {
+ min = max = opt->constraint.word_list[1];
+ for (i = 2; i < opt->constraint.word_list[0]; ++i)
+ {
+ if (opt->constraint.word_list[i] < min)
+ {
+ min = opt->constraint.word_list[i];
+ }
+
+ if (opt->constraint.word_list[i] > max)
+ {
+ max = opt->constraint.word_list[i];
+ }
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ if (min == max)
+ {
+ fprintf(stderr, "xsane_back_gtk_curve_new: %s: `%s'\n", WARN_NO_VALUE_CONSTRAINT, opt->name);
+ fmin = 0;
+ fmax = 255;
+ }
+ else if (opt->type == SANE_TYPE_FIXED)
+ {
+ fmin = SANE_UNFIX(min);
+ fmax = SANE_UNFIX(max);
+ }
+ else
+ {
+ fmin = min;
+ fmax = max;
+ }
+ gtk_curve_set_range(GTK_CURVE(curve), 0, optlen - 1, fmin, fmax);
+
+ status = sane_control_option(dev, optnum, SANE_ACTION_GET_VALUE, optval, 0);
+ if (status == SANE_STATUS_GOOD)
+ {
+ for (i = 0; i < optlen; ++i)
+ {
+ if (opt->type == SANE_TYPE_FIXED)
+ {
+ val = SANE_UNFIX(optval[i]);
+ }
+ else
+ {
+ val = optval[i];
+ }
+ vector[i] = val;
+ }
+ gtk_curve_set_vector(GTK_CURVE(curve), optlen, vector);
+ }
+ else
+ {
+ gtk_widget_set_sensitive(gamma, FALSE);
+ }
+
+ return gamma;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_back_gtk_vector_new(GSGDialog * dialog, GtkWidget *vbox, int num_vopts, int *vopts)
+{
+ GtkWidget *notebook, *label, *curve;
+ const SANE_Option_Descriptor *opt;
+ int i;
+
+ notebook = gtk_notebook_new();
+ gtk_container_set_border_width(GTK_CONTAINER(notebook), 4);
+ gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
+
+ for (i = 0; i < num_vopts; ++i)
+ {
+ opt = sane_get_option_descriptor(dialog->dev, vopts[i]);
+
+ label = gtk_label_new((char *) opt->title);
+ vbox = gtk_vbox_new(/* homogeneous */ FALSE, 0);
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label);
+ gtk_widget_show(vbox);
+ gtk_widget_show(label);
+
+ curve = xsane_back_gtk_curve_new(dialog, vopts[i]);
+ gtk_container_set_border_width(GTK_CONTAINER(curve), 4);
+ gtk_box_pack_start(GTK_BOX(vbox), curve, TRUE, TRUE, 0);
+ gtk_widget_show(curve);
+
+ dialog->element[vopts[i]].widget = curve;
+ }
+ gtk_widget_show(notebook);
+}
+#endif
+/* ----------------------------------------------------------------------------------------------------------------- */
+#if 0
+static void tooltips_destroy(GSGDialog * dialog)
+{
+ gtk_object_unref(GTK_OBJECT(dialog->tooltips));
+ dialog->tooltips = 0;
+}
+#endif
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_back_gtk_panel_destroy(GSGDialog * dialog)
+{
+ const SANE_Option_Descriptor *opt;
+ GSGDialogElement *elem;
+ int i, j;
+
+ gtk_widget_destroy(dialog->xsane_hbox);
+ gtk_widget_destroy(dialog->standard_hbox);
+ gtk_widget_destroy(dialog->advanced_hbox);
+
+ /* free the menu labels of integer/fix-point word-lists: */
+ for (i = 0; i < dialog->num_elements; ++i)
+ {
+ if (dialog->element[i].menu)
+ {
+ opt = sane_get_option_descriptor(dialog->dev, i);
+ elem = dialog->element + i;
+ if (opt->type != SANE_TYPE_STRING)
+ {
+ for (j = 0; j < elem->menu_size; ++j)
+ {
+ if (elem->menu[j].label)
+ {
+ free(elem->menu[j].label);
+ elem->menu[j].label = 0;
+ }
+ }
+ free(elem->menu);
+ elem->menu = 0;
+ }
+ }
+ }
+ memset(dialog->element, 0, dialog->num_elements * sizeof(dialog->element[0]));
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+/* When an setting an option changes the dialog, everything may
+ change: the option titles, the activity-status of the option, its
+ constraints or what not. Thus, rather than trying to be clever in
+ detecting what exactly changed, we use a brute-force method of
+ rebuilding the entire dialog. */
+
+static void xsane_back_gtk_panel_rebuild(GSGDialog * dialog)
+{
+ xsane_back_gtk_panel_destroy(dialog);
+ xsane_panel_build(dialog);
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_refresh_dialog(GSGDialog *dialog)
+{
+ xsane_back_gtk_panel_rebuild(dialog);
+ if (dialog->param_change_callback)
+ {
+ (*dialog->param_change_callback) (dialog, dialog->param_change_arg);
+ }
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_update_scan_window(GSGDialog *dialog)
+{
+ const SANE_Option_Descriptor *opt;
+ double old_val, new_val;
+ GSGDialogElement *elem;
+ SANE_Status status;
+ SANE_Word word;
+ int i, optnum;
+ char str[64];
+
+ for (i = 0; i < 4; ++i)
+ {
+ if (dialog->well_known.coord[i] > 0)
+ {
+ optnum = dialog->well_known.coord[i];
+ elem = dialog->element + optnum;
+ opt = sane_get_option_descriptor(dialog->dev, optnum);
+
+ status = sane_control_option(dialog->dev, optnum, SANE_ACTION_GET_VALUE, &word, 0);
+ if (status != SANE_STATUS_GOOD)
+ {
+ continue; /* sliently ignore errors */
+ }
+
+ switch(opt->constraint_type)
+ {
+ case SANE_CONSTRAINT_RANGE:
+ if (opt->type == SANE_TYPE_INT)
+ {
+ old_val = GTK_ADJUSTMENT(elem->data)->value;
+ new_val = word;
+ GTK_ADJUSTMENT(elem->data)->value = new_val;
+ }
+ else
+ {
+ old_val = GTK_ADJUSTMENT(elem->data)->value;
+ new_val = SANE_UNFIX(word);
+ if (opt->unit == SANE_UNIT_MM)
+ {
+ new_val /= preferences.length_unit;
+ }
+ GTK_ADJUSTMENT(elem->data)->value = new_val;
+ }
+
+ if (old_val != new_val)
+ {
+ gtk_signal_emit_by_name(GTK_OBJECT(elem->data), "value_changed");
+ }
+ break;
+
+ case SANE_CONSTRAINT_WORD_LIST:
+ if (opt->type == SANE_TYPE_INT)
+ {
+ sprintf(str, "%d", word);
+ }
+ else
+ {
+ sprintf(str, "%g", SANE_UNFIX(word));
+ }
+ /* XXX maybe we should call this only when the value changes... */
+ gtk_option_menu_set_history(GTK_OPTION_MENU(elem->widget), xsane_back_gtk_option_menu_lookup(elem->menu, str));
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+/* Ensure sure the device has up-to-date option values. Except for
+ vectors, all option values are kept current. Vectors are
+ downloaded into the device during this call. */
+void xsane_back_gtk_sync(GSGDialog *dialog)
+{
+ const SANE_Option_Descriptor *opt;
+ gfloat val, *vector;
+ SANE_Word *optval;
+ int i, j, optlen;
+ GtkWidget *curve;
+
+ for (i = 1; i < dialog->num_elements; ++i)
+ {
+ opt = sane_get_option_descriptor(dialog->dev, i);
+
+ if (!SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ continue;
+ }
+
+ if (opt->type != SANE_TYPE_INT && opt->type != SANE_TYPE_FIXED)
+ {
+ continue;
+ }
+
+ if (opt->size == sizeof(SANE_Word))
+ {
+ continue;
+ }
+
+ /* ok, we're dealing with an active vector */
+
+ optlen = opt->size / sizeof(SANE_Word);
+ optval = alloca(optlen * sizeof(optval[0]));
+ vector = alloca(optlen * sizeof(vector[0]));
+
+ curve = GTK_GAMMA_CURVE(dialog->element[i].widget)->curve;
+ gtk_curve_get_vector(GTK_CURVE(curve), optlen, vector);
+ for (j = 0; j < optlen; ++j)
+ {
+ val = vector[j];
+ if (opt->type == SANE_TYPE_FIXED)
+ {
+ optval[j] = SANE_FIX(val);
+ }
+ else
+ {
+ optval[j] = val + 0.5;
+ }
+ }
+
+ xsane_back_gtk_set_option(dialog, i, optval, SANE_ACTION_SET_VALUE);
+ }
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_update_vector(GSGDialog *dialog, int opt_num, SANE_Int *vector)
+{
+ const SANE_Option_Descriptor *opt;
+ gfloat val;
+ SANE_Word *optval;
+ int j, optlen;
+
+ if (opt_num < 1)
+ return; /* not defined */
+
+ opt = sane_get_option_descriptor(dialog->dev, opt_num);
+ if (!SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ return; /* inactive */
+ }
+
+ if (opt->type != SANE_TYPE_INT && opt->type != SANE_TYPE_FIXED)
+ {
+ return;
+ }
+
+ if (opt->size == sizeof(SANE_Word))
+ {
+ return;
+ }
+
+ /* ok, we're dealing with an active vector */
+
+ optlen = opt->size / sizeof(SANE_Word);
+ optval = alloca(optlen * sizeof(optval[0]));
+ for (j = 0; j < optlen; ++j)
+ {
+ val = vector[j];
+ if (opt->type == SANE_TYPE_FIXED)
+ {
+ optval[j] = SANE_FIX(val);
+ }
+ else
+ {
+ optval[j] = val + 0.5;
+ }
+ }
+
+ xsane_back_gtk_set_option(dialog, opt_num, optval, SANE_ACTION_SET_VALUE);
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_set_tooltips(GSGDialog *dialog, int enable)
+{
+ if (!dialog->tooltips)
+ {
+ return;
+ }
+
+ if (enable)
+ {
+ gtk_tooltips_enable(dialog->tooltips);
+ }
+ else
+ {
+ gtk_tooltips_disable(dialog->tooltips);
+ }
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_set_sensitivity(GSGDialog *dialog, int sensitive)
+{
+ const SANE_Option_Descriptor *opt;
+ int i;
+
+ for (i = 0; i < dialog->num_elements; ++i)
+ {
+ opt = sane_get_option_descriptor(dialog->dev, i);
+
+ if (!SANE_OPTION_IS_ACTIVE(opt->cap) || !SANE_OPTION_IS_SETTABLE(opt->cap) ||
+ opt->type == SANE_TYPE_GROUP || !dialog->element[i].widget)
+ {
+ continue;
+ }
+
+ if (!(opt->cap & SANE_CAP_ALWAYS_SETTABLE))
+ {
+ gtk_widget_set_sensitive(dialog->element[i].widget, sensitive);
+ }
+ }
+
+ if (dialog)
+ {
+ if (dialog->xsanemode_widget)
+ {
+ gtk_widget_set_sensitive(dialog->xsanemode_widget, sensitive);
+ }
+ }
+
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+}
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_set_sensitivity(SANE_Int sensitivity)
+{
+ if (xsane.shell)
+ {
+ gtk_widget_set_sensitive(xsane.shell, sensitivity);
+ gtk_widget_set_sensitive(xsane.standard_options_shell, sensitivity);
+ gtk_widget_set_sensitive(xsane.advanced_options_shell, sensitivity);
+ gtk_widget_set_sensitive(xsane.histogram_dialog, sensitivity);
+ }
+
+ if (xsane.preview)
+ {
+ gtk_widget_set_sensitive(xsane.preview->button_box, sensitivity); /* button box at top of window */
+#if 0
+ gtk_widget_set_sensitive(xsane.preview->viewport, sensitivity); /* Preview image selection */
+#endif
+ gtk_widget_set_sensitive(xsane.preview->start, sensitivity); /* Acquire preview button */
+ }
+
+ if (xsane.fax_dialog)
+ {
+ gtk_widget_set_sensitive(xsane.fax_dialog, sensitivity);
+ }
+
+ if (dialog)
+ {
+ xsane_back_gtk_set_sensitivity(dialog, sensitivity);
+ }
+
+ while (gtk_events_pending()) /* make sure set_sensitivity is displayed */
+ {
+ gtk_main_iteration();
+ }
+
+ xsane.sensitivity = sensitivity;
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+void xsane_back_gtk_destroy_dialog(GSGDialog * dialog)
+{
+ SANE_Handle dev = dialog->dev;
+
+ xsane_back_gtk_panel_destroy(dialog);
+ free((void *) dialog->dev_name);
+ free(dialog->element);
+ free(dialog);
+
+ sane_close(dev);
+}
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_set_window_icon(GtkWidget *gtk_window, gchar **xpm_d)
+{
+ GdkPixmap *pixmap;
+ GdkBitmap *mask;
+
+ gtk_widget_realize(gtk_window);
+ if (xpm_d)
+ {
+ pixmap = gdk_pixmap_create_from_xpm_d(gtk_window->window, &mask, xsane.bg_trans, xpm_d);
+ }
+ else
+ {
+ if (xsane.window_icon_pixmap)
+ {
+ pixmap = xsane.window_icon_pixmap;
+ mask = xsane.window_icon_mask;
+ }
+ else
+ {
+ pixmap = gdk_pixmap_create_from_xpm_d(gtk_window->window, &mask, xsane.bg_trans, (gchar **) xsane_window_icon_xpm);
+ }
+ }
+
+ gdk_window_set_icon(gtk_window->window, 0, pixmap, mask);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
diff --git a/frontend/xsane-back-gtk.h b/frontend/xsane-back-gtk.h
new file mode 100644
index 0000000..af1d55a
--- /dev/null
+++ b/frontend/xsane-back-gtk.h
@@ -0,0 +1,188 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-back-gtk.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifndef xsane_back_gtk_h
+#define xsane_back_gtk_h
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include <sys/types.h>
+
+#include <gtk/gtk.h>
+
+#include <sane/config.h>
+#include <sane/sane.h>
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+enum
+{
+ XSANE_PATH_LOCAL_SANE = 0,
+ XSANE_PATH_SYSTEM,
+ XSANE_PATH_TMP
+};
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+struct GSGDialog;
+
+typedef void (*GSGCallback) (struct GSGDialog *dialog, void *arg);
+typedef GtkWidget *(*XSANECallback) (void);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+typedef enum
+ {
+ xsane_back_gtk_TL_X, /* top-left x */
+ xsane_back_gtk_TL_Y, /* top-left y */
+ xsane_back_gtk_BR_X, /* bottom-right x */
+ xsane_back_gtk_BR_Y /* bottom-right y */
+ }
+GSGCornerCoordinates;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+typedef struct
+ {
+ /* The option number of the well-known options. Each of these may
+ be -1 in case the backend doesn't define the respective option. */
+ int scanmode;
+ int scansource;
+ int preview;
+ int dpi;
+ int dpi_x;
+ int dpi_y;
+ int coord[4];
+ int gamma_vector;
+ int gamma_vector_r;
+ int gamma_vector_g;
+ int gamma_vector_b;
+ int bit_depth;
+ }
+GSGWellKnownOptions;
+
+typedef struct
+ {
+ gchar *label;
+ struct GSGDialogElement *elem;
+ gint index;
+ }
+GSGMenuItem;
+
+typedef struct GSGDialogElement
+ {
+ struct GSGDialog *dialog; /* wasteful, but is there a better solution? */
+ GtkWidget *automatic; /* auto button for options that support this */
+ GtkWidget *widget;
+ GtkObject *data;
+ int menu_size; /* # of items in menu (if any) */
+ GSGMenuItem *menu;
+ }
+GSGDialogElement;
+
+typedef struct GSGDialog
+ {
+ GtkWidget *xsane_window;
+ GtkWidget *standard_window;
+ GtkWidget *advanced_window;
+ GtkWidget *xsane_hbox;
+ GtkWidget *standard_hbox;
+ GtkWidget *advanced_hbox;
+ GtkWidget *xsanemode_widget;
+ GtkTooltips *tooltips;
+ GdkColor tooltips_fg;
+ GdkColor tooltips_bg;
+ SANE_Handle *dev;
+ const char *dev_name;
+ GSGWellKnownOptions well_known;
+ int num_elements;
+ GSGDialogElement *element;
+ gint idle_id;
+ u_int rebuild : 1;
+ /* This callback gets invoked whenever the backend notifies us
+ that the option descriptors have changed. */
+ GSGCallback option_reload_callback;
+ void *option_reload_arg;
+ /* This callback gets invoked whenever the backend notifies us
+ that the parameters have changed. */
+ GSGCallback param_change_callback;
+ void *param_change_arg;
+ XSANECallback update_xsane_callback;
+ void *update_xsane_arg;
+ int pixelcolor;
+ }
+GSGDialog;
+
+extern int xsane_back_gtk_message_dialog_active;
+
+/* Construct the path and return it in filename_ret (this buffer must
+ be at least max_len bytes long). The path is constructed as
+ follows:
+
+ ~/.sane/${PROG_NAME}/${PREFIX}${DEV_NAME}${POSTFIX}
+
+ If PROG_NAME is NULL, an empty string is used and the leading slash
+ is removed. On success, 0 is returned, on error a negative number and
+ ERRNO is set to the appropriate value. */
+extern int xsane_back_gtk_make_path(size_t max_len, char *filename_ret,
+ const char *prog_name,
+ const char *dir_name,
+ const char *prefix, const char *dev_name,
+ const char *postfix,
+ int local);
+extern gint xsane_back_gtk_decision(gchar *title, gchar** icon_xpm, gchar *message, gchar *oktext, gchar *rejecttext, gint wait);
+extern void xsane_back_gtk_message(gchar *title, gchar** icon_xpm, gchar *message, gint wait);
+extern void xsane_back_gtk_error(gchar *error_message, gint wait);
+extern void xsane_back_gtk_warning(gchar *warning_message, gint wait);
+extern int xsane_back_gtk_get_filename(const char *label, const char *default_name,
+ size_t max_len, char *filename, int show_fileopts);
+
+extern void xsane_back_gtk_sync(GSGDialog *dialog);
+extern void xsane_back_gtk_update_vector(GSGDialog *dialog, int opt_num, SANE_Int *vector);
+extern void xsane_back_gtk_refresh_dialog(GSGDialog *dialog);
+extern void xsane_back_gtk_update_scan_window(GSGDialog *dialog);
+extern void xsane_back_gtk_set_advanced(GSGDialog *dialog, int advanced);
+extern void xsane_back_gtk_set_tooltips(GSGDialog *dialog, int enable);
+extern void xsane_back_gtk_set_tooltip(GtkTooltips *tooltips, GtkWidget *widget, const char *desc);
+extern void xsane_back_gtk_set_sensitivity(GSGDialog *dialog, int sensitive);
+extern void xsane_set_sensitivity(SANE_Int sensitivity);
+extern void xsane_back_gtk_destroy_dialog(GSGDialog *dialog);
+extern void xsane_back_gtk_set_option(GSGDialog * dialog, int opt_num, void *val, SANE_Action action);
+extern GtkWidget *xsane_back_gtk_group_new (GtkWidget *parent, const char * title);
+extern void xsane_back_gtk_button_new(GtkWidget * parent, const char *name, SANE_Word val,
+ GSGDialogElement *elem, GtkTooltips *tooltips, const char *desc, SANE_Int settable);
+extern void xsane_back_gtk_scale_new(GtkWidget * parent, const char *name, gfloat val,
+ gfloat min, gfloat max, gfloat quant, int automatic,
+ GSGDialogElement *elem, GtkTooltips *tooltips, const char *desc, SANE_Int settable);
+extern void xsane_back_gtk_option_menu_new(GtkWidget *parent, const char *name, char *str_list[],
+ const char *val, GSGDialogElement * elem, GtkTooltips *tooltips, const char *desc, SANE_Int settable);
+extern void xsane_back_gtk_text_entry_new(GtkWidget *parent, const char *name, const char *val,
+ GSGDialogElement *elem, GtkTooltips *tooltips, const char *desc, SANE_Int settable);
+extern void xsane_back_gtk_push_button_callback(GtkWidget * widget, gpointer data);
+extern const char *xsane_back_gtk_unit_string(SANE_Unit unit);
+void xsane_set_window_icon(GtkWidget *gtk_window, gchar **xpm_d);
+
+#define xsane_back_gtk_dialog_get_device(dialog) ((dialog)->dev)
+
+#endif /* gtkglue_h */
diff --git a/frontend/xsane-device-preferences.c b/frontend/xsane-device-preferences.c
new file mode 100644
index 0000000..cce2007
--- /dev/null
+++ b/frontend/xsane-device-preferences.c
@@ -0,0 +1,699 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-device-preferences.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+#include "xsane.h"
+#include "xsane-rc-io.h"
+#include "xsane-front-gtk.h"
+#include "xsane-gamma.h"
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+#define BITS_PER_LONG (8*sizeof(u_long))
+
+#define SET(set, bit) ((set)[(bit)/BITS_PER_LONG] |= (1UL << (bit)%BITS_PER_LONG))
+#define IS_SET(set, bit) (((set)[(bit)/BITS_PER_LONG] & (1UL << (bit)%BITS_PER_LONG)) != 0)
+
+#define DPOFFSET(field) ((char *) &((Xsane *) 0)->field - (char *) 0)
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+static struct
+{
+ SANE_String name;
+ void (*codec) (Wire *w, void *p, long offset);
+ long offset;
+}
+desc_xsane_device[] =
+{
+ {"xsane-main-window-x-position", xsane_rc_pref_int, DPOFFSET(shell_posx)},
+ {"xsane-main-window-y-position", xsane_rc_pref_int, DPOFFSET(shell_posy)},
+ {"xsane-main-window-width", xsane_rc_pref_int, DPOFFSET(shell_width)},
+ {"xsane-main-window-height", xsane_rc_pref_int, DPOFFSET(shell_height)},
+ {"xsane-standard-options-window-x-position", xsane_rc_pref_int, DPOFFSET(standard_options_shell_posx)},
+ {"xsane-standard-options-window-y-position", xsane_rc_pref_int, DPOFFSET(standard_options_shell_posy)},
+ {"xsane-advanced-options-window-x-position", xsane_rc_pref_int, DPOFFSET(advanced_options_shell_posx)},
+ {"xsane-advanced-options-window-y-position", xsane_rc_pref_int, DPOFFSET(advanced_options_shell_posy)},
+ {"xsane-histogram-window-x-position", xsane_rc_pref_int, DPOFFSET(histogram_dialog_posx)},
+ {"xsane-histogram-window-y-position", xsane_rc_pref_int, DPOFFSET(histogram_dialog_posy)},
+ {"xsane-preview-window-x-position", xsane_rc_pref_int, DPOFFSET(preview_dialog_posx)},
+ {"xsane-preview-window-y-position", xsane_rc_pref_int, DPOFFSET(preview_dialog_posy)},
+ {"xsane-preview-window-width", xsane_rc_pref_int, DPOFFSET(preview_dialog_width)},
+ {"xsane-preview-window-height", xsane_rc_pref_int, DPOFFSET(preview_dialog_height)},
+
+ {"xsane-gamma", xsane_rc_pref_double, DPOFFSET(gamma)},
+ {"xsane-gamma-red", xsane_rc_pref_double, DPOFFSET(gamma_red)},
+ {"xsane-gamma-green", xsane_rc_pref_double, DPOFFSET(gamma_green)},
+ {"xsane-gamma-blue", xsane_rc_pref_double, DPOFFSET(gamma_blue)},
+
+ {"xsane-brightness", xsane_rc_pref_double, DPOFFSET(brightness)},
+ {"xsane-brightness-red", xsane_rc_pref_double, DPOFFSET(brightness_red)},
+ {"xsane-brightness-green", xsane_rc_pref_double, DPOFFSET(brightness_green)},
+ {"xsane-brightness-blue", xsane_rc_pref_double, DPOFFSET(brightness_blue)},
+
+ {"xsane-contrast", xsane_rc_pref_double, DPOFFSET(contrast)},
+ {"xsane-contrast-red", xsane_rc_pref_double, DPOFFSET(contrast_red)},
+ {"xsane-contrast-green", xsane_rc_pref_double, DPOFFSET(contrast_green)},
+ {"xsane-contrast-blue", xsane_rc_pref_double, DPOFFSET(contrast_blue)},
+
+ {"xsane-enhancement-rgb-default", xsane_rc_pref_int, DPOFFSET(enhancement_rgb_default)},
+ {"xsane-negative", xsane_rc_pref_int, DPOFFSET(negative)},
+ {"xsane-show-preview", xsane_rc_pref_int, DPOFFSET(show_preview)},
+};
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_widget_get_uposition(GtkWidget *gtk_window, gint *x, gint *y)
+{
+#ifdef XSANE_BUGGY_WINDOWMANAGER_WINDOW_POSITION
+ gdk_window_get_root_origin(gtk_window->window, x, y);
+#else
+ gdk_window_get_deskrelative_origin(gtk_window->window, x, y);
+#endif
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+static int xsane_device_preferences_load_values(Wire *w, SANE_Handle device)
+{
+ const SANE_Option_Descriptor *opt;
+ SANE_Word *word_array;
+ SANE_String name, str;
+ u_long *caused_reload;
+ SANE_Int num_options;
+ SANE_Status status;
+ int i, keep_going;
+ SANE_Word word;
+ SANE_Int info;
+ off_t offset;
+ size_t size;
+ char *buf;
+
+ lseek(w->io.fd, 1, SEEK_SET); /* rewind file */
+ xsane_rc_io_w_flush(w);
+
+ offset = lseek(w->io.fd, 0, SEEK_CUR); /* remeber file position */
+
+ keep_going = 0;
+
+ sane_control_option(device, 0, SANE_ACTION_GET_VALUE, &num_options, 0);
+ size = (num_options + BITS_PER_LONG - 1) / BITS_PER_LONG * sizeof(long);
+ caused_reload = alloca(size);
+ memset(caused_reload, 0, size);
+
+ while (1)
+ {
+ xsane_rc_io_w_space(w, 3);
+ if (!w->status)
+ {
+ xsane_rc_io_w_string(w, &name);
+ }
+
+ if (w->status == XSANE_EOF) /* eof */
+ {
+ if (keep_going) /* we had a reload otpions? */
+ {
+ lseek(w->io.fd, offset, SEEK_SET); /* rewind file to position of first run */
+ xsane_rc_io_w_flush(w);
+ keep_going = 0;
+ continue;
+ }
+ return 0;
+ }
+ else if (w->status) /* error: skip line */
+ {
+ w->status = 0;
+ xsane_rc_io_w_free(w, (WireCodecFunc) xsane_rc_io_w_string, &name); /* free string memory */
+ xsane_rc_io_w_skip_newline(w); /* skip this line */
+ continue;
+ }
+
+ status = SANE_STATUS_GOOD;
+ info = 0;
+ for (i = 1; (opt = sane_get_option_descriptor(device, i)); ++i) /* search all options */
+ {
+ if (!opt->name || strcmp(opt->name, name) != 0) /* test if option names are equal */
+ {
+ continue; /* not equal, continue the search */
+ }
+
+ if (IS_SET(caused_reload, i))
+ {
+ continue; /* option caused a reload, continue search ??? why? ??? */
+ }
+
+ switch (opt->type)
+ {
+ case SANE_TYPE_BOOL:
+ case SANE_TYPE_INT:
+ case SANE_TYPE_FIXED:
+ if (opt->size == sizeof(SANE_Word))
+ {
+ xsane_rc_io_w_word(w, &word);
+ status = sane_control_option(device, i, SANE_ACTION_SET_VALUE, &word, &info);
+ }
+ else
+ {
+ SANE_Int len;
+
+ xsane_rc_io_w_array(w, &len, (void **) &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
+ status = sane_control_option(device, i, SANE_ACTION_SET_VALUE, word_array, &info);
+ w->direction = WIRE_FREE;
+ xsane_rc_io_w_array(w, &len, (void **) &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
+ w->direction = WIRE_DECODE;
+ }
+ break;
+
+ case SANE_TYPE_STRING:
+ xsane_rc_io_w_string(w, &str);
+ buf = malloc(opt->size);
+ if (!w->status) /* got a string ? */
+ {
+ strncpy(buf, str, opt->size);
+ buf[opt->size - 1] = '\0';
+ xsane_rc_io_w_free(w, (WireCodecFunc) xsane_rc_io_w_string, &str);
+ status = sane_control_option(device, i, SANE_ACTION_SET_VALUE, buf, &info);
+ }
+ break;
+
+ case SANE_TYPE_BUTTON:
+ case SANE_TYPE_GROUP:
+ /* nothing to read for button and group */
+ break;
+ }
+ break; /* option is set: do not continue search */
+ }
+ xsane_rc_io_w_free(w, (WireCodecFunc) xsane_rc_io_w_string, &name); /* free string memory */
+
+ if (status == SANE_STATUS_GOOD && (info & SANE_INFO_RELOAD_OPTIONS))
+ {
+ SET(caused_reload, i);
+ keep_going = 1;
+ }
+ }
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+static int xsane_device_preferences_save_values(Wire *w, SANE_Handle device)
+{
+ const SANE_Option_Descriptor *opt;
+ size_t word_array_size = 0;
+ SANE_Word *word_array = 0;
+ size_t str_size = 0;
+ SANE_String str = 0;
+ SANE_Word word;
+ int i;
+
+ for (i = 0; (opt = sane_get_option_descriptor(device, i)); ++i)
+ {
+ if ((opt->cap & (SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT)) != (SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT) || !opt->name)
+ /* if we can't query AND set the option, don't bother saving it */
+ {
+ continue;
+ }
+
+ switch (opt->type)
+ {
+ case SANE_TYPE_BOOL:
+ case SANE_TYPE_INT:
+ case SANE_TYPE_FIXED:
+ if (opt->size == sizeof(SANE_Word))
+ {
+ if (sane_control_option(device, i, SANE_ACTION_GET_VALUE, &word, 0) != SANE_STATUS_GOOD)
+ {
+ continue;
+ }
+ xsane_rc_io_w_string(w, (SANE_String *) &opt->name);
+ xsane_rc_io_w_word(w, &word);
+ }
+ else
+ {
+ SANE_Int len = opt->size / sizeof(SANE_Word);
+
+ if (opt->size > word_array_size)
+ {
+ word_array_size = ((opt->size + 32*sizeof(SANE_Word)) & ~(32*sizeof(SANE_Word) - 1));
+ if (word_array)
+ {
+ word_array = realloc(word_array, word_array_size);
+ }
+ else
+ {
+ word_array = malloc(word_array_size);
+ }
+
+ if (word_array == 0)
+ {
+ /* Malloc failed, so return an error. */
+ w->status = ENOMEM;
+ return 1;
+ }
+ }
+
+ if (sane_control_option(device, i, SANE_ACTION_GET_VALUE, word_array, 0) != SANE_STATUS_GOOD)
+ {
+ continue;
+ }
+
+ xsane_rc_io_w_string(w, (SANE_String *) &opt->name);
+ xsane_rc_io_w_array(w, &len, (void **) &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
+ }
+ break;
+
+ case SANE_TYPE_STRING:
+ if (opt->size > str_size)
+ {
+ str_size = (opt->size + 1024) & ~1023;
+
+ if (str)
+ {
+ str = realloc(str, str_size);
+ }
+ else
+ {
+ str = malloc(str_size);
+ }
+
+ if (str == 0)
+ {
+ /* Malloc failed, so return an error. */
+ w->status = ENOMEM;
+ return 1;
+ }
+ }
+
+ if (sane_control_option(device, i, SANE_ACTION_GET_VALUE, str, 0) != SANE_STATUS_GOOD)
+ {
+ continue;
+ }
+
+ xsane_rc_io_w_string(w, (SANE_String *) &opt->name);
+ xsane_rc_io_w_string(w, &str);
+ break;
+
+ case SANE_TYPE_BUTTON:
+ case SANE_TYPE_GROUP:
+ break;
+ }
+ }
+
+ if (word_array)
+ {
+ free(word_array);
+ }
+ if (str)
+ {
+ free(str);
+ }
+
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_device_preferences_load_file(char *filename)
+{
+ int fd;
+ char buf[256];
+#if 0
+ char *version = 0;
+#endif
+ Wire w;
+ SANE_String name;
+ int i;
+
+ /* set geometry and position to standard values */
+ xsane.shell_posx = XSANE_SHELL_POS_X;
+ xsane.shell_posy = XSANE_SHELL_POS_Y;
+ xsane.shell_width = XSANE_SHELL_WIDTH;
+ xsane.shell_height = XSANE_SHELL_HEIGHT;
+
+ xsane.standard_options_shell_posx = XSANE_STD_OPTIONS_POS_X;
+ xsane.standard_options_shell_posy = XSANE_STD_OPTIONS_POS_Y;
+
+ xsane.advanced_options_shell_posx = XSANE_ADV_OPTIONS_POS_X;
+ xsane.advanced_options_shell_posy = XSANE_ADV_OPTIONS_POS_Y;
+
+ xsane.histogram_dialog_posx = XSANE_HISTOGRAM_POS_X;
+ xsane.histogram_dialog_posy = XSANE_HISTOGRAM_POS_Y;
+
+ xsane.preview_dialog_posx = XSANE_PREVIEW_POS_X;
+ xsane.preview_dialog_posy = XSANE_PREVIEW_POS_Y;
+ xsane.preview_dialog_width = XSANE_PREVIEW_WIDTH;
+ xsane.preview_dialog_height = XSANE_PREVIEW_HEIGHT;
+
+ xsane.gamma = 1.0;
+ xsane.gamma_red = 1.0;
+ xsane.gamma_green = 1.0;
+ xsane.gamma_blue = 1.0;
+
+ xsane.brightness = 0.0;
+ xsane.brightness_red = 0.0;
+ xsane.brightness_green = 0.0;
+ xsane.brightness_blue = 0.0;
+
+ xsane.contrast = 0.0;
+ xsane.contrast_red = 0.0;
+ xsane.contrast_green = 0.0;
+ xsane.contrast_blue = 0.0;
+
+ xsane.enhancement_rgb_default = 1;
+ xsane.negative = 0;
+ xsane.show_preview = 1;
+
+ fd = open(filename, O_RDONLY);
+ if (fd >= 0)
+ {
+ /* prepare wire */
+ w.io.fd = fd;
+ w.io.read = read;
+ w.io.write = write;
+ xsane_rc_io_w_init(&w);
+ xsane_rc_io_w_set_dir(&w, WIRE_DECODE);
+
+ xsane_rc_io_w_space(&w, 3);
+ if (!w.status)
+ {
+ xsane_rc_io_w_string(&w, &name); /* get string */
+ if (!w.status)
+ {
+ if (strcmp(name, "XSANE_DEVICE_RC")) /* no real *.drc file */
+ {
+ w.status = -1; /* no *.drc file => error */
+ }
+ }
+ }
+
+ if (w.status)
+ {
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s\n%s %s", ERR_LOAD_DEVICE_SETTINGS, filename, ERR_NO_DRC_FILE);
+ xsane_back_gtk_error(buf, TRUE);
+ close(fd);
+ return;
+ }
+
+ xsane_rc_io_w_space(&w, 3);
+ if (!w.status)
+ {
+ xsane_rc_io_w_string(&w, &name); /* get string */
+ if (!w.status)
+ {
+ if (strcmp(name, xsane.device_set_filename))
+ {
+ snprintf(buf, sizeof(buf), "%s \"%s\"\n"
+ "%s \"%s\",\n"
+ "%s \"%s\",\n"
+ "%s",
+ TEXT_FILE, filename,
+ ERR_CREATED_FOR_DEVICE, name,
+ ERR_USED_FOR_DEVICE, xsane.device_set_filename,
+ ERR_MAY_CAUSE_PROBLEMS);
+ if (xsane_back_gtk_decision(ERR_HEADER_WARNING, (gchar **) error_xpm, buf, ERR_BUTTON_OK, BUTTON_CANCEL, TRUE) == FALSE)
+ { /* cancel */
+ close(fd);
+ return;
+ }
+ }
+ }
+ }
+
+ if (w.status)
+ {
+ /* may be we should pop up a window here */
+ close(fd);
+ return;
+ }
+
+
+#if 0
+/* add here: read version info */
+#if 0
+ while (!feof(file))
+ {
+ fgets(option, sizeof(option), file); /* get option name */
+ option[strlen(option)-1] = 0; /* remove cr */
+ if (strcmp(option, "\"xsane-version\"") == 0)
+ {
+ fgets(option, sizeof(option), file); /* get version */
+ option[strlen(option)-1] = 0; /* remove cr */
+ len = strlen(option);
+ if (len)
+ {
+ if (option[len-1] == 34)
+ {
+ option[len-1] = 0; /* remove " */
+ }
+ }
+ version = strdup(option+1);
+ }
+ else
+ {
+ fgets(option, sizeof(option), file); /* skip option */
+ }
+ }
+#endif
+
+
+ if (version)
+ {
+ if (strcmp(version, XSANE_VERSION))
+ {
+ snprintf(buf, sizeof(buf), "File: \"%s\"\n"
+ "has been saved with xsane-%s,\n"
+ "this may cause problems!", filename, version);
+ xsane_back_gtk_warning(buf, TRUE);
+ }
+ free(version);
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "File: \"%s\"\n"
+ "has been saved with xsane before version 0.40,\n"
+ "this may cause problems!", filename);
+ xsane_back_gtk_warning(buf, TRUE);
+ }
+#endif
+
+
+
+ while (1) /* read device dependant xsane options */
+ {
+ xsane_rc_io_w_space(&w, 3);
+ if (w.status)
+ {
+ break;
+ }
+
+ xsane_rc_io_w_string(&w, &name);
+
+ if (!w.status && name)
+ {
+ for (i = 0; i < NELEMS (desc_xsane_device); ++i)
+ {
+ if (strcmp(name, desc_xsane_device[i].name) == 0)
+ {
+ (*desc_xsane_device[i].codec) (&w, &xsane, desc_xsane_device[i].offset);
+ break; /* leave for loop */
+ }
+ }
+ }
+ w.status = 0;
+ }
+
+ xsane_device_preferences_load_values(&w, dialog->dev); /* read device preferences */
+ close(fd);
+
+ if (dialog->well_known.dpi > 0)
+ {
+ const SANE_Option_Descriptor *opt;
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.dpi);
+
+ switch (opt->type)
+ {
+ case SANE_TYPE_INT:
+ {
+ SANE_Int dpi;
+ sane_control_option(dialog->dev, dialog->well_known.dpi, SANE_ACTION_GET_VALUE, &dpi, 0);
+ xsane.resolution = dpi;
+ }
+ break;
+
+ case SANE_TYPE_FIXED:
+ {
+ SANE_Fixed dpi;
+ sane_control_option(dialog->dev, dialog->well_known.dpi, SANE_ACTION_GET_VALUE, &dpi, 0);
+ xsane.resolution = (int) SANE_UNFIX(dpi);
+ }
+ break;
+
+ default:
+ fprintf(stderr, "xsane_pref_load_file: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ return;
+ }
+ }
+ }
+
+ gtk_widget_set_uposition(xsane.shell, xsane.shell_posx, xsane.shell_posy);
+ gtk_window_set_default_size(GTK_WINDOW(xsane.shell), xsane.shell_width, xsane.shell_height);
+ gtk_widget_set_uposition(xsane.standard_options_shell, xsane.standard_options_shell_posx, xsane.standard_options_shell_posy);
+ gtk_widget_set_uposition(xsane.advanced_options_shell, xsane.advanced_options_shell_posx, xsane.advanced_options_shell_posy);
+ gtk_widget_set_uposition(xsane.histogram_dialog, xsane.histogram_dialog_posx, xsane.histogram_dialog_posy);
+ gtk_widget_set_uposition(xsane.preview->top, xsane.preview_dialog_posx, xsane.preview_dialog_posy);
+ gtk_window_set_default_size(GTK_WINDOW(xsane.preview->top), xsane.preview_dialog_width, xsane.preview_dialog_height);
+
+ xsane_refresh_dialog(dialog);
+ xsane_enhancement_by_gamma();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_device_preferences_restore(void)
+{
+ char filename[PATH_MAX];
+ struct stat st;
+
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, 0, xsane.device_set_filename, ".drc", XSANE_PATH_LOCAL_SANE);
+
+ if (stat(filename, &st) >= 0)
+ {
+ xsane_device_preferences_load_file(filename);
+ }
+ else /* no local sane file, look for system file */
+ {
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, 0, xsane.device_set_filename, ".drc", XSANE_PATH_SYSTEM);
+ xsane_device_preferences_load_file(filename);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_device_preferences_load(void)
+{
+ char filename[PATH_MAX];
+ char windowname[256];
+
+ xsane_set_sensitivity(FALSE);
+
+ sprintf(windowname, "%s %s %s", prog_name, WINDOW_LOAD_SETTINGS, device_text);
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, 0, xsane.device_set_filename, ".drc", XSANE_PATH_LOCAL_SANE);
+ xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, FALSE);
+ xsane_device_preferences_load_file(filename);
+ xsane_set_sensitivity(TRUE);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#define XSANE_RC_IO_W_STRINGCONST(wire, string) { SANE_String str=string; xsane_rc_io_w_string(wire, &str); }
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_device_preferences_save(GtkWidget *widget, gpointer data)
+{
+ char filename[PATH_MAX];
+ char windowname[256];
+ int fd;
+ Wire w;
+ int i;
+
+ xsane_set_sensitivity(FALSE);
+
+ sprintf(windowname, "%s %s %s", prog_name, WINDOW_SAVE_SETTINGS, device_text);
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, 0, xsane.device_set_filename, ".drc", XSANE_PATH_LOCAL_SANE);
+ xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, FALSE);
+
+ umask(XSANE_DEFAULT_UMASK); /* define new file permissions */
+ fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+ if (fd < 0)
+ {
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_CREATE_FILE, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ xsane_set_sensitivity(TRUE);
+ return;
+ }
+
+ /* prepare wire */
+ w.io.fd = fd;
+ w.io.read = read;
+ w.io.write = write;
+ xsane_rc_io_w_init(&w);
+ xsane_rc_io_w_set_dir(&w, WIRE_ENCODE);
+
+ XSANE_RC_IO_W_STRINGCONST(&w, "XSANE_DEVICE_RC");
+ xsane_rc_io_w_string(&w, &xsane.device_set_filename);
+
+ XSANE_RC_IO_W_STRINGCONST(&w, "xsane-version");
+ XSANE_RC_IO_W_STRINGCONST(&w, XSANE_VERSION);
+
+ /* make geometry and position values up to date */
+ xsane_widget_get_uposition(xsane.shell, &xsane.shell_posx, &xsane.shell_posy);
+#if 0
+/* other possibillities: */
+ gdk_window_get_deskrelative_origin(xsane.shell->window, &xsane.shell_posx, &xsane.shell_posy);
+ gdk_window_get_origin(xsane.shell->window, &xsane.shell_posx, &xsane.shell_posy);
+ gdk_window_get_position(xsane.shell->window, &xsane.shell_posx, &xsane.shell_posy);
+ gdk_window_get_geometry(xsane.shell->window, ?);
+#endif
+ gdk_window_get_size(xsane.shell->window, &xsane.shell_width, &xsane.shell_height);
+ gtk_widget_set_uposition(xsane.shell, xsane.shell_posx, xsane.shell_posy); /* geometry used when window closed and opened again */
+ gtk_window_set_default_size(GTK_WINDOW(xsane.shell), xsane.shell_width, xsane.shell_height);
+
+ xsane_widget_get_uposition(xsane.standard_options_shell, &xsane.standard_options_shell_posx, &xsane.standard_options_shell_posy);
+ gtk_widget_set_uposition(xsane.standard_options_shell, xsane.standard_options_shell_posx, xsane.standard_options_shell_posy);
+
+ xsane_widget_get_uposition(xsane.advanced_options_shell, &xsane.advanced_options_shell_posx, &xsane.advanced_options_shell_posy);
+ gtk_widget_set_uposition(xsane.advanced_options_shell, xsane.advanced_options_shell_posx, xsane.advanced_options_shell_posy);
+
+ xsane_widget_get_uposition(xsane.histogram_dialog, &xsane.histogram_dialog_posx, &xsane.histogram_dialog_posy);
+ gtk_widget_set_uposition(xsane.histogram_dialog, xsane.histogram_dialog_posx, xsane.histogram_dialog_posy);
+
+ if (xsane.preview)
+ {
+ xsane_widget_get_uposition(xsane.preview->top, &xsane.preview_dialog_posx, &xsane.preview_dialog_posy);
+ gdk_window_get_size(xsane.preview->top->window, &xsane.preview_dialog_width, &xsane.preview_dialog_height);
+ gtk_widget_set_uposition(xsane.preview->top, xsane.preview_dialog_posx, xsane.preview_dialog_posy);
+ gtk_window_set_default_size(GTK_WINDOW(xsane.preview->top), xsane.preview_dialog_width, xsane.preview_dialog_height);
+ }
+
+ xsane_device_preferences_save_values(&w, dialog->dev);
+
+ for (i = 0; i < NELEMS(desc_xsane_device); ++i) /* save device preferences xsane values */
+ {
+ xsane_rc_io_w_string(&w, &desc_xsane_device[i].name);
+ (*desc_xsane_device[i].codec) (&w, &xsane, desc_xsane_device[i].offset);
+ }
+
+ xsane_rc_io_w_flush(&w);
+ close(fd);
+
+ xsane_set_sensitivity(TRUE);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
diff --git a/frontend/xsane-device-preferences.c.old b/frontend/xsane-device-preferences.c.old
new file mode 100644
index 0000000..aa4d8b8
--- /dev/null
+++ b/frontend/xsane-device-preferences.c.old
@@ -0,0 +1,761 @@
+
+/* sane - Scanner Access Now Easy.
+ Copyright (C) 1999 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+#include "xsane.h"
+#include "xsane-rc-io.h"
+#include "xsane-front-gtk.h"
+#include "xsane-gamma.h"
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+#define BITS_PER_LONG (8*sizeof(u_long))
+
+#define SET(set, bit) ((set)[(bit)/BITS_PER_LONG] |= (1UL << (bit)%BITS_PER_LONG))
+#define IS_SET(set, bit) (((set)[(bit)/BITS_PER_LONG] & (1UL << (bit)%BITS_PER_LONG)) != 0)
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+int xsane_device_preferences_load_values(int fd, SANE_Handle device)
+{
+ const SANE_Option_Descriptor *opt;
+ SANE_Word *word_array;
+ SANE_String name, str;
+ u_long *caused_reload;
+ SANE_Int num_options;
+ SANE_Status status;
+ int i, keep_going;
+ SANE_Word word;
+ SANE_Int info;
+ off_t offset;
+ size_t size;
+ char *buf;
+ Wire w;
+
+ offset = lseek(fd, 0, SEEK_CUR);
+ w.io.fd = fd;
+ w.io.read = read;
+ w.io.write = write;
+ xsane_rc_io_w_init(&w);
+ xsane_rc_io_w_set_dir(&w, WIRE_DECODE);
+ keep_going = 0;
+
+ sane_control_option(device, 0, SANE_ACTION_GET_VALUE, &num_options, 0);
+ size = (num_options + BITS_PER_LONG - 1) / BITS_PER_LONG * sizeof(long);
+ caused_reload = alloca(size);
+ memset(caused_reload, 0, size);
+
+ while (1)
+ {
+ xsane_rc_io_w_space(&w, 3);
+
+ if (!w.status)
+ {
+ xsane_rc_io_w_string(&w, &name);
+ }
+
+ if (w.status)
+ {
+ if (keep_going)
+ {
+ lseek(fd, offset, SEEK_SET);
+ xsane_rc_io_w_set_dir(&w, WIRE_DECODE);
+ keep_going = 0;
+ continue;
+ }
+ return 0;
+ }
+
+ status = SANE_STATUS_GOOD;
+ info = 0;
+ for (i = 1; (opt = sane_get_option_descriptor(device, i)); ++i)
+ {
+ if (!opt->name || strcmp(opt->name, name) != 0)
+ {
+ continue;
+ }
+
+ if (IS_SET(caused_reload, i))
+ {
+ continue;
+ }
+
+ switch (opt->type)
+ {
+ case SANE_TYPE_BOOL:
+ case SANE_TYPE_INT:
+ case SANE_TYPE_FIXED:
+ if (opt->size == sizeof(SANE_Word))
+ {
+ xsane_rc_io_w_word(&w, &word);
+ status = sane_control_option(device, i, SANE_ACTION_SET_VALUE, &word, &info);
+ }
+ else
+ {
+ SANE_Int len;
+
+ xsane_rc_io_w_array(&w, &len, (void **) &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
+ status = sane_control_option(device, i, SANE_ACTION_SET_VALUE, word_array, &info);
+ w.direction = WIRE_FREE;
+ xsane_rc_io_w_array(&w, &len, (void **) &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
+ w.direction = WIRE_DECODE;
+ }
+ break;
+
+ case SANE_TYPE_STRING:
+ xsane_rc_io_w_string(&w, &str);
+ buf = malloc(opt->size);
+ if (!w.status) /* got a string ? */
+ {
+ strncpy(buf, str, opt->size);
+ buf[opt->size - 1] = '\0';
+ xsane_rc_io_w_free(&w, (WireCodecFunc) xsane_rc_io_w_string, &str);
+ status = sane_control_option(device, i, SANE_ACTION_SET_VALUE, buf, &info);
+ }
+ break;
+
+ case SANE_TYPE_BUTTON:
+ case SANE_TYPE_GROUP:
+ /* nothing to read for button and group */
+ break;
+ }
+ break;
+ }
+ xsane_rc_io_w_free(&w, (WireCodecFunc) xsane_rc_io_w_string, &name);
+
+ if (status == SANE_STATUS_GOOD && (info & SANE_INFO_RELOAD_OPTIONS))
+ {
+ SET(caused_reload, i);
+ keep_going = 1;
+ }
+ }
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+int xsane_device_preferences_save_values(int fd, SANE_Handle device)
+{
+ const SANE_Option_Descriptor *opt;
+ size_t word_array_size = 0;
+ SANE_Word *word_array = 0;
+ size_t str_size = 0;
+ SANE_String str = 0;
+ SANE_Word word;
+ Wire w;
+ int i;
+
+ w.io.fd = fd;
+ w.io.read = read;
+ w.io.write = write;
+ xsane_rc_io_w_init(&w);
+ xsane_rc_io_w_set_dir(&w, WIRE_ENCODE);
+
+ for (i = 0; (opt = sane_get_option_descriptor(device, i)); ++i)
+ {
+ if ((opt->cap & (SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT)) != (SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT) || !opt->name)
+ /* if we can't query AND set the option, don't bother saving it */
+ {
+ continue;
+ }
+
+ switch (opt->type)
+ {
+ case SANE_TYPE_BOOL:
+ case SANE_TYPE_INT:
+ case SANE_TYPE_FIXED:
+ if (opt->size == sizeof(SANE_Word))
+ {
+ if (sane_control_option(device, i, SANE_ACTION_GET_VALUE, &word, 0) != SANE_STATUS_GOOD)
+ {
+ continue;
+ }
+ xsane_rc_io_w_string(&w, (SANE_String *) &opt->name);
+ xsane_rc_io_w_word(&w, &word);
+ }
+ else
+ {
+ SANE_Int len = opt->size / sizeof(SANE_Word);
+
+ if (opt->size > word_array_size)
+ {
+ word_array_size = ((opt->size + 32*sizeof(SANE_Word)) & ~(32*sizeof(SANE_Word) - 1));
+ if (word_array)
+ {
+ word_array = realloc(word_array, word_array_size);
+ }
+ else
+ {
+ word_array = malloc(word_array_size);
+ }
+
+ if (word_array == 0)
+ {
+ /* Malloc failed, so return an error. */
+ w.status = ENOMEM;
+ return 1;
+ }
+ }
+
+ if (sane_control_option(device, i, SANE_ACTION_GET_VALUE, word_array, 0) != SANE_STATUS_GOOD)
+ {
+ continue;
+ }
+
+ xsane_rc_io_w_string(&w, (SANE_String *) &opt->name);
+ xsane_rc_io_w_array(&w, &len, (void **) &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
+ }
+ break;
+
+ case SANE_TYPE_STRING:
+ if (opt->size > str_size)
+ {
+ str_size = (opt->size + 1024) & ~1023;
+
+ if (str)
+ {
+ str = realloc(str, str_size);
+ }
+ else
+ {
+ str = malloc(str_size);
+ }
+
+ if (str == 0)
+ {
+ /* Malloc failed, so return an error. */
+ w.status = ENOMEM;
+ return 1;
+ }
+ }
+
+ if (sane_control_option(device, i, SANE_ACTION_GET_VALUE, str, 0) != SANE_STATUS_GOOD)
+ {
+ continue;
+ }
+
+ xsane_rc_io_w_string(&w, (SANE_String *) &opt->name);
+ xsane_rc_io_w_string(&w, &str);
+ break;
+
+ case SANE_TYPE_BUTTON:
+ case SANE_TYPE_GROUP:
+ break;
+ }
+ }
+ xsane_rc_io_w_set_dir(&w, WIRE_DECODE);
+
+ if (word_array)
+ {
+ free(word_array);
+ }
+ if (str)
+ {
+ free(str);
+ }
+
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_device_preferences_load_file(char *filename)
+{
+ int fd;
+ FILE *file;
+ char buf[256];
+ char option[256];
+ char *optionp;
+ char *version = 0;
+ int len;
+
+ int main_posx = XSANE_DIALOG_POS_X;
+ int main_posy = XSANE_DIALOG_POS_Y;
+ int main_width = XSANE_DIALOG_WIDTH;
+ int main_height = XSANE_DIALOG_HEIGHT;
+
+ int standard_options_posx = XSANE_DIALOG_POS_X;
+ int standard_options_posy = XSANE_DIALOG_POS_Y2;
+
+ int advanced_options_posx = XSANE_DIALOG_POS_X2;
+ int advanced_options_posy = XSANE_DIALOG_POS_Y2;
+
+ int histogram_posx = XSANE_DIALOG_POS_X2;
+ int histogram_posy = XSANE_DIALOG_POS_Y;
+
+ int preview_posx = 0;
+ int preview_posy = 0;
+ int preview_width = 0;
+ int preview_height = 0;
+
+ file = fopen(filename, "r");
+ if (file == 0) /* error ? */
+ {
+ return;
+ }
+
+ if (!feof(file))
+ {
+ fgets(option, sizeof(option), file); /* get first line */
+ option[strlen(option)-1] = 0; /* remove cr */
+
+ if (strcmp(option, "\"XSANE_DEVICE_RC\"") != 0) /* wrong file format ? */
+ {
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s\n%s %s", ERR_LOAD_DEVICE_SETTINGS, filename, ERR_NO_DRC_FILE);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ if (!feof(file))
+ {
+ fgets(option, sizeof(option), file); /* get version */
+ option[strlen(option)-1] = 0; /* remove cr */
+ len = strlen(option);
+ if (len)
+ {
+ if (option[len-1] == 34)
+ {
+ option[len-1] = 0; /* remove " */
+ }
+ }
+ optionp = option+1;
+
+ if (strcmp(optionp, xsane.device_set_filename))
+ {
+ snprintf(buf, sizeof(buf), "%s \"%s\"\n"
+ "%s \"%s\",\n"
+ "%s \"%s\",\n"
+ "%s",
+ TEXT_FILE, filename,
+ ERR_CREATED_FOR_DEVICE, optionp,
+ ERR_USED_FOR_DEVICE, xsane.device_set_filename,
+ ERR_MAY_CAUSE_PROBLEMS);
+ if (xsane_back_gtk_decision(ERR_HEADER_WARNING, buf, ERR_BUTTON_OK, BUTTON_CANCEL, TRUE) == FALSE)
+ { /* cancel */
+ fclose(file);
+ return;
+ }
+ }
+ }
+ }
+
+ while (!feof(file))
+ {
+ fgets(option, sizeof(option), file); /* get option name */
+ option[strlen(option)-1] = 0; /* remove cr */
+ if (strcmp(option, "\"xsane-version\"") == 0)
+ {
+ fgets(option, sizeof(option), file); /* get version */
+ option[strlen(option)-1] = 0; /* remove cr */
+ len = strlen(option);
+ if (len)
+ {
+ if (option[len-1] == 34)
+ {
+ option[len-1] = 0; /* remove " */
+ }
+ }
+ version = strdup(option+1);
+ }
+ else if (strcmp(option, "\"xsane-gamma\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.gamma);
+ }
+ else if (strcmp(option, "\"xsane-gamma-red\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.gamma_red);
+ }
+ else if (strcmp(option, "\"xsane-gamma-green\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.gamma_green);
+ }
+ else if (strcmp(option, "\"xsane-gamma-blue\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.gamma_blue);
+ }
+ else if (strcmp(option, "\"xsane-brightness\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.brightness);
+ }
+ else if (strcmp(option, "\"xsane-brightness-red\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.brightness_red);
+ }
+ else if (strcmp(option, "\"xsane-brightness-green\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.brightness_green);
+ }
+ else if (strcmp(option, "\"xsane-brightness-blue\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.brightness_blue);
+ }
+ else if (strcmp(option, "\"xsane-contrast\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.contrast);
+ }
+ else if (strcmp(option, "\"xsane-contrast-red\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.contrast_red);
+ }
+ else if (strcmp(option, "\"xsane-contrast-green\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.contrast_green);
+ }
+ else if (strcmp(option, "\"xsane-contrast-blue\"") == 0)
+ {
+ fscanf(file, "%lf\n", &xsane.contrast_blue);
+ }
+ else if (strcmp(option, "\"xsane-enhancement-rgb-default\"") == 0)
+ {
+ fscanf(file, "%d\n", &xsane.enhancement_rgb_default);
+ }
+ else if (strcmp(option, "\"xsane-negative\"") == 0)
+ {
+ fscanf(file, "%d\n", &xsane.negative);
+ }
+ else if (strcmp(option, "\"xsane-show-preview\"") == 0)
+ {
+ fscanf(file, "%d\n", &xsane.show_preview);
+ }
+ else if (strcmp(option, "\"xsane-main-window-x-position\"") == 0)
+ {
+ fscanf(file, "%d\n", &main_posx);
+ }
+ else if (strcmp(option, "\"xsane-main-window-y-position\"") == 0)
+ {
+ fscanf(file, "%d\n", &main_posy);
+ }
+ else if (strcmp(option, "\"xsane-main-window-width\"") == 0)
+ {
+ fscanf(file, "%d\n", &main_width);
+ }
+ else if (strcmp(option, "\"xsane-main-window-height\"") == 0)
+ {
+ fscanf(file, "%d\n", &main_height);
+ }
+ else if (strcmp(option, "\"xsane-standard-options-window-x-position\"") == 0)
+ {
+ fscanf(file, "%d\n", &standard_options_posx);
+ }
+ else if (strcmp(option, "\"xsane-standard-options-window-y-position\"") == 0)
+ {
+ fscanf(file, "%d\n", &standard_options_posy);
+ }
+ else if (strcmp(option, "\"xsane-advanced-options-window-x-position\"") == 0)
+ {
+ fscanf(file, "%d\n", &advanced_options_posx);
+ }
+ else if (strcmp(option, "\"xsane-advanced-options-window-y-position\"") == 0)
+ {
+ fscanf(file, "%d\n", &advanced_options_posy);
+ }
+ else if (strcmp(option, "\"xsane-histogram-window-x-position\"") == 0)
+ {
+ fscanf(file, "%d\n", &histogram_posx);
+ }
+ else if (strcmp(option, "\"xsane-histogram-window-y-position\"") == 0)
+ {
+ fscanf(file, "%d\n", &histogram_posy);
+ }
+ else if (strcmp(option, "\"xsane-preview-window-x-position\"") == 0)
+ {
+ fscanf(file, "%d\n", &preview_posx);
+ }
+ else if (strcmp(option, "\"xsane-preview-window-y-position\"") == 0)
+ {
+ fscanf(file, "%d\n", &preview_posy);
+ }
+ else if (strcmp(option, "\"xsane-preview-window-width\"") == 0)
+ {
+ fscanf(file, "%d\n", &preview_width);
+ }
+ else if (strcmp(option, "\"xsane-preview-window-height\"") == 0)
+ {
+ fscanf(file, "%d\n", &preview_height);
+ }
+ else
+ {
+ fgets(option, sizeof(option), file); /* skip option */
+ }
+ }
+ fclose(file);
+
+#if 0
+ if (version)
+ {
+ if (strcmp(version, XSANE_VERSION))
+ {
+ snprintf(buf, sizeof(buf), "File: \"%s\"\n"
+ "has been saved with xsane-%s,\n"
+ "this may cause problems!", filename, version);
+ xsane_back_gtk_warning(buf, TRUE);
+ }
+ free(version);
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "File: \"%s\"\n"
+ "has been saved with xsane before version 0.40,\n"
+ "this may cause problems!", filename);
+ xsane_back_gtk_warning(buf, TRUE);
+ }
+#endif
+
+
+ gtk_widget_set_uposition(xsane.shell, main_posx, main_posy);
+ gtk_widget_set_uposition(xsane.standard_options_shell, standard_options_posx, standard_options_posy);
+ gtk_widget_set_uposition(xsane.advanced_options_shell, advanced_options_posx, advanced_options_posy);
+ gtk_widget_set_uposition(xsane.histogram_dialog, histogram_posx, histogram_posy);
+
+ if (xsane.preview)
+ {
+ gtk_widget_set_uposition(xsane.preview->top, preview_posx, preview_posy);
+ }
+
+ gtk_window_set_default_size(GTK_WINDOW(xsane.shell), main_width, main_height);
+
+ if (xsane.preview)
+ {
+ gtk_window_set_default_size(GTK_WINDOW(xsane.preview->top), preview_width, preview_height);
+ }
+
+
+ fd = open(filename, O_RDONLY);
+ if (fd < 0)
+ {
+ return;
+ }
+ xsane_device_preferences_load_values(fd, dialog->dev);
+ close(fd);
+
+ if (dialog->well_known.dpi > 0)
+ {
+ const SANE_Option_Descriptor *opt;
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.dpi);
+
+ switch (opt->type)
+ {
+ case SANE_TYPE_INT:
+ {
+ SANE_Int dpi;
+ sane_control_option(dialog->dev, dialog->well_known.dpi, SANE_ACTION_GET_VALUE, &dpi, 0);
+ xsane.resolution = dpi;
+ }
+ break;
+
+ case SANE_TYPE_FIXED:
+ {
+ SANE_Fixed dpi;
+ sane_control_option(dialog->dev, dialog->well_known.dpi, SANE_ACTION_GET_VALUE, &dpi, 0);
+ xsane.resolution = (int) SANE_UNFIX(dpi);
+ }
+ break;
+
+ default:
+ fprintf(stderr, "xsane_pref_load_file: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ return;
+ }
+ }
+
+ xsane_refresh_dialog(dialog);
+ xsane_enhancement_by_gamma();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_device_preferences_restore(void)
+{
+ char filename[PATH_MAX];
+
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, 0, xsane.device_set_filename, ".drc");
+ xsane_device_preferences_load_file(filename);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_device_preferences_load(void)
+{
+ char filename[PATH_MAX];
+ char windowname[256];
+
+ xsane_set_sensitivity(FALSE);
+
+ sprintf(windowname, "%s %s %s", prog_name, WINDOW_LOAD_SETTINGS, device_text);
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, 0, xsane.device_set_filename, ".drc");
+ xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename);
+ xsane_device_preferences_load_file(filename);
+ xsane_set_sensitivity(TRUE);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_device_preferences_save(GtkWidget *widget, gpointer data)
+{
+ char filename[PATH_MAX];
+ char windowname[256];
+ int fd;
+ FILE *file;
+ int posx, posy, width, height;
+
+ xsane_set_sensitivity(FALSE);
+
+ sprintf(windowname, "%s %s %s", prog_name, WINDOW_SAVE_SETTINGS, device_text);
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, 0, xsane.device_set_filename, ".drc");
+ xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename);
+
+ file = fopen(filename, "w");
+ if (file == 0)
+ {
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_CREATE_FILE, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ xsane_set_sensitivity(TRUE);
+ return;
+ }
+
+ fprintf(file, "\"XSANE_DEVICE_RC\"\n");
+ fprintf(file, "\"%s\"\n", xsane.device_set_filename);
+ fclose(file);
+
+ fd = open(filename, O_WRONLY | O_APPEND , 0666);
+ if (fd < 0)
+ {
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_CREATE_FILE, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ xsane_set_sensitivity(TRUE);
+ return;
+ }
+ xsane_device_preferences_save_values(fd, dialog->dev);
+ close(fd);
+
+
+ file = fopen(filename, "a");
+ if (file == 0)
+ {
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_CREATE_FILE, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ xsane_set_sensitivity(TRUE);
+ return;
+ }
+
+ fprintf(file, "\"xsane-version\"\n");
+ fprintf(file, "\"" XSANE_VERSION "\"\n");
+ fprintf(file, "\"xsane-gamma\"\n");
+ fprintf(file, "%f\n", xsane.gamma);
+ fprintf(file, "\"xsane-gamma-red\"\n");
+ fprintf(file, "%f\n", xsane.gamma_red);
+ fprintf(file, "\"xsane-gamma-green\"\n");
+ fprintf(file, "%f\n", xsane.gamma_green);
+ fprintf(file, "\"xsane-gamma-blue\"\n");
+ fprintf(file, "%f\n", xsane.gamma_blue);
+
+ fprintf(file, "\"xsane-brightness\"\n");
+ fprintf(file, "%f\n", xsane.brightness);
+ fprintf(file, "\"xsane-brightness-red\"\n");
+ fprintf(file, "%f\n", xsane.brightness_red);
+ fprintf(file, "\"xsane-brightness-green\"\n");
+ fprintf(file, "%f\n", xsane.brightness_green);
+ fprintf(file, "\"xsane-brightness-blue\"\n");
+ fprintf(file, "%f\n", xsane.brightness_blue);
+
+ fprintf(file, "\"xsane-contrast\"\n");
+ fprintf(file, "%f\n", xsane.contrast);
+ fprintf(file, "\"xsane-contrast-red\"\n");
+ fprintf(file, "%f\n", xsane.contrast_red);
+ fprintf(file, "\"xsane-contrast-green\"\n");
+ fprintf(file, "%f\n", xsane.contrast_green);
+ fprintf(file, "\"xsane-contrast-blue\"\n");
+ fprintf(file, "%f\n", xsane.contrast_blue);
+
+ fprintf(file, "\"xsane-enhancement-rgb-default\"\n");
+ fprintf(file, "%d\n", xsane.enhancement_rgb_default);
+
+ fprintf(file, "\"xsane-negative\"\n");
+ fprintf(file, "%d\n", xsane.negative);
+
+ gdk_window_get_root_origin(xsane.shell->window, &posx, &posy);
+ gdk_window_get_size(xsane.shell->window, &width, &height);
+ fprintf(file, "\"xsane-main-window-x-position\"\n");
+ fprintf(file, "%d\n", posx);
+ fprintf(file, "\"xsane-main-window-y-position\"\n");
+ fprintf(file, "%d\n", posy);
+ fprintf(file, "\"xsane-main-window-width\"\n");
+ fprintf(file, "%d\n", width);
+ fprintf(file, "\"xsane-main-window-height\"\n");
+ fprintf(file, "%d\n", height);
+ gtk_widget_set_uposition(xsane.shell, posx, posy); /* set default geometry used when window is closed and opened again */
+ gtk_window_set_default_size(GTK_WINDOW(xsane.shell), width, height);
+
+ gdk_window_get_root_origin(xsane.standard_options_shell->window, &posx, &posy);
+ fprintf(file, "\"xsane-standard-options-window-x-position\"\n");
+ fprintf(file, "%d\n", posx);
+ fprintf(file, "\"xsane-standard-options-window-y-position\"\n");
+ fprintf(file, "%d\n", posy);
+ gtk_widget_set_uposition(xsane.standard_options_shell, posx, posy);
+
+ gdk_window_get_root_origin(xsane.advanced_options_shell->window, &posx, &posy);
+ fprintf(file, "\"xsane-advanced-options-window-x-position\"\n");
+ fprintf(file, "%d\n", posx);
+ fprintf(file, "\"xsane-advanced-options-window-y-position\"\n");
+ fprintf(file, "%d\n", posy);
+ gtk_widget_set_uposition(xsane.advanced_options_shell, posx, posy);
+
+ gdk_window_get_root_origin(xsane.histogram_dialog->window, &posx, &posy);
+ fprintf(file, "\"xsane-histogram-window-x-position\"\n");
+ fprintf(file, "%d\n", posx);
+ fprintf(file, "\"xsane-histogram-window-y-position\"\n");
+ fprintf(file, "%d\n", posy);
+ gtk_widget_set_uposition(xsane.histogram_dialog, posx, posy);
+
+ fprintf(file, "\"xsane-show-preview\"\n");
+ fprintf(file, "%d\n", xsane.show_preview);
+
+ if (xsane.preview)
+ {
+ gdk_window_get_root_origin(xsane.preview->top->window, &posx, &posy);
+ gdk_window_get_size(xsane.preview->top->window, &width, &height);
+ fprintf(file, "\"xsane-preview-window-x-position\"\n");
+ fprintf(file, "%d\n", posx);
+ fprintf(file, "\"xsane-preview-window-y-position\"\n");
+ fprintf(file, "%d\n", posy);
+ fprintf(file, "\"xsane-preview-window-width\"\n");
+ fprintf(file, "%d\n", width);
+ fprintf(file, "\"xsane-preview-window-height\"\n");
+ fprintf(file, "%d\n", height);
+ gtk_widget_set_uposition(xsane.preview->top, posx, posy);
+ gtk_window_set_default_size(GTK_WINDOW(xsane.preview->top), width, height);
+ }
+
+ fclose(file);
+
+ xsane_set_sensitivity(TRUE);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
diff --git a/frontend/xsane-device-preferences.h b/frontend/xsane-device-preferences.h
new file mode 100644
index 0000000..a372f2e
--- /dev/null
+++ b/frontend/xsane-device-preferences.h
@@ -0,0 +1,42 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-device-preferences.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifndef xsane_device_preferences_h
+#define xsane_device_preferences_h
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include <sane/sane.h>
+#include "xsane.h"
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+extern void xsane_device_preferences_save(GtkWidget *widget, gpointer data);
+extern void xsane_device_preferences_restore(void);
+extern void xsane_device_preferences_load(void);
+extern void xsane_device_preferences_load_file(char *filename);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#endif
diff --git a/frontend/xsane-front-gtk.c b/frontend/xsane-front-gtk.c
new file mode 100644
index 0000000..fca864e
--- /dev/null
+++ b/frontend/xsane-front-gtk.c
@@ -0,0 +1,798 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-front-gtk.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include "xsane.h"
+#include "xsane-back-gtk.h"
+#include "xsane-preferences.h"
+#include "xsane-preview.h"
+#include "xsane-save.h"
+#include "xsane-text.h"
+#include "xsane-gamma.h"
+#include "xsane-setup.h"
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+#include <png.h>
+#include <zlib.h>
+#endif
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* forward declarations: */
+
+void xsane_get_bounds(const SANE_Option_Descriptor *opt, double *minp, double *maxp);
+int xsane_set_resolution(int well_known_option, int resolution);
+void xsane_set_all_resolutions(void);
+void xsane_define_maximum_output_size();
+void xsane_close_dialog_callback(GtkWidget *widget, gpointer data);
+void xsane_authorization_button_callback(GtkWidget *widget, gpointer data);
+gint xsane_authorization_callback(SANE_String_Const resource,
+ SANE_Char username[SANE_MAX_USERNAME_LEN],
+ SANE_Char password[SANE_MAX_PASSWORD_LEN]);
+void xsane_progress_cancel(GtkWidget *widget, gpointer data);
+XsaneProgress_t *xsane_progress_new(char *title, char *text, GtkSignalFunc callback, gpointer callback_data);
+void xsane_progress_free(XsaneProgress_t *p);
+void xsane_progress_update(XsaneProgress_t *p, gfloat newval);
+void xsane_toggle_button_new_with_pixmap(GtkWidget *parent, const char *xpm_d[], const char *desc,
+ int *state, void *xsane_toggle_button_callback);
+GtkWidget *xsane_button_new_with_pixmap(GtkWidget *parent, const char *xpm_d[], const char *desc,
+ void *xsane_button_callback, gpointer data);
+void xsane_option_menu_new(GtkWidget *parent, char *str_list[], const char *val, int option_number, const char *desc,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name);
+void xsane_option_menu_new_with_pixmap(GtkBox *parent, const char *xpm_d[], const char *desc,
+ char *str_list[], const char *val,
+ GtkObject **data, int option,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name);
+void xsane_scale_new(GtkBox *parent, char *labeltext, const char *desc,
+ float min, float max, float quant, float step, float page_step,
+ int digits, double *val, GtkObject **data, void *xsane_scale_callback, SANE_Int settable);
+void xsane_scale_new_with_pixmap(GtkBox *parent, const char *xpm_d[], const char *desc,
+ float min, float max, float quant, float step, float page_step, int digits,
+ double *val, GtkObject **data, int option, void *xsane_scale_callback, SANE_Int settable);
+void xsane_separator_new(GtkWidget *xsane_parent, int dist);
+GtkWidget *xsane_info_table_text_new(GtkWidget *table, gchar *text, int row, int colomn);
+GtkWidget *xsane_info_text_new(GtkWidget *parent, gchar *text);
+void xsane_refresh_dialog(void *nothing);
+void xsane_set_sensitivity(SANE_Int sensitivity);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_get_bounds(const SANE_Option_Descriptor *opt, double *minp, double *maxp)
+{
+ double min, max;
+ int i;
+
+ min = -INF;
+ max = INF;
+ switch (opt->constraint_type)
+ {
+ case SANE_CONSTRAINT_RANGE:
+ min = opt->constraint.range->min;
+ max = opt->constraint.range->max;
+ break;
+
+ case SANE_CONSTRAINT_WORD_LIST:
+ min = INF;
+ max = -INF;
+
+ for (i = 1; i <= opt->constraint.word_list[0]; ++i)
+ {
+ if (opt->constraint.word_list[i] < min)
+ {
+ min = opt->constraint.word_list[i];
+ }
+ if (opt->constraint.word_list[i] > max)
+ {
+ max = opt->constraint.word_list[i];
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (opt->type == SANE_TYPE_FIXED)
+ {
+ if (min > -INF && min < INF)
+ {
+ min = SANE_UNFIX (min);
+ }
+ if (max > -INF && max < INF)
+ {
+ max = SANE_UNFIX (max);
+ }
+ }
+ *minp = min;
+ *maxp = max;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+int xsane_set_resolution(int well_known_option, int resolution)
+{
+ const SANE_Option_Descriptor *opt;
+ SANE_Word dpi;
+ SANE_Word bestdpi;
+ SANE_Word diff;
+ SANE_Word val;
+ int items;
+ int i;
+
+ opt = sane_get_option_descriptor(dialog->dev, well_known_option);
+
+ if (!opt)
+ {
+ return -1; /* option does not exits */
+ }
+
+ if (opt->constraint_type == SANE_CONSTRAINT_RANGE)
+ {
+ switch (opt->type)
+ {
+ case SANE_TYPE_INT:
+ dpi = resolution;
+ break;
+
+ case SANE_TYPE_FIXED:
+ dpi = SANE_FIX(resolution);
+ break;
+
+ default:
+ fprintf(stderr, "set_resolution: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ return 1; /* error */
+ }
+ }
+ else if (opt->constraint_type == SANE_CONSTRAINT_WORD_LIST)
+ {
+ switch (opt->type)
+ {
+ case SANE_TYPE_INT:
+ dpi = resolution;
+ break;
+
+ case SANE_TYPE_FIXED:
+ dpi = SANE_FIX(resolution);
+ break;
+
+ default:
+ fprintf(stderr, "set_resolution: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ return 1; /* error */
+ }
+
+ items = opt->constraint.word_list[0];
+ bestdpi = opt->constraint.word_list[1];
+ diff = abs(bestdpi - dpi);
+
+ for (i=1; i<=items; i++)
+ {
+ val = opt->constraint.word_list[i];
+ if (abs(val - dpi) < diff)
+ {
+ diff = abs(val - dpi);
+ bestdpi = val;
+ }
+ }
+
+ if (bestdpi == -1)
+ {
+ fprintf(stderr, "set_resolution: %s\n", ERR_FAILED_SET_RESOLUTION);
+ return -1;
+ }
+ dpi = bestdpi;
+ }
+ else
+ {
+ fprintf(stderr, "set_resolution: %s %d\n", ERR_UNKNOWN_CONSTRAINT_TYPE, opt->constraint_type);
+ return 1; /* error */
+ }
+
+ sane_control_option(dialog->dev, well_known_option, SANE_ACTION_SET_VALUE, &dpi, 0);
+ return 0; /* everything is ok */
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_set_all_resolutions(void)
+{
+ xsane_set_resolution(dialog->well_known.dpi_y, xsane.resolution_y); /* set y resolution if possible */
+ if (xsane_set_resolution(dialog->well_known.dpi_x, xsane.resolution_x)) /* set x resolution if possible */
+ {
+ xsane_set_resolution(dialog->well_known.dpi, xsane.resolution); /* set common resolution if necessary */
+ xsane.resolution_x = xsane.resolution;
+ xsane.resolution_y = xsane.resolution;
+ }
+
+ xsane.zoom = xsane.resolution / preferences.printer[preferences.printernr]->resolution;
+ xsane.zoom_x = xsane.resolution_x / preferences.printer[preferences.printernr]->resolution;
+ xsane.zoom_y = xsane.resolution_y / preferences.printer[preferences.printernr]->resolution;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_define_maximum_output_size()
+{
+ const SANE_Option_Descriptor *opt;
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.coord[0]);
+
+ if ( (opt) && (opt->unit== SANE_UNIT_MM) )
+ {
+ if (xsane.xsane_mode == XSANE_COPY)
+ {
+ if (preferences.psrotate) /* rotate: landscape */
+ {
+ preview_set_maximum_output_size(xsane.preview,
+ preferences.printer[preferences.printernr]->height / xsane.zoom_y,
+ preferences.printer[preferences.printernr]->width / xsane.zoom_x);
+ }
+ else /* do not rotate: portrait */
+ {
+ preview_set_maximum_output_size(xsane.preview,
+ preferences.printer[preferences.printernr]->width / xsane.zoom_x,
+ preferences.printer[preferences.printernr]->height / xsane.zoom_y);
+ }
+ }
+ else if (xsane.xsane_mode == XSANE_FAX)
+ {
+ preview_set_maximum_output_size(xsane.preview, preferences.fax_width, preferences.fax_height);
+ }
+ else
+ {
+ preview_set_maximum_output_size(xsane.preview, INF, INF);
+ }
+ }
+ else
+ {
+ preview_set_maximum_output_size(xsane.preview, INF, INF);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_close_dialog_callback(GtkWidget *widget, gpointer data)
+{
+ GtkWidget *dialog = data;
+
+ gtk_widget_destroy(dialog);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+int authorization_flag;
+
+void xsane_authorization_button_callback(GtkWidget *widget, gpointer data)
+{
+ authorization_flag = (long) data;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+gint xsane_authorization_callback(SANE_String_Const resource,
+ SANE_Char username[SANE_MAX_USERNAME_LEN],
+ SANE_Char password[SANE_MAX_PASSWORD_LEN])
+{
+ GtkWidget *authorize_dialog, *vbox, *hbox, *button, *label;
+ GtkWidget *username_widget, *password_widget;
+ char buf[256];
+ char *input;
+ int len;
+
+ authorize_dialog = gtk_window_new(GTK_WINDOW_DIALOG);
+ gtk_window_set_position(GTK_WINDOW(authorize_dialog), GTK_WIN_POS_CENTER);
+ gtk_window_set_policy(GTK_WINDOW(authorize_dialog), FALSE, FALSE, FALSE);
+ gtk_signal_connect(GTK_OBJECT(authorize_dialog), "delete_event",
+ GTK_SIGNAL_FUNC(xsane_authorization_button_callback), (void *) -1); /* -1 = cancel */
+ snprintf(buf, sizeof(buf), "%s %s", prog_name, WINDOW_AUTHORIZE);
+ gtk_window_set_title(GTK_WINDOW(authorize_dialog), buf);
+ xsane_set_window_icon(authorize_dialog, 0);
+
+ vbox = gtk_vbox_new(/* not homogeneous */ FALSE, 10); /* y-space between all box items */
+ gtk_container_add(GTK_CONTAINER(authorize_dialog), vbox);
+ gtk_widget_show(vbox);
+
+ snprintf(buf, sizeof(buf), "\n\n%s %s\n", TEXT_AUTHORIZATION_REQ, resource);
+ label = gtk_label_new(buf);
+ gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); /* y-space around authorization text */
+ gtk_widget_show(label);
+
+ /* ask for username */
+ hbox = gtk_hbox_new(FALSE, 10); /* x-space between label and input filed */
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); /* y-space around inner items */
+
+ label = gtk_label_new(TEXT_USERNAME);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 10); /* x-space around label */
+ gtk_widget_show(label);
+
+ username_widget = gtk_entry_new_with_max_length(SANE_MAX_USERNAME_LEN-1);
+ gtk_widget_set_usize(username_widget, 250, 0);
+ gtk_entry_set_text(GTK_ENTRY(username_widget), "");
+ gtk_box_pack_end(GTK_BOX(hbox), username_widget, FALSE, FALSE, 10); /* x-space around input filed */
+ gtk_widget_show(username_widget);
+ gtk_widget_show(hbox);
+
+
+ /* ask for password */
+ hbox = gtk_hbox_new(FALSE, 10); /* x-space between label and input filed */
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); /* y-space around inner items */
+
+ label = gtk_label_new(TEXT_PASSWORD);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 10); /* x-space around label */
+ gtk_widget_show(label);
+
+ password_widget = gtk_entry_new_with_max_length(SANE_MAX_PASSWORD_LEN-1);
+ gtk_entry_set_visibility(GTK_ENTRY(password_widget), FALSE); /* make entered text invisible */
+ gtk_widget_set_usize(password_widget, 250, 0);
+ gtk_entry_set_text(GTK_ENTRY(password_widget), "");
+ gtk_box_pack_end(GTK_BOX(hbox), password_widget, FALSE, FALSE, 10); /* x-space around input filed */
+ gtk_widget_show(password_widget);
+ gtk_widget_show(hbox);
+
+ /* buttons */
+ hbox = gtk_hbox_new(TRUE, 10); /* x-space between buttons */
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 10); /* y-space around buttons */
+
+ button = gtk_button_new_with_label(BUTTON_OK);
+ GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(xsane_authorization_button_callback), (void *) 1);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 10); /* x-space around OK-button */
+ gtk_widget_grab_default(button);
+ gtk_widget_show(button);
+
+ button = gtk_button_new_with_label(BUTTON_CANCEL);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(xsane_authorization_button_callback), (void *) -1);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 10); /* x-space around cancel-button */
+ gtk_widget_show(button);
+
+ gtk_widget_show(hbox);
+
+ gtk_widget_show(authorize_dialog);
+
+
+ username[0]=0;
+ password[0]=0;
+
+ authorization_flag = 0;
+
+ /* wait for ok or cancel */
+ while (authorization_flag == 0)
+ {
+ gtk_main_iteration();
+ }
+
+ if (authorization_flag == 1) /* 1=ok, -1=cancel */
+ {
+ input = gtk_entry_get_text(GTK_ENTRY(username_widget));
+ len = strlen(input);
+ memcpy(username, input, len);
+ username[len] = 0;
+
+ input = gtk_entry_get_text(GTK_ENTRY(password_widget));
+ len = strlen(input);
+ memcpy(password, input, len);
+ password[len] = 0;
+ }
+ gtk_widget_destroy(authorize_dialog);
+ return TRUE;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_progress_cancel(GtkWidget *widget, gpointer data)
+{
+ XsaneProgress_t *p = (XsaneProgress_t *) data;
+
+ (*p->callback) ();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+XsaneProgress_t *xsane_progress_new(char *title, char *text, GtkSignalFunc callback, gpointer callback_data)
+{
+ GtkWidget *button, *label;
+ GtkBox *vbox, *hbox;
+ XsaneProgress_t *p;
+ static const int progress_x = 5;
+ static const int progress_y = 5;
+
+ p = (XsaneProgress_t *) malloc(sizeof(XsaneProgress_t));
+ p->callback = callback;
+
+ p->shell = gtk_dialog_new();
+ gtk_widget_set_uposition(p->shell, progress_x, progress_y);
+ gtk_window_set_title(GTK_WINDOW (p->shell), title);
+
+ xsane_set_window_icon(p->shell, 0);
+
+ vbox = GTK_BOX(GTK_DIALOG(p->shell)->vbox);
+ hbox = GTK_BOX(GTK_DIALOG(p->shell)->action_area);
+
+ gtk_container_set_border_width(GTK_CONTAINER (vbox), 7);
+
+ label = gtk_label_new(text);
+ gtk_misc_set_alignment(GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start(vbox, label, FALSE, TRUE, 0);
+
+ p->pbar = gtk_progress_bar_new();
+ gtk_widget_set_usize(p->pbar, 200, 20);
+ gtk_box_pack_start(vbox, p->pbar, TRUE, TRUE, 0);
+
+ button = gtk_toggle_button_new_with_label(BUTTON_CANCEL);
+ gtk_signal_connect(GTK_OBJECT (button), "clicked", (GtkSignalFunc) xsane_progress_cancel, p);
+ gtk_box_pack_start(hbox, button, TRUE, TRUE, 0);
+
+ gtk_widget_show(label);
+ gtk_widget_show(p->pbar);
+ gtk_widget_show(button);
+ gtk_widget_show(GTK_WIDGET (p->shell));
+ return p;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_progress_free(XsaneProgress_t *p)
+{
+ if (p)
+ {
+ gtk_widget_destroy(p->shell);
+ free (p);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_progress_update(XsaneProgress_t *p, gfloat newval)
+{
+ if (p)
+ {
+ gtk_progress_bar_update(GTK_PROGRESS_BAR(p->pbar), newval);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_toggle_button_new_with_pixmap(GtkWidget *parent, const char *xpm_d[], const char *desc,
+ int *state, void *xsane_toggle_button_callback)
+{
+ GtkWidget *button;
+ GtkWidget *pixmapwidget;
+ GdkBitmap *mask;
+ GdkPixmap *pixmap;
+
+ button = gtk_toggle_button_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, button, desc);
+
+ pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) xpm_d);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_container_add(GTK_CONTAINER(button), pixmapwidget);
+ gtk_widget_show(pixmapwidget);
+ gdk_pixmap_unref(pixmap);
+
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *state);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_toggle_button_callback, (GtkObject *)state);
+ gtk_box_pack_start(GTK_BOX(parent), button, FALSE, FALSE, 0);
+ gtk_widget_show(button);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+GtkWidget *xsane_button_new_with_pixmap(GtkWidget *parent, const char *xpm_d[], const char *desc,
+ void *xsane_button_callback, gpointer data)
+{
+ GtkWidget *button;
+ GtkWidget *pixmapwidget;
+ GdkBitmap *mask;
+ GdkPixmap *pixmap;
+
+ button = gtk_button_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, button, desc);
+
+ pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) xpm_d);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_container_add(GTK_CONTAINER(button), pixmapwidget);
+ gtk_widget_show(pixmapwidget);
+ gdk_pixmap_unref(pixmap);
+
+ if (xsane_button_callback)
+ {
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_button_callback, data);
+ }
+ gtk_box_pack_start(GTK_BOX(parent), button, FALSE, FALSE, 0);
+ gtk_widget_show(button);
+
+ return(button);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int xsane_option_menu_lookup(GSGMenuItem menu_items[], const char *string)
+{
+ int i;
+
+ for (i = 0; strcmp(menu_items[i].label, string) != 0; ++i);
+ return i;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_option_menu_callback(GtkWidget *widget, gpointer data)
+{
+ GSGMenuItem *menu_item = data;
+ GSGDialogElement *elem = menu_item->elem;
+ const SANE_Option_Descriptor *opt;
+ GSGDialog *dialog = elem->dialog;
+ int opt_num;
+ double dval;
+ SANE_Word val;
+ void *valp = &val;
+
+ opt_num = elem - dialog->element;
+ opt = sane_get_option_descriptor(dialog->dev, opt_num);
+ switch (opt->type)
+ {
+ case SANE_TYPE_INT:
+ sscanf(menu_item->label, "%d", &val);
+ break;
+
+ case SANE_TYPE_FIXED:
+ sscanf(menu_item->label, "%lg", &dval);
+ val = SANE_FIX(dval);
+ break;
+
+ case SANE_TYPE_STRING:
+ valp = menu_item->label;
+ break;
+
+ default:
+ fprintf(stderr, "xsane_option_menu_callback: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ break;
+ }
+ xsane_back_gtk_set_option(dialog, opt_num, valp, SANE_ACTION_SET_VALUE);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_option_menu_new(GtkWidget *parent, char *str_list[], const char *val, int option_number, const char *desc,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name)
+{
+ GtkWidget *option_menu, *menu, *item;
+ GSGMenuItem *menu_items;
+ GSGDialogElement *elem;
+ int i, num_items;
+
+ elem = dialog->element + option_number;
+
+ for (num_items = 0; str_list[num_items]; ++num_items);
+ menu_items = malloc(num_items * sizeof(menu_items[0]));
+
+ menu = gtk_menu_new();
+ if (widget_name)
+ {
+ gtk_widget_set_name(menu, widget_name);
+ }
+
+ for (i = 0; i < num_items; ++i)
+ {
+ item = gtk_menu_item_new_with_label(_BGT(str_list[i]));
+ gtk_container_add(GTK_CONTAINER(menu), item);
+
+ if (option_menu_callback)
+ {
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) option_menu_callback, menu_items + i);
+ }
+ else
+ {
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_option_menu_callback, menu_items + i);
+ }
+
+ gtk_widget_show(item);
+
+ menu_items[i].label = str_list[i];
+ menu_items[i].elem = elem;
+ menu_items[i].index = i;
+ }
+
+ option_menu = gtk_option_menu_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, option_menu, desc);
+ gtk_box_pack_end(GTK_BOX(parent), option_menu, FALSE, FALSE, 2);
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), menu);
+ gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), xsane_option_menu_lookup(menu_items, val));
+
+ gtk_widget_show(option_menu);
+
+ gtk_widget_set_sensitive(option_menu, settable);
+
+ elem->widget = option_menu;
+ elem->menu_size = num_items;
+ elem->menu = menu_items;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_option_menu_new_with_pixmap(GtkBox *parent, const char *xpm_d[], const char *desc,
+ char *str_list[], const char *val,
+ GtkObject **data, int option,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name)
+{
+ GtkWidget *hbox;
+ GtkWidget *pixmapwidget;
+ GdkBitmap *mask;
+ GdkPixmap *pixmap;
+
+ hbox = gtk_hbox_new(FALSE, 5);
+ gtk_box_pack_start(parent, hbox, FALSE, FALSE, 0);
+
+ pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) xpm_d);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
+ gtk_widget_show(pixmapwidget);
+
+ xsane_option_menu_new(hbox, str_list, val, option, desc, option_menu_callback, settable, widget_name);
+ gtk_widget_show(hbox);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_scale_new(GtkBox *parent, char *labeltext, const char *desc,
+ float min, float max, float quant, float step, float page_step,
+ int digits, double *val, GtkObject **data, void *xsane_scale_callback, SANE_Int settable)
+{
+ GtkWidget *hbox;
+ GtkWidget *label;
+ GtkWidget *scale;
+
+ hbox = gtk_hbox_new(FALSE, 5);
+ gtk_box_pack_start(parent, hbox, FALSE, FALSE, 0);
+
+ label = gtk_label_new(labeltext);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+
+ *data = gtk_adjustment_new(*val, min, max, quant, step, page_step);
+ scale = gtk_hscale_new(GTK_ADJUSTMENT(*data));
+ xsane_back_gtk_set_tooltip(dialog->tooltips, scale, desc);
+ gtk_widget_set_usize(scale, 201, 0); /* minimum scale with = 201 pixels */
+ gtk_range_set_update_policy(GTK_RANGE(scale), preferences.gtk_update_policy);
+ /* GTK_UPDATE_CONTINUOUS, GTK_UPDATE_DISCONTINUOUS, GTK_UPDATE_DELAYED */
+ gtk_scale_set_value_pos(GTK_SCALE(scale), GTK_POS_TOP);
+ gtk_scale_set_digits(GTK_SCALE(scale), digits);
+ gtk_box_pack_end(GTK_BOX(hbox), scale, FALSE, TRUE, 5); /* make scale not sizeable */
+
+ if (xsane_scale_callback)
+ {
+ gtk_signal_connect(*data, "value_changed", (GtkSignalFunc) xsane_scale_callback, val);
+ }
+
+ gtk_widget_show(label);
+ gtk_widget_show(scale);
+ gtk_widget_show(hbox);
+
+ gtk_widget_set_sensitive(scale, settable);
+
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_scale_new_with_pixmap(GtkBox *parent, const char *xpm_d[], const char *desc,
+ float min, float max, float quant, float step, float page_step, int digits,
+ double *val, GtkObject **data, int option, void *xsane_scale_callback, SANE_Int settable)
+{
+ GtkWidget *hbox;
+ GtkWidget *scale;
+ GtkWidget *pixmapwidget;
+ GdkBitmap *mask;
+ GdkPixmap *pixmap;
+
+ hbox = gtk_hbox_new(FALSE, 5);
+ gtk_box_pack_start(parent, hbox, FALSE, FALSE, 0);
+
+ pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) xpm_d);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
+
+ *data = gtk_adjustment_new(*val, min, max, quant, step, page_step);
+ scale = gtk_hscale_new(GTK_ADJUSTMENT(*data));
+ xsane_back_gtk_set_tooltip(dialog->tooltips, scale, desc);
+ gtk_widget_set_usize(scale, 201, 0); /* minimum scale with = 201 pxiels */
+ gtk_range_set_update_policy(GTK_RANGE(scale), preferences.gtk_update_policy);
+ /* GTK_UPDATE_CONTINUOUS, GTK_UPDATE_DISCONTINUOUS, GTK_UPDATE_DELAYED */
+ gtk_scale_set_value_pos(GTK_SCALE(scale), GTK_POS_TOP);
+ gtk_scale_set_digits(GTK_SCALE(scale), digits);
+ gtk_box_pack_end(GTK_BOX(hbox), scale, TRUE, TRUE, 5); /* make scale sizeable */
+
+ if (xsane_scale_callback)
+ {
+ gtk_signal_connect(*data, "value_changed", (GtkSignalFunc) xsane_scale_callback, val);
+ }
+
+ gtk_widget_show(pixmapwidget);
+ gtk_widget_show(scale);
+ gtk_widget_show(hbox);
+
+ gtk_widget_set_sensitive(scale, settable);
+
+ gdk_pixmap_unref(pixmap);
+
+ if ( (dialog) && (option) )
+ {
+ GSGDialogElement *elem;
+
+ elem=dialog->element + option;
+ elem->data = *data;
+ elem->widget = scale;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_separator_new(GtkWidget *xsane_parent, int dist)
+{
+ GtkWidget *xsane_separator;
+
+ xsane_separator = gtk_hseparator_new();
+ gtk_box_pack_start(GTK_BOX(xsane_parent), xsane_separator, FALSE, FALSE, dist);
+ gtk_widget_show(xsane_separator);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+GtkWidget *xsane_info_table_text_new(GtkWidget *table, gchar *text, int row, int colomn)
+{
+ GtkWidget *hbox, *label;
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_table_attach_defaults(GTK_TABLE(table), hbox, row, row+1, colomn, colomn+1);
+ gtk_widget_show(hbox);
+
+ label = gtk_label_new(text);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 10);
+ gtk_widget_show(label);
+
+ return label;
+}
+/* ---------------------------------------------------------------------------------------------------------------------- */
+#if 0
+GtkWidget *xsane_info_text_new(GtkWidget *parent, gchar *text)
+{
+ GtkWidget *hbox, *label;
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(parent), hbox, TRUE, TRUE, 5);
+ gtk_widget_show(hbox);
+
+ label = gtk_label_new(text);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 10);
+ gtk_widget_show(label);
+
+ return label;
+}
+#endif
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_refresh_dialog(void *nothing)
+{
+ xsane_back_gtk_refresh_dialog(dialog);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
diff --git a/frontend/xsane-front-gtk.h b/frontend/xsane-front-gtk.h
new file mode 100644
index 0000000..600fa28
--- /dev/null
+++ b/frontend/xsane-front-gtk.h
@@ -0,0 +1,73 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-front-gtk.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include <sane/sane.h>
+#include "xsane.h"
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifndef xsane_front_gtk_h
+#define xsane_front_gtk_h
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+extern void xsane_get_bounds(const SANE_Option_Descriptor *opt, double *minp, double *maxp);
+extern int xsane_set_resolution(int well_known_option, int resolution);
+extern void xsane_set_all_resolutions(void);
+extern void xsane_define_maximum_output_size();
+extern void xsane_close_dialog_callback(GtkWidget *widget, gpointer data);
+extern void xsane_authorization_button_callback(GtkWidget *widget, gpointer data);
+extern gint xsane_authorization_callback(SANE_String_Const resource,
+ SANE_Char username[SANE_MAX_USERNAME_LEN],
+ SANE_Char password[SANE_MAX_PASSWORD_LEN]);
+extern void xsane_progress_cancel(GtkWidget *widget, gpointer data);
+extern XsaneProgress_t *xsane_progress_new(char *title, char *text, GtkSignalFunc callback, gpointer callback_data);
+extern void xsane_progress_free(XsaneProgress_t *p);
+extern void xsane_progress_update(XsaneProgress_t *p, gfloat newval);
+extern void xsane_toggle_button_new_with_pixmap(GtkWidget *parent, const char *xpm_d[], const char *desc,
+ int *state, void *xsane_toggle_button_callback);
+extern GtkWidget *xsane_button_new_with_pixmap(GtkWidget *parent, const char *xpm_d[], const char *desc,
+ void *xsane_button_callback, gpointer data);
+extern void xsane_pixmap_new(GtkWidget *parent, char *title, int width, int height, XsanePixmap *hist);
+extern void xsane_option_menu_new(GtkWidget *parent, char *str_list[], const char *val, int option_number, const char *desc,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name);
+extern void xsane_option_menu_new_with_pixmap(GtkBox *parent, const char *xpm_d[], const char *desc,
+ char *str_list[], const char *val,
+ GtkObject **data, int option,
+ void *option_menu_callback, SANE_Int settable, const gchar *widget_name);
+extern void xsane_scale_new(GtkBox *parent, char *labeltext, const char *desc,
+ float min, float max, float quant, float step, float xxx,
+ int digits, double *val, GtkObject **data, void *xsane_scale_callback, SANE_Int settable);
+extern void xsane_scale_new_with_pixmap(GtkBox *parent, const char *xpm_d[], const char *desc,
+ float min, float max, float quant, float step, float xxx, int digits,
+ double *val, GtkObject **data, int option, void *xsane_scale_callback, SANE_Int settable);
+extern void xsane_separator_new(GtkWidget *xsane_parent, int dist);
+extern GtkWidget *xsane_info_table_text_new(GtkWidget *table, gchar *text, int row, int colomn);
+extern GtkWidget *xsane_info_text_new(GtkWidget *parent, gchar *text);
+extern void xsane_refresh_dialog(void *nothing);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#endif
+
diff --git a/frontend/xsane-gamma.c b/frontend/xsane-gamma.c
new file mode 100644
index 0000000..90573f5
--- /dev/null
+++ b/frontend/xsane-gamma.c
@@ -0,0 +1,1541 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-gamma.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include "xsane.h"
+#include "xsane-front-gtk.h"
+#include "xsane-back-gtk.h"
+#include "xsane-preferences.h"
+#include "xsane-preview.h"
+#include "xsane-save.h"
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+#include <png.h>
+#include <zlib.h>
+#endif
+#endif
+
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* forward declarations: */
+
+static void xsane_bound_double(double *value, double min, double max);
+void xsane_clear_histogram(XsanePixmap *hist);
+static void xsane_draw_histogram_with_points(XsanePixmap *hist, int invert,
+ SANE_Int *count, SANE_Int *count_red, SANE_Int *count_green, SANE_Int *count_blue,
+ int show_red, int show_green, int show_blue, int show_inten, double scale);
+static void xsane_draw_histogram_with_lines(XsanePixmap *hist, int invert,
+ SANE_Int *count, SANE_Int *count_red, SANE_Int *count_green, SANE_Int *count_blue,
+ int show_red, int show_green, int show_blue, int show_inten, double scale);
+void xsane_draw_slider_level(XsaneSlider *slider);
+static void xsane_set_slider(XsaneSlider *slider, double min, double mid, double max);
+void xsane_update_slider(XsaneSlider *slider);
+void xsane_update_sliders(void);
+static gint xsane_slider_callback(GtkWidget *widget, GdkEvent *event, XsaneSlider *slider);
+void xsane_create_slider(XsaneSlider *slider);
+void xsane_create_histogram(GtkWidget *parent, const char *title, int width, int height, XsanePixmap *hist);
+static void xsane_calculate_auto_enhancement(int negative,
+ SANE_Int *count_raw, SANE_Int *count_raw_red, SANE_Int *count_raw_green, SANE_Int *count_raw_blue);
+void xsane_calculate_histogram(void);
+void xsane_update_histogram(void);
+void xsane_histogram_toggle_button_callback(GtkWidget *widget, gpointer data);
+void xsane_create_gamma_curve(SANE_Int *gammadata, int negative, double gamma,
+ double brightness, double contrast, int numbers, int maxout);
+void xsane_update_gamma(void);
+static void xsane_enhancement_update(void);
+static void xsane_gamma_to_histogram(double *min, double *mid, double *max,
+ double contrast, double brightness, double gamma);
+void xsane_enhancement_by_gamma(void);
+void xsane_enhancement_restore_default(void);
+void xsane_enhancement_restore(void);
+void xsane_enhancement_store(void);
+static void xsane_histogram_to_gamma(XsaneSlider *slider, double *contrast, double *brightness, double *gamma);
+void xsane_enhancement_by_histogram(void);
+static gint xsane_histogram_win_delete(GtkWidget *widget, gpointer data);
+void xsane_create_histogram_dialog(const char *devicetext);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_bound_double(double *value, double min, double max)
+{
+ if (*value < min)
+ {
+ *value = min;
+ }
+
+ if (*value > max)
+ {
+ *value = max;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_clear_histogram(XsanePixmap *hist)
+{
+ GdkRectangle rect;
+
+ if(hist->pixmap)
+ {
+ rect.x=0;
+ rect.y=0;
+ rect.width = HIST_WIDTH;
+ rect.height = HIST_HEIGHT;
+
+ gdk_draw_rectangle(hist->pixmap, xsane.gc_backg, TRUE, 0, 0, HIST_WIDTH, HIST_HEIGHT);
+ gtk_widget_draw(hist->pixmapwid, &rect);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_draw_histogram_with_points(XsanePixmap *hist, int invert,
+ SANE_Int *count, SANE_Int *count_red, SANE_Int *count_green, SANE_Int *count_blue,
+ int show_red, int show_green, int show_blue, int show_inten, double scale)
+{
+ GdkRectangle rect;
+ int i;
+ int inten, red, green, blue;
+ int colval;
+
+#define XD 1
+#define YD 2
+
+ if(hist->pixmap)
+ {
+ rect.x=0;
+ rect.y=0;
+ rect.width = HIST_WIDTH;
+ rect.height = HIST_HEIGHT;
+
+ gdk_draw_rectangle(hist->pixmap, xsane.gc_backg, TRUE, 0, 0, HIST_WIDTH, HIST_HEIGHT);
+
+ red = 0;
+ green = 0;
+ blue = 0;
+
+ for (i=0; i < HIST_WIDTH; i++)
+ {
+ if (invert)
+ {
+ colval = 255-i;
+ }
+ else
+ {
+ colval = i;
+ }
+
+ inten = show_inten * count[colval] * scale;
+
+ if (xsane.xsane_color)
+ {
+ red = show_red * count_red[colval] * scale;
+ green = show_green * count_green[colval] * scale;
+ blue = show_blue * count_blue[colval] * scale;
+ }
+
+ if (inten > HIST_HEIGHT)
+ inten = HIST_HEIGHT;
+
+ if (red > HIST_HEIGHT)
+ red = HIST_HEIGHT;
+
+ if (green > HIST_HEIGHT)
+ green = HIST_HEIGHT;
+
+ if (blue > HIST_HEIGHT)
+ blue = HIST_HEIGHT;
+
+
+ gdk_draw_rectangle(hist->pixmap, xsane.gc_red, TRUE, i, HIST_HEIGHT - red, XD, YD);
+ gdk_draw_rectangle(hist->pixmap, xsane.gc_green, TRUE, i, HIST_HEIGHT - green, XD, YD);
+ gdk_draw_rectangle(hist->pixmap, xsane.gc_blue, TRUE, i, HIST_HEIGHT - blue, XD, YD);
+ gdk_draw_rectangle(hist->pixmap, xsane.gc_black, TRUE, i, HIST_HEIGHT - inten, XD, YD);
+ }
+
+ gtk_widget_draw(hist->pixmapwid, &rect);
+ }
+}
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_draw_histogram_with_lines(XsanePixmap *hist, int invert,
+ SANE_Int *count, SANE_Int *count_red, SANE_Int *count_green, SANE_Int *count_blue,
+ int show_red, int show_green, int show_blue, int show_inten, double scale)
+{
+ GdkRectangle rect;
+ int i, j, k;
+ int inten, red, green, blue;
+ int inten0=0, red0=0, green0=0, blue0=0;
+ int val[4];
+ int val2[4];
+ int color[4];
+ int val_swap;
+ int color_swap;
+ int colval;
+
+ if (hist->pixmap)
+ {
+ rect.x=0;
+ rect.y=0;
+ rect.width = HIST_WIDTH;
+ rect.height = HIST_HEIGHT;
+
+ gdk_draw_rectangle(hist->pixmap, xsane.gc_backg, TRUE, 0, 0, HIST_WIDTH, HIST_HEIGHT);
+
+ red = 0;
+ green = 0;
+ blue = 0;
+
+ for (i=0; i < HIST_WIDTH; i++)
+ {
+ if (invert)
+ {
+ colval = 255-i;
+ }
+ else
+ {
+ colval = i;
+ }
+
+ inten = show_inten * count[colval] * scale;
+
+ if (xsane.xsane_color)
+ {
+ red = show_red * count_red[colval] * scale;
+ green = show_green * count_green[colval] * scale;
+ blue = show_blue * count_blue[colval] * scale;
+ }
+
+ if (inten > HIST_HEIGHT)
+ inten = HIST_HEIGHT;
+
+ if (red > HIST_HEIGHT)
+ red = HIST_HEIGHT;
+
+ if (green > HIST_HEIGHT)
+ green = HIST_HEIGHT;
+
+ if (blue > HIST_HEIGHT)
+ blue = HIST_HEIGHT;
+
+ val[0] = red; color[0] = 0;
+ val[1] = green; color[1] = 1;
+ val[2] = blue; color[2] = 2;
+ val[3] = inten; color[3] = 3;
+
+ for (j=0; j<3; j++)
+ {
+ for (k=j+1; k<4; k++)
+ {
+ if (val[j] < val[k])
+ {
+ val_swap = val[j];
+ color_swap = color[j];
+ val[j] = val[k];
+ color[j] = color[k];
+ val[k] = val_swap;
+ color[k] = color_swap;
+ }
+ }
+ }
+ val2[0]=val[1]+1;
+ val2[1]=val[2]+1;
+ val2[2]=val[3]+1;
+ val2[3]=0;
+
+ for (j=0; j<4; j++)
+ {
+ switch(color[j])
+ {
+ case 0: red0 = val2[j];
+ break;
+ case 1: green0 = val2[j];
+ break;
+ case 2: blue0 = val2[j];
+ break;
+ case 3: inten0 = val2[j];
+ break;
+ }
+ }
+
+
+ gdk_draw_line(hist->pixmap, xsane.gc_red, i, HIST_HEIGHT - red, i, HIST_HEIGHT - red0);
+ gdk_draw_line(hist->pixmap, xsane.gc_green, i, HIST_HEIGHT - green, i, HIST_HEIGHT - green0);
+ gdk_draw_line(hist->pixmap, xsane.gc_blue, i, HIST_HEIGHT - blue, i, HIST_HEIGHT - blue0);
+ gdk_draw_line(hist->pixmap, xsane.gc_black, i, HIST_HEIGHT - inten, i, HIST_HEIGHT - inten0);
+ }
+
+ gtk_widget_draw(hist->pixmapwid, &rect);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_establish_slider(XsaneSlider *slider)
+{
+ int x, y, pos, len;
+ guchar buf[XSANE_SLIDER_WIDTH*3];
+ GdkRectangle rect;
+
+ buf[0] = buf[1] = buf[2] = 0;
+ buf[3+0] = buf[3+1] = buf[3+2]= 0;
+
+ for (x=0; x<256; x++)
+ {
+ buf[3*x+0+6] = x * slider->r;
+ buf[3*x+1+6] = x * slider->g;
+ buf[3*x+2+6] = x * slider->b;
+ }
+
+ buf[258*3+0] = 255 * slider->r;
+ buf[258*3+1] = 255 * slider->g;
+ buf[258*3+2] = 255 * slider->b;
+
+ buf[259*3+0] = 255 * slider->r;
+ buf[259*3+1] = 255 * slider->g;
+ buf[259*3+2] = 255 * slider->b;
+
+ for (y=0; y<XSANE_SLIDER_HEIGHT; y++)
+ {
+ pos = slider->position[0]-y/2;
+ len = y;
+ if (pos<-2)
+ {
+ len = len + pos + 2;
+ pos = -2;
+ }
+ pos = pos * 3 + 6;
+
+ for (x=0; x<=len; x++)
+ {
+ if ((x == 0) || (x == len) || (y == XSANE_SLIDER_HEIGHT-1))
+ {
+ buf[pos++] = 255;
+ buf[pos++] = 255;
+ buf[pos++] = 255;
+ }
+ else
+ {
+ buf[pos++] = 0;
+ buf[pos++] = 0;
+ buf[pos++] = 0;
+ }
+ }
+
+
+ pos = slider->position[1]-y/2;
+ len = y;
+ pos = pos * 3 + 6;
+
+ for (x=0; x<=len; x++)
+ {
+ if ((x == 0) || (x == len) || (y == XSANE_SLIDER_HEIGHT-1))
+ {
+ buf[pos++] = 255;
+ buf[pos++] = 255;
+ buf[pos++] = 255;
+ }
+ else
+ {
+ buf[pos++] = 128;
+ buf[pos++] = 128;
+ buf[pos++] = 128;
+ }
+ }
+
+
+ pos = slider->position[2]-y/2;
+ len = y;
+ if (pos+len>257)
+ {
+ len = 257 - pos;
+ }
+ pos = pos * 3 + 6;
+
+ for (x=0; x<=len; x++)
+ {
+ if ((x == 0) || (x == len) || (y == XSANE_SLIDER_HEIGHT-1))
+ {
+ buf[pos++] = 0;
+ buf[pos++] = 0;
+ buf[pos++] = 0;
+ }
+ else
+ {
+ buf[pos++] = 255;
+ buf[pos++] = 255;
+ buf[pos++] = 255;
+ }
+ }
+
+ gtk_preview_draw_row(GTK_PREVIEW(slider->preview),buf, 0, y, XSANE_SLIDER_WIDTH);
+ }
+
+ rect.x=0;
+ rect.y=0;
+ rect.width = XSANE_SLIDER_WIDTH;
+ rect.height = XSANE_SLIDER_HEIGHT;
+
+ gtk_widget_draw(slider->preview, &rect);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_draw_slider_level(XsaneSlider *slider)
+{
+ int i;
+ guchar buf[XSANE_SLIDER_WIDTH*3];
+ GdkRectangle rect;
+
+ buf[0] = buf[1] = buf[2] = 0;
+ buf[3+0] = buf[3+1] = buf[3+2]= 0;
+
+ for (i=0; i<256; i++)
+ {
+ buf[3*i+0+6] = i * slider->r;
+ buf[3*i+1+6] = i * slider->g;
+ buf[3*i+2+6] = i * slider->b;
+ }
+
+ buf[258*3+0] = 255 * slider->r;
+ buf[258*3+1] = 255 * slider->g;
+ buf[258*3+2] = 255 * slider->b;
+
+ buf[259*3+0] = 255 * slider->r;
+ buf[259*3+1] = 255 * slider->g;
+ buf[259*3+2] = 255 * slider->b;
+
+ for (i=0; i<XSANE_SLIDER_HEIGHT; i++)
+ {
+ gtk_preview_draw_row(GTK_PREVIEW(slider->preview),buf, 0, i, XSANE_SLIDER_WIDTH);
+ }
+
+ rect.x=0;
+ rect.y=0;
+ rect.width = XSANE_SLIDER_WIDTH;
+ rect.height = XSANE_SLIDER_HEIGHT;
+
+ gtk_widget_draw(slider->preview, &rect);
+}
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_set_slider(XsaneSlider *slider, double min, double mid, double max)
+{
+ slider->value[0] = min;
+ slider->value[1] = mid;
+ slider->value[2] = max;
+
+ slider->position[0] = min * 2.55;
+ slider->position[1] = mid * 2.55;
+ slider->position[2] = max * 2.55;
+
+ xsane_establish_slider(slider);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_update_slider(XsaneSlider *slider)
+{
+ slider->position[0] = 2.55 * slider->value[0];
+ slider->position[1] = 2.55 * slider->value[1];
+ slider->position[2] = 2.55 * slider->value[2];
+
+ xsane_establish_slider(slider);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_update_sliders()
+{
+ xsane_update_slider(&xsane.slider_gray);
+
+ if ( (xsane.xsane_color) && (!xsane.enhancement_rgb_default) )
+ {
+ xsane_update_slider(&xsane.slider_red);
+ xsane_update_slider(&xsane.slider_green);
+ xsane_update_slider(&xsane.slider_blue);
+
+ xsane.slider_gray.active &= ~XSANE_SLIDER_INACTIVE; /* mark slider active */
+ xsane.slider_red.active &= ~XSANE_SLIDER_INACTIVE; /* mark slider active */
+ xsane.slider_green.active &= ~XSANE_SLIDER_INACTIVE; /* mark slider active */
+ xsane.slider_blue.active &= ~XSANE_SLIDER_INACTIVE; /* mark slider active */
+ }
+ else
+ {
+ xsane_draw_slider_level(&xsane.slider_red); /* remove slider */
+ xsane_draw_slider_level(&xsane.slider_green); /* remove slider */
+ xsane_draw_slider_level(&xsane.slider_blue); /* remove slider */
+
+ xsane.slider_red.active = XSANE_SLIDER_INACTIVE; /* mark slider inactive */
+ xsane.slider_green.active = XSANE_SLIDER_INACTIVE; /* mark slider inactive */
+ xsane.slider_blue.active = XSANE_SLIDER_INACTIVE; /* mark slider inactive */
+
+ if (xsane.param.depth == 1)
+ {
+ xsane_draw_slider_level(&xsane.slider_gray); /* remove slider */
+ xsane.slider_gray.active = XSANE_SLIDER_INACTIVE; /* mark slider inactive */
+ }
+ else
+ {
+ xsane.slider_gray.active &= ~XSANE_SLIDER_INACTIVE; /* mark slider active */
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static gint xsane_slider_callback(GtkWidget *widget, GdkEvent *event, XsaneSlider *slider)
+{
+ GdkEventButton *button_event;
+ GdkEventMotion *motion_event;
+ int distance;
+ int i = 0;
+ static int update = FALSE;
+ static int event_count = 0;
+ static int x;
+
+ if (slider->active == XSANE_SLIDER_INACTIVE)
+ {
+ return 0;
+ }
+
+ event_count++;
+
+ switch(event->type)
+ {
+ case GDK_BUTTON_PRESS:
+ gtk_grab_add(widget);
+ button_event = (GdkEventButton *) event;
+
+ distance = G_MAXINT;
+ for (i=0; i<3; i++)
+ {
+ if (fabs(button_event->x - slider->position[i]) < distance)
+ {
+ slider->active = i + 1;
+ distance = fabs(button_event->x - slider->position[i]);
+ }
+ }
+ if (distance<10)
+ {
+ x = button_event->x;
+ update = TRUE;
+ }
+ else
+ {
+ slider->active = XSANE_SLIDER_ACTIVE;
+ }
+ break;
+
+ case GDK_BUTTON_RELEASE:
+ gtk_grab_remove(widget);
+ xsane_enhancement_by_histogram(); /* slider->active must be unchanged !!! */
+ slider->active = XSANE_SLIDER_ACTIVE; /* ok, now we can reset it */
+ break;
+
+ case GDK_MOTION_NOTIFY:
+ motion_event = (GdkEventMotion *) event;
+ gdk_window_get_pointer(widget->window, &x, 0, 0);
+ update = TRUE;
+ break;
+
+ default:
+ break;
+ }
+
+ if (update)
+ {
+ update = FALSE;
+ switch(slider->active)
+ {
+ case 1:
+ slider->value[0] = (x-XSANE_SLIDER_OFFSET) / 2.55;
+ xsane_bound_double(&slider->value[0], 0.0, slider->value[1] - 1);
+ break;
+
+ case 2:
+ slider->value[1] = (x-XSANE_SLIDER_OFFSET) / 2.55;
+ xsane_bound_double(&slider->value[1], slider->value[0] + 1, slider->value[2] - 1);
+ break;
+
+ case 3:
+ slider->value[2] = (x-XSANE_SLIDER_OFFSET) / 2.55;
+ xsane_bound_double(&slider->value[2], slider->value[1] + 1, 100.0);
+ break;
+
+ default:
+ break;
+ }
+ xsane_set_slider(slider, slider->value[0], slider->value[1], slider->value[2]);
+
+ if ((preferences.gtk_update_policy == GTK_UPDATE_CONTINUOUS) && (event_count == 1))
+ {
+ xsane_enhancement_by_histogram();
+ }
+ else if ((preferences.gtk_update_policy == GTK_UPDATE_DELAYED) && (event_count == 1))
+ {
+ xsane_enhancement_by_histogram();
+ }
+ }
+
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ event_count--;
+
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_create_slider(XsaneSlider *slider)
+{
+ slider->preview = gtk_preview_new(GTK_PREVIEW_COLOR);
+ gtk_preview_size(GTK_PREVIEW(slider->preview), XSANE_SLIDER_WIDTH, XSANE_SLIDER_HEIGHT);
+ gtk_widget_set_events(slider->preview, XSANE_SLIDER_EVENTS);
+ gtk_signal_connect(GTK_OBJECT(slider->preview), "event", GTK_SIGNAL_FUNC(xsane_slider_callback), slider);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_create_histogram(GtkWidget *parent, const char *title, int width, int height, XsanePixmap *hist)
+{
+ GdkBitmap *mask=NULL;
+
+ hist->frame = gtk_frame_new(title);
+ hist->pixmap = gdk_pixmap_new(xsane.histogram_dialog->window, width, height, -1);
+ hist->pixmapwid = gtk_pixmap_new(hist->pixmap, mask);
+ gtk_container_add(GTK_CONTAINER(hist->frame), hist->pixmapwid);
+ gdk_draw_rectangle(hist->pixmap, xsane.gc_backg, TRUE, 0, 0, width, height);
+
+ gtk_box_pack_start(GTK_BOX(parent), hist->frame, FALSE, FALSE, 2);
+ gtk_widget_show(hist->pixmapwid);
+ gtk_widget_show(hist->frame);
+ }
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_calculate_auto_enhancement(int negative,
+ SANE_Int *count_raw, SANE_Int *count_raw_red, SANE_Int *count_raw_green, SANE_Int *count_raw_blue)
+{ /* calculate white, medium and black values for auto enhancement */
+ int limit, limit_mid;
+ int points, points_mix, points_red, points_green, points_blue;
+ int min, mid, max;
+ int min_red, mid_red, max_red;
+ int min_green, mid_green, max_green;
+ int min_blue, mid_blue, max_blue;
+ int val;
+ int i;
+
+ if (xsane.preview)
+ {
+ points = 0;
+ points_mix = 0;
+ points_red = 0;
+ points_green = 0;
+ points_blue = 0;
+
+ for (i=0; i<256; i++)
+ {
+ points += count_raw[i];
+ points_mix += 10 * log(1 + count_raw[i] + count_raw_red[i] + count_raw_green[i] + count_raw_blue[i]);
+ points_red += 10 * log(1 + count_raw_red[i]);
+ points_green += 10 * log(1 + count_raw_green[i]);
+ points_blue += 10 * log(1 + count_raw_blue[i]);
+ }
+
+ limit = 1 + points / 5000;
+
+ /* ----- gray ----- */
+
+ min = -1;
+ val = 0;
+ while ( (val/4 < limit) && (min < 254) )
+ {
+ min++;
+ val += count_raw[min] + count_raw_red[min] + count_raw_green[min] + count_raw_blue[min];
+ }
+
+ max = HIST_WIDTH;
+ val = 0;
+ while ( (val/4 < limit) && (max > min + 1) )
+ {
+ max--;
+ val += count_raw[max] + count_raw_red[max] + count_raw_green[max] + count_raw_blue[max];
+ }
+
+ limit_mid = points_mix / 2.0;
+
+ mid = 0;
+ val = 0;
+ while ( (val < limit_mid) && (mid < max - 2) )
+ {
+ mid++;
+ val += 10 * log(1 + count_raw[mid] + count_raw_red[mid] + count_raw_green[mid] + count_raw_blue[mid]);
+ }
+
+ /* ----- red ----- */
+
+ min_red = -1;
+ val = 0;
+ while ( (val < limit) && (min_red < 254) )
+ {
+ min_red++;
+ val += count_raw_red[min_red];
+ }
+
+ max_red = HIST_WIDTH;
+ val = 0;
+ while ( (val < limit) && (max_red > min_red + 1) )
+ {
+ max_red--;
+ val += count_raw_red[max_red];
+ }
+
+ limit_mid = points_red / 2.0;
+
+ mid_red = 0;
+ val = 0;
+ while ( (val < limit_mid) && (mid_red < max_red - 2) )
+ {
+ mid_red++;
+ val += 10 * log(1 + count_raw_red[mid_red]);
+ }
+
+ /* ----- green ----- */
+
+ min_green = -1;
+ val = 0;
+ while ( (val < limit) && (min_green < 254) )
+ {
+ min_green++;
+ val += count_raw_green[min_green];
+ }
+
+ max_green = HIST_WIDTH;
+ val = 0;
+ while ( (val < limit) && (max_green > min_green + 1) )
+ {
+ max_green--;
+ val += count_raw_green[max_green];
+ }
+
+ limit_mid = points_green / 2.0;
+
+ mid_green = 0;
+ val = 0;
+ while ( (val < limit_mid) && (mid_green < max_green - 2) )
+ {
+ mid_green++;
+ val += 10 * log(1 + count_raw_green[mid_green]);
+ }
+
+ /* ----- blue ----- */
+
+ min_blue = -1;
+ val = 0;
+ while ( (val < limit) && (min_blue < 254) )
+ {
+ min_blue++;
+ val += count_raw_blue[min_blue];
+ }
+
+ max_blue = HIST_WIDTH;
+ val = 0;
+ while ( (val < limit) && (max_blue > min_blue + 1) )
+ {
+ max_blue--;
+ val += count_raw_blue[max_blue];
+ }
+
+ limit_mid = points_blue / 2.0;
+
+ mid_blue = 0;
+ val = 0;
+ while ( (val < limit_mid) && (mid_blue < max_blue - 2) )
+ {
+ mid_blue++;
+ val += 10 * log(1 + count_raw_blue[mid_blue]);
+ }
+
+ if (negative)
+ {
+ xsane.auto_white = (255-min)/2.55;
+ xsane.auto_gray = (255-mid)/2.55;
+ xsane.auto_black = (255-max)/2.55;
+
+ xsane.auto_white_red = (255-min_red)/2.55;
+ xsane.auto_gray_red = (255-mid_red)/2.55;
+ xsane.auto_black_red = (255-max_red)/2.55;
+
+ xsane.auto_white_green = (255-min_green)/2.55;
+ xsane.auto_gray_green = (255-mid_green)/2.55;
+ xsane.auto_black_green = (255-max_green)/2.55;
+
+ xsane.auto_white_blue = (255-min_blue)/2.55;
+ xsane.auto_gray_blue = (255-mid_blue)/2.55;
+ xsane.auto_black_blue = (255-max_blue)/2.55;
+ }
+ else /* positive */
+ {
+ xsane.auto_white = max/2.55;
+ xsane.auto_gray = mid/2.55;
+ xsane.auto_black = min/2.55;
+
+ xsane.auto_white_red = max_red/2.55;
+ xsane.auto_gray_red = mid_red/2.55;
+ xsane.auto_black_red = min_red/2.55;
+
+ xsane.auto_white_green = max_green/2.55;
+ xsane.auto_gray_green = mid_green/2.55;
+ xsane.auto_black_green = min_green/2.55;
+
+ xsane.auto_white_blue = max_blue/2.55;
+ xsane.auto_gray_blue = mid_blue/2.55;
+ xsane.auto_black_blue = min_blue/2.55;
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_calculate_histogram(void)
+{
+ SANE_Int *count_raw;
+ SANE_Int *count_raw_red;
+ SANE_Int *count_raw_green;
+ SANE_Int *count_raw_blue;
+ SANE_Int *count_enh;
+ SANE_Int *count_enh_red;
+ SANE_Int *count_enh_green;
+ SANE_Int *count_enh_blue;
+ int i;
+ int maxval_raw;
+ int maxval_enh;
+ int maxval;
+ double scale;
+
+ /* at first reset auto enhancement values */
+
+ xsane.auto_black = 0.0;
+ xsane.auto_gray = 50.0;
+ xsane.auto_white = 100.0;
+
+ xsane.auto_black_red = 0.0;
+ xsane.auto_gray_red = 50.0;
+ xsane.auto_white_red = 100.0;
+
+ xsane.auto_black_green = 0.0;
+ xsane.auto_gray_green = 50.0;
+ xsane.auto_white_green = 100.0;
+
+ xsane.auto_black_blue = 0.0;
+ xsane.auto_gray_blue = 50.0;
+ xsane.auto_white_blue = 100.0;
+
+ if (xsane.preview) /* preview window exists? */
+ {
+ count_raw = calloc(256, sizeof(SANE_Int));
+ count_raw_red = calloc(256, sizeof(SANE_Int));
+ count_raw_green = calloc(256, sizeof(SANE_Int));
+ count_raw_blue = calloc(256, sizeof(SANE_Int));
+ count_enh = calloc(256, sizeof(SANE_Int));
+ count_enh_red = calloc(256, sizeof(SANE_Int));
+ count_enh_green = calloc(256, sizeof(SANE_Int));
+ count_enh_blue = calloc(256, sizeof(SANE_Int));
+
+ preview_calculate_histogram(xsane.preview, count_raw, count_raw_red, count_raw_green, count_raw_blue,
+ count_enh, count_enh_red, count_enh_green, count_enh_blue);
+
+ if (xsane.param.depth > 1)
+ {
+ xsane_calculate_auto_enhancement(xsane.negative, count_raw, count_raw_red, count_raw_green, count_raw_blue);
+ }
+
+ if (xsane.histogram_log) /* logarithmical display */
+ {
+ for (i=0; i<=255; i++)
+ {
+ count_raw[i] = (int) (50*log(1.0 + count_raw[i]));
+ count_raw_red[i] = (int) (50*log(1.0 + count_raw_red[i]));
+ count_raw_green[i] = (int) (50*log(1.0 + count_raw_green[i]));
+ count_raw_blue[i] = (int) (50*log(1.0 + count_raw_blue[i]));
+
+ count_enh[i] = (int) (50*log(1.0 + count_enh[i]));
+ count_enh_red[i] = (int) (50*log(1.0 + count_enh_red[i]));
+ count_enh_green[i] = (int) (50*log(1.0 + count_enh_green[i]));
+ count_enh_blue[i] = (int) (50*log(1.0 + count_enh_blue[i]));
+ }
+ }
+
+ maxval_raw = 0;
+ maxval_enh = 0;
+
+ /* first and last 10 values are not used for calculating maximum value */
+ for (i = 10 ; i < HIST_WIDTH - 10; i++)
+ {
+ if (count_raw[i] > maxval_raw) { maxval_raw = count_raw[i]; }
+ if (count_raw_red[i] > maxval_raw) { maxval_raw = count_raw_red[i]; }
+ if (count_raw_green[i] > maxval_raw) { maxval_raw = count_raw_green[i]; }
+ if (count_raw_blue[i] > maxval_raw) { maxval_raw = count_raw_blue[i]; }
+ if (count_enh[i] > maxval_enh) { maxval_enh = count_enh[i]; }
+ if (count_enh_red[i] > maxval_enh) { maxval_enh = count_enh_red[i]; }
+ if (count_enh_green[i] > maxval_enh) { maxval_enh = count_enh_green[i]; }
+ if (count_enh_blue[i] > maxval_enh) { maxval_enh = count_enh_blue[i]; }
+ }
+ maxval = ((maxval_enh > maxval_raw) ? maxval_enh : maxval_raw);
+ scale = 100.0/maxval;
+
+ if (xsane.histogram_lines)
+ {
+ xsane_draw_histogram_with_lines(&xsane.histogram_raw, xsane.negative,
+ count_raw, count_raw_red, count_raw_green, count_raw_blue,
+ xsane.histogram_red, xsane.histogram_green, xsane.histogram_blue, xsane.histogram_int, scale);
+
+ xsane_draw_histogram_with_lines(&xsane.histogram_enh, 0 /* negative is done by gamma table */,
+ count_enh, count_enh_red, count_enh_green, count_enh_blue,
+ xsane.histogram_red, xsane.histogram_green, xsane.histogram_blue, xsane.histogram_int, scale);
+ }
+ else
+ {
+ xsane_draw_histogram_with_points(&xsane.histogram_raw, xsane.negative,
+ count_raw, count_raw_red, count_raw_green, count_raw_blue,
+ xsane.histogram_red, xsane.histogram_green, xsane.histogram_blue, xsane.histogram_int, scale);
+
+ xsane_draw_histogram_with_points(&xsane.histogram_enh, 0 /*negative is done by gamma table */,
+ count_enh, count_enh_red, count_enh_green, count_enh_blue,
+ xsane.histogram_red, xsane.histogram_green, xsane.histogram_blue, xsane.histogram_int, scale);
+ }
+
+ free(count_enh_blue);
+ free(count_enh_green);
+ free(count_enh_red);
+ free(count_enh);
+ free(count_raw_blue);
+ free(count_raw_green);
+ free(count_raw_red);
+ free(count_raw);
+ }
+ else
+ {
+ xsane_clear_histogram(&xsane.histogram_raw);
+ xsane_clear_histogram(&xsane.histogram_enh);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_update_histogram()
+{
+ if (preferences.show_histogram)
+ {
+ xsane_calculate_histogram();
+ gtk_widget_show(xsane.histogram_dialog);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_histogram_toggle_button_callback(GtkWidget *widget, gpointer data)
+{
+ int *valuep = data;
+
+ *valuep = (GTK_TOGGLE_BUTTON(widget)->active != 0);
+ xsane_update_histogram();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_create_gamma_curve(SANE_Int *gammadata, int negative, double gamma,
+ double brightness, double contrast, int numbers, int maxout)
+{
+ int i;
+ double midin;
+ double val;
+ double m;
+ double b;
+ int maxin = numbers-1;
+
+ if (contrast < -100.0)
+ {
+ contrast = -100.0;
+ }
+
+ midin = (int)(numbers / 2.0);
+
+ m = 1.0 + contrast/100.0;
+ b = (1.0 + brightness/100.0) * midin;
+
+ if (negative)
+ {
+ for (i=0; i <= maxin; i++)
+ {
+ val = ((double) (maxin - i)) - midin;
+ val = val * m + b;
+ xsane_bound_double(&val, 0.0, maxin);
+
+ gammadata[i] = 0.5 + maxout * pow( val/maxin, (1.0/gamma) );
+ }
+ }
+ else /* positive */
+ {
+ for (i=0; i <= maxin; i++)
+ {
+ val = ((double) i) - midin;
+ val = val * m + b;
+ xsane_bound_double(&val, 0.0, maxin);
+
+ gammadata[i] = 0.5 + maxout * pow( val/maxin, (1.0/gamma) );
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_update_gamma(void)
+{
+ if (xsane.preview)
+ {
+ if (!xsane.preview_gamma_data_red)
+ {
+ xsane.preview_gamma_data_red = malloc(256 * sizeof(SANE_Int));
+ xsane.preview_gamma_data_green = malloc(256 * sizeof(SANE_Int));
+ xsane.preview_gamma_data_blue = malloc(256 * sizeof(SANE_Int));
+
+ xsane.histogram_gamma_data_red = malloc(256 * sizeof(SANE_Int));
+ xsane.histogram_gamma_data_green = malloc(256 * sizeof(SANE_Int));
+ xsane.histogram_gamma_data_blue = malloc(256 * sizeof(SANE_Int));
+ }
+
+ xsane_create_gamma_curve(xsane.preview_gamma_data_red, xsane.negative,
+ xsane.gamma * xsane.gamma_red * preferences.preview_gamma * preferences.preview_gamma_red,
+ xsane.brightness + xsane.brightness_red,
+ xsane.contrast + xsane.contrast_red, 256, 255);
+
+ xsane_create_gamma_curve(xsane.preview_gamma_data_green, xsane.negative,
+ xsane.gamma * xsane.gamma_green * preferences.preview_gamma * preferences.preview_gamma_green,
+ xsane.brightness + xsane.brightness_green,
+ xsane.contrast + xsane.contrast_green, 256, 255);
+
+ xsane_create_gamma_curve(xsane.preview_gamma_data_blue, xsane.negative,
+ xsane.gamma * xsane.gamma_blue * preferences.preview_gamma * preferences.preview_gamma_blue,
+ xsane.brightness + xsane.brightness_blue,
+ xsane.contrast + xsane.contrast_blue , 256, 255);
+
+ xsane_create_gamma_curve(xsane.histogram_gamma_data_red, xsane.negative,
+ xsane.gamma * xsane.gamma_red,
+ xsane.brightness + xsane.brightness_red,
+ xsane.contrast + xsane.contrast_red, 256, 255);
+
+ xsane_create_gamma_curve(xsane.histogram_gamma_data_green, xsane.negative,
+ xsane.gamma * xsane.gamma_green,
+ xsane.brightness + xsane.brightness_green,
+ xsane.contrast + xsane.contrast_green, 256, 255);
+
+ xsane_create_gamma_curve(xsane.histogram_gamma_data_blue, xsane.negative,
+ xsane.gamma * xsane.gamma_blue,
+ xsane.brightness + xsane.brightness_blue,
+ xsane.contrast + xsane.contrast_blue , 256, 255);
+
+ preview_gamma_correction(xsane.preview,
+ xsane.preview_gamma_data_red, xsane.preview_gamma_data_green, xsane.preview_gamma_data_blue,
+ xsane.histogram_gamma_data_red, xsane.histogram_gamma_data_green, xsane.histogram_gamma_data_blue);
+
+ }
+ xsane_update_histogram();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_enhancement_update(void)
+{
+ guint sig_changed=0;
+
+ if (xsane.param.depth == 1) /* lineart? no gamma */
+ {
+ return;
+ }
+
+ sig_changed = gtk_signal_lookup("changed", GTK_OBJECT_TYPE(xsane.gamma_widget));
+
+ GTK_ADJUSTMENT(xsane.gamma_widget)->value = xsane.gamma;
+ GTK_ADJUSTMENT(xsane.brightness_widget)->value = xsane.brightness;
+ GTK_ADJUSTMENT(xsane.contrast_widget)->value = xsane.contrast;
+
+ if ( (xsane.xsane_color) && (!xsane.enhancement_rgb_default) )
+ {
+ GTK_ADJUSTMENT(xsane.gamma_red_widget)->value = xsane.gamma_red;
+ GTK_ADJUSTMENT(xsane.gamma_green_widget)->value = xsane.gamma_green;
+ GTK_ADJUSTMENT(xsane.gamma_blue_widget)->value = xsane.gamma_blue;
+
+ GTK_ADJUSTMENT(xsane.brightness_red_widget)->value = xsane.brightness_red;
+ GTK_ADJUSTMENT(xsane.brightness_green_widget)->value = xsane.brightness_green;
+ GTK_ADJUSTMENT(xsane.brightness_blue_widget)->value = xsane.brightness_blue;
+
+ GTK_ADJUSTMENT(xsane.contrast_red_widget)->value = xsane.contrast_red;
+ GTK_ADJUSTMENT(xsane.contrast_green_widget)->value = xsane.contrast_green;
+ GTK_ADJUSTMENT(xsane.contrast_blue_widget)->value = xsane.contrast_blue;
+
+ gtk_signal_emit(xsane.gamma_red_widget, sig_changed);
+ gtk_signal_emit(xsane.gamma_green_widget, sig_changed);
+ gtk_signal_emit(xsane.gamma_blue_widget, sig_changed);
+
+ gtk_signal_emit(xsane.brightness_red_widget, sig_changed);
+ gtk_signal_emit(xsane.brightness_green_widget, sig_changed);
+ gtk_signal_emit(xsane.brightness_blue_widget, sig_changed);
+
+ gtk_signal_emit(xsane.contrast_red_widget, sig_changed);
+ gtk_signal_emit(xsane.contrast_green_widget, sig_changed);
+ gtk_signal_emit(xsane.contrast_blue_widget, sig_changed);
+
+ }
+
+ gtk_signal_emit(xsane.gamma_widget, sig_changed);
+ gtk_signal_emit(xsane.brightness_widget, sig_changed);
+ gtk_signal_emit(xsane.contrast_widget, sig_changed);
+
+ xsane_update_sliders(); /* update histogram slider */
+
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_gamma_to_histogram(double *min, double *mid, double *max,
+ double contrast, double brightness, double gamma)
+{
+ double m;
+ double b;
+
+ m = 1.0 + contrast/100.0;
+ b = (1.0 + brightness/100.0) * 50.0;
+
+ if (m > 0)
+ {
+ *min = 50.0 - b/m;
+ *mid = (100.0 * pow(0.5, gamma)-b) / m + 50.0;
+ *max = (100.0-b)/m + 50.0;
+ }
+ else
+ {
+ *min = 0.0;
+ *mid = 50.0;
+ *max = 100.0;
+ }
+
+ xsane_bound_double(min, 0.0, 99.0);
+ xsane_bound_double(max, 1.0, 100.0);
+ xsane_bound_double(mid, *min+1, *max-1);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_enhancement_by_gamma(void)
+{
+ double min, mid, max;
+ double contrast, brightness, gamma;
+
+ xsane_gamma_to_histogram(&min, &mid, &max, xsane.contrast, xsane.brightness, xsane.gamma);
+
+ xsane.slider_gray.value[0] = min;
+ xsane.slider_gray.value[1] = mid;
+ xsane.slider_gray.value[2] = max;
+
+
+ /* red */
+ contrast = xsane.contrast + xsane.contrast_red;
+ brightness = xsane.brightness + xsane.brightness_red;
+ gamma = xsane.gamma * xsane.gamma_red;
+
+ if (contrast < -100.0)
+ {
+ contrast = -100.0;
+ }
+
+ xsane_gamma_to_histogram(&min, &mid, &max, contrast, brightness, gamma);
+
+ xsane.slider_red.value[0] = min;
+ xsane.slider_red.value[1] = mid;
+ xsane.slider_red.value[2] = max;
+
+
+ /* green */
+ contrast = xsane.contrast + xsane.contrast_green;
+ brightness = xsane.brightness + xsane.brightness_green;
+ gamma = xsane.gamma * xsane.gamma_green;
+
+ if (contrast < -100.0)
+ {
+ contrast = -100.0;
+ }
+
+ xsane_gamma_to_histogram(&min, &mid, &max, contrast, brightness, gamma);
+
+ xsane.slider_green.value[0] = min;
+ xsane.slider_green.value[1] = mid;
+ xsane.slider_green.value[2] = max;
+
+
+ /* blue */
+ contrast = xsane.contrast + xsane.contrast_blue;
+ brightness = xsane.brightness + xsane.brightness_blue;
+ gamma = xsane.gamma * xsane.gamma_blue;
+
+ if (contrast < -100.0)
+ {
+ contrast = -100.0;
+ }
+
+ xsane_gamma_to_histogram(&min, &mid, &max,
+ xsane.contrast + xsane.contrast_blue,
+ xsane.brightness + xsane.brightness_blue,
+ xsane.gamma * xsane.gamma_blue);
+
+ xsane.slider_blue.value[0] = min;
+ xsane.slider_blue.value[1] = mid;
+ xsane.slider_blue.value[2] = max;
+
+
+ xsane_enhancement_update();
+ xsane_update_gamma();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_enhancement_restore_default()
+{
+ xsane.gamma = 1.0;
+ xsane.gamma_red = 1.0;
+ xsane.gamma_green = 1.0;
+ xsane.gamma_blue = 1.0;
+
+ xsane.brightness = 0.0;
+ xsane.brightness_red = 0.0;
+ xsane.brightness_green = 0.0;
+ xsane.brightness_blue = 0.0;
+
+ xsane.contrast = 0.0;
+ xsane.contrast_red = 0.0;
+ xsane.contrast_green = 0.0;
+ xsane.contrast_blue = 0.0;
+
+ xsane_enhancement_by_gamma();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_enhancement_restore()
+{
+ xsane.gamma = preferences.xsane_gamma;
+ xsane.gamma_red = preferences.xsane_gamma_red;
+ xsane.gamma_green = preferences.xsane_gamma_green;
+ xsane.gamma_blue = preferences.xsane_gamma_blue;
+
+ xsane.brightness = preferences.xsane_brightness;
+ xsane.brightness_red = preferences.xsane_brightness_red;
+ xsane.brightness_green = preferences.xsane_brightness_green;
+ xsane.brightness_blue = preferences.xsane_brightness_blue;
+
+ xsane.contrast = preferences.xsane_contrast;
+ xsane.contrast_red = preferences.xsane_contrast_red;
+ xsane.contrast_green = preferences.xsane_contrast_green;
+ xsane.contrast_blue = preferences.xsane_contrast_blue;
+
+ xsane.enhancement_rgb_default = preferences.xsane_rgb_default;
+ xsane.negative = preferences.xsane_negative;
+
+ xsane_refresh_dialog(dialog);
+ xsane_enhancement_by_gamma();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_enhancement_store()
+{
+ preferences.xsane_gamma = xsane.gamma;
+ preferences.xsane_gamma_red = xsane.gamma_red;
+ preferences.xsane_gamma_green = xsane.gamma_green;
+ preferences.xsane_gamma_blue = xsane.gamma_blue;
+
+ preferences.xsane_brightness = xsane.brightness;
+ preferences.xsane_brightness_red = xsane.brightness_red;
+ preferences.xsane_brightness_green = xsane.brightness_green;
+ preferences.xsane_brightness_blue = xsane.brightness_blue;
+
+ preferences.xsane_contrast = xsane.contrast;
+ preferences.xsane_contrast_red = xsane.contrast_red;
+ preferences.xsane_contrast_green = xsane.contrast_green;
+ preferences.xsane_contrast_blue = xsane.contrast_blue;
+
+ preferences.xsane_rgb_default = xsane.enhancement_rgb_default;
+ preferences.xsane_negative = xsane.negative;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_histogram_to_gamma(XsaneSlider *slider, double *contrast, double *brightness, double *gamma)
+{
+ double mid;
+ double range;
+
+ *contrast = (10000.0 / (slider->value[2] - slider->value[0]) - 100.0);
+ *brightness = - (slider->value[0] - 50.0) * (*contrast + 100.0)/50.0 - 100.0;
+
+ mid = slider->value[1] - slider->value[0];
+ range = slider->value[2] - slider->value[0];
+
+ *gamma = log(mid/range) / log(0.5);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_enhancement_by_histogram(void)
+{
+ double gray_brightness;
+ double gray_contrast;
+ double gray_gamma;
+ double brightness;
+ double contrast;
+ double gamma;
+
+ xsane_histogram_to_gamma(&xsane.slider_gray, &gray_contrast, &gray_brightness, &gray_gamma);
+
+ xsane.gamma = gray_gamma;
+ xsane.brightness = gray_brightness;
+ xsane.contrast = gray_contrast;
+
+ if ( (xsane.xsane_color) && (!xsane.enhancement_rgb_default) ) /* rgb sliders active */
+ {
+ if ((xsane.slider_gray.active == XSANE_SLIDER_ACTIVE) ||
+ (xsane.slider_gray.active == XSANE_SLIDER_INACTIVE)) /* gray slider not moved */
+ {
+ xsane_histogram_to_gamma(&xsane.slider_red, &contrast, &brightness, &gamma);
+
+ xsane.gamma_red = gamma / gray_gamma;
+ xsane.brightness_red = brightness - gray_brightness;
+ xsane.contrast_red = contrast - gray_contrast;
+
+ xsane_histogram_to_gamma(&xsane.slider_green, &contrast, &brightness, &gamma);
+
+ xsane.gamma_green = gamma / gray_gamma;
+ xsane.brightness_green = brightness - gray_brightness;
+ xsane.contrast_green = contrast - gray_contrast;
+
+ xsane_histogram_to_gamma(&xsane.slider_blue, &contrast, &brightness, &gamma);
+
+ xsane.gamma_blue = gamma / gray_gamma;
+ xsane.brightness_blue = brightness - gray_brightness;
+ xsane.contrast_blue = contrast - gray_contrast;
+
+ xsane_enhancement_update();
+ xsane_update_gamma();
+ }
+ else /* gray slider was moved in rgb-mode */
+ {
+ xsane_enhancement_by_gamma();
+ }
+ }
+ else /* rgb sliders not active */
+ {
+ xsane_enhancement_update();
+ xsane_update_gamma();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static gint xsane_histogram_win_delete(GtkWidget *widget, gpointer data)
+{
+ gtk_widget_hide(widget);
+ preferences.show_histogram = FALSE;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.show_histogram_widget), preferences.show_histogram);
+ return TRUE;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_create_histogram_dialog(const char *devicetext)
+{
+ char windowname[255];
+ GtkWidget *xsane_color_hbox;
+ GtkWidget *xsane_histogram_vbox;
+ GdkColor color_black;
+ GdkColor color_red;
+ GdkColor color_green;
+ GdkColor color_blue;
+ GdkColor color_backg;
+ GdkColormap *colormap;
+ GtkStyle *style;
+
+ xsane.histogram_dialog = gtk_window_new(GTK_WINDOW_DIALOG);
+ gtk_window_set_policy(GTK_WINDOW(xsane.histogram_dialog), FALSE, FALSE, FALSE);
+ gtk_widget_set_uposition(xsane.histogram_dialog, XSANE_HISTOGRAM_POS_X, XSANE_HISTOGRAM_POS_Y);
+ gtk_signal_connect(GTK_OBJECT(xsane.histogram_dialog), "delete_event", GTK_SIGNAL_FUNC(xsane_histogram_win_delete), 0);
+ sprintf(windowname, "%s %s", WINDOW_HISTOGRAM, devicetext);
+ gtk_window_set_title(GTK_WINDOW(xsane.histogram_dialog), windowname);
+ xsane_set_window_icon(xsane.histogram_dialog, 0);
+
+ xsane_histogram_vbox = gtk_vbox_new(FALSE, 0);
+ gtk_container_set_border_width(GTK_CONTAINER(xsane_histogram_vbox), 5);
+ gtk_container_add(GTK_CONTAINER(xsane.histogram_dialog), xsane_histogram_vbox);
+ gtk_widget_show(xsane_histogram_vbox);
+
+
+ /* set gc for histogram drawing */
+ gtk_widget_realize(xsane.histogram_dialog); /* realize dialog to get colors and style */
+
+ style = gtk_widget_get_style(xsane.histogram_dialog);
+/*
+ style = gtk_rc_get_style(xsane.histogram_dialog);
+ style = gtk_widget_get_default_style();
+*/
+
+ xsane.gc_trans = style->bg_gc[GTK_STATE_NORMAL];
+ xsane.bg_trans = &style->bg[GTK_STATE_NORMAL];
+
+ colormap = gdk_window_get_colormap(xsane.histogram_dialog->window);
+
+ xsane.gc_black = gdk_gc_new(xsane.histogram_dialog->window);
+ color_black.red = 0;
+ color_black.green = 0;
+ color_black.blue = 0;
+ gdk_color_alloc(colormap, &color_black);
+ gdk_gc_set_foreground(xsane.gc_black, &color_black);
+
+ xsane.gc_red = gdk_gc_new(xsane.histogram_dialog->window);
+ color_red.red = 40000;
+ color_red.green = 10000;
+ color_red.blue = 10000;
+ gdk_color_alloc(colormap, &color_red);
+ gdk_gc_set_foreground(xsane.gc_red, &color_red);
+
+ xsane.gc_green = gdk_gc_new(xsane.histogram_dialog->window);
+ color_green.red = 10000;
+ color_green.green = 40000;
+ color_green.blue = 10000;
+ gdk_color_alloc(colormap, &color_green);
+ gdk_gc_set_foreground(xsane.gc_green, &color_green);
+
+ xsane.gc_blue = gdk_gc_new(xsane.histogram_dialog->window);
+ color_blue.red = 10000;
+ color_blue.green = 10000;
+ color_blue.blue = 40000;
+ gdk_color_alloc(colormap, &color_blue);
+ gdk_gc_set_foreground(xsane.gc_blue, &color_blue);
+
+ xsane.gc_backg = gdk_gc_new(xsane.histogram_dialog->window);
+ color_backg.red = 50000;
+ color_backg.green = 50000;
+ color_backg.blue = 50000;
+ gdk_color_alloc(colormap, &color_backg);
+ gdk_gc_set_foreground(xsane.gc_backg, &color_backg);
+
+
+ /* add histogram images and sliders */
+
+ xsane_create_histogram(xsane_histogram_vbox, FRAME_RAW_IMAGE, 256, 100, &(xsane.histogram_raw));
+
+ xsane_separator_new(xsane_histogram_vbox, 0);
+
+ xsane.slider_gray.r = 1;
+ xsane.slider_gray.g = 1;
+ xsane.slider_gray.b = 1;
+ xsane.slider_gray.active = XSANE_SLIDER_ACTIVE;
+ xsane_create_slider(&xsane.slider_gray);
+ gtk_box_pack_start(GTK_BOX(xsane_histogram_vbox), xsane.slider_gray.preview, FALSE, FALSE, 0);
+ gtk_widget_show(xsane.slider_gray.preview);
+ gtk_widget_realize(xsane.slider_gray.preview);
+
+ xsane_separator_new(xsane_histogram_vbox, 0);
+
+ xsane.slider_red.r = 1;
+ xsane.slider_red.g = 0;
+ xsane.slider_red.b = 0;
+ xsane.slider_red.active = XSANE_SLIDER_ACTIVE;
+ xsane_create_slider(&xsane.slider_red);
+ gtk_box_pack_start(GTK_BOX(xsane_histogram_vbox), xsane.slider_red.preview, FALSE, FALSE, 0);
+ gtk_widget_show(xsane.slider_red.preview);
+ gtk_widget_realize(xsane.slider_red.preview);
+
+ xsane_separator_new(xsane_histogram_vbox, 0);
+
+ xsane.slider_green.r = 0;
+ xsane.slider_green.g = 1;
+ xsane.slider_green.b = 0;
+ xsane.slider_green.active = XSANE_SLIDER_ACTIVE;
+ xsane_create_slider(&xsane.slider_green);
+ gtk_box_pack_start(GTK_BOX(xsane_histogram_vbox), xsane.slider_green.preview, FALSE, FALSE, 0);
+ gtk_widget_show(xsane.slider_green.preview);
+ gtk_widget_realize(xsane.slider_green.preview);
+
+ xsane_separator_new(xsane_histogram_vbox, 0);
+
+ xsane.slider_blue.r = 0;
+ xsane.slider_blue.g = 0;
+ xsane.slider_blue.b = 1;
+ xsane.slider_blue.active = XSANE_SLIDER_ACTIVE;
+ xsane_create_slider(&xsane.slider_blue);
+ gtk_box_pack_start(GTK_BOX(xsane_histogram_vbox), xsane.slider_blue.preview, FALSE, FALSE, 0);
+ gtk_widget_show(xsane.slider_blue.preview);
+ gtk_widget_realize(xsane.slider_blue.preview);
+
+ xsane_draw_slider_level(&xsane.slider_gray);
+ xsane_draw_slider_level(&xsane.slider_red);
+ xsane_draw_slider_level(&xsane.slider_green);
+ xsane_draw_slider_level(&xsane.slider_blue);
+
+ xsane_separator_new(xsane_histogram_vbox, 0);
+
+ xsane_create_histogram(xsane_histogram_vbox, FRAME_ENHANCED_IMAGE, 256, 100, &(xsane.histogram_enh));
+
+ xsane_color_hbox = gtk_hbox_new(TRUE, 5);
+ gtk_container_set_border_width(GTK_CONTAINER(xsane_color_hbox), 5);
+ gtk_container_add(GTK_CONTAINER(xsane_histogram_vbox), xsane_color_hbox);
+ gtk_widget_show(xsane_color_hbox);
+
+ xsane_toggle_button_new_with_pixmap(xsane_color_hbox, intensity_xpm, DESC_HIST_INTENSITY,
+ &xsane.histogram_int, xsane_histogram_toggle_button_callback);
+ xsane_toggle_button_new_with_pixmap(xsane_color_hbox, red_xpm, DESC_HIST_RED,
+ &xsane.histogram_red, xsane_histogram_toggle_button_callback);
+ xsane_toggle_button_new_with_pixmap(xsane_color_hbox, green_xpm, DESC_HIST_GREEN,
+ &xsane.histogram_green, xsane_histogram_toggle_button_callback);
+ xsane_toggle_button_new_with_pixmap(xsane_color_hbox, blue_xpm, DESC_HIST_BLUE,
+ &xsane.histogram_blue, xsane_histogram_toggle_button_callback);
+ xsane_toggle_button_new_with_pixmap(xsane_color_hbox, pixel_xpm, DESC_HIST_PIXEL,
+ &xsane.histogram_lines, xsane_histogram_toggle_button_callback);
+ xsane_toggle_button_new_with_pixmap(xsane_color_hbox, log_xpm, DESC_HIST_LOG,
+ &xsane.histogram_log, xsane_histogram_toggle_button_callback);
+
+ gtk_widget_show(xsane_color_hbox);
+
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
diff --git a/frontend/xsane-gamma.h b/frontend/xsane-gamma.h
new file mode 100644
index 0000000..ed70175
--- /dev/null
+++ b/frontend/xsane-gamma.h
@@ -0,0 +1,48 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-gamma.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include <sane/sane.h>
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+extern void xsane_clear_histogram(XsanePixmap *hist);
+extern void xsane_draw_slider_level(XsaneSlider *slider);
+extern void xsane_update_slider(XsaneSlider *slider);
+extern void xsane_update_sliders(void);
+extern void xsane_create_slider(XsaneSlider *slider);
+extern void xsane_create_histogram(GtkWidget *parent, const char *title, int width, int height, XsanePixmap *hist);
+extern void xsane_calculate_histogram(void);
+extern void xsane_update_histogram(void);
+extern void xsane_histogram_toggle_button_callback(GtkWidget *widget, gpointer data);
+extern void xsane_create_gamma_curve(SANE_Int *gammadata, int negative, double gamma,
+ double brightness, double contrast, int numbers, int maxout);
+extern void xsane_update_gamma(void);
+extern void xsane_enhancement_by_gamma(void);
+extern void xsane_enhancement_restore_default(void);
+extern void xsane_enhancement_restore(void);
+extern void xsane_enhancement_store(void);
+extern void xsane_enhancement_by_histogram(void);
+extern void xsane_create_histogram_dialog(const char *devicetext);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
diff --git a/frontend/xsane-icons.c b/frontend/xsane-icons.c
new file mode 100644
index 0000000..3165ab6
--- /dev/null
+++ b/frontend/xsane-icons.c
@@ -0,0 +1,1751 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-icons.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* --------------------------------------------------- */
+
+const char *xsane_window_icon_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 14 16 6 1",
+/* color */
+" none",
+"b c #2020e0",
+"w c #eeeeee",
+"x c #fff098",
+"y c #f0e890",
+"z c #e8d880",
+/* pixel */
+" xxyyyyy ",
+" xyyyyyyyyyyz ",
+"xyyyyzzyyyyyyz",
+"xyxz zyyz",
+"xxy yyz",
+" yyyy yy ",
+" zyyyyz yyy ",
+" zzzz yxz",
+" zbbbbz yyz",
+" x zbbwwbbz yy",
+"xy zbbwwbbz yy",
+"xyy zbbbbz xyy",
+"xyyy zzzz xyyz",
+"xyyyyyyyyyyyz ",
+" zyyyyyyyyz ",
+" zzzzzzz "
+};
+
+/* --------------------------------------------------- */
+
+const char *error_xpm[] =
+{
+"40 40 6 1",
+" c None",
+". c #FE0809",
+"+ c #FDFDFC",
+"@ c #E5D5D6",
+"# c #E1A09F",
+"$ c #FE8081",
+" #@@++++@@# ",
+" #@++++++++++++@# ",
+" #+++@#$......$$@+++# ",
+" #+++#..............#+++# ",
+" #++#..................@++# ",
+" @++$....................$++@ ",
+" @+@........................++@ ",
+" #+@$.........................@+# ",
+" #++...........................$++# ",
+" ++$.....@+...............++....$++ ",
+" #+#.....+++@.............+++@....#+# ",
+" ++.....$+++++...........@++++$....++ ",
+" #+#......#++++@.........+++++#.....#+# ",
+" @+........#+++++.......@++++$.......+@ ",
+" +@.........$++++@.....+++++#........++ ",
+"#+$..........#+++++...@++++$.........$+#",
+"@+$...........$+++++$@++++#..........$+@",
+"@+.............#+++++++++$............+@",
+"++..............$+++++++#.............++",
+"++...............#+++++#..............++",
+"++...............++++++@..............++",
+"++..............@++++++++.............++",
+"@+.............+++++@++++@............+@",
+"@+$...........@++++#.#+++++..........$+@",
+"#+$..........+++++$...$++++@.........$+#",
+" +@.........@++++#.....#+++++........@+ ",
+" @+........+++++$.......$++++@.......+@ ",
+" #+#......@++++#.........#+++++.....#+# ",
+" ++.....#++++#...........$++++$....++ ",
+" @+#.....$++$.............#++$....#+# ",
+" ++$.....#$...............$#....$++ ",
+" #++............................++# ",
+" #++..........................++# ",
+" @++........................++@ ",
+" @++$....................$++@ ",
+" #++#..................#++# ",
+" #+++#..............#+++# ",
+" #+++@$$......$$++++# ",
+" #+++++++++++++@# ",
+" #@@++++@@# "
+};
+
+/* --------------------------------------------------- */
+
+const char *warning_xpm[] =
+{
+"40 40 4 1",
+" c None",
+". c #FFFFFF",
+"+ c #FFFA00",
+"@ c #000000",
+" ",
+" .. ",
+" .. ",
+" .++. ",
+" .++. ",
+" .++++. ",
+" .++++. ",
+" .++++++. ",
+" .++++++. ",
+" .++++++++. ",
+" .++++++++. ",
+" .++++++++++. ",
+" .++++@@++++. ",
+" .++++@@@@++++. ",
+" .+++@@@@@@+++. ",
+" .++++@@@@@@++++. ",
+" .+++@@@@@@@@+++. ",
+" .++++@@@@@@@@++++. ",
+" .++++@@@@@@@@++++. ",
+" .++++++@@@@@@++++++. ",
+" .++++++@@@@@@++++++. ",
+" .+++++++@@@@@@+++++++. ",
+" .+++++++@@@@@@+++++++. ",
+" .+++++++++@@@@+++++++++. ",
+" .+++++++++@@@@+++++++++. ",
+" .++++++++++@@@@++++++++++. ",
+" .+++++++++++@@+++++++++++. ",
+" .++++++++++++++++++++++++++. ",
+" .++++++++++++++++++++++++++. ",
+" .++++++++++++++++++++++++++++. ",
+" .+++++++++++++@@+++++++++++++. ",
+" .+++++++++++++@@@@+++++++++++++. ",
+" .+++++++++++++@@@@+++++++++++++. ",
+" .+++++++++++++++@@+++++++++++++++. ",
+" .++++++++++++++++++++++++++++++++. ",
+" .++++++++++++++++++++++++++++++++++. ",
+" .++++++++++++++++++++++++++++++++++. ",
+" ..++++++++++++++++++++++++++++++++++.. ",
+" ...................................... ",
+"........................................"
+};
+
+/* --------------------------------------------------- */
+
+const char *file_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+"* c #000000",
+". c #707070",
+"- c #e0e0e0",
+" none",
+/* pixels */
+" ",
+" ................ ",
+" .*............*. ",
+" .*............*. ",
+" ................ ",
+" ................ ",
+" ................ ",
+" ................ ",
+" ................ ",
+" ................ ",
+" ................ ",
+" ................ ",
+" ....--------.... ",
+" ....-...----.... ",
+" ....-...----.... ",
+" ....-...----.... ",
+" ....-...----.... ",
+" ............... ",
+" ",
+" "
+};
+
+/* --------------------------------------------------- */
+
+const char *fax_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+"* c #000000",
+". c #ffffff",
+"- c #e0e0e0",
+" none",
+/* pixels */
+" ",
+" ",
+" ",
+" .*********** ",
+" ..*.........* ",
+" ...*..**.*.*.* ",
+" ****.........* ",
+" *............* ",
+" *...*...***..* ",
+" *............* ",
+" *.*.*.**.**..* ",
+" *............* ",
+" *..*....*..*.* ",
+" *............* ",
+" *.**..*....*.* ",
+" *............* ",
+" ************** ",
+" ",
+" ",
+" "
+};
+
+/* --------------------------------------------------- */
+
+const char *faxreceiver_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+"* c #000000",
+"- c #e0e0e0",
+" none",
+/* pixels */
+" ",
+" ********* ",
+" *****-----* ",
+" ****--------* ",
+" ****-----***-* ",
+" ****----*----* ",
+" ***-------**--* ",
+" ***------------* ",
+" **--------------* ",
+" **------------*** ",
+" **-----------* ",
+" **----------* ",
+" *-------*---* ",
+" *--------*** ",
+" *----------* ",
+" *----------* ",
+" *----------* ",
+" *---------* ",
+" *------*** ",
+" *----* ",
+};
+
+/* --------------------------------------------------- */
+
+const char *colormode_xpm[] = {
+/* width height num_colors chars_per_pixel */
+" 20 20 7 1",
+/* colors */
+". c #000000",
+"# c #0000ff",
+"a c #00ff00",
+"b c #7f7f7f",
+"d c #ff0000",
+"e c #ffffff",
+" none",
+/* pixels */
+" ",
+" eeeee ",
+" eeeee...... ",
+" eeeee......ddddddd ",
+" eeeee......ddddddd ",
+" eeeee......ddddddd ",
+" eeeee......ddddddd ",
+" eeeeebbbbbbddddddd ",
+" eeeeebbbbbbddddddd ",
+" .....bbbbbbaaaaaaa ",
+" .....bbbbbbaaaaaaa ",
+" .....bbbbbbaaaaaaa ",
+" .....eeeeeeaaaaaaa ",
+" .....eeeeeeaaaaaaa ",
+" .....eeeeee####### ",
+" .....eeeeee####### ",
+" .....eeeeee####### ",
+" eeeeee####### ",
+" ####### ",
+" "
+};
+
+/* --------------------------------------------------- */
+
+const char *Gamma_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 2 1",
+/* colors */
+". c #000000",
+" none",
+/* pixels */
+" ",
+" ",
+" ............. ",
+" ... .. ",
+" .. .. ",
+" .. . ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .... ",
+" ........ ",
+" "
+};
+
+/* --------------------------------------------------- */
+
+const char *Gamma_red_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 2 1",
+/* colors */
+". c #ff0000",
+" none",
+/* pixels */
+" ",
+" ",
+" ",
+" ............. ",
+" ... .. ",
+" .. .. ",
+" .. . ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .... ",
+" ........ ",
+};
+
+/* --------------------------------------------------- */
+
+const char *Gamma_green_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 2 1",
+/* colors */
+". c #00ff00",
+" none",
+/* pixels */
+" ",
+" ",
+" ",
+" ............. ",
+" ... .. ",
+" .. .. ",
+" .. . ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .... ",
+" ........ ",
+};
+
+/* --------------------------------------------------- */
+
+const char *Gamma_blue_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 2 1",
+/* colors */
+". c #0000ff",
+" none",
+/* pixels */
+" ",
+" ",
+" ",
+" ............. ",
+" ... .. ",
+" .. .. ",
+" .. . ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .. ",
+" .... ",
+" ........ ",
+};
+
+/* --------------------------------------------------- */
+
+const char *brightness_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ffffff",
+/* pixels */
+" ",
+" ",
+" ",
+" . ",
+" . ",
+" . ",
+" . ... . ",
+" . .aaa. . ",
+" .aaaaa. ",
+" .aaaaaaa. ",
+" .aaaaaaaaa. ",
+" ....aaaaaaaaa.... ",
+" .aaaaaaaaa. ",
+" .aaaaaaa. ",
+" .aaaaa. ",
+" . .aaa. . ",
+" . ... . ",
+" . ",
+" . ",
+" . ",
+};
+
+/* --------------------------------------------------- */
+
+const char *brightness_red_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ff0000",
+/* pixels */
+" ",
+" ",
+" ",
+" . ",
+" . ",
+" . ",
+" . ... . ",
+" . .aaa. . ",
+" .aaaaa. ",
+" .aaaaaaa. ",
+" .aaaaaaaaa. ",
+" ....aaaaaaaaa.... ",
+" .aaaaaaaaa. ",
+" .aaaaaaa. ",
+" .aaaaa. ",
+" . .aaa. . ",
+" . ... . ",
+" . ",
+" . ",
+" . ",
+};
+
+/* --------------------------------------------------- */
+
+const char *brightness_green_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #00ff00",
+/* pixels */
+" ",
+" ",
+" ",
+" . ",
+" . ",
+" . ",
+" . ... . ",
+" . .aaa. . ",
+" .aaaaa. ",
+" .aaaaaaa. ",
+" .aaaaaaaaa. ",
+" ....aaaaaaaaa.... ",
+" .aaaaaaaaa. ",
+" .aaaaaaa. ",
+" .aaaaa. ",
+" . .aaa. . ",
+" . ... . ",
+" . ",
+" . ",
+" . ",
+};
+
+const char *brightness_blue_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #0000ff",
+/* pixels */
+" ",
+" ",
+" ",
+" . ",
+" . ",
+" . ",
+" . ... . ",
+" . .aaa. . ",
+" .aaaaa. ",
+" .aaaaaaa. ",
+" .aaaaaaaaa. ",
+" ....aaaaaaaaa.... ",
+" .aaaaaaaaa. ",
+" .aaaaaaa. ",
+" .aaaaa. ",
+" . .aaa. . ",
+" . ... . ",
+" . ",
+" . ",
+" . ",
+};
+
+/* --------------------------------------------------- */
+
+const char *contrast_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ffffff",
+/* pixels */
+" ",
+" ",
+" ",
+" ..... ",
+" .....aa.. ",
+" ......aaaa.. ",
+" .......aaaaa. ",
+" ........aaaaaa. ",
+" ........aaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" ........aaaaaa. ",
+" ........aaaaaa. ",
+" .......aaaaa. ",
+" ......aaaa.. ",
+" .....aa.. ",
+" ..... ",
+};
+
+/* --------------------------------------------------- */
+
+const char *contrast_red_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ff0000",
+/* pixels */
+" ",
+" ",
+" ",
+" ..... ",
+" .....aa.. ",
+" ......aaaa.. ",
+" .......aaaaa. ",
+" ........aaaaaa. ",
+" ........aaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" ........aaaaaa. ",
+" ........aaaaaa. ",
+" .......aaaaa. ",
+" ......aaaa.. ",
+" .....aa.. ",
+" ..... ",
+};
+
+/* --------------------------------------------------- */
+
+const char *contrast_green_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #00ff00",
+/* pixels */
+" ",
+" ",
+" ",
+" ..... ",
+" .....aa.. ",
+" ......aaaa.. ",
+" .......aaaaa. ",
+" ........aaaaaa. ",
+" ........aaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" ........aaaaaa. ",
+" ........aaaaaa. ",
+" .......aaaaa. ",
+" ......aaaa.. ",
+" .....aa.. ",
+" ..... ",
+};
+
+/* --------------------------------------------------- */
+
+const char *contrast_blue_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #0000ff",
+/* pixels */
+" ",
+" ",
+" ",
+" ..... ",
+" .....aa.. ",
+" ......aaaa.. ",
+" .......aaaaa. ",
+" ........aaaaaa. ",
+" ........aaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" .........aaaaaaa. ",
+" ........aaaaaa. ",
+" ........aaaaaa. ",
+" .......aaaaa. ",
+" ......aaaa.. ",
+" .....aa.. ",
+" ..... ",
+};
+
+/* --------------------------------------------------- */
+
+const char *rgb_default_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 6 1",
+/* colors */
+" none",
+"w c #ffffff",
+"k c #000000",
+"r c #ff0000",
+"g c #00ff00",
+"b c #0000ff",
+/* pixels */
+" ",
+" rr gg kk bb ",
+" rr gg kk bb ",
+" rr gg kk bb ",
+" rr gg kk bb ",
+" rr gg kk bb ",
+" rr gg kk bb ",
+" r g k b ",
+" r g k b ",
+" r g k b ",
+" rg k b ",
+" rg k b ",
+" rgkkb ",
+" kk ",
+" kk ",
+" kk ",
+" kk ",
+" kk ",
+" kk ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *negative_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 16 1",
+/* colors */
+" none",
+"W c #b0b0b0",
+"r c #a01010",
+"g c #20a010",
+"b c #0020a0",
+"c c #10a0a0",
+"m c #a000a0",
+"y c #a0a000",
+"W c #ffffff",
+"R c #ff0000",
+"G c #00ff00",
+"B c #0000ff",
+"C c #00ffff",
+"M c #ff00ff",
+"Y c #ffff00",
+"k c #000000",
+/* pixels */
+" ",
+" YYYYYYYYYYYYYYYYYk ",
+" kkYYYYYYYYYkkCCbkB ",
+" kkkYYYYYYkkkkCCkBB ",
+" YYYYYYYYYYCCCCkRRB ",
+" YYYYYkkYYYYCCkRWWW ",
+" YYYYYYYYYYYYkRRBWW ",
+" YYkkYYYYYYkkWBBBBB ",
+" YkkYYYYYYkkWWWBBBB ",
+" YYYYYYYYYkBBBBBBBB ",
+" MMMMMMMMkGGGGGGGGG ",
+" MMMMMMMkGGGGGGGGGG ",
+" MMMGMMkGGGGGGGgGGG ",
+" MMMCMkGGGGGGGGGgGG ",
+" MBMMkgGGRGGGGGGGGG ",
+" MMMkGGgGGGGGGGGgGG ",
+" MMkGGGGGgGGGGgGGGG ",
+" MkGGGGGGGgGGGGGGgG ",
+" kGGGGGGGGGGGGGGGGG ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *enhance_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 16 1",
+/* colors */
+" none",
+"w c #b0b0b0",
+"r c #a01010",
+"g c #20a010",
+"b c #0020a0",
+"c c #10a0a0",
+"m c #a000a0",
+"y c #a0a000",
+"W c #ffffff",
+"R c #ff0000",
+"G c #00ff00",
+"B c #0000ff",
+"C c #00ffff",
+"M c #ff00ff",
+"Y c #ffff00",
+"k c #000000",
+/* pixels */
+" ",
+" bbbbbbbbbbbbbbbbbk ",
+" wwbbbbbbbbbwwrrbkB ",
+" wwwbbbbbbwwwwrrkBB ",
+" bbbbbbbbbbrrrrkRRB ",
+" bbbbbwwbbbbrrkRWWW ",
+" bbbbbbbbbbbbkRRBWW ",
+" bbwwbbbbbbwkBBBBBB ",
+" bwwbbbbbbbkBWBBBBB ",
+" bbbbbbbbbkBBBBBBBB ",
+" ggggggggkGGGGGGGGG ",
+" gggmgggkGGGGGGGGGG ",
+" gggrggkGGGGGGGgGGG ",
+" gggggkGGGGGGGGGgGG ",
+" gyggkgGGRGGGGGGGGG ",
+" gggkGGgGGGGGGGGgGG ",
+" ggkGGGGGgGGGGgGGGG ",
+" gkGGGGGGGgGGGGGGgG ",
+" kGGGGGGGGGGGGGGGGG ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *store_enhancement_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 5 1",
+/* colors */
+"* c #000000",
+". c #606060",
+"- c #e0e0e0",
+"w c #ffffff",
+" none",
+/* pixels */
+" ",
+" * * ",
+" ** ** ",
+" *** *** ",
+" **** **** ",
+" ** ** ** ** ",
+" ** ** ** ** ",
+" ** ***** ** ",
+" ** *** ** ",
+" ** * ** ",
+" ** ** ",
+" ** ** ",
+" ** ** ",
+" ** ** ",
+" ** ** ",
+" ** ** ",
+" ** ** ",
+" ** ** ",
+" **** **** ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *restore_enhancement_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 5 1",
+/* colors */
+"* c #000000",
+". c #606060",
+"- c #e0e0e0",
+"w c #ffffff",
+" none",
+/* pixels */
+" ",
+" ************** ",
+" **************** ",
+" ** ** ",
+" ** ** ",
+" ** ** ",
+" ** ** ",
+" ** ** ",
+" ** ** ",
+" *************** ",
+" ************* ",
+" ** *** ",
+" ** ** ",
+" ** ** ",
+" ** *** ",
+" ** ** ",
+" ** *** ",
+" ** ** ",
+" **** **** ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *default_enhancement_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+"* c #000000",
+". c #606060",
+"- c #e0e0e0",
+" none",
+/* pixels */
+" ",
+" * ",
+" * ",
+" * ",
+" * ",
+" * ",
+" * * * ",
+" ** * ** ",
+" ** * ** ",
+" ******* * ******** ",
+" ** * ** ",
+" ** * ** ",
+" * * * ",
+" * ",
+" * ",
+" * ",
+" * ",
+" * ",
+" * ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *pipette_white_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ffffff",
+/* pixels */
+" ",
+" ",
+" .... ",
+" ...... ",
+" ...... ",
+" ......... ",
+" ...... ",
+" .aaa.. ",
+" .aaaa.. ",
+" .aaaa. . ",
+" .aaaa. . ",
+" .aaaa. ",
+" .aaaa. ",
+" .aaaa. ",
+" .aaaa. ",
+" .aaaa. ",
+" .aaaa. ",
+" .aaaa. ",
+" .aaa. ",
+" ... ",
+};
+
+/* --------------------------------------------------- */
+
+const char *pipette_gray_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ffffff",
+"X c #808080",
+/* pixels */
+" ",
+" ",
+" .... ",
+" ...... ",
+" ...... ",
+" ......... ",
+" ...... ",
+" .aaa.. ",
+" .aaaa.. ",
+" .aaaa. . ",
+" .XXXX. . ",
+" .XXXX. ",
+" .XXXX. ",
+" .XXXX. ",
+" .XXXX. ",
+" .XXXX. ",
+" .XXXX. ",
+" .XXXX. ",
+" .XXX. ",
+" ... ",
+};
+
+
+const char *pipette_black_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ffffff",
+/* pixels */
+" ",
+" ",
+" .... ",
+" ...... ",
+" ...... ",
+" ......... ",
+" ...... ",
+" .aaa.. ",
+" .aaaa.. ",
+" .aaaa. . ",
+" ...... . ",
+" ...... ",
+" ...... ",
+" ...... ",
+" ...... ",
+" ...... ",
+" ...... ",
+" ...... ",
+" ..... ",
+" ... ",
+};
+
+/* --------------------------------------------------- */
+
+const char *zoom_in_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+" none",
+". c #000000",
+"+ c #c0c0c0",
+"a c #ffffff",
+/* pixels */
+" ",
+" ",
+" ..... ",
+" .+aaaa. ",
+" .++aaaaa. ",
+" .+++aaaaaa. ",
+" .aaaaaaaaa. ",
+" .aaaaaaaaa. ",
+" .aaaaaaaaa. ",
+" .aaaaaaa. ",
+" .aaaaa. ",
+" ....... ",
+" ... ",
+" . ... ",
+" . ... ",
+" ..... ... ",
+" . ... ",
+" . .. ",
+" ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *zoom_not_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+" none",
+". c #000000",
+"+ c #c0c0c0",
+"a c #ffffff",
+/* pixels */
+" ",
+" ",
+" .. ..... .. ",
+" ...+aaaa. .. ",
+" ..+aaaaa. .. ",
+" .+..aaaaaa. .. ",
+" .aa..aaaaa... ",
+" .aaa..aaaa.. ",
+" .aaaa..aa.. ",
+" .aaaa.... ",
+" .aaaa.. ",
+" ....... ",
+" .. ... ",
+" .. ... ",
+" .. ... ",
+" .. ... ",
+" .. ... ",
+" .. .. ",
+" ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *zoom_undo_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+" none",
+". c #000000",
+"+ c #c0c0c0",
+"a c #ffffff",
+/* pixels */
+" ",
+" ",
+" ..... ",
+" .+aaaa. ",
+" .++aaaaa. ",
+" .+++aaaaaa. ",
+" .aaaaaaaaa. ",
+" .aaaaaaaaa. ",
+" .aaaaaaaaa. ",
+" .aaaaaaa. ",
+" .aaaaa. ",
+" ....... ",
+" ... ",
+" ",
+" . . . . .. .. ",
+" . . .. . . . . . ",
+" . . .... . . . . ",
+" . . . .. . . . . ",
+" .. . . .. .. ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *zoom_out_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+" none",
+". c #000000",
+"+ c #c0c0c0",
+"a c #ffffff",
+/* pixels */
+" ",
+" ",
+" ..... ",
+" .+aaaa. ",
+" .++aaaaa. ",
+" .+++aaaaaa. ",
+" .aaaaaaaaa. ",
+" .aaaaaaaaa. ",
+" .aaaaaaaaa. ",
+" .aaaaaaa. ",
+" .aaaaa. ",
+" ....... ",
+" ... ",
+" ... ",
+" ... ",
+" ..... ... ",
+" ... ",
+" .. ",
+" ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *full_preview_area_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+" none",
+". c #000000",
+"+ c #c0c0c0",
+"a c #ffffff",
+/* pixels */
+" ",
+" ................. ",
+" . . ",
+" . . . ",
+" . ... . ",
+" . . . . . ",
+" . . . ",
+" . . . ",
+" . . . . . ",
+" . . . . . ",
+" . ............. . ",
+" . . . . . ",
+" . . . . . ",
+" . . . ",
+" . . . ",
+" . . . . . ",
+" . ... . ",
+" . . . ",
+" ................. ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *printer_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+". c #000000",
+"# c #7f7f7f",
+" none",
+"b c #ffffff",
+/* pixels */
+" ",
+" ",
+" ",
+" ",
+" ......... ",
+" .bbbbbbb.. ",
+" .bbbbbbb.b. ",
+" .bbbbbbb.... ",
+" .bbbbbbbbbb. ",
+" .bbbbbbbbbb. ",
+" .bbbbbbbbbb. ",
+" .bbbbbbbbbb. ",
+" .bbbbbbbbbb... ",
+" ............. .. ",
+" ..###########.. . ",
+" . . . ",
+" . . . ",
+" .bbbbbbbbbbbbb. . ",
+" .#############.. ",
+" .............. ",
+};
+
+/* --------------------------------------------------- */
+
+const char *zoom_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ffffff",
+/* pixels */
+" ",
+" ",
+" .............. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaa....aaaaa. ",
+" .aaaa...aaaaa. ",
+" .aaa....aaaaa. ",
+" .aa...a.aaaaa. ",
+" .aaa.aaaaaaaa. ",
+" .......aaaaaaaaaa. ",
+" .aaaaa.aaaaaaaaaa. ",
+" .aaaaa............ ",
+" .aaaaa. ",
+" .aaaaa. ",
+" .aaaaa. ",
+" ....... ",
+};
+
+/* --------------------------------------------------- */
+
+const char *zoom_x_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ffffff",
+"# c #4040ff",
+/* pixels */
+" ",
+" ",
+" .............. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaa....aaaaa. ",
+" .aaaa...aaaaa. ",
+" .aaa....aaaaa. ",
+" .aa...a.aaaaa. ",
+" .aaa ",
+" .......a ## ## ",
+" .aaaaa.a ## ## ",
+" .aaaaa.. #### ",
+" .aaaaa. ## ",
+" .aaaaa. #### ",
+" .aaaaa. ## ## ",
+" ....... ## ## ",
+};
+
+/* --------------------------------------------------- */
+
+const char *zoom_y_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 4 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ffffff",
+"# c #4040ff",
+/* pixels */
+" ",
+" ",
+" .............. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaaaaaaaaaaa. ",
+" .aaa....aaaaa. ",
+" .aaaa...aaaaa. ",
+" .aaa....aaaaa. ",
+" .aa...a.aaaaa. ",
+" .aaa ",
+" .......a ## ## ",
+" .aaaaa.a ## ## ",
+" .aaaaa.. #### ",
+" .aaaaa. ## ",
+" .aaaaa. ## ",
+" .aaaaa. ## ",
+" ....... ## ",
+};
+
+/* --------------------------------------------------- */
+
+const char *resolution_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 2 1",
+/* colors */
+". c #000000",
+" none",
+/* pixels */
+" ",
+" ",
+" ",
+" ... .. ",
+" ..... .... . ",
+" ....... ...... ... ",
+" ....... .... . ",
+" ....... .. ",
+" ..... ",
+" ... .. . ",
+" .... ... ",
+" .. .... . ",
+" .... .. ",
+" ...... ",
+" .... .. . ",
+" .. .... ",
+" .. . ",
+" .. ",
+" .... .. . ",
+" .. .. ",
+};
+
+/* --------------------------------------------------- */
+
+const char *resolution_x_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+"# c #4040ff",
+" none",
+/* pixels */
+" ",
+" ",
+" ",
+" ... .. ",
+" ..... .... . ",
+" ....... ...... ... ",
+" ....... .... . ",
+" ....... .. ",
+" ..... ",
+" ... .. . ",
+" .... ... ",
+" .. .... . ",
+" .... ",
+" ...... ## ## ",
+" .... ## ## ",
+" .. #### ",
+" ## ",
+" .. #### ",
+" .... ## ## ",
+" .. ## ## ",
+};
+
+/* --------------------------------------------------- */
+
+const char *resolution_y_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+"# c #4040ff",
+" none",
+/* pixels */
+" ",
+" ",
+" ",
+" ... .. ",
+" ..... .... . ",
+" ....... ...... ... ",
+" ....... .... . ",
+" ....... .. ",
+" ..... ",
+" ... .. . ",
+" .... ... ",
+" .. .... . ",
+" .... ",
+" ...... ## ## ",
+" .... ## ## ",
+" .. #### ",
+" ## ",
+" .. ## ",
+" .... ## ",
+" .. ## ",
+};
+
+/* --------------------------------------------------- */
+
+const char *scanner_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ffffff",
+/* pixels */
+" ",
+" ",
+" ",
+" ",
+" ",
+" .. ",
+" .... ",
+" .... ",
+" .... ",
+" .... ",
+" ... ",
+" .... ",
+" ................ ",
+" .aaaa.a.a.a.a.aa. ",
+" .aaaaa.a.a.a.a.aa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" ................. ",
+" .................. ",
+};
+
+/* --------------------------------------------------- */
+
+const char *intensity_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ffffff",
+/* pixels */
+" ",
+" .................. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaa........aaaa. ",
+" .aaaaaaa..aaaaaaa. ",
+" .aaaaaaa..aaaaaaa. ",
+" .aaaaaaa..aaaaaaa. ",
+" .aaaaaaa..aaaaaaa. ",
+" .aaaaaaa..aaaaaaa. ",
+" .aaaaaaa..aaaaaaa. ",
+" .aaaaaaa..aaaaaaa. ",
+" .aaaaaaa..aaaaaaa. ",
+" .aaaaaaa..aaaaaaa. ",
+" .aaaaaaa..aaaaaaa. ",
+" .aaaa........aaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .................. ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *red_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #ff2020",
+/* pixels */
+" ",
+" .................. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aa..........aaaa. ",
+" .aa...........aaa. ",
+" .aa..aaaaaaaa..aa. ",
+" .aa..aaaaaaaa..aa. ",
+" .aa..aaaaaaaa..aa. ",
+" .aa...........aaa. ",
+" .aa..........aaaa. ",
+" .aa..aaaa..aaaaaa. ",
+" .aa..aaaaa..aaaaa. ",
+" .aa..aaaaaa..aaaa. ",
+" .aa..aaaaaaa..aaa. ",
+" .aa..aaaaaaa..aaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .................. ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *green_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #20ff20",
+/* pixels */
+" ",
+" .................. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaaa.......aaaa. ",
+" .aaa...........aa. ",
+" .aaa..aaaaaaa..aa. ",
+" .aaa..aaaaaaaaaaa. ",
+" .aaa..aaaaaaaaaaa. ",
+" .aaa..aaa.....aaa. ",
+" .aaa..aaa......aa. ",
+" .aaa..aaaaaaa..aa. ",
+" .aaa..aaaaaaa..aa. ",
+" .aaa..aaaaaaa..aa. ",
+" .aaaa.........aaa. ",
+" .aaaaa.......aaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .................. ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *blue_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+". c #000000",
+" none",
+"a c #3030ff",
+/* pixels */
+" ",
+" .................. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aa...........aaa. ",
+" .aa............aa. ",
+" .aa..aaaaaaaa..aa. ",
+" .aa..aaaaaaaa..aa. ",
+" .aa..aaaaaaaa..aa. ",
+" .aa...........aaa. ",
+" .aa...........aaa. ",
+" .aa..aaaaaaaa..aa. ",
+" .aa..aaaaaaaa..aa. ",
+" .aa..aaaaaaaa..aa. ",
+" .aa............aa. ",
+" .aa...........aaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .aaaaaaaaaaaaaaaa. ",
+" .................. ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *pixel_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 3 1",
+/* colors */
+"a c #000000",
+" none",
+". c #ffffff",
+/* pixels */
+" ",
+" ",
+" ",
+" a . ",
+" a a . ",
+" a . ",
+" a a a . ",
+" a . ",
+" a . ",
+" . ",
+" . ",
+" . a ",
+" . aaaa ",
+" . aaaa a ",
+" . a aaaaaa ",
+" . a aaaaaaaaa ",
+" . aaaaaaaaaaaa ",
+" ",
+" ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *log_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 2 1",
+/* colors */
+". c #000000",
+" none",
+/* pixels */
+" ",
+" ",
+" ",
+" ",
+" ",
+" . .. ... ",
+" . . . . . ",
+" . . . . ",
+" . . . . ",
+" . . . . ",
+" . . . . ... ",
+" . . . . . ",
+" . . . . . ",
+" . . . . . ",
+" . . . . . ",
+" .... .. ... ",
+" ",
+" ",
+" ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *move_up_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 2 1",
+/* colors */
+". c #000000",
+" none",
+/* pixels */
+" ",
+" ",
+" ",
+" . ",
+" ... ",
+" ... ",
+" . . . ",
+" . . . ",
+" . . . ",
+" . . . ",
+" . ",
+" . ",
+" . ",
+" . ",
+" . ",
+" . ",
+" . ",
+" ",
+" ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const char *move_down_xpm[] =
+{
+/* width height num_colors chars_per_pixel */
+" 20 20 2 1",
+/* colors */
+". c #000000",
+" none",
+/* pixels */
+" ",
+" ",
+" ",
+" . ",
+" . ",
+" . ",
+" . ",
+" . ",
+" . ",
+" . ",
+" . . . ",
+" . . . ",
+" . . . ",
+" . . . ",
+" ... ",
+" ... ",
+" . ",
+" ",
+" ",
+" ",
+};
+
+/* --------------------------------------------------- */
+
+const unsigned char cursor_pipette_white[] =
+{
+ 0x00, 0x70, 0x00, 0xf8, 0x80, 0xff, 0x00, 0xfe, 0x00, 0x7d, 0x80, 0x38,
+ 0x40, 0x18, 0x20, 0x14, 0x10, 0x12, 0x08, 0x01, 0x84, 0x00, 0x44, 0x00,
+ 0x32, 0x00, 0x09, 0x00, 0x04, 0x00, 0x00, 0x00
+};
+
+/* --------------------------------------------------- */
+
+const unsigned char cursor_pipette_black[] =
+{
+ 0x00, 0x70, 0x00, 0xf8, 0x80, 0xff, 0x00, 0xfe, 0x00, 0x7d, 0x80, 0x38,
+ 0x40, 0x18, 0xe0, 0x17, 0xf0, 0x13, 0xf8, 0x01, 0xfc, 0x00, 0x7c, 0x00,
+ 0x3e, 0x00, 0x0f, 0x00, 0x04, 0x00, 0x00, 0x00
+};
+
+/* --------------------------------------------------- */
+
+const unsigned char cursor_pipette_gray[] =
+{
+ 0x00, 0x70, 0x00, 0xf8, 0x80, 0xff, 0x00, 0xfe, 0x00, 0x7d, 0x80, 0x38,
+ 0x40, 0x18, 0x20, 0x14, 0x10, 0x12, 0xf8, 0x01, 0xfc, 0x00, 0x7c, 0x00,
+ 0x3e, 0x00, 0x0f, 0x00, 0x04, 0x00, 0x00, 0x00
+};
+
+/* --------------------------------------------------- */
+
+const unsigned char cursor_pipette_mask[] =
+{
+ 0x00, 0x70, 0x00, 0xf8, 0x80, 0xff, 0x00, 0xfe, 0x00, 0x7f, 0x80, 0x3f,
+ 0xc0, 0x1f, 0xe0, 0x17, 0xf0, 0x13, 0xf8, 0x01, 0xfc, 0x00, 0x7c, 0x00,
+ 0x3e, 0x00, 0x0f, 0x00, 0x04, 0x00, 0x00, 0x00
+};
+
+/* --------------------------------------------------- */
+
diff --git a/frontend/xsane-icons.h b/frontend/xsane-icons.h
new file mode 100644
index 0000000..538f9ea
--- /dev/null
+++ b/frontend/xsane-icons.h
@@ -0,0 +1,87 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-icons.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ------------------------------------------------------------------------- */
+
+#ifndef XSANE_ICONS_H
+#define XSANE_ICONS_H
+
+#define CURSOR_PIPETTE_WIDTH 16
+#define CURSOR_PIPETTE_HEIGHT 16
+#define CURSOR_PIPETTE_HOT_X 1
+#define CURSOR_PIPETTE_HOT_Y 14
+
+extern const char *xsane_window_icon_xpm[];
+extern const char *error_xpm[];
+extern const char *warning_xpm[];
+extern const char *file_xpm[];
+extern const char *fax_xpm[];
+extern const char *faxreceiver_xpm[];
+extern const char *colormode_xpm[];
+extern const char *Gamma_xpm[];
+extern const char *Gamma_red_xpm[];
+extern const char *Gamma_green_xpm[];
+extern const char *Gamma_blue_xpm[];
+extern const char *brightness_xpm[];
+extern const char *brightness_red_xpm[];
+extern const char *brightness_green_xpm[];
+extern const char *brightness_blue_xpm[];
+extern const char *contrast_xpm[];
+extern const char *contrast_red_xpm[];
+extern const char *contrast_green_xpm[];
+extern const char *contrast_blue_xpm[];
+extern const char *rgb_default_xpm[];
+extern const char *negative_xpm[];
+extern const char *enhance_xpm[];
+extern const char *store_enhancement_xpm[];
+extern const char *restore_enhancement_xpm[];
+extern const char *default_enhancement_xpm[];
+extern const char *pipette_white_xpm[];
+extern const char *pipette_gray_xpm[];
+extern const char *pipette_black_xpm[];
+extern const char *zoom_not_xpm[];
+extern const char *zoom_out_xpm[];
+extern const char *zoom_in_xpm[];
+extern const char *zoom_undo_xpm[];
+extern const char *full_preview_area_xpm[];
+extern const char *printer_xpm[];
+extern const char *zoom_xpm[];
+extern const char *zoom_x_xpm[];
+extern const char *zoom_y_xpm[];
+extern const char *resolution_xpm[];
+extern const char *resolution_x_xpm[];
+extern const char *resolution_y_xpm[];
+extern const char *scanner_xpm[];
+extern const char *intensity_xpm[];
+extern const char *red_xpm[];
+extern const char *green_xpm[];
+extern const char *blue_xpm[];
+extern const char *pixel_xpm[];
+extern const char *log_xpm[];
+extern const char *move_up_xpm[];
+extern const char *move_down_xpm[];
+extern const char cursor_pipette_white[];
+extern const char cursor_pipette_gray[];
+extern const char cursor_pipette_black[];
+extern const char cursor_pipette_mask[];
+
+#endif
diff --git a/frontend/xsane-logo.xpm b/frontend/xsane-logo.xpm
new file mode 100644
index 0000000..cfe0a03
--- /dev/null
+++ b/frontend/xsane-logo.xpm
@@ -0,0 +1,372 @@
+/* XPM */
+static char *xsane_64c[] = {
+/* width height ncolors chars_per_pixel */
+"256 300 65 1",
+/* colors */
+" c #CBDDFC",
+". c #363777",
+"X c #D2E6FC",
+"o c #27241C",
+"O c #B0A47E",
+"+ c #1F1C14",
+"@ c #D9EFFC",
+"# c #E2D9B5",
+"$ c #788DFC",
+"% c #3848FC",
+"& c #978C6B",
+"* c #0A0B54",
+"= c #C8BC94",
+"- c #D6CCA5",
+"; c #C0B48C",
+": c #2028FB",
+"> c #687CFC",
+", c #242777",
+"< c #5468FC",
+"1 c #8097FC",
+"2 c #4E4836",
+"3 c #A2B9FC",
+"4 c #858279",
+"5 c #98ACFC",
+"6 c #E9F7FC",
+"7 c #3D47B3",
+"8 c #B0C7FC",
+"9 c #AAA27F",
+"0 c #F1ECD5",
+"q c #13179A",
+"w c #BED7FC",
+"e c #595785",
+"r c #8FA6FC",
+"t c #5F5842",
+"y c #2F36B5",
+"u c #CFC49C",
+"i c #302C21",
+"p c #BBCDFC",
+"a c #4558FC",
+"s c #867C5E",
+"d c #8C9EFC",
+"f c #DAD2AD",
+"g c #020204",
+"h c #B8AC85",
+"j c #FBFBF5",
+"k c #2B2EA0",
+"l c #1E25B1",
+"z c #AEBEFC",
+"x c #7D7458",
+"c c #C6C2B0",
+"v c #EBE4C7",
+"b none",
+"n c #171CF9",
+"m c #71684F",
+"M c #15140F",
+"N c #5E74FC",
+"B c #3D3829",
+"V c #131863",
+"C c #6F84FC",
+"Z c #474A8C",
+"A c #0D0C0A",
+"S c #8E8464",
+"D c #2B37FB",
+"F c #62669C",
+"G c #A49976",
+/* pixels */
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbS&#u##-#f###v##ummbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&&G=f#f#f---ff#f-#-##--#v#v#v-u=-==uh9hu=mbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbsS&;u-u-#f#v#vfff-###--f####---###-#fvv#ff#fu=-;OO;u;h;;===9&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbGO-##-=-#f;==#-uff#vv####vv#fff#=vvvf#-f-f-####vff#--u==-uhOhu=;u=uf-u==;&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbGOcvvvfff#--###uuff--uff-#fvv##f#v##-u-f#-##v#--u-###vfu-f-u-#-==uuu==uu;uu---===-=u;&Sbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;;-vvf-##vv##f--f-#--##-#u--uf#f--fv#####-==-ffv##-##u=-###f-uu;uu-u=u-uu;==hu-===u---uu=;OGh;;;Gbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=-##v#f##f##v###fv#ff-f#fu-##-u=u-#fu-f-#f-##fuu----#-u--uu-fu-u=#u=uu=u=hu--u;h=u-u==uu-u=f-u;h===;u;h;;&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbf-vvf##v#fvvv##v#f#v#-v#f#f=##-f###u;=uuuu=u==-##-u-ufu--=u--u=-u=u-u;-u=uuhuu==u--uOh========u-#-u-=-=uu;===;h=hGSbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb9-=-vvv##0######v####ff#-#f#vv--=-##f-=uu-=uuhO=-uhhu--uu-===u==-u=uu=;u=u=--#;=9=f--u;;;u;=uhO;-u;hu#--=-u=uu==u=h==h9hhhGbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=u#fv-=##vvv#vfvvvvv-##---u--f--#--=-----==h;uu;hO;;-hG=;-u-u=;u=f--h==;hhO;;=;=-=uh=uu=u=;hh=uhh9;;-h9;=-u#uu;-=ff-==;;hhGhhhhhhbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;fffv#--f####-v-v-f#v####v-uu;u==-u-f#ff-;u=-=h;O;h;==hhO==;;huhu;;=-===--=h;O;h;===ufu-uO==u;hhO;O;;=hOO===;hu;u==u--u--#uh=h;Oh;hh;=;hbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=v---#v#fv##fu#0##f##ff#-f#-uu;;==;---ff-u-=-uuu=uh9h;u;h=;;;G;-==h==;=u;uu=;=Ohh;h=uu---u-=uuuu;=h99;=;h=;;;9;-u=;-u=u-uu-u=uhh;;h=uu=-=;=hh9bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=v#vv###fv#-vff#v###--cfuu--====-h=9;-=uu-fu==uff=h==;hhO;;h=hh;u=-=;=h==;=uh;;;=h;Ghu==u--===u-f=h=u;;;9==h;;;;u=-u;=O==h=u;;;=u;;9;-u=u--=;hh==O9mbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc00#v##0#vv#vfu-#--f#--=h-f;;c9;h;O;;h=u==;-u=hh-uu;=;;u;=u;=;9h=h;=uu;h9;uhO;GhOhOh;h=u==;uuuhO-uu;=;hu;;uh=;9O;h;;=u;;G;u;O;9;O;hh=;=u=u;-uuh9uu=hh99OGbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#6v0#-f00##vv#f--=--c-f--Ou-;u=;OOOG;;h=u===;;h=u-=u;OOuu;;=u=;Oh9=;;;=;=9;uh==;hO9Gh;O===;=;=O==-==;O9=u;;=u=;hhO;=h;u;u9;u;==;OO99O=h=uuuuu=h=uf==;O&h;OG9hSbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbhvvv#v0v-f#vvv#vf#-u--uu-f-uu==h;=h;O99OO==h;uu;h==;;=u=hO;=uuuu=u;h;u;;uu-=u==hh;O;9G9Oh;=h===;h==;h=u=OO;;=uu===;h===;uu-====hh;h;O99hO;=;;uu=;=u===u=h9hh;;hO9OSbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-#f#f##vvv##--#0#fu=u--u==u;=f-=h;;O;u=hOhu;h=;h;hOhhOh;==h;Oh;fu=;h=uu==;u;=--;hO=O;u;;Oh=;h=h;;hOhh9h;==;;hh;--u;h=u==;;u;=-f=hh=O;==hO9==h;;;h;O;;9;;=u;;hOh==;9GGOGmbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbfvv###vvf#-vf=-#-f#-u=-u;u;u=cu-=h;;99;u;h;=;;h;;;=hhh=;hhOu;9h===-==h==;=hu;;uuuh;;OOhuhhh=;hh;;;=hhh;=hOh=;9O==;u==h=u;=h==;uuuh;=OOhu;hh=hh;;;=;;hh;=;hh==hO=u;u;h9OhGG&Sbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-0v#fvv0###uffu-f-f-uuuu===huu=-uhu;hhhhh;;h&huu;;=h9;h=;=h9h;h;=u=u=;==;=;Ouu=-uh=;hOhhO;;h&O=-;;=h9;h=;;;OO;h;=u=uu=u==;=h=u=u-hu=O9hhO;h;GOu-;;;;9hh==;;Oh;;;=-=u=;=;h9O&G9G&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-v06#vvv#vf--f=9;u;--=;===uh;huuuu;=-;h;;Ghh9GGOh;uuh;=;;;hhh=O&9hOuu;;====h;hu-uu;;-=hh;9h;9GGOh;=u;;;;;;hO;;h&G;h=u=h;u==h;huuuu;h-=hh=9h;9GG9O==-;;=;;;;O;;;&G;hu-uh;==;hO9OOOGGxbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;f-0v00vv##-uu-;9;uGh=u=u;=;=;;-=u==hh==;=hOh;OOOGG==uu;;h;;OO=O&9=GO=u=uh;=u;;u=;==O;==;uhOO;OOOGG===u;=h;;OO;h&O;G9=u;u;;==;;=====O;==;uhOO=OOO9&;=;u=;h;;9O;;&9;99;u=u=;==;;h;hOG&&&Sbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=##fvvv0v#-##ff---9h;=-hOuuuu=G-#=huOhh;u=uu;hOGhhh9h;h-=hO;u;=;=u99h=uh9=-uu;Guf=;=hO;huu===hO9hhh9h;;u=hOhu;u;=u99h=uhO=uuu=G=#=;=;9;Ouu===;O9Ohh9h=;u=hhhu;u;=uOGh=u;O=-u-u&=f=OhhSG&GG&tbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbvf##v#fv###f##f###f;=;-u=h9uu-cu=uf=hh=h=O;h;=;=;9hOhhO;hh=;==u-#f-;;;uu=O9=uuu=uu-uhh=h;O;h;=;=;OhOhOhh;h;===uu#ff;;huu=hG=u=u=u=-uhh=h;hh;h=h;;OOOhhOh;h=;==uu#-#=;huuuh9;-uu=uu--hOh9G&&SS&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbc0v0#0--v#uv#ufu--##-;h;uu-;---uuu=u=u-uu;h=;h9O==;;O;OG=;Ouu;====ff-;h;=uf;u-uuuu=u==-=u;h==hOO==;;O;h&=;Ouu;u=u=-#f;hhuu-=uu-u=-uuu=-=-;h=;hh9===;O;h&;;O=u;====-ff;h;=u-==--uuuuu==-=uh999&&xSsbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbb;vvv0vv0#=-v-#-u=u-uu=;u;=u=-uuu;u-==uu-u-u-uh9;hO;h=h;=;Ghu=uu=;uuuu=;===u=-=uu;=-=uuu--fu-=h9;hO;h;;;;=9Ou=uu=;=u-=u;==;u=uuuu;u-;u=u---uuu;G;hO=h;;;;=OO==uuu;=u-=u;==;u=uuuu;=f;-=u---u==OS&&sSstbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbv00ff#vv--f----u-u====u=;=;==u;;=;uu==u--f--=hh;h==9GO=;OO;;====u=u=====h;;;=u=hu;uu=;ufu#-f=hh;h;=OGO==OO;;====u=u;====;;;==u=hu;uu=;u-u#-#=;h;;;=OGO==h9;=====u=u=====;h;;=u=hu;=-=;u-uf-#;h9hGG9smmsbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbvv0ff-v#--uu-=-u--==;;u==;;===u=;;==-=;-=ff-=uu=;h=9GG;;hhh;=;uuu-==;;uu;;;;u=u==h==-==-=-f-=u-=;h=OGGh=Ohh;=;=uu-==;;uu=;;;=;uu=h==-==u=-f-==uu;h;OGGh=hOhh=;=uu-==;;uu=;=;u==u=h==-==u=-#-u=-=hOO&xss&mtbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbb;60v#v0#u=uf==u=---u;==ff=h;;=Ou--;=;=;;=uuuuu==uu;;9;=;GGO=hh=;u-uu;=;ufu;;;=9uuu==O;;=;=-uuu==u==;Oh=;G9O=hh=;u-uu;=;u-u;;;=Ouu-=;;=;=;u-uuu=====;hh=;GGO=;O=;=--u;===fu;h;;Ouuu==;;;u;=-uuu==uu=h9GOGsxmsmbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbb;vv60v###fu;=u=h==-u=u=u-u;;O;;;;uu-=h;h;=uu-;;;=;h==;Oh;;;Oh=;h==--====-u;;O;;;;-u-OsOhhuuu-;;;=;h==;hh;hhOh=;h==--u===-u=;O;;=;uu-u;;h;=uu-=;;==h=u;OO;;;OO==h;=u-u;==-uu;O;;=;u-f=;;hh=uu-=;;;=O;u;OG9&&Sxxs2bbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbcvvv0v#v#--=;;h==;h;=f-===u;OO;u;-u==u=hh=uuu=;;hO;h=hh;=h;hhhO;=hh;;-u===u;O9;u=uu=hs9hh;uuu==hhO;h=;h;=;=OhOO;=;hh;-u===u;O9h=;uu==u=;O==u=u=;hO;h;=h;=;;hhh9h=;hh=uuu==u;hGh===u==u==O;=u=u;;;9;h;=9h;h9&&Smsxtbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbc00vvv#-##f=;Oh;==O;=;==;uu=Oh;=;uu;;===;;u;u;;u;;;h;=hO;==hO&G9OOG9O9h;=uu=Oh;=;=u=hGxh;;u;==;u;;;h;=hOh==hO9h;=;hh;;=;=uu=hO;===u=;===;;u;u=hu;;;hh=hO;==;O9O;==hh;;==;uu=hO===;-=;=u=;;u===hu=h;hh=hOh=;h&&SSSSmtbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbb=0v00#vv-f-fu;9O;h;;;;hh=u-======u=;=u=;=u=h=u=;u=;=;O==h;=u=OmtmmmtmmtxG;u===;===uhuhxG;u=h=u=hu=;=;O=;;;=u=;G9h;hhh;h;;uf=;u;u;uuh==u;;u=;;u=;u=;=;O;;;h=u=;G9h;h;h;;h;=f==u;u;=u;===;;==;;u=;=u;=;O;;;h===h&&&Ssxmmbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbb;6jj0##v0#fu=;;;;;;OG;==9Ouu=u;u=h==;=u=;==;;=;=;uuu;hO=-uu=;h;OG9G&&GhOSmmh==;u=h==;;;m9==;;=;=;uu-;;9;-uu=;;;=h;;O9;==O9=uuu;u=;;=;;u=;==;h=;=;uu-;=G=-uu=h;;=h;;OGh==O9=uu=;==h==;;uu;===h=;=;uu-;=G;-uu=;hh;G9&smmxmbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbb;000j0vfvff-u=;Oh==OOG;;=OG;;u=u==h==-uu;==hhhh;;=;u-==O=====;hOh==OO9h;=9smmh=-==hu=-u;mO=hhhO;==;=-==h====u;;Oh;=OOGhhuOG;;u=u==hu=--uh==;hhO;;;;=uu=h;u==u;;Oh;uOO9OhuhGh;u=-=uh=;u-u;==;h;O;;;;=uu=;huu;u=;OOh;&&xmmxtbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbb0600600vf=uu-hOhh;h;=;OOh;;;;O-huh;uu=u=u-h;hO;hh===u-u-uh==u;OhOhO;=;OOh;;9&mhhuh;=u==Gs=;;;O;hh===u-uuuh==u;OOO;Oh=;OOO;;hhO=h=;;=u===u-=h;O;;h===u--u-O==u=OOO;O;;=hOO;;;hh=;=;h=uu==uu=h;O;hh===u--u-O====9OOh9OGGSmmmtbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbv0jjjjvvv=fuu=;=O9h;=hh=;;h9;u=;;u;;=-;u==;hOhh;h=uu--uu-;u=uu==O9O;=hh=;;hG;=s&O===;-;OS9h;OOh;h==uu-uuu;====;;OGO;=hh;;hhG;uu;h=;;;u;==;h;OOhhh=uuufuuu=u==u;=h99;=;O=;;;G;u=;hu==;u==u=;;hOh;h==uufuu-===u===hGGh;h&Gsxmttbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbb0j00000#--#ff;huu=hOh=;h;hh===-=;;Ou;h==hh;;uh;&;-===--u;=u-f;h==;;hO=;h;hh=u=u9mm&;;;;9s&h;=OhGh====--=;==-f;h==;;hO=;h;h;;u=u=;=h=;h;=;;;;=hhGhu===--u=u=-f=h=u;;hO;=h;h;;u=uu;=O;;;;u;h;;=hhGOu==u--u===-f=;;==;hOhh9G&smtttbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbj000j0v==#-u;=;;=;u;;=OOh;h;;u=;O9=uOh;GhhhOO;h;=;=;-u=OOfuu;=;huh==;=h9h;O;;u=;&tx9G99tG9h9O;h;===;uu=hO--u;=;h=;;=O=;GO;hhhuu;h&;uhO=GhOhOO;h;==;;uu=O9uu-==;h=;;=h=;GO=hh;=u;;G;u;O;GhOhhO;h;===;uuuh9uuu=;;;=;;=h=;&&&x2B2t2bbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbb00j00#f##fuu;Ohuu;;=u=hhhO=;h==;=G==h==hhO9G;;O=u====;h=u-==;OO=u;;=u=;hh9==h=u;=G9Gmm&x&99Gh;O;==;;;;O==-;;h9G==hO;=;h9OGh;Oh=h=&;=h;;hOO9GO;hh==;=;=O==-==;OG=u;;;-==hhOh=h;u;u9hu;;;;hh99O=h;==;=;=O==-==;h9===h;-=;OOSmmxmmttBbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbb-v0j0vf#fu;uu;Oh;==u=u==;h;u;;u-u====hh=O;GG9Oh==h===;h===huu=OO;==u====hh;=;;=uu;==;&tm&hGGGOO;=O;=;;O;;;O;;;GGOh;;;;h;hOh;hh;;=h;;hOOO9OGGGOO;=h;==;O===h===h9;==uu===;h===;uu-;u==;;hhhOGGOO;u;;=u;;;==;=u=h9;;uuu===;&x&&&&smt2Bbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbv0vvv#--;;h===;;Oh=fu=hh=u===;u;=--;hh;hhu=hOh=;h;h;hhOhOOO;==h;hh=f-=;h====;h=;=--;h9GtG=;hOO;hO;OOO9G9GGG9hhG9G&O;hOG&GO99GGOGO;;9GGOG9;h9GG;hOhh;hhOhhGhh==h;hO;--=;h====;;=;=--;hO=O;==;OO=;h;;;hhOhhGhh;=h;hO;u-==hOx9;hGGsxmt2bbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbv000vvfu=uuh;hu;9h==uu==;=uh=hu==u-=O;;9O;=hh;;h;h;;;=hhh==hhO=;9h===u=;h==h=hu=;uu=O;;&t9=OOO;O9GO9OOG&&GG&&SG&sS&&GGG&S&&S&s&GSG99S&GSSGOGGGh9GOOOhhhOO;;;Oh;;OO===u==h=u;=hu=;uu-hh=OOh=;;h=;hh;;;=hhh;=;hh==OO==;-==h9s9;Oh9Ssmt2ibbbbbbbbbbbbbb",
+"bbbbbbbbbbbbjv00#ffuf==h9;;h;=u=u====;=;huu;-=hu;hOhOh;;h&;uu;==OO;h=;=hOh;h;=========;=O=u;-=h=h99&tSO99sGOhGGGSsSS&SSsmxsmxxsxxxmxxmxmmxxxssmsxxmxxxSSSxS9hG9O9GOOhh;OOO;h;;u=u=====;=h=u=u-h==hOhhO;hhG9=u=;=;Oh;;=;;OO;h;;u=uu;=hx&;h;;OGGmt2Bobbbbbbbbbbbbb",
+"bbbbbbbbbbb#0jjv##-uuhhh=O&O;huu;;====h;hu-uuh=-;h;;9hhGGGOh;=uh;;;;;hhh;hSOhO=u;h==;=hhh=u==OhuhG9&tSGssxsSS&&xxxmmmttttt22t2ttt22t22222ttttttmtttmtmmtmtmsS&9&GGGOOOGhhh&Ghh===;;===h;h=uuu=;-=Oh;9h;OGG9h;=u;;;;h;;O;;;&Ghh=u=h;hGx9;O=u=9&xmtBibbbbbbbbbbbbb",
+"bbbbbbbbbbb-0000v#uu;hh=O&O;GO=u;=h=;u;;u====hh==;=h9h;OO99G==uu;=h;hOh;O&9=&O=u;uh;;=h;==hhhG99OGGx2xSxmmmtmmmmttt222B2BiBBiBBBBBBBBBBBBB2B2BB22222B2t2ttt2xxsSS&S&G&&OOSGhGG;u;=;;==;;=u===hh;u;=;OO=O9O9&;=;u=;h;;OO;;&9hOO;===Gxx9;;;=;hO&xmtBiobbbbbbbbbbbb",
+"bbbbbbbbbbb00vj#f=uu=;=u=GO;;uhhu-uu;G--=huOhh;u=uu;hOGhhh9h;h-;hO;u;=;;=G9;;uhO=u=u;&=uh9hG&&&G&&S2tmtttt22222BBiBBiiiio++oooo+oooio+iiioii+iiBBBBBBBBB2222ttmmmmx&S&&Gh&&O;;;O;-=u=G=f=;=;9;h=uu==;O9OhhOO=;uuhhhu;=h=uOGh===O;h4Oh&=#=;;;&Gsxm2Bibbbbbbbbbbbb",
+"bbbbbbbbbb#v#0###---ufff-;;;uu;O9u=u===uf=Oh=h=O;O;;;;;9hOhhO=h;;;===uff-;;;u=;9G=;;;hhh;9SS&sxmxt2B222BBiiioiooo++++o+++++++++++++++MMM+MMMMoooioiBiBiiiBB2B222ttmxsSG9OGGGh;;9G;u=u;uu-uh;;;h;;hhuh;;OOOOhhO;h;;==uufff=;huu=h&xhuu=u=--hhh9Sst2iiMbbbbbbbbbbb",
+"bbbbbbbbbb-f0v#0#u-==u##u;h;uu-;u--uuuuu=u-u=;h==hOh==;;O;GG=;Ouuh=;==f#-hhO==uh;=;hOOGGSSSxxttt2B++iBio+o+MM+MMMMMMMMMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbMiBoBB2222ttmms&&ssSOh=h;u-==u=u==-=u;h;=hhG===hh;h&;=O=u;==u=-f#;hh=u-9shuu=u=u==u==O&Sm2io+bbbbbbbbbbb",
+"bbbbbbbbbb6vfv0v#f==ufuu=;u;=u=uuuu;u-==uu-u-uuuh9=Oh;h=;;=;Ghu======-==;;;;;;hhOO9&&Gsxxmmtt2BBioMM+MMMMAMAAAAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbB2222tttmxxsSSG9hh=;;=f=u=u---uuu;G;;O;h;;;;=O9==uu=;=u-=u;=u;uhx9uu==f=u;u-uu=hGx2Bo+bbbbbbbbbbb",
+"bbbbbbbbb-##0vv#f-uu=====;;;;=uu;;uhuu=;---#-f=hhhh==OGO==OO;;;===u===;;=hOOGOOO&xSxxmt222BBii+MMMAAAAgAAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbB22tttmmmss&O9G;O;===u-u#-#=;O;h;uhGO;=;Oh====uu=u=====;h=hOshh===u===-ufu-h&xmBioMbbbbbbbbbb",
+"bbbbbbbbb#v#0v##f--u=;;u==;h=====;;u=-==u=ff-;uu=;h=GGG;;Ohh;;;uuuu=;hh;hOGGG&ssxmt222Biioo+MAAAAAgAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb22tttmssS&GGhhu=;==-f-=u-u;;;h&GhuhOh;;==u=-==;;u==;;hhsO==;==-u===-#-=hhSm2i+Abbbbbbbbbb",
+"bbbbbbbbbv0#vv###fu;u=--=h=;=O--u;=;;=;=uuuuu==uu=hO;=h9Gh=OO=;=-u=h;h;;O&SsstxttBBio++MMAAgAggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2tmtxs&S&GOO=h=-u-u==uu=;Ohu;GG9;;O=;=--u;=;=fu;h;OmG--;;;;hu;=u=u==hh&x2i+Mbbbbbbbbbb",
+"bbbbbbbbb#v0#####-===u-u;;O;;;;-u-=h=O;=-u-;;;=;h==;Oh;hhOh=;h==u=;hOOOGSstm22BBio+MMAgAgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbtmxs&&S&GG;=u-=;;==h;u;hO;;hOh;=h;=--u===-uu;hhOm9=--u;;;h=uu-=;hhOSxtB+Mbbbbbbbbbb",
+"bbbbbbbb=v##0v-=u=fuu;=;99G===uu==u=hh=uu===;hO;h=h;;=h;hOO9;=hOhh;OGSSst22BBio+MAAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbtxxSSSSOhu=u=;hO;;;=O;=;;hhhOh=;hh=uuu==u=OGhhmhu==u=;O;=-=u;;OGG&smBoMAbbbbbbbbb",
+"bbbbbbbbhfvvvvuuu===;;OxmG;=====;===;;=;u=;u;;;h;=hO;==hOGO;=;9OOGG&sxmtBio+MAAgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbtxsSS9Oh=;u=;;hh=;O;==;OOOh==hh;;====u=hOhO&m;=;====;u;==hu=h;9&StBoMAbbbbbbbbb",
+"bbbbbbbb;ffv#fu==h;hOsx9h====u;===;===;===hu=;;;O;=h;=u=hGO;OhGG&sxmmtBio+MAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbxs&&9;;;uu==;O;;;h=uu;GOh;hhh;;h;=f===GsmtmO==u;;==;;u=h==;hh&Sm2oMAbbbbbbbbb",
+"bbbbbbbb#vvv#-;-=hsxsOh=;u=h=;;=u=;=u;;===;uuu=hOu-uu=;hh;hhh&S&Sx2BBi+MAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbtSSGO;;--#=u9=-uu=;h;=h;;OOh==hG=u=hGs9&mG;;u=;==;;;==;=uu;h&SstB+Abbbbbbbbb",
+"bbbbbbbb#vvv-=Oh9xmsh;==u==;==-uuh==hhhh;=;;u-=;O====u;hOh;hGSsxmtB++AAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbs&h;=uu#-=h;uu;u=hOh;uh9GOhuhGh;Oxs9;Gm9u--;;=;h;O;;;;=u=hGSsti+Abbbbbbbbb",
+"bbbbbbbb#####uxmm&O=h;h-Ouh;uuu==u-h;h9;hh===u--uuh==uhOhOhGGGxtBo+AggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbSh;----#f--O==u=OhOhO;;;hOO;;;9s9O;;Gx;u==uuuh;Ohh;=;;=-uhhmtB+ggbbbbbbbb",
+"bbbbbbbbf=uu-9mGO;OO;u=;;u;==u;u==;hOh;hh=u=-fuu-;u=u=;;OGGGGxt2iMggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbu##vv#--u==u===hOOh=;h=h;;Gh=;;h-h4Gc==u=;;hOh;h;=uu-u=;9stBoAgbbbbbbbb",
+"bbbbbbbbf&sssxx;;;=uuu=;;O=;;==;h=;uO;G;-=uu--===u--;h;=;OG&&m2iMgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbG#vvv#--=-#=;;=;hhO;=h;;h;u;-c;=Ohh;h-;h;;=;h9O=u=uu-u;hG&xB+ggbbbbbbbb",
+"bbbbbbbbf#ccchO==h;=u=;hG=-Oh;GhhhOhhh;===;u-=OOfu-;=;h=h;O&stiMgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#vvvuh---==;;==;uh==GO=h;;=u=;G;u;9;GhOhhOhhh===;=uuhGhhGm2+Agbbbbbbbb",
+"bbbbbbbbv00v#-uh=;h=u;=Gu=h==hhO9G;;h=u;;==;h=u-==;Oh==;h;h&x2iAgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbvv-v#v-u;hO=u;;;u=;hhOh=h;u;u9hu;;=;hh9O9=hhuu;=;=O;=u;9StioAgbbbbbbbb",
+"bbbbbbbbvv0vv-uu-;=u-u;===hh;hhGGOOO==h===;h===hu==9O;===;O&m2+Agbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;vvv##uuu=hO;==uu=u=;h;=;;=u-;===;;O;h99GOO;=;;=u=;h==hh9&mBoggbbbbbbbb",
+"bbbbbbbb00vff##uu=;u==fuhhh;hhu;h9h=;h=h;hhOhOhO==;hhOh=-;Ost2+gbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbvv###;==uuh=hO;--=;h;=u==hu==--=h9=hh;=hOO;=h;;;hhOhhGO9G&tBoAgbbbbbbbb",
+"bbbbbbbbcvvvf##==;===u-=h;;9O==;h;;;hh;;;;hhh;;h;Ou;Gh;==;G&m2oAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0vv###u;h==hO===u==h=u;=;==;uu-;h=9hh=;;h=hhh;;;=hhOh;h9G&mB+Agbbbbbbbb",
+"bbbbbbbb=vvvv#-u;uu=-=hu;hOhOh;;h&;uuh==hO;h=;=hG;;h;;===h9&m2iAgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbf#vvv#f=hh;h;;u==u=u==;=h=u;=-h=;hOhOO=hhGO=-;;=;Ohh;==hG&Sm2oAgbbbbbbbb",
+"bbbbbbbbh#vv##uu;--uuh=-hO;hOhhGGGhh==uh;;;;;hh;;h&O;h=uhOO&x2BMAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbh0vvvvf==;;GG;h=u=;;u==;;h=--u=h-u9h=9h;OGG9h==u;;;;;h;OOOGmtB+ggbbbbbbbb",
+"bbbbbbbbbvf##v-uuu===;h==;=hG;;OOOGG==uu;=h;;Oh=O&O;GO==;;GGstBi+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbj00vv#u=u=&9;GO;u==;;==;;;u===h;==;uh99=O9O9Gh=;u==h;;OOhOsmmB+Agbbbbbbbb",
+"bbbbbbbbbvvvf=v#===Ohh;u=uu;hOG;hhG;;h-;hO;=;;;;=GO=h=hh==hOSttBo+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb600v#0ff=uu9G;==;O;-=u=G=f=;==9hOuuu==hOOO;O9O=;uuhhO=h=;;;&mm2+ggbbbbbbbb",
+"bbbbbbbbb0vv#####=h;=h=O;O==;;h9hOhhO=;;;;=uu-ff-h;;uu;OG=;h&st2Bobbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbv0vvvvvv##f#;=h=u=hO;-uu;uu-uOh;=h;hhhu;;hh9hOhOO=h;h==uu-u-9St2oggbbbbbbbb",
+"bbbbbbbbb0vvvv#fu-uuu;h==h9O==;hO;GG=;Ouu;====f#-;h;=-u==u=;9&xt2iibbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;00v00vv#f-#f#;;h=--==u-uuu=uu=-=u;h==h;G===hO;;&;=O;-;====---GstBoggbbbbbbbb",
+"bbbbbbbbbcv#vv#f#-fu-u-=hO=Oh;h=;;=;Ghu=u==;u-u==;=====uu==OO9xm22Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#0##000v#----uu;==;u===uu;=f=-=u---uuu;Gh;9=h;;;;uOG=u=u=;;u-;;GSmB+ggbbbbbbbb",
+"bbbbbbbbb;vfvvf-f#-fff;hOhh==OGh=;h9;===u=u===u===;;;==u=huO;9Sxtt2Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#0v#v000vvf-uu=u==;h;;=uuhu;=u=;u-uf-f=;O=h;=hGO;;;Oh;===uu==;==hOStBMggbbbbbbbb",
+"bbbbbbbbbbfv#0#f#-#f-;-uu;h=GGG=;hOh;=;u=u-u=;;u=;;;==;===h=h;Gsxtt2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=v6v#vvvv##f#-==;===;;;u;u==h==-===u-#-uuuu;;;h&Ghuh9h;===u=-u==;;hGstiMggbbbbbbbb",
+"bbbbbbbbbb##f#fff-f=-==uu;hO;=hGGh=hh;=u--=;=;--=;;;=O-u=;;;hO9&smm22bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-6v#f#0v-vf#ff-;=;=fu;h;;h=u-;;;;;u;=uu-=u=u==hhh=;GG9;;9=;=--u;;;=u;&xtiAggbbbbbbbb",
+"bbbbbbbbbb--#-ff#f-=;==;hu=;Oh;hhO;=;h==f-==;u-u;;h;;;;-u-=hh9G9GSmt22bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-v##v##----;==-u=h;;u==;Oh;;;=-fu;;hh==--==;==h;u;hO;;hOh;=O;=--u;;=u=;Gm2iAggbbbbbbbb",
+"bbbbbbbbbbu#uf###--=hhh;h=hh;=h=hOhO;=;h;;-u=;uu;OG;==uu==u=OOhh9&xt22ibbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbOf#v-f#-u=;hGGOG&&G;hhhh;;OGO===u;=u=;9==u;u=hhO;;;uO;=;;;hhOh=;hh=uu==;;OSm2igggbbbbbbbb",
+"bbbbbbbbbbbff##f#u=-;;;h;;;O;==hO9h;==O;=;===uu;Oh;=;=u;;;==;;;Oh&sstt2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbh9h=;;9SsxsSsxssS&G&9hOGGOh;hu;;====;=;=uh==h=hO=hO;;=;OOOh==hh;=;===u;&sm2+Aggbbbbbbbb",
+"bbbbbbbbbbb-##-##-=-=;=;h;=h;=u=OGO;h;hh;h;=u-=======u;=u=;;=;hh;9S&xtt2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbxSxtttttttmmmsSGGGG9hO;=h;;=;h;=;=u=;==;;=O;;;huu=;9Oh;;hhh;h;;-=hO&mB+ggbbbbbbbbb",
+"bbbbbbbbbbb-#ffff-u--==hh=-u=;;;=;h;;OG==;Ghu-==;u=;=;;==;;=u;O=hOGG&stt2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbBtt222ttttxssSS&9&9OOh=;h===h;;=;uu-;=9=-uu=;;;;O;;OOO==hG=u=h9SmBMggbbbbbbbbb",
+"bbbbbbbbbbbbu-----u=--=;O===u=;hO;=;O9G;;=OG;=u=u==hu=--u;=;hhhOhh9GG&xt22bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbi22t222mmmsSSSGGO;;Oh;hhhhh;;;=-==Ohu=;u;;Oh==h99OhuOGO;=O9StBMggbbbbbbbbb",
+"bbbbbbbbbbbb--=----u=-u-uuh==uhOOOhhh=;OOh;;hhhuhuh;u=u===-;h;9hhOhOGGSSmm2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2222tmtmmmsSGG9h;;Gh9Oh;;=;=-uu-O==u=OhOhh;;h;OO;h;hOOGxtogggbbbbbbbbb",
+"bbbbbbbbbbbb;u--uf#-ffuuf;==u==;OOO;=h;;;;hO;-=;;u;==u;=u=;;Oh;;O;;;;hGSsmmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2t2tmtmxsss&&GGGGOhO;=uu--uuu;==u=;h9Oh=;h;h;;Gh=;9Sx2ogggbbbbbbbbb",
+"bbbbbbbbbbbbb-h-vf#fffu==---;;==;hhh=;h=h;===u=;;O=;;=u;;;;=OhGh-==;=;9&sxxmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb22ttttxmxss&&&SGh;;=u-u=u;-f=h;u=hhO;=;;;;h=;=;G&mB+gggbbbbbbbbb",
+"bbbbbbbbbbbbb=-#-f-##uOOffu==;;=h==h=hGh;Oh=u=;;G=uOh;GhhhOhhhh=;=huuh&SG&smm2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb22t2ttmmxsS&9OhO=u=hG=--u=;h=;;uh==GO;hh;=uOGmtBMggbbbbbbbbbb",
+"bbbbbbbbbbbbbG#-fffu=u--==;Ohu=;;u==hhhO;=h=u;=G==h==hhO9G;;h;u;==;;9;;;9&xmtmmbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2t2ttxmxS&GGOhG;;-u=;h9=u;;;u=;OhO;=O;uO;smtiAggbbbbbbbbbb",
+"bbbbbbbbbbbbbbu-##-=--=;=u=GO;==uu=u=;h;u;;=uu;===hh;hhGOGOO=uh;=u=O;=;9hO&mmmmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2tttsxxSG&G9h;h;;=O9;===u=uu;h;=;;===O&x2ogggbbbbbbbbbb",
+"bbbbbbbbbbbbbbuuuuu=uh;h==;;;hh=fu=O;=====;u==fu;hh;hhu;OOh=;h;;;hhOh999OOGSsmtmmbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2mtmmxxss&GS9O==O;;O;--=;h;===;h=;;hGmBMgggbbbbbbbbbb",
+"bbbbbbbbbbbbbbbu--u==u=;;hu;G;===uu=h=u;=h==;ufuh;;9O==;h;;;hh;h;;hhO;;hhGh&sxxxmmbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2tmmxxxsSGGGO;;O9;==-u=h=u==O=uOhO&tiMggbbbbbbbbbbb",
+"bbbbbbbbbbbbbbb-==-ufu-;G;;h;===u=====;;h=u;-=h=h;OhOO=hh&;uu;;=hO;h=;=OGOhGG&&sxmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbttmmsS&&&&OOhhu===;u==;;h;u;;;Ss2igggbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbb=uu--=;==h&h;huu;;====;;;ufuu;=-hOh;O;h99GO;=uuh;h;;;hOhhOSG9&G&sxmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbtmxxmSSGs&hh;u=;;===;;h=uu;Osx2+gggbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbu-u-===uOGO;Gh=u;=;;==h======h;=u;uhGh;G9OGG;=u=;=h;hOh;h&GhSG9GSSxmmbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmmmsSxs&&Gh==;;;==;;;==;h&stBAggbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbb&;u--uuu=GO=huhhuuuuhOu-=;=OhO;u=uuhhO9;hhG;;;-;;Ohu;;;;=GG;O;G&GGSSmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmxsxm&OOhO=-uu=G=f=;;;&Sm2igggbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbb=-f###vf;;;uu;OOuuu=;uuf;;h=h=h;O==;;hOOO;hO;;;;;==u--f-h;hu=hG&9G&sxx2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbm&sssGOhGG;uuu;=u-uOOG&t2+gggbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbb&--ffvvf=;;u--;uuuuuu=u=uu=uhh==hOh==;hO;9G;;O=u;u==uf#-;hh=uuhhhO&&sxxtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmxs&9hOh=uuu-=-===OOxtiMgggbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbuuf##f-====u=uuuu=u-==uu--uuu=h9;hO=h=h;;;9h=uu==;uuu==;=;==;=;;hG&GssmmbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbSS&GOh=u==-=u;==;Gs2ogggbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbG---#-fu==;=uu=;uhuu==ufu#-f=hOhh==O9h=;hOh====uu====;u=;;h;==h9h&G&xxmmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmSG9O9;;=-===u=;&sB+gggbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbb-uuuf-u====;u==;u=-=;-=ff-=uu=;h=GGG;=hOh==;uu=u=;;;u=;hh;=h;hOG9&&smmttt2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbSGG99;=-u===;h&tiAggbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbb&u=##-=u;uh-uu;;=;===u=-=-==uu=hO;=hGGh=OO=;u-u=;=hu-=hhh;G=hh&&Ssxmt22BBBBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbG9GGO;;-;;=hGm2Mgggbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbb=-#f-u=u=;;---=h=O;=-fu=;==;h==hOh;hhOhu=O==--==;u-u;h9OOG&9G&xmt2BBBioo+oibbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbShhOhhOu==hstiAgggbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbb&=-#=;h=-=uu=uu=hh==u=u;hhhhhuh;;=h=hhOO;;hh;;-u=h;=hGSGG&&smmt2iio+MMAAMMoobbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbSOOO9;=-OOx2+gggbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbb;-u;;u-=u-;;====;====;u;;;h;;hO;==hO9Oh;=Oh;;=;;==OGSGSsxmt2Bio+MAgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=f##vvv00v-uSSbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbSOhO=;;hsmBMgggbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbb=u-u----=====;==;=u;;==;;;h;=h;=u=hGO;h;hh;9;h;=OGGssxmtBBo+MAgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbhc##0v#v#v#v#fffhsbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbSO;h;;9xtiAggbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbh-=f-=-==uu;;=u;h=;=;-uu;;O=-==;;h;hO;;OG;;h&GOO&SxxtBBi+MMAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-#v##vf#vff#f---uOSbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbGhOhhGx2+gggbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbb;-uu=f---u;==hh;;;=;;u-=;O=uu==hhO;=;OGGOhhSs&Ssmt2Bo+MAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb9&GG;uuuufuu-GG&4bbbbbbbbbbbbbbbbbbbbbb9#f#-##v0vf#-u==h;=;Sbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb9OO9&mBAggbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbOh-;=f-f-u=-;;;G;h;==;-u-uuh;=uhOhOhOOh9G&&&smt22iiMAgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbhhf##v###v---=uuu--uf-#-fh=u=&bbbbbbbbbbbbbbbbbbbh=-f####v#--;==h=;h;h&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb9GGStigggbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbb;-=-u#uu-u=hOh;;O==u-f=u-;=====;9GOhhGGGSsmtt2BoMAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&;v#ffv###vf###f-uu--=f###vf-#-uuuu==O9&&bbbbbbbbbbbbbbbb9==u----uuuu=uuuu-u;=h&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&O&stiggbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbhu==--=;===O;G;u=u=--u===u-;h=;hOGGOGSsmm2Bi+AAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;=f#v#vv#f-##f#v#fff#u-;u##f####f-u##u;uu=hhO=;9Gbbbbbbbbbbbbbb9hOh;-=u;ufff---u=;h==9sbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&GS2oggbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbb;-h;uh=;;hh;hh===;--=O9---==hh=O;O&Gstm2BB+MAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=-#uf#-f#vv#f=#v-u#;---uu-u-fffu#v#=;###--==u==uh=;&hhGGbbbbbbbbbbbbb&&GGh;;-ff-##-;9=uu;hOG9xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbSGx2+gbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbh==;=;h9=;h======;h==u==hOO=;OG9Gsxt2Bi+Agggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbu#0v#ff-##f#vfv=fv-##---;=u-uu#----f;--#-fu;;--u==-=;hhGh;9h;xbbbbbbbbbbbmSG&9===uuf;-u#uuhOGhh9GG9bbbbbbbbbbbbbbbbbbbbbbbbbbbbbSm2+gbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbh=;hhhhhh=u;====O;==;==;GGOhOG&SxtBB+MAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbfvvvvv0v###v#vvvvf###-uuu=h=O=;ufuuf--=--fu---h;u-u--u-u;;;=hh;;=O9bbbbbbbbbbbSS9GO;u==u-fuuuuO9h;hhh999bbbbbbbbbbbbbbbbbbbbbbbbbbbxm2+bbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbb;hh-=;hhu=h;;;hhOhOOh;=hOOG&&&xt2ioMgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb###ffv60vffv#vv#-###v#-u=-=;fuh;h-u;===;;h=;Oh=uu;=;hu##-===uu==O;;h=;9&bbbbbbbbbbbS&&9GOO;=O;=-u;;hOhu=OG&GGbbbbbbbbbbbbbbbbbbbbbbbbbbt2bbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbO=====u=;h=h;;hOh;;OhG;GsSsxm2BoMAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc##vv-##vvvv#f#vf#c##cf##;=uh;uu=;;u;h;=;==;hh;=;;;u=h;=uu-uu;u-=uhuuO;=;GG9sbbbbbbbbbb&S&GGG9h==;=uuhO=;;=;hG9OG&mbbbbbbbbbbbbbbbbbbbbbbbm2bbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbsO=;;G=-u;==hh;h;;=O&9GSSxmtBiMAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbcv0f-#v###0vvv#v##--uf#=f#;u==h;O9=;;Ghuu;;=;h;h==uhOh=h;;u=uu=uu===;uu;uu9;9G&&&xbbbbbbbbbbSS&&O;=;Oh=;;=-uuu;;hO9G&&&bbbbbbbbbbbbbbbbbbbbbbmbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbOhGOO;=uuuh;hh;;GGGG&mmm22i+Aggggbbbbbbbbbbbbbbbbbbbbbbbbbbbb##v#f###=fvfvv##f#-f-==-#fu==f;Oh;h;hO9GO;=uuh;hh;=hO;h;G9;;uu===uu==;;u--u;huh&GGS&&tbbbbbbbbbs&GG9Ghh=9O;;uu=;=;;hO9&O99Gbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;GhOhOuuf=;=hhOG9GSmttBi+Mggggbbbbbbbbbbbbbbbbbbbbbbbbbbbcv0#vvf#v#=u#=u##--uu--;uuu==u;;=u;u;9O=9999G;=uu=u;;;Oh;;&9h99=u==h;=uh==uu=u;;;=hh9&sGsmbbbbbbbbbm&&&&hhG9hOO=uu=;===OOOOGG&&mbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmhhhO===f;hOhhOG&Sm22B+Mgggggbbbbbbbbbbbbbbbbbbbbbbbbbbf0v###v#v#v#;=f-fuu-#--=Ou-==u;9h;uuuuhhh9hhOGO=;u;hOh=;=h==GG;;;;h=-=u;9u-=;u=9O;===;9G&ssSsbbbbbbbbbb&G&9h&&;=;=h=-=-=9=-;OO9sSs&sbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbGOO;;hu=;hhhhOO&smBiMAggggbbbbbbbbbbbbbbbbbbbbbbbbbb-fvv#v#v000000--uf#uhhu-u=;u-#;h;;;;h;hhu;;hOOhh;Oh=;hh;=uu-u-hhhu-;O9u-uu;=uf=h;;=h;;;O=O9&Ssxsmbbbbbbbbb9hh=hhhu-uOO=-uu;=u-=99GGSSssbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb9;GGu=h==hOGSsxtB+Mggggbbbbbbbbbbbbbbbbbbbbbbbbbhvfuvvfv0vvv#v00v-==--f==u-u--=u=uu;uOh;;hhO;;;;9;O&=;O=u=u===##f;hh=u-=;=-=uuuu=uu;uhh;;;h9hhO&ssstmbbbbbbbbbh;=OOh=ufu=u-=u-=u;==h;G&&&sstbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;;;G;u=;O&sxt2iMAggggbbbbbbbbbbbbbbbbbbbbbbbb;0vvvv-f000v#####f-=uu=u=uuuu==u==;;-u-c==;9hOO;h;hh;;99;==;;h=uu=u;===u==u-u==f=uuu---uuu=9hO9;99G&sSmmbbbbbbbbb9OGOh;uu=u--==-=uuuuuu;hOGxsxmbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&h9h;=;OGst2B+Aggggbbbbbbbbbbbbbbbbbbbbbbbbc#-#vv#fvv#v#v#-f--uu=;;;==u=h=O==hGS;=-=-;OGOhh;9GG;hOGOh;;;==;=;=;=;hhh;=u=huh=u;;=-uf-f=;9h;;=OGG9G&xmxxbbbbbbbbb999Ghhu-u;-;u-===-u---=9&&SSSx2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&O;;Oh&sm2oMAgggbbbbbbbbbbbbbbbbbbbbbbbb;0fu-v0#-fv#f##-#-u;;==;hhh;h;hh9;h=&x9;=u=h;;hO9OGSSG;G&GhhO;;h=;hhO;;hOhh=h;;;h=;u=;u=-f-=uu=;h;O&&O;GssSxmmbbbbbbbbbsG9O=;uu=;u=-u=uu-#-u;=h9&Sstmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbGGhGGSm2oAggggbbbbbbbbbbbbbbbbbbbbbbb-v##vv#--#v-u#--#-uh=O;uh9O9h&;hhG9GG&mSG9OOO9GOOG&S&G&sSSGGSOG9hhhGOGO=h99OOG;=;OhOhh=h;;uu==;uu=hOh=OGG&O&xSxmmbbbbbbbbbs9OG;u-====;u;=uu-=u;=;hG&SSxmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbGO&&sx2oAgggbbbbbbbbbbbbbbbbbbbbbbbc0v00###vf-u-fu;==-=hO9O;O9GS&&&SGGGSxmtmS&GGSSsSsxsSxxxsxxxsSSxS&O9&GSGO9GGSGGGGO;;O9OG9h;u=h;h;;O;=hOO;O9G99GxxmsmbbbbbbbbbsGOO=-fu==;Ouu--==;==hh;G&sSxmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&&sm2oMgggbbbbbbbbbbbbbbbbbbbbbbbv###0vv#vf#u=h9hhG&G&O&&SS&smmxxxssxxmBBtmmmmmtttttttmttmtmttttmmmtmmsxsxxssmmxSS&G&GGG&SGOhO;OGGGO9h;OO;OhhOGG&&smtmtbbbbbbbbb&h;==uuu=h==-;-=hhO;hh=GGG&ssmm2bbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbSmtB+Agbbbbbbbbbbbbbbbbbbbbbbb0vvv#vv#u#--;9&&&&&sxxxsxmxxtttttttt22t2BB22222222222B22B2222B22222222tttttmtttttmmxxmxxsssSs&GSGG&GG&OG&hh;hGGG9O9sxmtt2bbbbbbbbbG;hh=uuu;u=uuh==h;hO=OGhOG&xmmttbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbt2i+gbbbbbbbbbbbbbbbbbbbbbbcv60vvv##f=;;hGsmmxmtttt2t22t2B2BB2BBBBBBiiBiBBBiiBiiiiioiioiBBiiiBBBBBBBBBB2222222t2ttttmttmxmxxxsSsSSS&G&&O;h9&GGGGSxmtt2bbbbbbbbbbOh;==;=u==u=;=u;;;;;h;9;h9Smmmttbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbB2Bbbbbbbbbbbbbbbbbbbbbbb=00v000#f;u=OGsmmmt222BBBBBiiBBiiiiioooooooooo++++o+ooo+o+oioioooioooooooiiiiBBiiBBBBBBBB2B22t22ttttmmxmxms&SG&SGGG&O9&SSSm222bbbbbbbbbbG;;;=-u;=u=;uu-;uG;-==hO9G&xxmttbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbBbbbbbbbbbbbbbbbbbbbbbb#vv0vvvvuO&&smtt2BiBiio++o++MM++++++M++++MMMMM+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb++oiooiiiBiBBBBiBBBBBB222ttttttxxxsxsxS&G&SssSst2BBbbbbbbbbbb;h;==;=;;=;;=-u;Ohu=;uhO&&&&mt22bbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc0fv###uhO&Stt2BBioo++++++MMMM+MAAAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbboiooiiBBBBBB22t2t2ttmmtmmxxsSSSxmm22Bbbbbbbbbbb&;==;=h;=;==;=u-uuh====9OG&Sxxmt2bbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbv#v#f==h&4xt2Biooo+MMAAAAAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbioBBB2B2B222t222tmxxxxxmm222Bbbbbbbbbbb9;;hh=u;=uu---u-u;==u;h9&&&SxmmtBbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#vv--OO9Smt2iio+MMMAAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbboB2BB222222ttmmmmmt2BBibbbbbbbbbbO=;hh;u-u----=u;-f=h;u;O9&G&mmtt2bbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbG#v-c;9sxt2iii+AAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbsS&SGSsx222bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbBB2222t2ttttt22iibbbbbbbbbbbOh;hu-u=u-u;O=--u=;h=;h=G9Gmmm22bbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-f=hh9smt2BobbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbG=#v###0v#=;;G&S&msmBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbi2B2Bt2t22BioobbbbbbbbbbS;h--u-=-;u;u-u;hO=u;;hu;O&Smxtt2bbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-ch9SsmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbGfvvvv0vffvv#-u;;hGGO;OO&s2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbBt22222iiobbbbbbbbbbbhu=u-#u=;uu;===O9;=======9&Ssmtt2bbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcu;u9xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&-ff#fu##vv#f-u-fu;9O;;===O;;hSmibbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbi22BBiibbbbbbbbbbbbh==u==;=;9hh=uh;hO;--=hOhO9&stttBbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-hObbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;fvv##f####-#f;;;;;;;h9;u;uhuu9=;hStibbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbBBBiobbbbbbbbbbbS=;u-==;;==h;=;hO;;=uu;O;;9&sxm22bbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbO##0#####v#uh;=h9G9G&G&99hh;;=u;uu9hG&x2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbiiBbbbbbbbbbbbb;u==u=u-u;O9=;hhu==u;u=;hOG&smttBbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbS#000v####-=9O&&mmxmxxmmxxs&&G9=---;;uhS&&tBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbboBbbbbbbbbbbbb==;uuuuO;h;G9;;=u=;====hhGGGSmtBBbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;#-v000##=h9ssmm222BB22222tmmmsS9Oh=;;;=OOGsmt+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbu-fuu-;;==GGO9O;u=;h;==hhhOGsxt2Bbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbf#f#0vvf=G&SttBBio+iiooiiBB222txmsS&SGh=uu;G&sxtobbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;;ufu-=u=G&;;;;h=-===G=u;O9&tt22Bbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&#v#vv---hSmt2Bio++M+AAAMAAMMMiBBtmtmxS&GOhhh=O&sxtibbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;=-f###f#=;huu=OO;-u=;=uu;GGsx22Bibbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbh0v#vf;-;SmtBo+AMMgM*,lqn:D::nql,Voo2tmsmS&9OhO;OGSmxBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb--#ffvvv=h;u-u===-=uu=u;=;9Gxt2Bibbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;0v0vv#c&mt2oMAgggVy%aa%:nDDD::DD%%ayqVitss&&&9OO;9GSxm2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-f-###ff==;=uu==-uu;-=u===;h&xt2iobbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc0vf#v-;st2oMggg*qn:aaa<a::DDD::D%%aa%nnlVimxmSGO=OGGGSxtBgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbff###---=;;;uuu;=;=u===uu=;O&t2Bibbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=0#--##Om2iMggg*qnnnn%a<<aDnDDDDnD%%a<:nn:D:qomSSGG&Gh;&mmmBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbv##ffff==;;u;u=;;==-===uu-=hsxtBiobbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb9vvv0#h&m2iAgggqnnnnnnDa<<<%nDDDD:D%a<a:n:D%:nnV2xS&hO99GGxtmobbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbO-fffv#=;=;;=u-;=;=;u;==uuhh&sm2iobbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&06v##-GmB+ggg*:::nnnnn:a<<N%:D%DD:Daa<ann:%D:nnnqix&&hOOG9&st2Mbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbf##vv#-h=;;;u--=;;hh==fu=;9GSm2Bi+bbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#00v#fGxBMgggq::::::nnnn%NNNa::%DDD%a<N%n:D%Dnnnn::,mGGh;;OGSxm2Abbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbf##fvf=O;=u=uuuu=;O;=u;-;OG&smt2i+bbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-00vf#OxBMggA:D::n:n:nnnnDNNC<:D%%:D%aNNDn:%%nnnnn::D,m9O9OhO9Sm2Bgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbh##v#u;===h-=;====h=;=u;=;O9&mt2iobbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbh00vv-Os2MggADDD:::::::nnn:<>C>DDa%DDa<NN:nD%%nnnn:DDD:,m99GhhO&mt2obbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbf0###f-=-u======;u;=u;h==h9&Sm2io+bbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb00#00u&2+gg*lDDDDD::::::nn:aC$C%:a%DDaNC<n:%%:nnn:DDD:::,mhhOu;9smtBAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbvvvv#u#==u;;u=;;u=h;=;;u==hhxxt2iobbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbv0vvv-9togggn:DD%DDDD:::::nn%C11a:aaD%<>$%:Da%nnn:DD%DD::n,xh;uhGSxm2ogbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbuvv#v#u=u=u-u=;=;h;;h=;;=u;Osxm2o+Mbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbS06jv#GmiAggqn::DD%%DD::D::nn:C1d<Daa%%N$1D:%<:nn:DD%D:::nnn.Sh;=uOSm22MbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbO-f#v--;u=uuu=u=;;OO=h;=;==;O&t2io+bbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0jj00cs2Mggq:nn::DD%%%D:D:D:n:<rrCD<a%aC1C:Daann::%%%D:::nnnn2O;u=;9xtBogbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbhvv#fv#u=uu===u;hO;;O;==u-u;;GmtBoMbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb4jjj0fGmogg*nn:::::D%%%%D:DD:nnar5dD<<%<$5N:a<Dnn:%%%D:::nnn:Dlxhu-=;&m2BMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbvvv#u-u==u==;;uhOOO=u=uuuu;h&&mBo+bbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbvj0#uuSBAggn:::n:::DD%aa%DDDD:nDdzz%N>a>r3a:<<nnDDa%%D::nn:::::.Guuh=9xtBigbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0v#uf#-h=Oh;hhh;hO;==;=--hGhh&m2o+Abbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0v0v#ht+ggq:nnn:::::D%%aa%DDDDn:$p NC1<dz8%aC%n:Daa%D::nn::DD:DDx===h;&t2iAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#v--vfu=;O;GO9;;huu;=;=h;;=;9SmBi+Abbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-v00v;sBAggn::::::::::D%a<<%D%%D:NX6115C3 zD$C::Da<%D::n::DD:DD%aZh=uuu9xti+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0vv#vfu;uO9OGOOhu;==u=;h=u;h9&mBi+Abbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#v0#=&toggqD:::n:::::D:D%aN<a%aaDaXjp58r jr<5<:%<Na%D:n:DDDDD%<N<<x--ff;stBogbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbv00vf=-;h==OOO;=h;;;hhOh;GOOOGmtB+Mbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbsv##v=sBMgADD:D:::::::D:DDaNC><<Na%pj@3Xz6j$53%%N$>%D:::D%DDaN>N>N<7=#-#h9xBiMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbv0j###=;;===h=hhh;h;=;OOhhhO9&s2i+Agbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcvvv#=miggVDDDDDDD::D::DDDDa$r1$$$<5jjpjXj61X1aC51<%::D%%DaNCCC><<a%&ff--hmtiMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0vv##uuh9u;;G9=u;h=;hhhh=uhG&GstBoMAbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-v0vuStMggn:D%%%%%DD:D::DD%a>5835311jj6j6j68@N$88$aD:%a%aN$11$CNaa%De=--#-&tB+gbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0vjv=uuh=hhOG9hu=u;;O;;;hOhOOsxt2oAgbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbjv0#hs2MggnnnnDD%%a%%DDDDD%aNdp@www56jjjjjX68r @5>a%Naa>d5rd$N<a%%DDk;f##uGmBoAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbv#v0##-h9=999OGOu=u=u;;;Oh;=&SxtBoMgbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbttbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbGvv0#;miggV:n:nn::Daa<aa%D%%<>186j66@Xjjjjj6j8@jXrN>1C$5zz5dCNaa%DDD::9vf#-OtBiMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#vv00vu;hOO;O9G=;=uhOh;;hO;;&xSx2iMgbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbm=h&xxbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;v00#=xigglDDD::n:n:D%<<N<a<<Cr3@jjjjjjjjjjj66j6wr335w@ 851><a%DDDDDD:xv0#uhStB+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0#0##=#u=hhOhO;hOu;;h;uuu-u-hGSx2iAgbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbGf=hGG&stbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#000-9moggn::DDDDDD:::D%N$dd1158@6jjjjjjjjjjjjj6 @@@jj6pdC<a%%%DDDDDD%Z##0#;9t2Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbv#vv#-=;u=;Oh;&;;hhu=;u==-#fhGSxtBMgbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbhv##=9&sxtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbv00#-Gt+g*n::::DDD%%%DDD:%>3wwwX6jjjjjjjjjjjjjj6jjjjj6pd><a%%%%a%aaaa%7#vv0#;sm2gbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc000vu-;;=h;=;;;h9;uu==;=uuuuh9GxtiMggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;v##fuhGsm2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0j0#=sBMg*::::::::DDD%a<<aaNr 6jjjjjjjjjjjjjjjjjjjjj6pr$N<<<NNN<<<aaaa7=v00vuOstgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbfjjvfuuuu;9h;;;OO;=;=-u======;9&xtBMggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbO0vvv#uh&xmBibbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb000#;xBMg*n::::D:D:DDDDDaN1533p6jjjjjjjjjjjjjjjjjjjjX8z5rd11$C>NN<<aa%Dh0v00#hsxMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbj000vv-u;GGhu;9h;=;===-=u;h==hO&xtiMggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcvvvvvf;Gxt2ibbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbj00uOmiMgqnn:n:::::DDD%%a<>13X@6jjjjjjjjjjjjjjjjjjjjj66 z51$><<a%DDD:::90v0v-;&&ibbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0j000#==h;hOOG;=Gu;uuu-;=;;-uhGGxtiMggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb9#0###vv-GstBiMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbj0#uGmBMgqnnnnnnn::n:::DD%<$rw@jjjjjjjjjjjjjjjjjjjjj6Xzd><a%%%DDDDDDDDD9000#-OGSBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;0v00#f#=;O=hOOh;=h;=ffu;==uuuhGSx2BMggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-###f##f=hSmBoAAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb##v=&tiMgqn:n::n:n::::::D%aN15w6jjjjjjjjjjjjjjjjjjjjj@X pzz355rd11$C>>N96v0#=9sxibbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb00v#v--f;;;;;;;Ohh;;h;=u=u=;uuG&SstBAggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbb#0vff##vfh&m2iMgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbff-u&mBAgq:::::DDDDD%%a<>158w66jjjjjjjjjjjjjjjjjjjj@ pzrd$CC>>>NNN<<<<aOv0#v=GStobbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb00vv#-f=O==u;OOOh=u;h;==uu=u=OGO&xtiMggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbO#00v#uf#=OxtiMggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb==-;&xBMglDD%D%D%%a%%%%%%%aNr8@jjjjjjjjjjjjjjjjjjjjXz1<aDDDD:D:::::::::h0v##=&mt+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc600v#f-;=Ou-uhGOh;hhhh;h=;-==;hh&stiAggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbj00vvvvf=;GmB+gggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbuuhhOxB+g*:::::n:nn:::D%N5 6jjjjjjjjjjjjjjjjjjjjjjjj6@85Ca%D::::::::::nh00#v=&tBgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0jj0vv=u#uu;;;=;Oh;hhh==h9uu===O=SxtiAggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbb#06000v#u-=&tiMgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;-O9Gs2oA*nnnnn:DD%<>$53p @66666jjjjjjjjjjjjjjjjjX8w8z5d$CCN<a%DD::nn:nc#0#uhsB+gbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbh0v0jv#;=-==-=hO;==hGGG;uOGOuu=;=O&x2oAggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbj00v000f-=G&tiMgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbO;-;9x2iM*::D%%<NC$$1dddr535rr3Xjjjjjjjjjjjjjjj6j6w$NNN><a<a<aaaa%%DD:lu0#v-&tiAgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbv0000vvff;==u=OhOh;h=h;Oh;;hOh==OOsx2igggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbc06jvv00v#=GxtiMgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbhuu;=GtiMA%a<<N<N>>C>>>N<<aaN5@jjjjjjjjjjjjjjjjj XjX1aDDD%%%%%%%%%%%%%7##vv=&2+ggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc00j000##fhu=-=;OOOh;;;;Oh;O;=;;h;O&m2ogggbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbXjj0v0j0#-uhStiMgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbOuf-;hxB+A7aa<<<<<<<aa%DDD%Nz6@ 66jjjjjjjjjjjjjjjz5 X5<D::::D%DDDDDDDDev00#=sBAgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0j0j00v#-;f-u;;u;hOO==h;;;;;h==uh9GStB+ggbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbvj0v#j60vf=h&mB+gggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbs=f##=x2oAyaa%%%%%%DDD:::%>3855w86jjjjjjjjj@@jj@jj3<13r>D::nn::DDDDD:D400v-Omoggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbfj0v0jv-;uf--==;==;uh;=9h;;hO;u=h9OGStBMggbbbbbbb",
+"bbbbbbbbbbbbbbbbbb00v0000vfc=;9m2ogggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbx--ffh&2i+VD%%%DDD::n::Da>d1N$51 jjjjjjjjjj88XjXw66z%%>$CaD::nnn::::::f00vuG2Mggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbj0000f#--fu=;O==;;;u;=hOO;;9xm9=OGOGstiAggbbbbbbb",
+"bbbbbbbbbbbbbbbbb60v000vv#fOh9&tBMggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;f##-GmBiADD:D::::n:D%NCC<%>CN36 @@wj6jjjj3r1@j3rw 3%D%N>N%D:nnnnn::7v00v=xBAggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb000jvv-ffu===hG;u=;=u=uhhh;=hGmh;;hh&x2igggbbbbbbb",
+"bbbbbbbbbbbbbbbb0vvvv##-##=h9Sm2ogggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=u#vf=S2iMq::nnnn::%a<N<%D<a%$w83w38@Xjjj63NNr6X>$53d%:D%<<a%::nnnnnxvvv-9togggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0000v#f--O;;=uhhhh=--=;;=;=u=hhmhuuhGsmB+gggbbbbbbb",
+"bbbbbbbbbbbbbbb#00vv#v#--=uh&st2+ggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbs#vuf-GtBo*nnnn::D%a<<%DDa%D<5315r$pp8@6jj3a<a363aNC1dan:Daaa%D::nnnu0vvu&2Mggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-v0vvv#-==;;h;u=hO;;=-u=h=u=;;=;mGu-O&StB+gggbbbbbbb",
+"bbbbbbbbbbbbbbv6vvv#vv#=h;;9&stiAggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-uv#;Om2iAn:n:DDaaaaD:%aDDa$1NC$CNw13pX668%%D<z >DaNC$<:n:%aaa%:::Z000#;xiAggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#j000v#fuuuu;OO;;hhu==u;u===h=;u;G&G;O&xtiAggbbbbbbbb",
+"bbbbbbbbbbbbbb6vvvvvvu==;;&G&xtiAgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-#v-fc42Bo*::D%%a%%::%%::%N1a<N<aN3>138 @8%:D:N33%Da<NC<Dnn:D%%%D:u00v-&togggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=060jvvu--u=O;h=GG;;u====;==;=O=--=9m9Gxm2oAggbbbbbbbb",
+"bbbbbbbbbbbbb0jj00v#f=uu;GGGsm2oAgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbS-#-=uhmtBA:D%%%%::DD%::%<$a%aaaDCC<C1rzw3%:DnD>5$DD%a<N<Dnn:DD%%Fvj0v-&2Aggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#fv000#vu==hh=uG9OOO;-=hh===hh===;=httttt2+gggbbbbbbbb",
+"bbbbbbbbbbbbv0jvv###uu=;9SGOsx2oggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbh;=--;Gm2oV%%%D:::%D::Da>a%a%%DD$aa<$1r35annnn%Cr<:D%aa<<%nn::Dy=6v0#Otigggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbv#fjv0vf==u;;O=;&S;;O=h=-===Ouu;===GOGG&x2oAgggbbbbbbbb",
+"bbbbbbbbbbbb#00vv###ff-f-OhGGs2oAgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbSu-uu;&xm2MlD::nDD::nDaN<D%%%D:%>%%a<>$dda:n:n:a$1a::%%aa<%nnnnsvvvvuS2Aggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb4#vv0##v#u==uuu-uf=;huu=9O=--=h=-f=O;h=9O&xB+gggbbbbbbbbb",
+"bbbbbbbbbbb-00#00v#f-f#vuhOGGstB+gbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb=hu-uO&tt2Ann:DD:::D%aa%D%%DD:<<D%%<<>$1<nnnnnD<$CD:DD%%aa%:ny#-0vuGmiAggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb#v#vv=vv-ufuuu=uf##;;h=u-=;=-=-u=-;-=;=9GGSmB+gggbbbbbbbbb",
+"bbbbbbbbbbbvfv0jv#----u-=hh99&tBoMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&-u-uOGxmti*::D:nn:%aa%DDDDD:D<%D%%a<NC$<:nnnnn%NC<:nDD%%%a%:-0v#-=&2Aggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbfv00vvvf=-#fu=;u---u=;==-===uu==-=uu=u--;hGS2iAgggbbbbbbbbb",
+"bbbbbbbbbbb#v00vvvfu=uu=u;hOGSx2iobbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc-uhh;Gsm2oqD:n::D%a%:D%DD::D<DDD%aa<NCNDnnnnn:%>>a:::DD%%%O00#f-9togggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbf0#vvvvfuf-uu-u;u=====;;;=uuu;u;;-;===--uu;&mBogggbbbbbbbbbb",
+"bbbbbbbbbbcv0vv0vfff=;;==;OOG&xtBi+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbx=u--;h&ttt+qnn:D%a%:DDDD:::aa:DD%aa<N>NDnnnnn:DaN<D:::DDD460f##OxBAggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb00--v0vu-f-=uu=-uu=;===;h;=;u==;==uu==uufu;&SmBMgggbbbbbbbbbb",
+"bbbbbbbbbb##v0vvv#-==;--=;;Oh&&xtBBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&-u=;h9&mt2Mq:D%%%D:DDD::::a%:DDD%%a<<N%nnnnnn:%a<<Dn:::xf##0#OS2Mgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-#v#v##fu#-h-uuu--=;;;fu;;=;;=uu;=;==u=;uu-;h&stoAggbbbbbbbbbbb",
+"bbbbbbbbbb-vv#vv0vuu=ufu=;h;O&&Smt2Bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbt9;cu;h9Gmm2MlD%%D::D:D::nDaD:DD%%%aa<<%nnnnnnnD%a<%:nnx0vv##u&t+gggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-06v#v0f-uu-u;;=-fu==u-u-=O;;h;u--=;;hh;;fu;OGStBMgggbbbbbbbbbbb",
+"bbbbbbbbbbc#vvvff---=;-uhOGh;O9&smt22bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmG===h;GG4mto,%:::DD:::::%%:::DD%%%a<<%:nnnnnnnD%aa%:xvvvvf;&tiAggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbhvvv0vvv##fu=;;=;;;uu=u==u=hGh===u=uu=hhh=-h-h&Sm2oggggbbbbbbbbbbb",
+"bbbbbbbbbb=#vv#ffu--=uu;OOh;;h;GSxmmttbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbxhO9c=;9SxxmBV:::D::::n:%%::DDDD%%aaaa:nnnnnnn:Daa7G000v-;&tiAgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbfvv#0v-vv#-=;h;=uh;;==u==u=hOh;=;uu;=u=uO;;=uOh&xtiMgggbbbbbbbbbbbb",
+"bbbbbbbbbb=#f#--f=u;=-u=;;;=;=O9GSsmmmtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbS99Ou-;9s44xtol:::::nnD%Dn::DDD%%%aa%DnnnnnnnnDDFuv#6j#uSmBMgggbbbbbbbbbbbbbbbbbbbbbbbbbbb#0vv0vvv#-##f=Ohh;;h;h;;=;f=====;uu====u;;====hOO&m2ogggbbbbbbbbbbbbb",
+"bbbbbbbbbbb###u#fuh=-u=u;=uh=;OhOGSssxmmbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbB9h;hh==9&GSsmB,::::n:D%::::DDDD%%aaa:nnnnnnnny&vj00v#uOmiAgggbbbbbbbbbbbbbbbbbbbbbbbbbb=v606v0-v0v#fu=u;O;;hhh=;Ohuuu==hfh;uhhu=;;==hh;hGGStiAgggbbbbbbbbbbbbb",
+"bbbbbbbbbbbfu==-#-GO=uu;-=;;=;==;G9Gsssxxtbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2&O;9h9;;h&sx4x2Vn:n:%D::::DDDDD%%%aDnnnnnnqxffv60vv=GtBMgggbbbbbbbbbbbbbbbbbbbbbbbbbb#0vv0j0v-fv#-fu=O=;=;GGO=uO&hu-;=u;;==uuu=;=;h;;9h&sm2ogggbbbbbbbbbbbbbb",
+"bbbbbbbbbbbu-f--u=u;;hh#Ouhhu=uu;;hG&&mSss&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2&OGG99hhO9GG&&x2,n:%:n::::DDDDD%%%Dnnnnk4vvj00v##=StiAgggbbbbbbbbbbbbbbbbbbbbbbbbb##0v00vvv0#vu---=hhhh;;=O;Oh;;hO;=u;=h=;uuu==;h;O&h&Sm2iAgggbbbbbbbbbbbbbb",
+"bbbbbbbbbbb=-f-uu-;;=u;;=uh==u;;=;;O&9G&sSG&&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbB&G&&G9h;hhGGGG&&s2.ln::::DDDD%%%%D:,Z;#0j00jv--hStiAgggbbbbbbbbbbbbbbbbbbbbbbbb;#vv#v00000#vf=-=-uhOOhh;;;hhh;O;==;h-===uu====;OOhO&SxtiMgggbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbb#--f--u==u==hh=h;u==;;;;G9SGO999OOObbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbboxG&SGG=;h=hhhhG=;GGte.kkyy:yyZZeS;#000000v#--OxBoAgggbbbbbbbbbbbbbbbbbbbbbbb;0####v0000vv#f=ff=;=u;hhO==h=;;=;huu=;O;;;===;;;uhGGG&Sm2+ggggbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbb-u;--==-f-;;h;uOh=OhhhOhOhGh;9Gh;O&&hsbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbms&GS99G;hO;=uu;h9;-hG;Gh;;;uf#u#v##000f=u;&mBMggggbbbbbbbbbbbbbbbbbbbbbb;#vv#vfv0vfvvvu;u#f-=;;u===h;=Gh;hh;u-=;O;==O=hOOOhhOO&&&mBoAgggbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbb===u-u=-;=Ghu;=hOOOG9h;h;=;hhh;9O&G9GGsbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbBx&&&S&Gh;h;-;u9;-u-u==uh=ufffvv#v#v--=OGm2oMggggbbbbbbbbbbbbbbbbbbbbb9v-#fvv#0vv###u-=ufu=hh===h;u;=hOO;;;;=;=OO=;=;OOhGO9hOG9&m2iMgggbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbb===#u---u=;uuhh=;O9OGhO;u;;u=;9h9xtmm9S&O&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbotssss49GO==cu=ufu=u-=;uhuu-#####-;O9&m2iMAgggbbbbbbbbbbbbbbbbbbbbb-v#u#u###vv###fu;u-u===OG=u===u=uhhh=;;==u=;=u;;h=OGOG99GG&xtiMgggbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbhu---=ff-uu;hh;hO=OGOO=;hh;;;OOGm&&9hOO99O;=hSbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbimxxsS&S9;;=u==;--=#-;=;--===;h&sxtBi+AggggbbbbbbbbbbbbbbbbbbbOfv#fvv-#-#v#--fu;;==Ohh=uh;hh=--=;;=;===h=uuuu;;O;hO;;9GGGGSmti+ggggbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbf=-=f-=-#uh;;hO=u;hh;;hh=h;;h&xGhh;h=h99h;u==h9&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbimxxmsSxGh;Gh=;;---u==;hGO&sxt2Bi+AAgggbbbbbbbbbbbbbbbbbbb###v##v0v####-uf===;hO;h;h=u;hhh;uuu=O=u==h=-h=-f;h;OOhu;h9OGSxtB+ggggbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbO==--=#-=u;;hOOh=hh9;==h;=h;OmG=uhOh=hh;u;==;=;=h;OG&bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbi2mmtxxxSS&G99O-hhGGGSmmt2BioMAggggbbbbbbbbbbbbbbbbbbc0#0#v##f-v##c-ffu=u==;h;=u;OO=;hhu==u;u===;;;=;=-;=h;Oh99=OO&&&xtB+ggggbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbb;;-#ff=u-hOhhhhhO9&h=u==;hOGxhhh;;;9h==uu=====;;hhu-==G9bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb+2tmtmxxmsGGOOOSmmmt2Bio+MAAAggbbbbbbbbbbbbbbbbbc000v#6vuf#f#--=h;-f--;=O;;;;O;h;GO;;=u===;==;=hu--=u;-=GOOOhOO&sxxmBoAgggbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbb=uu=-=;-uh=hG;=G99OG;=-==hmGhO;=;9G;Oh--=;=u=-Ou;u=;uhO=u9hsbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbAoi2tmmS&sGhssttii++AAgAggbbbbbbbbbbbbbbbbO=#vvvv0v#vv#v#cc#;;hh9;=u-;uh;=hh;=GGOOO;-=h;===h;;===u;h;=h;=GG;&Sxm2Boggggbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbb==uh;h=--fuOOh9;hOGh=;u;;GmO;;h;9&9u9=;u-f=-;=-u=uu;OO=u=-uhO9G9GbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbA+222m&G&stBMAgAgggbbbbbbbbbbbbbbb9f##-0vvvv#--#vvvv-uu==u;O9-;u=;hh=;;O=;&&;hh;;=-===O=u;===OOh;uu-h9GGSSm2BoAgggbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbb9;h=;u;=h=-;hOOOO;;9;u;9&x;=uu-fO;;u-;9;-f-=;u##hu=u=;;=h=-;;9hOhhh9;mbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgbbbbbbbbbbbbbbbbbbbb-f;-000v-v00##v#v-##-u#-=h;hhh=Oh==hh=uuuuuf;;huu=GO=u-=h=-f;h=O=O=;;G=hGSxm2B+Agggbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbb;h=G=;==;h=;;OOh9G;;9;;x9==u##-=h;=-u=;--------#u;fhu=u==;u=uhO;hG==O;-=uu;mbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbc0#-f#00###0#6vv0#0#-vc---u-==uuhOhh&;=h;u====uf#f=hh=--=;=-;-u=-=-=h=hO;;hhO&G&m2B+ggggbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbOu=u;u=OOh;=;=;;h;9h;-hm9=u-u-=;;=uuu=u--uu---uuf#--u-=hh;;u=u=u;;hhuf-=u=---f-=u=uhmbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbs-f#fv#vvv###vvvv#0vvv0vvv#v0v#---hhO;=;=;=;h;O;uu==;uu-u-=;==uu==-uu=-uu==u--==;hGGSSsm2i+ggggbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbb;=-=h9O=;;hOh;;;9h===;s9;=uu=u=;;;=u-=;uh-u==--#f##fuhhuuu=;=uuuh;u-u-f-=u--u-uuu=u-#-uf=-#uu-######u;;---u=u---=u-#f#vvf##v#v#####v0v#v-#vf########=h9=;=hOh;;=hO;u==uu;==u===;;;==uu;u;=u==;u---fu;G&GSxt2oMggggbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbb=O;h==h=O9G;u;Ghu;hu=Gs;=;;==;h=;=;===;u=-==--ff#=u=u-;u;99=-=h=-u=f-u##fu---u==ufu--uuf-#--#f#vv#-ff#u-u;h=v-;u##-v##vvv##v##ff######f#fvf-#####-=uuu;;;GGOu=GO=;;u==-uu;;u==;h;==u=;;==u;;uuuf-uhhOGsxtB+Mggggbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbb9h;;OOhhhOO9O=Ohu==-;s9=;u-==;;uh-u=;;==uu;u=fu-uu-u;h;;;h;hh-=;--f###u-u-#---u-=###u---#f-#f####f##-=uuu==u=#-=###vvvf#f#0v#ff#-###uf---fuuu#-uu=-u;hhhhhOh9=;O===-u-;=;;-u;;=;;=uu;=;;=u===u-;;OhGst2B+Aggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbOG9hh9O;;9Oh;=;h=ufuh===fu=h;;;h=--u=;=Oh=u-uuu;u;=uuhh==Ohh=uu=u-##u---###u=--=-###-u-=uf#v###-##-##uuf#=u=-f#-fvvv####v##-u--=-###u=u;;=u#uuu;u=;=uhh;=OOO;;=h;u-f===u-u-;h;;h;u-u;;;h;;=-=;hOGSxmtiMAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbb&GOOO9;O;;OOhhh;h==u==;u-;O9h===uu-=;;h=uu=-;hh;hh=;=h=hu;hhh;;u=uufu-u-fu=h=f--#f##-u=-f#-#-uuuuuf#-u-uff-uu-----fv-#-##-=h=--ufuf-=;h=u-=f=hhh;h;u;h;h;;hOhh;;h;=-==;=uuOGh===u=uu=hhh==h=h&Ssm2BiMggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbb&G&&OhhhGOOhu=h;;=uu=uu;OOh==;-=;=u=;;==uu;=;;hhh=hO=;=;OOhh=u;h==--u--u;h;uuu#uu-f--=--#f-fuuuu=-u=f-fu;===--uuu-ff-f--;h==u=fu==u=uh===u;==;;;h=;O;==;OOhO==;;;==uu=u=hhh;=;u=h====O;h;;GGSxt2BoAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbSGSGh;O9GOhh;O;;O=;=uu=;;;==u;====;;===u;;u=;=;;;;hhuu;hGh;;;hh=h===fu==u=uu-uuuu-uu-uuf==#-uuuu==;=f#u;O;uuu;==;u==#u====ucu==u=u;;=====;u=;;;;;h;O=u=hGO;;;hhh;;;;f==;;=;=======hh;;OhGsSxtBo+gggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbG&G&GOOGGhhh9;;;O;u-=u;=uhu=h=u;;=-;h===;-====9u-=u;=;=h9;;hO==;O;-u=u==u;uuh=uu==-u;uuu=-uuuuh-f-u===-;O=;;h;==h;--uuu;-h=u;;==;;-=h=u=;uuu==G=u===;;=h9;;hhh=;hhu-u==huh==h;==hh=hGGGSmm2BoAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbb&G&&&&Ohh9&&;==GG;uu;u==h===uu;==;h;;h=;=--=OO;uu=u;;O==;hGGh=uGG;u-=uu=;=uuuu===;;;=;u==-f=hO;-uu-;;O===hO9h=u9G;u-;uu=;===-u====;;=h=;;u-=;9;uu=u;;O;;=hGGO==O&huu;;u=;=====;hhO&&Smm2Bi+Aggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbxGsSSSGG9h9OhO;OhOh-huhhu=-uu==;h;Gh;;;=;u=f;u;;=uhhhO;;h=O;hh=hhh;u;=hhu=-uu===;;9h=h=u;u=f=u;==u=hhh;;;;O;hh=hhO;u;=;hu=-u-===h;9O=;==;u=f;u;==u=hhhh;h;O;hh=hhG;=uh=O=;u==hh9&SmttBB+Aggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbsxxss&GGOG9hOO==;;=uhu;u;;==u;O;;;9;u=ufuu-;;==u=h9Oh;h;;OO;hh===;;-;u=u===uuhOh;;O;==uf-uf=hu=u=h9Ohh;;;hhhhh=u==;-===u===uu;Oh;;9hu=u--u-uh==u=h9Ohh;;;hOhhG==;;h-;;;;;hOOGSmmt2i+Mggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbssmxsG&G9OOhhhu=;hh=O;u=u==;;9h9h=uuu-u-u==--=;==;OOhu;;==;;;h-=uhh=h=u====;uhhOh=u-uf-fu==f-=;=u;OOhu=;==;=;h-=uhh;;;=====huhOOO=uuu---u=h--=;;u;OOh=;h;;h=;hu==hO;OhhhGGSxxtBi+MAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbtSsxSsxG&&Oh==hhO;uhh=9Ohhh;hh9;u;;u-uhOu#-u=h==;==h=hG;hO;=u-;;h;=hhuOh;hhh;;9;u;;u--hh=f--=;==;=uO;;G;hhh=u-=hh;=;huOOhhhhh;9;u;hu--hh=#-u=;;=;==O;;Gh;hh;uu=hOOhO&GSsmm22ioMAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbmxxmmssG&Gh9;&O=h;hOOhGOO;h;u=;;;u;=;u-=;h;=;=h==;;hOh;;h;uh=GO===hhOhGOO;;huu===u;=;=f=;hh=;=;;=;=hOO;;;huh=99u;=hhO;GhO;;huu;==u;=;=f=;;h=;;hh=;;hOO;hhh=h;G&hOG&xmm22io+Aggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbxmxmSsSGG999h;9O;;9GOGhOh=;==u;hh=u==;=GO;u;==uu;hhOu;;=uu;;u=hh;;OGOG;Oh=;;===hh=u====O9;u;=uu==hhh=;;==u=;=u;;h=hGOGhhh=;==u;hh=u====OG;=;==u==hhO;;h;;;OGGGSxmm2Bi+MAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbtmxxxmSGGG9GGGOOG;OG99;=;h;;;hh;hOO;u;Ohhhu-u=h==;===Ouuuuu;;h;;OuhGO9;=;h;=;hh;;Oh;u;hhhhu-uuh==;===hu-uuu;hO;;9=;GO9h=;;;;;hh;;9hh=;OO;h=-u=h;;h=;;Gh;hOGSstm2BBoMAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbtmmxxmsG&s&&&&hhhOOhhOh;hhhh9Oh;h;;uhhhh;uu==h=-==huuOu--h;;hO===;h;;hh=h;hhOhhhh;;=;hhh;uuu;h=u==huuO=--;;;hO;==;h;;hh;h;;hOOhOhh;u;hhO;=u==O;=hhGhOS&&Smt2BioMAAgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2mtxxxxxsSss&OGGGO;hOh;h;hh;==O9h=hO;u==u==;=;;h=u;-u==h;hO9Ouhh9;==h;=;;hh;==hOO=hhhu==u;u;==;;==;uu;uh;hhOOuhh9;=;hh;hhhO;;u;OO;hOh==;=h;hhOGG&&ssstt2ii+AAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2xtmxmtmxxssSsx&hhh;OOGh;;hhhOhGO;;=u==;==;;;Ouuuu;;u;9Ohhhhh9&O=u==;;9;;=;h;hhOO=;u=u=====;;hu-u-=;-;9OhhhOh9&G;u==;;O;;=hOhOhGOh;=;;;hOOG&&xSsmttBBoMAgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2mmtmmtmstxxsxGO;OO;9OOGO;hGGO9O=u;h;;==O=;u=;uhhu=O=;GO=&9GOG;=u=;uh;;Oh;;9GOOO=-;hh===O=;u==u;h==h;;G9=GGGOGh=u=;uhhhOO;;9&GGGO;O&&&&&mmmt22Bi+MMgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb2mtttttmmmmxSS9&G&GO99GOGsG;Ghh;;-;=h;==;==;OO;=uuuOhOO;hOG9;;==hhO=hhO;OSG;9hh;=-;=;h==;==;G9;==uuhOhhhhhG9=;=;hOO=hhGh9Ssh&&G&GGSsmtttBBio+Agggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbtt222tttmtxssxs&G9OOh;G9O;=O&O=u=;9=--O;h;;h;;h;u;h9OhOh;O;u;hh;==uu=fhhhuu;Ghuuu=9=--h;;;=O=;;hu;hGOOOO;OO=;O9h;;=hh=G&&9Gsmmxmm2BBBi+MAgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbt22222tmtmxxssSGO;OG&G9;;hOh;hu;;==u;9uGhh;h;O;;=OGhO&;;Oh=====u##f;;h=-u=;=u=-uuu;-;Ou9hh;hhhh;;OGOO&h;9OhhOh9h;;hSsxxsmt222iBo+MAgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb22222tmttmmxxSSSssSGGG&9hhhO;;;;h=u=;h;hGG9Ohh;h;hO99hu=;;;u=uu=;h;===;;uu=;u==u=u-=;h=;99GO;OhOh9GG&GhhGG&G&&SSmmttt2Biio+MAAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbB2222tt2tmmtmmmxxxS&&&GsG9&G9hhh;==O&&OOOOGOO9hGGh;;;=;Oh;=;=h;hhh===h=O;=hhh=u=uuuhG&h99O&GGGG&S&GSS&Smmxmtt22iiioo+MAAggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbB2t22222t2tttmmmmmxssSSsGG9OOGGG99GG&ss&hOS&hOGhhO=;;OOhhO9OO;O;hOOhh=hO=;;u;;G99O&G&sxsG&mxsxmxmmmtt2BBiio++MAAAgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbBB22222222ttttttmmmmmxSssssSSsxsssxsssGSsGGGOOO&G&GhGG&GG&999&G&GG9&GGhOGG&GGsssxxmmmtmtttt222BBiioo+MMAAgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbBiBBBB222222222ttttmmtmtmmmtmmxtmmxsxxsS&&sSsS&&&ssssxS&G&SssxxsS&sssxxmmmmtttt22B22BBiBBio++MMMAAggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbiiBBBBBBBBB222BB22222tt222t2t2tttttmmmmmmmmmtttmmmmmxtttttmmtmt2t222222BBBBBiooo++MMMMAAAAgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbooBBBBBBBBiiBBBi2B2BBBBB2222B2222222222222t222222B2222B2BBBBBiiooo++M+MMMMMAAAAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbo+iiiiiiiiBiioiiiioiiiBBBBBBiiBBBiBBiBBiiiiiiioioo++o+++M++MMAAAAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb+++++oioioioooiiooiooooo+o+o+oooo++o+o++++MMAAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbggggggggggbbbbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbggggggggbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbggggggbbbbbbbbbgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbgggggbbbbbbbbgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbggggggbbbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggggggbbbgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggggbbbbbbbbbbbbbbbggggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggggggggggggggggggggggbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbggggggbbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggbbbbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggggbbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggggbbbbbbbbbggggggbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbggggggbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggggbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbgggbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbgggggbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggbbbbbbbbbbbgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggggbbbbbbbbbbbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbggbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbggggggbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggbbbbbbbbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggggggbbbbbbbbbbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbggbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbggggggbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggbbggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbggggggbbbbbbbbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbgggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbgbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbggggggbbbbbbbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggbbbbggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbggggggbbbbbbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbgbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbggggggbbbbbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbgbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbgggggggggbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbbbbbbbggbbbbbbggggbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbgggbbbbbggggggbbbbbbbbggbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbgggggbbbbbbbbbbbggbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbggggggbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbbbgggggggggbbbbbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbbggbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbgggbbbbbbggggggbbbbbbbggbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbggggggggggggggggggbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbgggggggbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbgggggggggbbbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbbggbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbgggbbbbbbbggggggbbbbbbggbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbggggggggggggggggggbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbggggggggbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbbbbbbbgggggggggbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbbbbbggbbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbgggbbbbbbbbgggggggbbbbggbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbgggggbbbbbbbbbbbggbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbgggbggggggbbbbbbbbbbbbbbbgbbbbbbbbbbbbbbbbbbbbbbbbbggggggggbbbbbbbbbbbbbbbgbbbbbbbbbbbbbbbbbbbbbggbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbgbbbbbbbbbbbbbbbbbgggbbbbbbbbbbggggggbbbggbbbbbbbbbbbbbbbbbgbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbgbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbgggbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggggggggggggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbggggggbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbggbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbgggggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbggbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbggggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbggbbbbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbgggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbggbbbbbbb",
+"bbbbbbbbbbbbbbggbbbbbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbbgggbbbbbbb",
+"bbbbbbbbbbbbbggbbbbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggbbbbbbbbbbbbbbbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbbbbbbgggbbbbbbbb",
+"bbbbbbbbbbbbgggbbbbbbbbbggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggbbbbbbbbbggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbbgggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbbbgggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbggggggbbbbbbbbbbbbgggggbbbbbbbb",
+"bbbbbbbbbbggggggbbbbbbbggggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbggggggggbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggggbbbbbbbbbbbbbbbggggggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggggbbbbbbbbbbbbbbbbbggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbgggggggggggggggggggggggbbbbbbbbb",
+"bbbbbbbbbbgggggggbbbbggggggggggggbbbbbbbbbbbbbbbbbbbbbbbbbbgbbbbbbgggggbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
+};
diff --git a/frontend/xsane-preferences.c b/frontend/xsane-preferences.c
new file mode 100644
index 0000000..8c13c5d
--- /dev/null
+++ b/frontend/xsane-preferences.c
@@ -0,0 +1,292 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-preferences.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* --------------------------------------------------------------------- */
+
+#include "xsane.h"
+#include "xsane-preferences.h"
+#include "xsane-rc-io.h"
+
+/* --------------------------------------------------------------------- */
+
+#define POFFSET(field) ((char *) &((Preferences *) 0)->field - (char *) 0)
+#define PFIELD(p,offset,type) (*((type *)(((char *)(p)) + (offset))))
+
+#define PRTOFFSET(field) ((char *) &((Preferences_printer_t *) 0)->field - (char *) 0)
+
+/* --------------------------------------------------------------------- */
+
+Preferences preferences =
+ {
+ 0, /* no default filename */
+ 0137, /* image umask (permission mask for -rw-r------) */
+ 0027, /* image umask (permission mask for -rwxr-x----) */
+ 0, /* no fax project */
+ 0, /* no default faxcommand */
+ 0, /* no default fax receiver option */
+ 0, /* no default fax postscript option */
+ 0, /* no default fax normal option */
+ 0, /* no default fax fine option */
+ 0, /* no fax viewer */
+ 210.0, /* fax_width: width of fax paper in mm */
+ 296.98, /* fax_height: height of fax paper in mm */
+ 0.0, /* fax_leftoffset */
+ 0.0, /* fax_bottomoffset */
+ 0, /* no doc viewer */
+ 80.0, /* jpeg_quality */
+ 7.0, /* png_compression */
+ 5, /* tiff_compression_nr */
+ 5, /* tiff_compression_1_nr */
+ 1, /* overwrite_warning */
+ 1, /* increase_filename_counter */
+ 1, /* skip_existing_numbers */
+ 1, /* tooltips enabled */
+ 0, /* (dont) show histogram */
+ 0, /* (dont) show standard options */
+ 0, /* (dont) show advanced options */
+ 0, /* (dont) show resolution list */
+ 10.0, /* length unit */
+ 1, /* main window fixed (1) or scrolled (0) */
+ 1, /* preserve_preview */
+ 0, /* preview_own_cmap */
+ 1.0, /* preview_gamma */
+ 1.0, /* preview_gamma_red */
+ 1.0, /* preview_gamma_green */
+ 1.0, /* preview_gamma_blue */
+ 1.6, /* gamma */
+ 1.0, /* gamma red */
+ 1.0, /* gamma green */
+ 1.0, /* gamma blue */
+ 0.0, /* brightness */
+ 0.0, /* brightness red */
+ 0.0, /* brightness green */
+ 0.0, /* brightness blue */
+ 0.0, /* contrast */
+ 0.0, /* contrast red */
+ 0.0, /* contrast green */
+ 0.0, /* contrast blue */
+ 1, /* rgb default */
+ 0, /* negative */
+ GTK_UPDATE_DISCONTINUOUS, /* update policy for gtk frontend sliders */
+ 0, /* psrotate: rotate in postscript mode (landscape) */
+ 0, /* printernr */
+ 0 /* printerdefinitions */
+ };
+
+/* --------------------------------------------------------------------- */
+
+static struct
+ {
+ SANE_String name;
+ void (*codec) (Wire *w, void *p, long offset);
+ long offset;
+ }
+desc[] =
+ {
+ {"filename", xsane_rc_pref_string, POFFSET(filename)},
+ {"image-umask", xsane_rc_pref_int, POFFSET(image_umask)},
+ {"directory-umask", xsane_rc_pref_int, POFFSET(directory_umask)},
+ {"fax-project", xsane_rc_pref_string, POFFSET(fax_project)},
+ {"fax-command", xsane_rc_pref_string, POFFSET(fax_command)},
+ {"fax-receiver-option", xsane_rc_pref_string, POFFSET(fax_receiver_option)},
+ {"fax-postscript-option", xsane_rc_pref_string, POFFSET(fax_postscript_option)},
+ {"fax-normal-option", xsane_rc_pref_string, POFFSET(fax_normal_option)},
+ {"fax-fine-option", xsane_rc_pref_string, POFFSET(fax_fine_option)},
+ {"fax-viewer", xsane_rc_pref_string, POFFSET(fax_viewer)},
+ {"fax-left-offset", xsane_rc_pref_double, POFFSET(fax_leftoffset)},
+ {"fax-bottom-offset", xsane_rc_pref_double, POFFSET(fax_bottomoffset)},
+ {"fax-width", xsane_rc_pref_double, POFFSET(fax_width)},
+ {"fax-height", xsane_rc_pref_double, POFFSET(fax_height)},
+ {"doc-viewer", xsane_rc_pref_string, POFFSET(doc_viewer)},
+ {"overwrite-warning", xsane_rc_pref_int, POFFSET(overwrite_warning)},
+ {"increase-filename-counter", xsane_rc_pref_int, POFFSET(increase_filename_counter)},
+ {"skip-existing-numbers", xsane_rc_pref_int, POFFSET(skip_existing_numbers)},
+ {"jpeg-quality", xsane_rc_pref_double, POFFSET(jpeg_quality)},
+ {"png-compression", xsane_rc_pref_double, POFFSET(png_compression)},
+ {"tiff-compression_nr", xsane_rc_pref_int, POFFSET(tiff_compression_nr)},
+ {"tiff-compression_1_nr", xsane_rc_pref_int, POFFSET(tiff_compression_1_nr)},
+ {"tool-tips", xsane_rc_pref_int, POFFSET(tooltips_enabled)},
+ {"show-histogram", xsane_rc_pref_int, POFFSET(show_histogram)},
+ {"show-standard-options", xsane_rc_pref_int, POFFSET(show_standard_options)},
+ {"show-advanced-options", xsane_rc_pref_int, POFFSET(show_advanced_options)},
+ {"show-resolution-list", xsane_rc_pref_int, POFFSET(show_resolution_list)},
+ {"length-unit", xsane_rc_pref_double, POFFSET(length_unit)},
+ {"main-window-fixed", xsane_rc_pref_int, POFFSET(main_window_fixed)},
+ {"preserve-preview", xsane_rc_pref_int, POFFSET(preserve_preview)},
+ {"preview-own-cmap", xsane_rc_pref_int, POFFSET(preview_own_cmap)},
+ {"preview-gamma", xsane_rc_pref_double, POFFSET(preview_gamma)},
+ {"preview-gamma-red", xsane_rc_pref_double, POFFSET(preview_gamma_red)},
+ {"preview-gamma-green", xsane_rc_pref_double, POFFSET(preview_gamma_green)},
+ {"preview-gamma-blue", xsane_rc_pref_double, POFFSET(preview_gamma_blue)},
+ {"gamma", xsane_rc_pref_double, POFFSET(xsane_gamma)},
+ {"gamma-red", xsane_rc_pref_double, POFFSET(xsane_gamma_red)},
+ {"gamma-green", xsane_rc_pref_double, POFFSET(xsane_gamma_green)},
+ {"gamma-blue", xsane_rc_pref_double, POFFSET(xsane_gamma_blue)},
+ {"brightness", xsane_rc_pref_double, POFFSET(xsane_brightness)},
+ {"brightness-red", xsane_rc_pref_double, POFFSET(xsane_brightness_red)},
+ {"brightness-green", xsane_rc_pref_double, POFFSET(xsane_brightness_green)},
+ {"brightness-blue", xsane_rc_pref_double, POFFSET(xsane_brightness_blue)},
+ {"contrast", xsane_rc_pref_double, POFFSET(xsane_contrast)},
+ {"contrast-red", xsane_rc_pref_double, POFFSET(xsane_contrast_red)},
+ {"contrast-green", xsane_rc_pref_double, POFFSET(xsane_contrast_green)},
+ {"contrast-blue", xsane_rc_pref_double, POFFSET(xsane_contrast_blue)},
+ {"rgb-default", xsane_rc_pref_int, POFFSET(xsane_rgb_default)},
+ {"negative", xsane_rc_pref_int, POFFSET(xsane_negative)},
+ {"gtk-update-policy", xsane_rc_pref_int, POFFSET(gtk_update_policy)},
+ {"postscript-rotate", xsane_rc_pref_int, POFFSET(psrotate)},
+ {"printernr", xsane_rc_pref_int, POFFSET(printernr)},
+ {"printerdefinitions", xsane_rc_pref_int, POFFSET(printerdefinitions)}
+ };
+
+/* --------------------------------------------------------------------- */
+
+static struct
+ {
+ SANE_String name;
+ void (*codec) (Wire *w, void *p, long offset);
+ long offset;
+ }
+desc_printer[] =
+ {
+ {"printer-name", xsane_rc_pref_string, PRTOFFSET(name)},
+ {"printer-command", xsane_rc_pref_string, PRTOFFSET(command)},
+ {"printer-copy-number-option", xsane_rc_pref_string, PRTOFFSET(copy_number_option)},
+ {"printer-resolution", xsane_rc_pref_int, PRTOFFSET(resolution)},
+ {"printer-width", xsane_rc_pref_double, PRTOFFSET(width)},
+ {"printer-height", xsane_rc_pref_double, PRTOFFSET(height)},
+ {"printer-left-offset", xsane_rc_pref_double, PRTOFFSET(leftoffset)},
+ {"printer-bottom-offset", xsane_rc_pref_double, PRTOFFSET(bottomoffset)},
+ {"printer-gamma", xsane_rc_pref_double, PRTOFFSET(gamma)},
+ {"printer-gamma-red", xsane_rc_pref_double, PRTOFFSET(gamma_red)},
+ {"printer-gamma-green", xsane_rc_pref_double, PRTOFFSET(gamma_green)},
+ {"printer-gamma-blue", xsane_rc_pref_double, PRTOFFSET(gamma_blue)}
+ };
+
+/* --------------------------------------------------------------------- */
+
+void preferences_save(int fd)
+{
+ Wire w;
+ int i, n;
+
+ w.io.fd = fd;
+ w.io.read = read;
+ w.io.write = write;
+ xsane_rc_io_w_init(&w);
+ xsane_rc_io_w_set_dir(&w, WIRE_ENCODE);
+
+ for (i = 0; i < NELEMS(desc); ++i)
+ {
+ xsane_rc_io_w_string(&w, &desc[i].name);
+ (*desc[i].codec) (&w, &preferences, desc[i].offset);
+ }
+
+ n=0;
+
+ while (n < preferences.printerdefinitions)
+ {
+ for (i = 0; i < NELEMS(desc_printer); ++i)
+ {
+ xsane_rc_io_w_string(&w, &desc_printer[i].name);
+ (*desc_printer[i].codec) (&w, preferences.printer[n], desc_printer[i].offset);
+ }
+ n++;
+ }
+
+ xsane_rc_io_w_set_dir(&w, WIRE_DECODE); /* flush it out */
+}
+
+/* --------------------------------------------------------------------- */
+
+void preferences_restore(int fd)
+{
+ SANE_String name;
+ Wire w;
+ int i, n;
+
+ w.io.fd = fd;
+ w.io.read = read;
+ w.io.write = write;
+ xsane_rc_io_w_init(&w);
+ xsane_rc_io_w_set_dir(&w, WIRE_DECODE);
+
+
+ while (1)
+ {
+ xsane_rc_io_w_space(&w, 3);
+ if (w.status)
+ {
+ return;
+ }
+
+ xsane_rc_io_w_string(&w, &name);
+ if (w.status || !name)
+ {
+ return;
+ }
+
+ for (i = 0; i < NELEMS (desc); ++i)
+ {
+ if (strcmp(name, desc[i].name) == 0)
+ {
+ (*desc[i].codec) (&w, &preferences, desc[i].offset);
+ break;
+ }
+ }
+ if (!strcmp(name, "printerdefinitions"))
+ {
+ break;
+ }
+ }
+
+
+ n=0;
+ while (n < preferences.printerdefinitions)
+ {
+ preferences.printer[n] = calloc(sizeof(Preferences_printer_t), 1);
+ for (i = 0; i < NELEMS(desc_printer); ++i)
+ {
+ xsane_rc_io_w_space (&w, 3);
+ if (w.status)
+ {
+ return;
+ }
+
+ xsane_rc_io_w_string(&w, &name);
+ if (w.status || !name)
+ {
+ return;
+ }
+
+ if (strcmp(name, desc_printer[i].name) == 0)
+ {
+ (*desc_printer[i].codec) (&w, preferences.printer[n], desc_printer[i].offset);
+ }
+ else
+ {
+ break;
+ }
+ }
+ n++;
+ }
+
+}
diff --git a/frontend/xsane-preferences.h b/frontend/xsane-preferences.h
new file mode 100644
index 0000000..19482fa
--- /dev/null
+++ b/frontend/xsane-preferences.h
@@ -0,0 +1,122 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-preferences.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifndef xsane_preferences_h
+#define xsane_preferences_h
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include <sane/sane.h>
+#include <gtk/gtk.h>
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+typedef struct
+ {
+ char *name; /* user defined printer name */
+ char *command; /* printercommand */
+ char *copy_number_option; /* option to define number of copies */
+ int resolution; /* printer resolution for copy mode */
+ double width; /* printer width of printable area in mm */
+ double height; /* printer height of printable area in mm */
+ double leftoffset; /* printer left offset in mm */
+ double bottomoffset;/* printer bottom offset in mm */
+ double gamma; /* printer gamma */
+ double gamma_red; /* printer gamma red */
+ double gamma_green; /* printer gamma green */
+ double gamma_blue; /* printer gamma blue */
+ }
+Preferences_printer_t;
+
+typedef struct
+ {
+ char *filename; /* default filename */
+ mode_t image_umask; /* image umask (permisson mask) */
+ mode_t directory_umask; /* directory umask (permisson mask) */
+
+ char *fax_project; /* fax project */
+ char *fax_command; /* faxcommand */
+ char *fax_receiver_option; /* fax receiver option */
+ char *fax_postscript_option; /* fax postscript option */
+ char *fax_normal_option; /* fax normal mode option */
+ char *fax_fine_option; /* fax fine mode option */
+ char *fax_viewer; /* fax viewer */
+ double fax_width; /* width of fax paper in mm */
+ double fax_height; /* height of fax paper in mm */
+ double fax_leftoffset; /* left offset of fax paper in mm */
+ double fax_bottomoffset; /* bottom offset of fax paper in mm */
+
+ char *doc_viewer; /* doc viewer for helpfiles */
+
+ double jpeg_quality; /* quality when saving image as jpeg */
+ double png_compression; /* compression when saving image as pnm */
+ int tiff_compression_nr; /* compression type nr when saving multi bit image as tiff */
+ int tiff_compression_1_nr; /* compression type nr when saving one bit image as tiff */
+ int overwrite_warning; /* warn if file exists */
+ int increase_filename_counter; /* automatically increase counter */
+ int skip_existing_numbers; /* automatically increase counter */
+
+ int tooltips_enabled; /* should tooltips be disabled? */
+ int show_histogram; /* show histogram ? */
+ int show_standard_options; /* show standard options ? */
+ int show_advanced_options; /* show advanced options ? */
+ int show_resolution_list; /* show resolution list instead of slider ? */
+ double length_unit; /* 1.0==mm, 10.0==cm, 25.4==inches, etc. */
+ int main_window_fixed; /* fixed (1) or scrolled (0) main window */
+ int preserve_preview; /* save/restore preview image(s)? */
+ int preview_own_cmap; /* install colormap for preview */
+ double preview_gamma; /* gamma value for previews */
+ double preview_gamma_red; /* red gamma value for previews */
+ double preview_gamma_green; /* green gamma value for previews */
+ double preview_gamma_blue; /* blue gamma value for previews */
+ double xsane_gamma;
+ double xsane_gamma_red;
+ double xsane_gamma_green;
+ double xsane_gamma_blue;
+ double xsane_brightness;
+ double xsane_brightness_red;
+ double xsane_brightness_green;
+ double xsane_brightness_blue;
+ double xsane_contrast;
+ double xsane_contrast_red;
+ double xsane_contrast_green;
+ double xsane_contrast_blue;
+
+ int xsane_rgb_default;
+ int xsane_negative;
+ GtkUpdateType gtk_update_policy;
+
+ int psrotate; /* rotate by 90 degree in postscript mode - landscape */
+ int printernr; /* number of printers */
+ int printerdefinitions;
+ Preferences_printer_t *printer[10];
+ }
+Preferences;
+
+extern Preferences preferences;
+
+extern void preferences_save (int fd);
+extern void preferences_restore (int fd);
+
+#endif /* preferences_h */
diff --git a/frontend/xsane-preview.c b/frontend/xsane-preview.c
new file mode 100644
index 0000000..a75b12a
--- /dev/null
+++ b/frontend/xsane-preview.c
@@ -0,0 +1,3257 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-preview.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/*
+
+ The preview strategy is as follows:
+ -----------------------------------
+
+ 1) The preview is done on the full scan area or a part of it.
+
+ 2) The preview is zoomable so the user can precisely pick
+ the selection area even for small scans on a large scan
+ surface.
+
+ 3) The preview window is resizeable.
+
+ 4) The preview scan resolution depends on preview window size
+ and the selected preview surface (zoom area).
+
+ 5) We let the user/backend pick whether a preview is in color,
+ grayscale, lineart or what not. The only options that the
+ preview may (temporarily) modify are:
+
+ - resolution (set so the preview fills the window)
+ - scan area options (top-left corner, bottom-right corner)
+ - preview option (to let the backend know we're doing a preview)
+ - gamma table is set to default (gamma=1.0)
+
+ 5) The initial size of the scan surface is determined based on the constraints
+ of the four corner coordinates. Missing constraints are replaced
+ by 0/+INF as appropriate (0 for top-left, +INF for bottom-right coords).
+
+ 6) Given the preview window size and the scan surface size, we
+ select the resolution so the acquired preview image just fits
+ in the preview window. The resulting resolution may be out
+ of range in which case we pick the minum/maximum if there is
+ a range or word-list constraint or a default value if there is
+ no such constraint.
+
+ 7) Once a preview image has been acquired, we know the size of the
+ preview image (in pixels). An initial scale factor is chosen
+ so the image fits into the preview window.
+
+*/
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include "xsane.h"
+/* #include <sys/param.h> */
+#include "xsane-back-gtk.h"
+#include "xsane-front-gtk.h"
+#include "xsane-preview.h"
+#include "xsane-preferences.h"
+#include "xsane-gamma.h"
+
+
+#ifndef PATH_MAX
+# define PATH_MAX 1024
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+extern const char *prog_name;
+extern const char *device_text;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* Cut fp conversion routines some slack: */
+#define GROSSLY_DIFFERENT(f1,f2) (fabs ((f1) - (f2)) > 1e-3)
+#define GROSSLY_EQUAL(f1,f2) (fabs ((f1) - (f2)) < 1e-3)
+
+#ifdef __alpha__
+ /* This seems to be necessary for at least some XFree86 3.1.2
+ servers. It's known to be necessary for the XF86_TGA server for
+ Linux/Alpha. Fortunately, it's no great loss so we turn this on
+ by default for now. */
+# define XSERVER_WITH_BUGGY_VISUALS
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#define PRESET_AREA_ITEMS 11
+typedef struct
+{
+ char *name;
+ float width;
+ float height;
+} Preset_area;
+
+static const Preset_area preset_area[] =
+{
+ { "full size", INF, INF },
+ { "DIN A3", 296.98, 420.0 },
+ { "DIN A4", 210.0, 296.98 },
+ { "DIN A4H", 296.98, 210.0 },
+ { "DIN A5", 148.5, 210.0 },
+ { "DIN A5H", 210.0, 148.5 },
+ { "9x13 cm", 90.0, 130.0 },
+ { "13x9 cm", 130.0, 90.0 },
+ { "legal", 215.9, 355.6 },
+ { "letter", 215.9, 279.4 },
+ { "custom", INF, INF }
+};
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static SANE_Int *preview_gamma_data_red = 0;
+static SANE_Int *preview_gamma_data_green = 0;
+static SANE_Int *preview_gamma_data_blue = 0;
+
+static SANE_Int *histogram_gamma_data_red = 0;
+static SANE_Int *histogram_gamma_data_green = 0;
+static SANE_Int *histogram_gamma_data_blue = 0;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* forward declarations */
+static void preview_order_selection(Preview *p);
+static void preview_bound_selection(Preview *p);
+static void preview_draw_rect(Preview *p, GdkWindow *win, GdkGC *gc, float coord[4]);
+static void preview_draw_selection(Preview *p);
+static void preview_update_selection(Preview *p);
+static void preview_establish_selection(Preview *p);
+/* static void preview_update_batch_selection(Preview *p); */
+static void preview_get_scale_device_to_image(Preview *p, float *xscalep, float *yscalep);
+static void preview_get_scale_device_to_preview(Preview *p, float *xscalep, float *yscalep);
+static void preview_get_scale_preview_to_image(Preview *p, float *xscalep, float *yscalep);
+static void preview_paint_image(Preview *p);
+static void preview_display_partial_image(Preview *p);
+static void preview_display_maybe(Preview *p);
+static void preview_display_image(Preview *p);
+static void preview_save_option(Preview *p, int option, SANE_Word *save_loc, int *valid);
+static void preview_restore_option(Preview *p, int option, SANE_Word saved_value, int valid);
+static void preview_set_option_float(Preview *p, int option, float value);
+static void preview_set_option_bool(Preview *p, int option, SANE_Bool value);
+static void preview_set_option_int(Preview *p, int option, SANE_Int value);
+static int preview_increment_image_y(Preview *p);
+static void preview_read_image_data(gpointer data, gint source, GdkInputCondition cond);
+static void preview_scan_done(Preview *p);
+static void preview_scan_start(Preview *p);
+static int preview_make_image_path(Preview *p, size_t filename_size, char *filename, int level);
+static void preview_restore_image(Preview *p);
+static gint preview_expose_handler(GtkWidget *window, GdkEvent *event, gpointer data);
+static gint preview_event_handler(GtkWidget *window, GdkEvent *event, gpointer data);
+static void preview_start_button_clicked(GtkWidget *widget, gpointer data);
+static void preview_cancel_button_clicked(GtkWidget *widget, gpointer data);
+static void preview_area_correct(Preview *p);
+static void preview_save_image(Preview *p);
+static void preview_zoom_not(GtkWidget *window, gpointer data);
+static void preview_zoom_out(GtkWidget *window, gpointer data);
+static void preview_zoom_in(GtkWidget *window, gpointer data);
+static void preview_zoom_undo(GtkWidget *window, gpointer data);
+static void preview_get_color(Preview *p, int x, int y, int *red, int *green, int *blue);
+static void preview_pipette_white(GtkWidget *window, gpointer data);
+static void preview_pipette_gray(GtkWidget *window, gpointer data);
+static void preview_pipette_black(GtkWidget *window, gpointer data);
+static void preview_full_preview_area(GtkWidget *widget, gpointer call_data);
+static void preview_preset_area_callback(GtkWidget *widget, gpointer call_data);
+
+void preview_do_gamma_correction(Preview *p);
+void preview_calculate_histogram(Preview *p,
+ SANE_Int *count_raw, SANE_Int *count_raw_red, SANE_Int *count_raw_green, SANE_Int *count_raw_blue,
+ SANE_Int *count, SANE_Int *count_red, SANE_Int *count_green, SANE_Int *count_blue);
+void preview_gamma_correction(Preview *p,
+ SANE_Int *gamma_red, SANE_Int *gamma_green, SANE_Int *gamma_blue,
+ SANE_Int *gamma_red_hist, SANE_Int *gamma_green_hist, SANE_Int *gamma_blue_hist);
+void preview_area_resize(GtkWidget *widget);
+void preview_update_maximum_output_size(Preview *p);
+void preview_set_maximum_output_size(Preview *p, float width, float height);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_order_selection(Preview *p)
+{
+ float tmp_coordinate;
+
+ p->selection.active = ( (p->selection.coordinate[0] != p->selection.coordinate[2]) &&
+ (p->selection.coordinate[1] != p->selection.coordinate[3]) );
+
+
+ if (p->selection.active)
+ {
+ if (p->selection.coordinate[0] > p->selection.coordinate[2])
+ {
+ tmp_coordinate = p->selection.coordinate[0];
+ p->selection.coordinate[0] = p->selection.coordinate[2];
+ p->selection.coordinate[2] = tmp_coordinate;
+
+ p->selection_xedge = (p->selection_xedge + 2) & 3;
+ }
+
+ if (p->selection.coordinate[1] > p->selection.coordinate[3])
+ {
+ tmp_coordinate = p->selection.coordinate[1];
+ p->selection.coordinate[1] = p->selection.coordinate[3];
+ p->selection.coordinate[3] = tmp_coordinate;
+
+ p->selection_yedge = (p->selection_yedge + 2) & 3;
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_bound_selection(Preview *p)
+{
+
+ p->selection.active = ( (p->selection.coordinate[0] != p->selection.coordinate[2]) &&
+ (p->selection.coordinate[1] != p->selection.coordinate[3]) );
+
+
+ if (p->selection.active)
+ {
+ if (p->selection.coordinate[0] < p->scanner_surface[0])
+ {
+ p->selection.coordinate[0] = p->scanner_surface[0];
+ }
+
+ if (p->selection.coordinate[1] < p->scanner_surface[1])
+ {
+ p->selection.coordinate[1] = p->scanner_surface[1];
+ }
+
+ if (p->selection.coordinate[2] > p->scanner_surface[2])
+ {
+ p->selection.coordinate[2] = p->scanner_surface[2];
+ }
+
+ if (p->selection.coordinate[3] > p->scanner_surface[3])
+ {
+ p->selection.coordinate[3] = p->scanner_surface[3];
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_draw_rect(Preview *p, GdkWindow *win, GdkGC *gc, float coordinate[4])
+{
+ float xscale, yscale;
+ float x, y, w, h;
+ gint xi, yi, wi, hi;
+
+ x = coordinate[0];
+ y = coordinate[1];
+ w = coordinate[2] - x;
+ h = coordinate[3] - y;
+
+ if (w < 0)
+ {
+ x = coordinate[2];
+ w = -w;
+ }
+
+ if (h < 0)
+ {
+ y = coordinate[3];
+ h = -h;
+ }
+
+ preview_get_scale_device_to_preview(p, &xscale, &yscale);
+
+ x = x - p->surface[0];
+ y = y - p->surface[1];
+
+ xi = (gint) (x * xscale + 0.5);
+ yi = (gint) (y * yscale + 0.5);
+ wi = (gint) (w * xscale + 0.5);
+ hi = (gint) (h * yscale + 0.5);
+
+ gdk_draw_rectangle(win, gc, FALSE, xi, yi, wi + 1, hi + 1);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_draw_selection(Preview *p)
+{
+ if (!p->gc_selection) /* window isn't mapped yet */
+ {
+ return;
+ }
+
+ while (gtk_events_pending()) /* make sure all drawing actions are finished */
+ {
+ gtk_main_iteration();
+ }
+
+ if (p->previous_selection.active)
+ {
+ preview_draw_rect(p, p->window->window, p->gc_selection, p->previous_selection.coordinate);
+ }
+
+ if (p->selection.active)
+ {
+ preview_draw_rect(p, p->window->window, p->gc_selection, p->selection.coordinate);
+ }
+
+ p->previous_selection = p->selection;
+
+
+ if (!p->gc_selection_maximum) /* window isn't mapped yet */
+ {
+ return;
+ }
+
+ if (p->previous_selection_maximum.active)
+ {
+ preview_draw_rect(p, p->window->window, p->gc_selection_maximum, p->previous_selection_maximum.coordinate);
+ }
+
+ if (p->selection_maximum.active)
+ {
+ preview_draw_rect(p, p->window->window, p->gc_selection_maximum, p->selection_maximum.coordinate);
+ }
+
+ p->previous_selection_maximum = p->selection_maximum;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_update_selection(Preview *p)
+/* draw selection box as defined in backend */
+{
+ const SANE_Option_Descriptor *opt;
+ SANE_Status status;
+ SANE_Word val;
+ int i, optnum;
+
+ p->previous_selection = p->selection;
+
+ for (i = 0; i < 4; ++i)
+ {
+ optnum = p->dialog->well_known.coord[i];
+ if (optnum > 0)
+ {
+ opt = sane_get_option_descriptor(p->dialog->dev, optnum);
+ status = sane_control_option(p->dialog->dev, optnum, SANE_ACTION_GET_VALUE, &val, 0);
+ if (status != SANE_STATUS_GOOD)
+ {
+ continue;
+ }
+ if (opt->type == SANE_TYPE_FIXED)
+ {
+ p->selection.coordinate[i] = SANE_UNFIX(val);
+ }
+ else
+ {
+ p->selection.coordinate[i] = val;
+ }
+ }
+ else /* backend does not use scanarea options */
+ {
+ switch (i)
+ {
+ case 0:
+ case 1:
+ p->selection.coordinate[i] = 0;
+ break;
+
+ case 2:
+ p->selection.coordinate[i] = p->preview_width;
+ break;
+
+ case 3:
+ p->selection.coordinate[i] = p->preview_height;
+ break;
+ }
+ }
+ }
+
+ for (i = 0; i < 2; ++i)
+ {
+ if (p->selection.coordinate[i + 2] < p->selection.coordinate[i])
+ {
+ p->selection.coordinate[i + 2] = p->selection.coordinate[i];
+ }
+ }
+
+ p->selection.active = ( (p->selection.coordinate[0] != p->selection.coordinate[2]) &&
+ (p->selection.coordinate[1] != p->selection.coordinate[3]) );
+
+ preview_draw_selection(p);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_establish_selection(Preview *p)
+{
+ /* This routine only shall be called if the preview area really is changed. */
+
+ int i;
+
+ preview_order_selection(p);
+
+ xsane.block_update_param = TRUE; /* do not change parameters each time */
+
+ for (i = 0; i < 4; ++i)
+ {
+ preview_set_option_float(p, p->dialog->well_known.coord[i], p->selection.coordinate[i]);
+ }
+
+ xsane_back_gtk_update_scan_window(p->dialog);
+
+ xsane.block_update_param = FALSE;
+
+ if (p->dialog->param_change_callback)
+ {
+ (*p->dialog->param_change_callback) (p->dialog, p->dialog->param_change_arg);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#if 0
+static void preview_update_batch_selection(Preview *p)
+{
+ Batch_selection *batch_selection;
+
+ if (!p->gc_selection) /* window isn't mapped yet */
+ {
+ return;
+ }
+
+ batch_selection = p->batch_selection;
+
+ while (batch_selection)
+ {
+ preview_draw_rect(p, p->window->window, p->gc_selection, batch_selection->coordinate);
+
+ batch_selection = batch_selection->next;
+ }
+}
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_get_scale_device_to_image(Preview *p, float *xscalep, float *yscalep)
+{
+ float device_width, device_height;
+ float xscale = 1.0;
+ float yscale = 1.0;
+
+ device_width = fabs(p->image_surface[2] - p->image_surface[0]);
+ device_height = fabs(p->image_surface[3] - p->image_surface[1]);
+
+ if ( (device_width >0) && (device_width < INF) )
+ {
+ xscale = p->image_width / device_width;
+ }
+
+ if ( (device_height >0) && (device_height < INF) )
+ {
+ yscale = p->image_height / device_height;
+ }
+
+ if (p->surface_unit == SANE_UNIT_PIXEL)
+ {
+ if (xscale > yscale)
+ {
+ yscale = xscale;
+ }
+ else
+ {
+ xscale = yscale;
+ }
+ }
+
+ *xscalep = xscale;
+ *yscalep = yscale;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_get_scale_device_to_preview(Preview *p, float *xscalep, float *yscalep)
+{
+ float device_width, device_height;
+ float xscale = 1.0;
+ float yscale = 1.0;
+
+ device_width = fabs(p->image_surface[2] - p->image_surface[0]);
+ device_height = fabs(p->image_surface[3] - p->image_surface[1]);
+
+ if ( (device_width >0) && (device_width < INF) )
+ {
+ xscale = p->preview_width / device_width;
+ }
+
+ if ( (device_height >0) && (device_height < INF) )
+ {
+ yscale = p->preview_height / device_height;
+ }
+
+ if (p->surface_unit == SANE_UNIT_PIXEL)
+ {
+ if (xscale > yscale)
+ {
+ yscale = xscale;
+ }
+ else
+ {
+ xscale = yscale;
+ }
+ }
+
+ *xscalep = xscale;
+ *yscalep = yscale;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_get_scale_preview_to_image(Preview *p, float *xscalep, float *yscalep)
+{
+ float xscale = 1.0;
+ float yscale = 1.0;
+
+ if (p->image_width > 0)
+ {
+ xscale = p->image_width / (float) p->preview_width;
+ }
+
+ if (p->image_height > 0)
+ {
+ yscale = p->image_height / (float) p->preview_height;
+ }
+
+ if (p->surface_unit == SANE_UNIT_PIXEL)
+ {
+ if (xscale > yscale)
+ {
+ yscale = xscale;
+ }
+ else
+ {
+ xscale = yscale;
+ }
+ }
+
+ *xscalep = xscale;
+ *yscalep = yscale;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_paint_image(Preview *p)
+{
+ float xscale, yscale, src_x, src_y;
+ int dst_x, dst_y, height, x, y, old_y, src_offset;
+
+ preview_get_scale_preview_to_image(p, &xscale, &yscale);
+
+ memset(p->preview_row, 0x80, 3*p->preview_window_width);
+
+ /* don't draw last line unless it's complete: */
+ height = p->image_y;
+
+ if (p->image_x == 0 && height < p->image_height)
+ {
+ ++height;
+ }
+
+ /* for now, use simple nearest-neighbor interpolation: */
+ src_offset = 0;
+ src_x = src_y = 0.0;
+ old_y = -1;
+
+ for (dst_y = 0; dst_y < p->preview_height; ++dst_y)
+ {
+ y = (int) (src_y + 0.5);
+ if (y >= height)
+ {
+ break;
+ }
+ src_offset = y * 3 * p->image_width;
+
+ if ((p->image_data_enh) && (old_y != y))
+ {
+ old_y = y;
+ for (dst_x = 0; dst_x < p->preview_width; ++dst_x)
+ {
+ x = (int) (src_x + 0.5);
+ if (x >= p->image_width)
+ {
+ break;
+ }
+
+ p->preview_row[3*dst_x + 0] = p->image_data_enh[src_offset + 3*x + 0];
+ p->preview_row[3*dst_x + 1] = p->image_data_enh[src_offset + 3*x + 1];
+ p->preview_row[3*dst_x + 2] = p->image_data_enh[src_offset + 3*x + 2];
+ src_x += xscale;
+ }
+ }
+ gtk_preview_draw_row(GTK_PREVIEW(p->window), p->preview_row, 0, dst_y, p->preview_window_width);
+ src_x = 0.0;
+ src_y += yscale;
+ }
+
+ if (dst_y >= p->preview_height-5)
+ {
+ memset(p->preview_row, 0x80, 3*p->preview_window_width);
+ for (dst_y = p->preview_height-1; dst_y < p->preview_window_height; ++dst_y)
+ {
+ gtk_preview_draw_row(GTK_PREVIEW(p->window), p->preview_row, 0, dst_y, p->preview_window_width);
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_display_partial_image(Preview *p)
+{
+ preview_paint_image(p);
+
+ if (GTK_WIDGET_DRAWABLE(p->window))
+ {
+ GtkPreview *preview = GTK_PREVIEW(p->window);
+ int src_x, src_y;
+
+ src_x = (p->window->allocation.width - preview->buffer_width)/2;
+ src_y = (p->window->allocation.height - preview->buffer_height)/2;
+ gtk_preview_put(preview, p->window->window, p->window->style->black_gc, src_x, src_y,
+ 0, 0, p->preview_width, p->preview_height);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_display_maybe(Preview *p)
+{
+ time_t now;
+
+ time(&now);
+
+ if (now > p->image_last_time_updated) /* wait at least one secone */
+ {
+ p->image_last_time_updated = now;
+ preview_display_partial_image(p);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_display_image(Preview *p)
+{
+ /* if image height was unknown and got larger than expected get missing memory */
+ if (p->params.lines <= 0 && p->image_y < p->image_height)
+ {
+ p->image_height = p->image_y;
+ p->image_data_raw = realloc(p->image_data_raw, 3 * p->image_width * p->image_height);
+ p->image_data_enh = realloc(p->image_data_enh, 3 * p->image_width * p->image_height);
+ assert(p->image_data_raw);
+ assert(p->image_data_enh);
+ }
+
+ memcpy(p->image_data_raw, p->image_data_enh, 3 * p->image_width * p->image_height);
+
+ preview_do_gamma_correction(p);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_save_option(Preview *p, int option, SANE_Word *save_loc, int *valid)
+{
+ SANE_Status status;
+
+ if (option <= 0)
+ {
+ *valid = 0;
+ return;
+ }
+
+ status = sane_control_option(p->dialog->dev, option, SANE_ACTION_GET_VALUE, save_loc, 0);
+ *valid = (status == SANE_STATUS_GOOD);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_restore_option(Preview *p, int option, SANE_Word saved_value, int valid)
+{
+ const SANE_Option_Descriptor *opt;
+ SANE_Status status;
+ SANE_Handle dev;
+
+ if (!valid)
+ {
+ return;
+ }
+
+ dev = p->dialog->dev;
+ status = sane_control_option(dev, option, SANE_ACTION_SET_VALUE, &saved_value, 0);
+
+ if (status != SANE_STATUS_GOOD)
+ {
+ char buf[256];
+ opt = sane_get_option_descriptor(dev, option);
+ snprintf(buf, sizeof(buf), "%s %s: %s.", ERR_SET_OPTION, opt->name, XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(buf, TRUE);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_set_option_float(Preview *p, int option, float value)
+{
+ const SANE_Option_Descriptor *opt;
+ SANE_Handle dev;
+ SANE_Word word;
+
+ if (option <= 0 || value <= -INF || value >= INF)
+ {
+ return;
+ }
+
+ dev = p->dialog->dev;
+ opt = sane_get_option_descriptor(dev, option);
+ if (opt->type == SANE_TYPE_FIXED)
+ {
+ word = SANE_FIX(value) + 0.5;
+ }
+ else
+ {
+ word = value + 0.5;
+ }
+
+ sane_control_option(dev, option, SANE_ACTION_SET_VALUE, &word, 0);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_set_option_bool(Preview *p, int option, SANE_Bool value)
+{
+ SANE_Handle dev;
+
+ if (option <= 0)
+ return;
+
+ dev = p->dialog->dev;
+ sane_control_option(dev, option, SANE_ACTION_SET_VALUE, &value, 0);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_set_option_int(Preview *p, int option, SANE_Int value)
+{
+ SANE_Handle dev;
+
+ if (option <= 0)
+ return;
+
+ dev = p->dialog->dev;
+ sane_control_option(dev, option, SANE_ACTION_SET_VALUE, &value, 0);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int preview_increment_image_y(Preview *p)
+{
+ size_t extra_size, offset;
+ char buf[256];
+
+ p->image_x = 0;
+ ++p->image_y;
+ if (p->params.lines <= 0 && p->image_y >= p->image_height)
+ {
+ offset = 3 * p->image_width*p->image_height;
+ extra_size = 3 * 32 * p->image_width;
+ p->image_height += 32;
+ p->image_data_raw = realloc(p->image_data_raw, offset + extra_size);
+ p->image_data_enh = realloc(p->image_data_enh, offset + extra_size);
+ if ( (!p->image_data_enh) || (!p->image_data_raw) )
+ {
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_ALLOCATE_IMAGE, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ preview_scan_done(p);
+ return -1;
+ }
+ memset(p->image_data_enh + offset, 0xff, extra_size);
+ }
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_read_image_data(gpointer data, gint source, GdkInputCondition cond)
+{
+ SANE_Status status;
+ Preview *p = data;
+ u_char buf[8192];
+ SANE_Handle dev;
+ SANE_Int len;
+ int i, j;
+
+ dev = p->dialog->dev;
+ while (1)
+ {
+ status = sane_read(dev, buf, sizeof(buf), &len);
+ if (status != SANE_STATUS_GOOD)
+ {
+ if (status == SANE_STATUS_EOF)
+ {
+ if (p->params.last_frame) /* got all preview image data */
+ {
+ preview_display_image(p); /* display preview image */
+ preview_save_image(p); /* save preview image */
+ preview_scan_done(p); /* scan is done */
+ return; /* ok, all finished */
+ }
+ else
+ {
+ preview_scan_start(p);
+ break;
+ }
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_DURING_READ, XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(buf, TRUE);
+ }
+ preview_scan_done(p);
+ return;
+ }
+
+ if (!len)
+ {
+ break; /* out of data for now */
+ }
+
+ switch (p->params.format)
+ {
+ case SANE_FRAME_RGB:
+ if (p->params.depth != 8)
+ {
+ goto bad_depth;
+ }
+
+ for (i = 0; i < len; ++i)
+ {
+ p->image_data_enh[p->image_offset++] = buf[i];
+ if (p->image_offset%3 == 0)
+ {
+ if (++p->image_x >= p->image_width && preview_increment_image_y(p) < 0)
+ {
+ return;
+ }
+ }
+ }
+ break;
+
+ case SANE_FRAME_GRAY:
+ switch (p->params.depth)
+ {
+ case 1:
+ for (i = 0; i < len; ++i)
+ {
+ u_char mask = buf[i];
+
+ for (j = 7; j >= 0; --j)
+ {
+ u_char gl = (mask & (1 << j)) ? 0x00 : 0xff;
+ p->image_data_enh[p->image_offset++] = gl;
+ p->image_data_enh[p->image_offset++] = gl;
+ p->image_data_enh[p->image_offset++] = gl;
+ if (++p->image_x >= p->image_width)
+ {
+ if (preview_increment_image_y(p) < 0)
+ {
+ return;
+ }
+ break; /* skip padding bits */
+ }
+ }
+ }
+ break;
+
+ case 8:
+ for (i = 0; i < len; ++i)
+ {
+ u_char gl = buf[i];
+ p->image_data_enh[p->image_offset++] = gl;
+ p->image_data_enh[p->image_offset++] = gl;
+ p->image_data_enh[p->image_offset++] = gl;
+ if (++p->image_x >= p->image_width && preview_increment_image_y(p) < 0)
+ {
+ return;
+ }
+ }
+ break;
+
+ default:
+ goto bad_depth;
+ }
+ break;
+
+ case SANE_FRAME_RED:
+ case SANE_FRAME_GREEN:
+ case SANE_FRAME_BLUE:
+ switch (p->params.depth)
+ {
+ case 1:
+ for (i = 0; i < len; ++i)
+ {
+ u_char mask = buf[i];
+
+ for (j = 0; j < 8; ++j)
+ {
+ u_char gl = (mask & 1) ? 0xff : 0x00;
+ mask >>= 1;
+ p->image_data_enh[p->image_offset++] = gl;
+ p->image_offset += 3;
+ if (++p->image_x >= p->image_width && preview_increment_image_y(p) < 0)
+ {
+ return;
+ }
+ }
+ }
+ break;
+
+ case 8:
+ for (i = 0; i < len; ++i)
+ {
+ p->image_data_enh[p->image_offset] = buf[i];
+ p->image_offset += 3;
+ if (++p->image_x >= p->image_width && preview_increment_image_y(p) < 0)
+ {
+ return;
+ }
+ }
+ break;
+
+ default:
+ goto bad_depth;
+ }
+ break;
+
+ default:
+ fprintf(stderr, "preview_read_image_data: %s %d\n", ERR_BAD_FRAME_FORMAT, p->params.format);
+ preview_scan_done(p);
+ return;
+ }
+
+ if (p->input_tag < 0)
+ {
+ preview_display_maybe(p);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ }
+ }
+ preview_display_maybe(p);
+ return;
+
+bad_depth:
+ snprintf(buf, sizeof(buf), "%s %d.", ERR_PREVIEW_BAD_DEPTH, p->params.depth);
+ xsane_back_gtk_error(buf, TRUE);
+ preview_scan_done(p);
+ return;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_scan_done(Preview *p)
+{
+ int i;
+
+ p->scanning = FALSE;
+
+ if (p->input_tag >= 0)
+ {
+ gdk_input_remove(p->input_tag);
+ p->input_tag = -1;
+ }
+
+ sane_cancel(p->dialog->dev);
+
+ xsane.block_update_param = TRUE; /* do not change parameters each time */
+
+ preview_restore_option(p, p->dialog->well_known.dpi, p->saved_dpi, p->saved_dpi_valid);
+ preview_restore_option(p, p->dialog->well_known.dpi_x, p->saved_dpi_x, p->saved_dpi_x_valid);
+ preview_restore_option(p, p->dialog->well_known.dpi_y, p->saved_dpi_y, p->saved_dpi_y_valid);
+
+ for (i = 0; i < 4; ++i)
+ {
+ preview_restore_option(p, p->dialog->well_known.coord[i], p->saved_coord[i], p->saved_coord_valid[i]);
+ }
+
+ preview_restore_option(p, p->dialog->well_known.bit_depth, p->saved_bit_depth, p->saved_bit_depth_valid);
+
+ preview_set_option_bool(p, p->dialog->well_known.preview, SANE_FALSE);
+
+ gtk_widget_set_sensitive(p->cancel, FALSE);
+ xsane_set_sensitivity(TRUE);
+
+ xsane.block_update_param = FALSE;
+
+ preview_update_surface(p, 0); /* if surface was not defined it's necessary to redefine it now */
+
+ preview_update_selection(p);
+ xsane_update_histogram();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int preview_get_memory(Preview *p)
+{
+ char buf[256];
+
+ if (p->image_data_enh)
+ {
+ free(p->image_data_enh);
+ p->image_data_enh = 0;
+ }
+
+ if (p->image_data_raw)
+ {
+ free(p->image_data_raw);
+ p->image_data_raw = 0;
+ }
+
+ if (p->preview_row)
+ {
+ free(p->preview_row);
+ p->preview_row = 0;
+ }
+
+ p->image_data_enh = malloc(3 * p->image_width * (p->image_height));
+ p->image_data_raw = malloc(3 * p->image_width * (p->image_height));
+ p->preview_row = malloc(3 * p->preview_window_width);
+
+ if ( (!p->image_data_raw) || (!p->image_data_enh) || (!p->preview_row) )
+ {
+ if (p->image_data_enh)
+ {
+ free(p->image_data_enh);
+ p->image_data_enh = 0;
+ }
+
+ if (p->image_data_raw)
+ {
+ free(p->image_data_raw);
+ p->image_data_raw = 0;
+ }
+
+ if (p->preview_row)
+ {
+ free(p->preview_row);
+ p->preview_row = 0;
+ }
+
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_ALLOCATE_IMAGE, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+
+ return -1; /* error */
+ }
+
+ memset(p->image_data_enh, 0xff, 3*p->image_width*p->image_height); /* clean memory */
+
+ return 0; /* ok */
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_scan_start(Preview *p)
+{
+ SANE_Handle dev = p->dialog->dev;
+ SANE_Status status;
+ char buf[256];
+ int fd, y, i;
+ int gamma_gray_size = 256; /* set this values to image depth for more than 8bpp input support!!! */
+ int gamma_red_size = 256;
+ int gamma_green_size = 256;
+ int gamma_blue_size = 256;
+ int gamma_gray_max = 255; /* set this to to image depth for more than 8bpp output support */
+ int gamma_red_max = 255;
+ int gamma_green_max = 255;
+ int gamma_blue_max = 255;
+
+ for (i=0; i<4; i++)
+ {
+ p->image_surface[i] = p->surface[i];
+ }
+
+ xsane_clear_histogram(&xsane.histogram_raw);
+ xsane_clear_histogram(&xsane.histogram_enh);
+ gtk_widget_set_sensitive(p->cancel, TRUE);
+ xsane_set_sensitivity(FALSE);
+
+ /* clear old preview: */
+ memset(p->preview_row, 0xff, 3*p->preview_width);
+ for (y = 0; y < p->preview_height; ++y)
+ {
+ gtk_preview_draw_row(GTK_PREVIEW(p->window), p->preview_row, 0, y, p->preview_width);
+ }
+
+ if (p->input_tag >= 0)
+ {
+ gdk_input_remove(p->input_tag);
+ p->input_tag = -1;
+ }
+
+ if (p->dialog->well_known.gamma_vector >0)
+ {
+ const SANE_Option_Descriptor *opt;
+
+ opt = sane_get_option_descriptor(p->dialog->dev, p->dialog->well_known.gamma_vector);
+ if (SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ SANE_Int *gamma_data;
+
+ opt = sane_get_option_descriptor(p->dialog->dev, p->dialog->well_known.gamma_vector);
+ gamma_gray_size = opt->size / sizeof(opt->type);
+ gamma_gray_max = opt->constraint.range->max;
+
+ gamma_data = malloc(gamma_gray_size * sizeof(SANE_Int));
+ xsane_create_gamma_curve(gamma_data, 0, 1.0, 0.0, 0.0, gamma_gray_size, gamma_gray_max);
+ xsane_back_gtk_update_vector(p->dialog, p->dialog->well_known.gamma_vector, gamma_data);
+ free(gamma_data);
+ }
+ }
+
+ if (p->dialog->well_known.gamma_vector_r >0)
+ {
+ const SANE_Option_Descriptor *opt;
+
+ opt = sane_get_option_descriptor(p->dialog->dev, p->dialog->well_known.gamma_vector_r);
+ if (SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ SANE_Int *gamma_data_red, *gamma_data_green, *gamma_data_blue;
+
+ opt = sane_get_option_descriptor(p->dialog->dev, p->dialog->well_known.gamma_vector_r);
+ gamma_red_size = opt->size / sizeof(opt->type);
+ gamma_red_max = opt->constraint.range->max;
+
+ opt = sane_get_option_descriptor(p->dialog->dev, p->dialog->well_known.gamma_vector_g);
+ gamma_green_size = opt->size / sizeof(opt->type);
+ gamma_green_max = opt->constraint.range->max;
+
+ opt = sane_get_option_descriptor(p->dialog->dev, p->dialog->well_known.gamma_vector_b);
+ gamma_blue_size = opt->size / sizeof(opt->type);
+ gamma_blue_max = opt->constraint.range->max;
+
+ gamma_data_red = malloc(gamma_red_size * sizeof(SANE_Int));
+ gamma_data_green = malloc(gamma_green_size * sizeof(SANE_Int));
+ gamma_data_blue = malloc(gamma_blue_size * sizeof(SANE_Int));
+
+ xsane_create_gamma_curve(gamma_data_red, 0, 1.0, 0.0, 0.0, gamma_red_size, gamma_red_max);
+ xsane_create_gamma_curve(gamma_data_green, 0, 1.0, 0.0, 0.0, gamma_green_size, gamma_green_max);
+ xsane_create_gamma_curve(gamma_data_blue, 0, 1.0, 0.0, 0.0, gamma_blue_size, gamma_blue_max);
+
+ xsane_back_gtk_update_vector(p->dialog, p->dialog->well_known.gamma_vector_r, gamma_data_red);
+ xsane_back_gtk_update_vector(p->dialog, p->dialog->well_known.gamma_vector_g, gamma_data_green);
+ xsane_back_gtk_update_vector(p->dialog, p->dialog->well_known.gamma_vector_b, gamma_data_blue);
+
+ free(gamma_data_red);
+ free(gamma_data_green);
+ free(gamma_data_blue);
+ }
+ }
+
+ status = sane_start(dev);
+ if (status != SANE_STATUS_GOOD)
+ {
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_START_SCANNER, XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(buf, TRUE);
+ preview_scan_done(p);
+ return;
+ }
+
+ status = sane_get_parameters(dev, &p->params);
+ if (status != SANE_STATUS_GOOD)
+ {
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_GET_PARAMS, XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(buf, TRUE);
+ preview_scan_done(p);
+ return;
+ }
+
+ p->image_offset = p->image_x = p->image_y = 0;
+
+ if (p->params.format >= SANE_FRAME_RED && p->params.format <= SANE_FRAME_BLUE)
+ {
+ p->image_offset = p->params.format - SANE_FRAME_RED;
+ }
+
+ if ( (!p->image_data_enh) || (p->params.pixels_per_line != p->image_width)
+ || ( (p->params.lines >= 0) && (p->params.lines != p->image_height) ) )
+ {
+ p->image_width = p->params.pixels_per_line;
+ p->image_height = p->params.lines;
+
+ if (p->image_height < 0)
+ {
+ p->image_height = 32; /* may have to adjust as we go... */
+ }
+
+ if (preview_get_memory(p))
+ {
+ preview_scan_done(p); /* error */
+ return;
+ }
+ }
+
+/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+/* THIS IS A BIT STRANGE HERE */
+ p->selection.active = FALSE;
+ p->previous_selection_maximum.active = FALSE;
+/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */
+
+ p->scanning = TRUE;
+
+ if (sane_set_io_mode(dev, SANE_TRUE) == SANE_STATUS_GOOD && sane_get_select_fd(dev, &fd) == SANE_STATUS_GOOD)
+ {
+ p->input_tag = gdk_input_add(fd, GDK_INPUT_READ, preview_read_image_data, p);
+ }
+ else
+ {
+ preview_read_image_data(p, -1, GDK_INPUT_READ);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int preview_make_image_path(Preview *p, size_t filename_size, char *filename, int level)
+{
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "preview-level-%d-", level);
+ return xsane_back_gtk_make_path(filename_size, filename, 0, 0, buf, p->dialog->dev_name, ".ppm", XSANE_PATH_TMP);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int preview_restore_image_from_file(Preview *p, FILE *in, int min_quality)
+{
+ u_int psurface_type, psurface_unit;
+ int image_width, image_height;
+ int xoffset, yoffset, width, height;
+ int quality;
+ int y;
+ float psurface[4];
+ size_t nread;
+ char *imagep;
+
+ if (!in)
+ {
+ return min_quality;
+ }
+
+ /* See whether there is a saved preview and load it if present: */
+
+ if (fscanf(in, "P6\n# surface: %g %g %g %g %u %u\n%d %d\n255\n",
+ psurface + 0, psurface + 1, psurface + 2, psurface + 3,
+ &psurface_type, &psurface_unit,
+ &image_width, &image_height) != 8)
+ {
+ return min_quality;
+ }
+
+ if ((psurface_type != p->surface_type) || (psurface_unit != p->surface_unit))
+ {
+ return min_quality;
+ }
+
+ xoffset = (p->surface[0] - psurface[0])/(psurface[2] - psurface[0]) * image_width;
+ yoffset = (p->surface[1] - psurface[1])/(psurface[3] - psurface[1]) * image_height;
+ width = (p->surface[2] - p->surface[0])/(psurface[2] - psurface[0]) * image_width;
+ height = (p->surface[3] - p->surface[1])/(psurface[3] - psurface[1]) * image_height;
+ quality = width;
+
+ if ((xoffset < 0) || (yoffset < 0) ||
+ (xoffset+width > image_width) || (yoffset+height > image_height) ||
+ (width == 0) || (height == 0))
+ {
+ return min_quality;
+ }
+
+ if (quality < min_quality)
+ {
+ return min_quality;
+ }
+
+ p->params.depth = 8;
+ p->image_width = width;
+ p->image_height = height;
+
+ if (preview_get_memory(p))
+ {
+ return min_quality; /* error allocating memory */
+ }
+
+ fseek(in, yoffset * 3 * image_width, SEEK_CUR); /* skip unused lines */
+
+ imagep = p->image_data_enh;
+
+ for (y = yoffset; y < yoffset + height; y++)
+ {
+ fseek(in, xoffset * 3, SEEK_CUR); /* skip unused pixel left of area */
+
+ nread = fread(imagep, 3, width, in);
+ imagep += width * 3;
+
+ fseek(in, (image_width - width - xoffset) * 3, SEEK_CUR); /* skip unused pixel right of area */
+ }
+
+ p->image_y = height;
+ p->image_x = width;
+
+ p->image_surface[0] = p->surface[0];
+ p->image_surface[1] = p->surface[1];
+ p->image_surface[2] = p->surface[2];
+ p->image_surface[3] = p->surface[3];
+
+ return quality;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_restore_image(Preview *p)
+{
+ char filename[PATH_MAX];
+ FILE *in;
+ int status;
+ int quality = 0;
+ int level;
+
+ /* See whether there is a saved preview and load it if present: */
+
+ for(level = 2; level >= 0; level--)
+ {
+ status = preview_make_image_path(p, sizeof(filename), filename, level);
+ if (status >= 0)
+ {
+ in = fopen(filename, "r");
+ if (in)
+ {
+ quality = preview_restore_image_from_file(p, in, quality);
+ }
+ }
+ }
+ memcpy(p->image_data_raw, p->image_data_enh, 3 * p->image_width * p->image_height);
+
+/* the following commands may be removed because they are done because a event is emmited */
+ preview_do_gamma_correction(p);
+ xsane_update_histogram();
+ preview_draw_selection(p);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* This is executed _after_ the gtkpreview's expose routine. */
+static gint preview_expose_handler(GtkWidget *window, GdkEvent *event, gpointer data)
+{
+ Preview *p = data;
+
+ p->previous_selection.active = FALSE; /* ok, old selections are overpainted */
+ p->previous_selection_maximum.active = FALSE;
+ p->selection.active = TRUE; /* ok, old selections are overpainted */
+ p->selection_maximum.active = TRUE;
+ preview_draw_selection(p); /* draw selections again */
+
+ return FALSE;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static gint preview_event_handler(GtkWidget *window, GdkEvent *event, gpointer data)
+{
+ Preview *p = data;
+ GdkCursor *cursor;
+ GdkColor color;
+ GdkColormap *colormap;
+ float preview_selection[4];
+ float xscale, yscale;
+ static int event_count = 0;
+ int cursornr;
+
+ event_count++;
+
+ preview_get_scale_device_to_preview(p, &xscale, &yscale);
+
+ preview_selection[0] = xscale * (p->selection.coordinate[0] - p->surface[0]);
+ preview_selection[1] = yscale * (p->selection.coordinate[1] - p->surface[1]);
+ preview_selection[2] = xscale * (p->selection.coordinate[2] - p->surface[0]);
+ preview_selection[3] = yscale * (p->selection.coordinate[3] - p->surface[1]);
+
+ if (event->type == GDK_EXPOSE)
+ {
+ if (!p->gc_selection)
+ {
+ colormap = gdk_window_get_colormap(p->window->window);
+
+ p->gc_selection = gdk_gc_new(p->window->window);
+ gdk_gc_set_function(p->gc_selection, GDK_INVERT);
+ gdk_gc_set_line_attributes(p->gc_selection, 1, GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER);
+
+ p->gc_selection_maximum = gdk_gc_new(p->window->window);
+ gdk_gc_set_function(p->gc_selection_maximum, GDK_XOR);
+ gdk_gc_set_line_attributes(p->gc_selection_maximum, 1, GDK_LINE_ON_OFF_DASH, GDK_CAP_BUTT, GDK_JOIN_MITER);
+ color.red = 0;
+ color.green = 65535;
+ color.blue = 30000;
+ gdk_color_alloc(colormap, &color);
+ gdk_gc_set_foreground(p->gc_selection_maximum, &color);
+
+ preview_paint_image(p);
+ }
+ else
+ {
+ while (gtk_events_pending()) /* make sure image is updated */
+ {
+ gtk_main_iteration();
+ }
+
+ p->previous_selection.active = FALSE; /* ok, old selections are overpainted */
+ p->previous_selection_maximum.active = FALSE;
+ preview_draw_selection(p); /* draw selections again */
+ }
+ }
+ else if (!p->scanning)
+ {
+ switch (event->type)
+ {
+ case GDK_UNMAP:
+ case GDK_MAP:
+ break;
+
+ case GDK_BUTTON_PRESS:
+ switch (p->mode)
+ {
+ case MODE_PIPETTE_WHITE:
+ {
+ if ( ( (((GdkEventButton *)event)->button == 1) || (((GdkEventButton *)event)->button == 2) ) &&
+ (p->image_data_raw) ) /* left or middle button */
+ {
+ int r,g,b;
+
+ preview_get_color(p, event->button.x, event->button.y, &r, &g, &b);
+
+ xsane.slider_gray.value[2] = sqrt( (r*r+g*g+b*b) / 3)/2.55;
+
+ if ( (!xsane.enhancement_rgb_default) && (((GdkEventButton *)event)->button == 2) ) /* middle button */
+ {
+ xsane.slider_red.value[2] = r/2.55;
+ xsane.slider_green.value[2] = g/2.55;
+ xsane.slider_blue.value[2] = b/2.55;
+ }
+ else
+ {
+ xsane.slider_red.value[2] = xsane.slider_gray.value[2];
+ xsane.slider_green.value[2] = xsane.slider_gray.value[2];
+ xsane.slider_blue.value[2] = xsane.slider_gray.value[2];
+ }
+
+ if (xsane.slider_gray.value[2] < 2)
+ {
+ xsane.slider_gray.value[2] = 2;
+ }
+ if (xsane.slider_gray.value[1] >= xsane.slider_gray.value[2])
+ {
+ xsane.slider_gray.value[1] = xsane.slider_gray.value[2]-1;
+ if (xsane.slider_gray.value[0] >= xsane.slider_gray.value[1])
+ {
+ xsane.slider_gray.value[0] = xsane.slider_gray.value[1]-1;
+ }
+ }
+
+ if (xsane.slider_red.value[2] < 2)
+ {
+ xsane.slider_red.value[2] = 2;
+ }
+ if (xsane.slider_red.value[1] >= xsane.slider_red.value[2])
+ {
+ xsane.slider_red.value[1] = xsane.slider_red.value[2]-1;
+ if (xsane.slider_red.value[0] >= xsane.slider_red.value[1])
+ {
+ xsane.slider_red.value[0] = xsane.slider_red.value[1]-1;
+ }
+ }
+
+ if (xsane.slider_green.value[2] < 2)
+ {
+ xsane.slider_green.value[2] = 2;
+ }
+ if (xsane.slider_green.value[1] >= xsane.slider_green.value[2])
+ {
+ xsane.slider_green.value[1] = xsane.slider_green.value[2]-1;
+ if (xsane.slider_green.value[0] >= xsane.slider_green.value[1])
+ {
+ xsane.slider_green.value[0] = xsane.slider_green.value[1]-1;
+ }
+ }
+
+ if (xsane.slider_blue.value[2] < 2)
+ {
+ xsane.slider_blue.value[2] = 2;
+ }
+ if (xsane.slider_blue.value[1] >= xsane.slider_blue.value[2])
+ {
+ xsane.slider_blue.value[1] = xsane.slider_blue.value[2]-1;
+ if (xsane.slider_blue.value[0] >= xsane.slider_blue.value[1])
+ {
+ xsane.slider_blue.value[0] = xsane.slider_blue.value[1]-1;
+ }
+ }
+
+ xsane_enhancement_by_histogram();
+ }
+
+ p->mode = MODE_NORMAL;
+
+ cursor = gdk_cursor_new(XSANE_CURSOR_PREVIEW);
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = XSANE_CURSOR_PREVIEW;
+ }
+ break;
+
+ case MODE_PIPETTE_GRAY:
+ {
+ if ( ( (((GdkEventButton *)event)->button == 1) || (((GdkEventButton *)event)->button == 2) ) &&
+ (p->image_data_raw) ) /* left or middle button */
+ {
+ int r,g,b;
+
+ preview_get_color(p, event->button.x, event->button.y, &r, &g, &b);
+
+ xsane.slider_gray.value[1] = sqrt( (r*r+g*g+b*b) / 3)/2.55;
+
+ if ( (!xsane.enhancement_rgb_default) && (((GdkEventButton *)event)->button == 2) ) /* middle button */
+ {
+ xsane.slider_red.value[1] = r/2.55;
+ xsane.slider_green.value[1] = g/2.55;
+ xsane.slider_blue.value[1] = b/2.55;
+ }
+ else
+ {
+ xsane.slider_red.value[1] = xsane.slider_gray.value[1];
+ xsane.slider_green.value[1] = xsane.slider_gray.value[1];
+ xsane.slider_blue.value[1] = xsane.slider_gray.value[1];
+ }
+
+ if (xsane.slider_gray.value[1] == 0)
+ {
+ xsane.slider_gray.value[1] += 1;
+ }
+ if (xsane.slider_gray.value[1] == 100)
+ {
+ xsane.slider_gray.value[1] -= 1;
+ }
+ if (xsane.slider_gray.value[1] >= xsane.slider_gray.value[2])
+ {
+ xsane.slider_gray.value[2] = xsane.slider_gray.value[1]+1;
+ }
+ if (xsane.slider_gray.value[1] <= xsane.slider_gray.value[0])
+ {
+ xsane.slider_gray.value[0] = xsane.slider_gray.value[1]-1;
+ }
+
+ if (xsane.slider_red.value[1] == 0)
+ {
+ xsane.slider_red.value[1] += 1;
+ }
+ if (xsane.slider_red.value[1] == 100)
+ {
+ xsane.slider_red.value[1] -= 1;
+ }
+ if (xsane.slider_red.value[1] >= xsane.slider_red.value[2])
+ {
+ xsane.slider_red.value[2] = xsane.slider_red.value[1]+1;
+ }
+ if (xsane.slider_red.value[1] <= xsane.slider_red.value[0])
+ {
+ xsane.slider_red.value[0] = xsane.slider_red.value[1]-1;
+ }
+
+ if (xsane.slider_green.value[1] == 0)
+ {
+ xsane.slider_green.value[1] += 1;
+ }
+ if (xsane.slider_green.value[1] == 100)
+ {
+ xsane.slider_green.value[1] -= 1;
+ }
+ if (xsane.slider_green.value[1] >= xsane.slider_green.value[2])
+ {
+ xsane.slider_green.value[2] = xsane.slider_green.value[1]+1;
+ }
+ if (xsane.slider_green.value[1] <= xsane.slider_green.value[0])
+ {
+ xsane.slider_green.value[0] = xsane.slider_green.value[1]-1;
+ }
+
+ if (xsane.slider_blue.value[1] == 0)
+ {
+ xsane.slider_blue.value[1] += 1;
+ }
+ if (xsane.slider_blue.value[1] == 100)
+ {
+ xsane.slider_blue.value[1] -= 1;
+ }
+ if (xsane.slider_blue.value[1] >= xsane.slider_blue.value[2])
+ {
+ xsane.slider_blue.value[2] = xsane.slider_blue.value[1]+1;
+ }
+ if (xsane.slider_blue.value[1] <= xsane.slider_blue.value[0])
+ {
+ xsane.slider_blue.value[0] = xsane.slider_blue.value[1]-1;
+ }
+
+ xsane_enhancement_by_histogram();
+ }
+
+ p->mode = MODE_NORMAL;
+
+ cursor = gdk_cursor_new(XSANE_CURSOR_PREVIEW);
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = XSANE_CURSOR_PREVIEW;
+ }
+ break;
+
+ case MODE_PIPETTE_BLACK:
+ {
+ if ( ( (((GdkEventButton *)event)->button == 1) || (((GdkEventButton *)event)->button == 2) ) &&
+ (p->image_data_raw) ) /* left or middle button */
+ {
+ int r,g,b;
+
+ preview_get_color(p, event->button.x, event->button.y, &r, &g, &b);
+
+ xsane.slider_gray.value[0] = sqrt( (r*r+g*g+b*b) / 3)/2.55;
+
+ if ( (!xsane.enhancement_rgb_default) && (((GdkEventButton *)event)->button == 2) ) /* middle button */
+ {
+ xsane.slider_red.value[0] = r/2.55;
+ xsane.slider_green.value[0] = g/2.55;
+ xsane.slider_blue.value[0] = b/2.55;
+ }
+ else
+ {
+ xsane.slider_red.value[0] = xsane.slider_gray.value[0];
+ xsane.slider_green.value[0] = xsane.slider_gray.value[0];
+ xsane.slider_blue.value[0] = xsane.slider_gray.value[0];
+ }
+
+ if (xsane.slider_gray.value[0] > 98)
+ {
+ xsane.slider_gray.value[0] = 98;
+ }
+ if (xsane.slider_gray.value[1] <= xsane.slider_gray.value[0])
+ {
+ xsane.slider_gray.value[1] = xsane.slider_gray.value[0]+1;
+ if (xsane.slider_gray.value[2] <= xsane.slider_gray.value[1])
+ {
+ xsane.slider_gray.value[2] = xsane.slider_gray.value[1]+1;
+ }
+ }
+
+ if (xsane.slider_red.value[0] > 98)
+ {
+ xsane.slider_red.value[0] = 98;
+ }
+ if (xsane.slider_red.value[1] <= xsane.slider_red.value[0])
+ {
+ xsane.slider_red.value[1] = xsane.slider_red.value[0]+1;
+ if (xsane.slider_red.value[2] <= xsane.slider_red.value[1])
+ {
+ xsane.slider_red.value[2] = xsane.slider_red.value[1]+1;
+ }
+ }
+
+ if (xsane.slider_green.value[0] > 98)
+ {
+ xsane.slider_green.value[0] = 98;
+ }
+ if (xsane.slider_green.value[1] <= xsane.slider_green.value[0])
+ {
+ xsane.slider_green.value[1] = xsane.slider_green.value[0]+1;
+ if (xsane.slider_green.value[2] <= xsane.slider_green.value[1])
+ {
+ xsane.slider_green.value[2] = xsane.slider_green.value[1]+1;
+ }
+ }
+
+ if (xsane.slider_blue.value[0] > 98)
+ {
+ xsane.slider_blue.value[0] = 98;
+ }
+ if (xsane.slider_blue.value[1] <= xsane.slider_blue.value[0])
+ {
+ xsane.slider_blue.value[1] = xsane.slider_blue.value[0]+1;
+ if (xsane.slider_blue.value[2] <= xsane.slider_blue.value[1])
+ {
+ xsane.slider_blue.value[2] = xsane.slider_blue.value[1]+1;
+ }
+ }
+
+ xsane_enhancement_by_histogram();
+ }
+
+ p->mode = MODE_NORMAL;
+
+ cursor = gdk_cursor_new(XSANE_CURSOR_PREVIEW);
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = XSANE_CURSOR_PREVIEW;
+ }
+ break;
+
+ case MODE_NORMAL:
+ {
+ switch (((GdkEventButton *)event)->button)
+ {
+ case 1: /* left button */
+ p->selection_xedge = -1;
+ if ( (preview_selection[0] - SELECTION_RANGE_OUT < event->button.x) && (event->button.x < preview_selection[0] + SELECTION_RANGE_IN) ) /* left */
+ {
+ p->selection_xedge = 0;
+ }
+ else if ( (preview_selection[2] - SELECTION_RANGE_IN < event->button.x) && (event->button.x < preview_selection[2] + SELECTION_RANGE_OUT) ) /* right */
+ {
+ p->selection_xedge = 2;
+ }
+
+ p->selection_yedge = -1;
+ if ( (preview_selection[1] - SELECTION_RANGE_OUT < event->button.y) && (event->button.y < preview_selection[1] + SELECTION_RANGE_IN) ) /* top */
+ {
+ p->selection_yedge = 1;
+ }
+ else if ( (preview_selection[3] - SELECTION_RANGE_IN < event->button.y) && (event->button.y < preview_selection[3] + SELECTION_RANGE_OUT) ) /* bottom */
+ {
+ p->selection_yedge = 3;
+ }
+
+ if ( (p->selection_xedge != -1) && (p->selection_yedge != -1) ) /* move edge */
+ {
+ p->selection_drag_edge = TRUE;
+ p->selection.coordinate[p->selection_xedge] = p->surface[0] + event->button.x / xscale;
+ p->selection.coordinate[p->selection_yedge] = p->surface[1] + event->button.y / yscale;
+ preview_draw_selection(p);
+ }
+ else /* select new area */
+ {
+ p->selection_xedge = 2;
+ p->selection_yedge = 3;
+ p->selection.coordinate[0] = p->surface[0] + event->button.x / xscale;
+ p->selection.coordinate[1] = p->surface[1] + event->button.y / yscale;
+ p->selection_drag = TRUE;
+
+ cursornr = GDK_CROSS;
+ cursor = gdk_cursor_new(cursornr); /* set curosr */
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = cursornr;
+ }
+ break;
+
+ case 2: /* middle button */
+ case 3: /* right button */
+ if ( (preview_selection[0]-SELECTION_RANGE_OUT < event->button.x) &&
+ (preview_selection[2]+SELECTION_RANGE_OUT > event->button.x) &&
+ (preview_selection[1]-SELECTION_RANGE_OUT < event->button.y) &&
+ (preview_selection[3]+SELECTION_RANGE_OUT > event->button.y) )
+ {
+ p->selection_drag = TRUE;
+ p->selection_xpos = event->button.x;
+ p->selection_ypos = event->button.y;
+
+ cursornr = GDK_HAND2;
+ cursor = gdk_cursor_new(cursornr); /* set curosr */
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = cursornr;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ break;
+
+ case GDK_BUTTON_RELEASE:
+ switch (((GdkEventButton *)event)->button)
+ {
+ case 1: /* left button */
+ case 2: /* middle button */
+ case 3: /* right button */
+ if (p->selection_drag)
+ {
+ cursornr = XSANE_CURSOR_PREVIEW;
+ cursor = gdk_cursor_new(cursornr); /* set curosr */
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = cursornr;
+ }
+
+ if ( (p->selection_drag) || (p->selection_drag_edge) )
+ {
+
+ if (((GdkEventButton *)event)->button == 1) /* left button */
+ {
+ p->selection.coordinate[p->selection_xedge] = p->surface[0] + event->button.x / xscale;
+ p->selection.coordinate[p->selection_yedge] = p->surface[1] + event->button.y / yscale;
+ }
+
+ p->selection_drag_edge = FALSE;
+ p->selection_drag = FALSE;
+
+ preview_order_selection(p);
+ preview_bound_selection(p);
+ preview_update_maximum_output_size(p);
+ preview_draw_selection(p);
+ preview_establish_selection(p);
+ }
+ default:
+ break;
+ }
+ break;
+
+ case GDK_MOTION_NOTIFY:
+ switch (((GdkEventMotion *)event)->state)
+ {
+ case 256: /* left button */
+ if (p->selection_drag_edge)
+ {
+ p->selection.active = TRUE;
+ p->selection.coordinate[p->selection_xedge] = p->surface[0] + event->button.x / xscale;
+ p->selection.coordinate[p->selection_yedge] = p->surface[1] + event->button.y / yscale;
+
+ preview_order_selection(p);
+ preview_bound_selection(p);
+ preview_update_maximum_output_size(p);
+ preview_draw_selection(p);
+
+ if ((preferences.gtk_update_policy == GTK_UPDATE_CONTINUOUS) && (event_count == 1))
+ {
+ preview_establish_selection(p);
+ }
+ else if ((preferences.gtk_update_policy == GTK_UPDATE_DELAYED) && (event_count == 1))
+ {
+ preview_establish_selection(p);
+ }
+ }
+
+ if (p->selection_drag)
+ {
+ p->selection.active = TRUE;
+ p->selection.coordinate[p->selection_xedge] = p->surface[0] + event->motion.x / xscale;
+ p->selection.coordinate[p->selection_yedge] = p->surface[1] + event->motion.y / yscale;
+
+ preview_order_selection(p);
+ preview_bound_selection(p);
+ preview_update_maximum_output_size(p);
+ preview_draw_selection(p);
+
+ if ((preferences.gtk_update_policy == GTK_UPDATE_CONTINUOUS) && (event_count == 1))
+ {
+ preview_establish_selection(p);
+ }
+ else if ((preferences.gtk_update_policy == GTK_UPDATE_DELAYED) && (event_count == 1))
+ {
+ preview_establish_selection(p);
+ }
+ }
+
+ cursornr = p->cursornr;
+
+ if ( ( (preview_selection[0] - SELECTION_RANGE_OUT < event->button.x) && (event->button.x < preview_selection[0] + SELECTION_RANGE_IN) ) && /* left */
+ ( (preview_selection[1] - SELECTION_RANGE_OUT < event->button.y) && (event->button.y < preview_selection[1] + SELECTION_RANGE_IN) ) ) /* top */
+ {
+ cursornr = GDK_TOP_LEFT_CORNER;
+ }
+ else if ( ( (preview_selection[2] - SELECTION_RANGE_IN < event->button.x) && (event->button.x < preview_selection[2] + SELECTION_RANGE_OUT) ) && /* right */
+ ( (preview_selection[1] - SELECTION_RANGE_OUT < event->button.y) && (event->button.y < preview_selection[1] + SELECTION_RANGE_IN) ) ) /* top */
+ {
+ cursornr = GDK_TOP_RIGHT_CORNER;
+ }
+ else if ( ( (preview_selection[0] - SELECTION_RANGE_OUT < event->button.x) && (event->button.x < preview_selection[0] + SELECTION_RANGE_IN) ) && /* left */
+ ( (preview_selection[3] - SELECTION_RANGE_IN < event->button.y) && (event->button.y < preview_selection[3] + SELECTION_RANGE_OUT) ) ) /* bottom */
+ {
+ cursornr = GDK_BOTTOM_LEFT_CORNER;
+ }
+ else if ( ( (preview_selection[2] - SELECTION_RANGE_IN < event->button.x) && (event->button.x < preview_selection[2] + SELECTION_RANGE_OUT) ) && /* right */
+ ( (preview_selection[3] - SELECTION_RANGE_IN < event->button.y) && (event->button.y < preview_selection[3] + SELECTION_RANGE_OUT) ) ) /* bottom */
+ {
+ cursornr = GDK_BOTTOM_RIGHT_CORNER;
+ }
+
+ if (cursornr != p->cursornr)
+ {
+ cursor = gdk_cursor_new(cursornr); /* set curosr */
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = cursornr;
+ }
+ break;
+
+ case 512: /* middle button */
+ case 1024: /* right button */
+ if (p->selection_drag)
+ {
+ int dx, dy;
+
+ dx = p->selection_xpos - event->motion.x;
+ dy = p->selection_ypos - event->motion.y;
+
+ p->selection_xpos = event->motion.x;
+ p->selection_ypos = event->motion.y;
+
+ p->selection.active = TRUE;
+ p->selection.coordinate[0] -= dx / xscale;
+ p->selection.coordinate[1] -= dy / yscale;
+ p->selection.coordinate[2] -= dx / xscale;
+ p->selection.coordinate[3] -= dy / yscale;
+
+ preview_bound_selection(p);
+ preview_update_maximum_output_size(p);
+ preview_draw_selection(p);
+
+ if ((preferences.gtk_update_policy == GTK_UPDATE_CONTINUOUS) && (event_count == 1))
+ {
+ preview_establish_selection(p);
+ }
+ else if ((preferences.gtk_update_policy == GTK_UPDATE_DELAYED) && (event_count == 1))
+ {
+ preview_establish_selection(p);
+ }
+ }
+ break;
+
+ default:
+ if ( ( (preview_selection[0] - SELECTION_RANGE_OUT < event->button.x) && (event->button.x < preview_selection[0] + SELECTION_RANGE_IN) ) && /* left */
+ ( (preview_selection[1] - SELECTION_RANGE_OUT < event->button.y) && (event->button.y < preview_selection[1] + SELECTION_RANGE_IN) ) ) /* top */
+ {
+ cursornr = GDK_TOP_LEFT_CORNER;
+ }
+ else if ( ( (preview_selection[2] - SELECTION_RANGE_IN < event->button.x) && (event->button.x < preview_selection[2] + SELECTION_RANGE_OUT) ) && /* right */
+ ( (preview_selection[1] - SELECTION_RANGE_OUT < event->button.y) && (event->button.y < preview_selection[1] + SELECTION_RANGE_IN) ) ) /* top */
+ {
+ cursornr = GDK_TOP_RIGHT_CORNER;
+ }
+ else if ( ( (preview_selection[0] - SELECTION_RANGE_OUT < event->button.x) && (event->button.x < preview_selection[0] + SELECTION_RANGE_IN) ) && /* left */
+ ( (preview_selection[3] - SELECTION_RANGE_IN < event->button.y) && (event->button.y < preview_selection[3] + SELECTION_RANGE_OUT) ) ) /* bottom */
+ {
+ cursornr = GDK_BOTTOM_LEFT_CORNER;
+ }
+ else if ( ( (preview_selection[2] - SELECTION_RANGE_IN < event->button.x) && (event->button.x < preview_selection[2] + SELECTION_RANGE_OUT) ) && /* right */
+ ( (preview_selection[3] - SELECTION_RANGE_IN < event->button.y) && (event->button.y < preview_selection[3] + SELECTION_RANGE_OUT) ) ) /* bottom */
+ {
+ cursornr = GDK_BOTTOM_RIGHT_CORNER;
+ }
+ else
+ {
+ cursornr = XSANE_CURSOR_PREVIEW;
+ }
+
+ if ((cursornr != p->cursornr) && (p->cursornr != -1))
+ {
+ cursor = gdk_cursor_new(cursornr); /* set curosr */
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = cursornr;
+ }
+ break;
+ }
+ break;
+
+ default:
+#if 0
+ fprintf(stderr, "preview_event_handler: unhandled event type %d\n", event->type);
+#endif
+ break;
+ }
+ }
+
+ while (gtk_events_pending()) /* make sure all selection draw is done now */
+ {
+ gtk_main_iteration();
+ }
+
+ event_count--;
+
+ return FALSE;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_start_button_clicked(GtkWidget *widget, gpointer data)
+{
+ preview_scan(data);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_cancel_button_clicked(GtkWidget *widget, gpointer data)
+{
+ preview_scan_done(data);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+Preview *preview_new(GSGDialog *dialog)
+{
+ static int first_time = 1;
+ GtkWidget *table, *frame;
+ GtkSignalFunc signal_func;
+ GtkWidgetClass *class;
+ GtkBox *vbox, *hbox;
+ GdkCursor *cursor;
+ GtkWidget *preset_area_option_menu, *preset_area_menu, *preset_area_item;
+ Preview *p;
+ int i;
+ char buf[256];
+
+ p = malloc(sizeof(*p));
+ if (!p)
+ {
+ return 0;
+ }
+ memset(p, 0, sizeof(*p));
+
+ p->mode = MODE_NORMAL; /* no pipette functions etc */
+ p->dialog = dialog;
+ p->input_tag = -1;
+
+ if (first_time)
+ {
+ first_time = 0;
+ gtk_preview_set_gamma(1.0);
+ gtk_preview_set_install_cmap(preferences.preview_own_cmap);
+ }
+
+ p->preset_width = INF; /* use full scanarea */
+ p->preset_height = INF; /* use full scanarea */
+
+ p->maximum_output_width = INF; /* full output with */
+ p->maximum_output_height = INF; /* full output height */
+
+#ifndef XSERVER_WITH_BUGGY_VISUALS
+ gtk_widget_push_visual(gtk_preview_get_visual());
+#endif
+ gtk_widget_push_colormap(gtk_preview_get_cmap());
+
+ snprintf(buf, sizeof(buf), "%s %s", WINDOW_PREVIEW, device_text);
+ p->top = gtk_dialog_new();
+ gtk_window_set_title(GTK_WINDOW(p->top), buf);
+ vbox = GTK_BOX(GTK_DIALOG(p->top)->vbox);
+ hbox = GTK_BOX(GTK_DIALOG(p->top)->action_area);
+
+ xsane_set_window_icon(p->top, 0);
+
+ /* top hbox for pipette buttons */
+ p->button_box = gtk_hbox_new(FALSE, 5);
+ gtk_container_set_border_width(GTK_CONTAINER(p->button_box), 4);
+ gtk_box_pack_start(GTK_BOX(vbox), p->button_box, FALSE, FALSE, 0);
+
+ /* White, gray and black pipette button */
+ p->pipette_white = xsane_button_new_with_pixmap(p->button_box, pipette_white_xpm, DESC_PIPETTE_WHITE, (GtkSignalFunc) preview_pipette_white, p);
+ p->pipette_gray = xsane_button_new_with_pixmap(p->button_box, pipette_gray_xpm, DESC_PIPETTE_GRAY, (GtkSignalFunc) preview_pipette_gray, p);
+ p->pipette_black = xsane_button_new_with_pixmap(p->button_box, pipette_black_xpm, DESC_PIPETTE_BLACK, (GtkSignalFunc) preview_pipette_black, p);
+
+ /* Zoom not, zoom out and zoom in button */
+ p->zoom_not = xsane_button_new_with_pixmap(p->button_box, zoom_not_xpm, DESC_ZOOM_FULL, (GtkSignalFunc) preview_zoom_not, p);
+ p->zoom_out = xsane_button_new_with_pixmap(p->button_box, zoom_out_xpm, DESC_ZOOM_OUT, (GtkSignalFunc) preview_zoom_out, p);
+ p->zoom_in = xsane_button_new_with_pixmap(p->button_box, zoom_in_xpm, DESC_ZOOM_IN, (GtkSignalFunc) preview_zoom_in, p);
+ p->zoom_undo = xsane_button_new_with_pixmap(p->button_box, zoom_undo_xpm, DESC_ZOOM_UNDO, (GtkSignalFunc) preview_zoom_undo, p);
+
+ gtk_widget_set_sensitive(p->zoom_not, FALSE); /* no zoom at this point, so no zoom not */
+ gtk_widget_set_sensitive(p->zoom_out, FALSE); /* no zoom at this point, so no zoom out */
+ gtk_widget_set_sensitive(p->zoom_undo, FALSE); /* no zoom at this point, so no zoom undo */
+
+
+
+ xsane_button_new_with_pixmap(p->button_box, full_preview_area_xpm, DESC_FULL_PREVIEW_AREA,
+ (GtkSignalFunc) preview_full_preview_area, p);
+
+ /* select maximum scanarea */
+ preset_area_menu = gtk_menu_new();
+
+ for (i = 0; i < PRESET_AREA_ITEMS; ++i)
+ {
+ preset_area_item = gtk_menu_item_new_with_label(preset_area[i].name);
+ gtk_container_add(GTK_CONTAINER(preset_area_menu), preset_area_item);
+ gtk_signal_connect(GTK_OBJECT(preset_area_item), "activate", (GtkSignalFunc) preview_preset_area_callback, p);
+ gtk_object_set_data(GTK_OBJECT(preset_area_item), "Selection", (void *) i);
+
+ gtk_widget_show(preset_area_item);
+ }
+
+ preset_area_option_menu = gtk_option_menu_new();
+ gtk_box_pack_start(GTK_BOX(p->button_box), preset_area_option_menu, FALSE, FALSE, 2);
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(preset_area_option_menu), preset_area_menu);
+ gtk_option_menu_set_history(GTK_OPTION_MENU(preset_area_option_menu), 0); /* full area */
+/* xsane_back_gtk_set_tooltip(tooltips, preset_area_option_menu, desc); */
+
+ gtk_widget_show(preset_area_option_menu);
+ p->preset_area_option_menu = preset_area_option_menu;
+
+ gtk_widget_show(p->button_box);
+
+
+
+ /* construct the preview area (table with sliders & preview window) */
+ table = gtk_table_new(2, 2, /* homogeneous */ FALSE);
+ gtk_table_set_col_spacing(GTK_TABLE(table), 0, 1);
+ gtk_table_set_row_spacing(GTK_TABLE(table), 0, 1);
+ gtk_container_set_border_width(GTK_CONTAINER(table), 2);
+ gtk_box_pack_start(vbox, table, /* expand */ TRUE, /* fill */ TRUE, /* padding */ 0);
+
+ /* the empty box in the top-left corner */
+ frame = gtk_frame_new(/* label */ 0);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
+ gtk_table_attach(GTK_TABLE(table), frame, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
+
+ /* the horizontal ruler */
+ p->hruler = gtk_hruler_new();
+ gtk_table_attach(GTK_TABLE(table), p->hruler, 1, 2, 0, 1, GTK_FILL, 0, 0, 0);
+
+ /* the vertical ruler */
+ p->vruler = gtk_vruler_new();
+ gtk_table_attach(GTK_TABLE(table), p->vruler, 0, 1, 1, 2, 0, GTK_FILL, 0, 0);
+
+ /* the preview area */
+
+ p->window = gtk_preview_new(GTK_PREVIEW_COLOR);
+ gtk_preview_set_expand(GTK_PREVIEW(p->window), TRUE);
+ gtk_widget_set_events(p->window,
+ GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
+ gtk_signal_connect(GTK_OBJECT(p->window), "event", (GtkSignalFunc) preview_event_handler, p);
+ gtk_signal_connect_after(GTK_OBJECT(p->window), "expose_event", (GtkSignalFunc) preview_expose_handler, p);
+ gtk_signal_connect_after(GTK_OBJECT(p->window), "size_allocate", (GtkSignalFunc) preview_area_resize, 0);
+ gtk_object_set_data(GTK_OBJECT(p->window), "PreviewPointer", p);
+
+ /* Connect the motion-notify events of the preview area with the rulers. Nifty stuff! */
+
+ class = GTK_WIDGET_CLASS(GTK_OBJECT(p->hruler)->klass);
+ signal_func = (GtkSignalFunc) class->motion_notify_event;
+ gtk_signal_connect_object(GTK_OBJECT(p->window), "motion_notify_event", signal_func, GTK_OBJECT(p->hruler));
+
+ class = GTK_WIDGET_CLASS(GTK_OBJECT(p->vruler)->klass);
+ signal_func = (GtkSignalFunc) class->motion_notify_event;
+ gtk_signal_connect_object(GTK_OBJECT(p->window), "motion_notify_event", signal_func, GTK_OBJECT(p->vruler));
+
+ p->viewport = gtk_frame_new(/* label */ 0);
+ gtk_frame_set_shadow_type(GTK_FRAME(p->viewport), GTK_SHADOW_IN);
+ gtk_container_add(GTK_CONTAINER(p->viewport), p->window);
+
+ gtk_table_attach(GTK_TABLE(table), p->viewport, 1, 2, 1, 2,
+ GTK_FILL | GTK_EXPAND | GTK_SHRINK,
+ GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 0);
+
+ preview_update_surface(p, 0);
+
+ /* fill in action area: */
+
+ /* Start button */
+ p->start = gtk_button_new_with_label(BUTTON_PREVIEW_ACQUIRE);
+ gtk_signal_connect(GTK_OBJECT(p->start), "clicked", (GtkSignalFunc) preview_start_button_clicked, p);
+ gtk_box_pack_start(GTK_BOX(hbox), p->start, TRUE, TRUE, 0);
+
+ /* Cancel button */
+ p->cancel = gtk_button_new_with_label(BUTTON_PREVIEW_CANCEL);
+ gtk_signal_connect(GTK_OBJECT(p->cancel), "clicked", (GtkSignalFunc) preview_cancel_button_clicked, p);
+ gtk_box_pack_start(GTK_BOX(hbox), p->cancel, TRUE, TRUE, 0);
+ gtk_widget_set_sensitive(p->cancel, FALSE);
+
+ gtk_widget_show(p->cancel);
+ gtk_widget_show(p->start);
+ gtk_widget_show(p->viewport);
+ gtk_widget_show(p->window);
+ gtk_widget_show(p->hruler);
+ gtk_widget_show(p->vruler);
+ gtk_widget_show(frame);
+ gtk_widget_show(table);
+ gtk_widget_show(p->top);
+
+ cursor = gdk_cursor_new(XSANE_CURSOR_PREVIEW); /* set default curosr */
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = XSANE_CURSOR_PREVIEW;
+
+ gtk_widget_pop_colormap();
+#ifndef XSERVER_WITH_BUGGY_VISUALS
+ gtk_widget_pop_visual();
+#endif
+ return p;
+}
+
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_area_correct(Preview *p)
+{
+ float width, height, max_width, max_height;
+
+ width = p->preview_width;
+ height = p->preview_height;
+ max_width = p->preview_window_width;
+ max_height = p->preview_window_height;
+
+ width = max_width;
+ height = width / p->aspect;
+
+ if (height > max_height)
+ {
+ height = max_height;
+ width = height * p->aspect;
+ }
+
+ p->preview_width = width + 0.5;
+ p->preview_height = height + 0.5;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void preview_update_surface(Preview *p, int surface_changed)
+{
+ float val;
+ float width, height;
+ float max_width, max_height;
+ float preset_width, preset_height;
+ const SANE_Option_Descriptor *opt;
+ int i;
+ SANE_Value_Type type;
+ SANE_Unit unit;
+ double min, max;
+
+ unit = SANE_UNIT_PIXEL;
+ type = SANE_TYPE_INT;
+
+ for (i = 0; i < 4; ++i) /* test if surface (max vals of scanarea) has changed */
+ {
+/* val = (i & 2) ? INF : -INF; */
+ val = (i & 2) ? INF : 0;
+
+ if (p->dialog->well_known.coord[i] > 0)
+ {
+ opt = sane_get_option_descriptor(p->dialog->dev, p->dialog->well_known.coord[i]);
+ assert(opt->unit == SANE_UNIT_PIXEL || opt->unit == SANE_UNIT_MM);
+ unit = opt->unit;
+ type = opt->type;
+
+ xsane_get_bounds(opt, &min, &max);
+
+ if (i & 2)
+ {
+ val = max;
+ }
+ else
+ {
+ val = min;
+ }
+ }
+
+ if (p->max_scanner_surface[i] != val)
+ {
+ surface_changed = 2;
+ p->max_scanner_surface[i] = val;
+ }
+ }
+
+ if (surface_changed == 2) /* redefine all surface subparts */
+ {
+ for (i = 0; i < 4; i++)
+ {
+ val = p->max_scanner_surface[i];
+ p->scanner_surface[i] = val;
+ p->surface[i] = val;
+ p->image_surface[i] = val;
+ }
+ }
+
+ max_width = p->max_scanner_surface[xsane_back_gtk_BR_X] - p->max_scanner_surface[xsane_back_gtk_TL_X];
+ max_height = p->max_scanner_surface[xsane_back_gtk_BR_Y] - p->max_scanner_surface[xsane_back_gtk_TL_Y];
+
+ width = p->scanner_surface[xsane_back_gtk_BR_X] - p->scanner_surface[xsane_back_gtk_TL_X];
+ height = p->scanner_surface[xsane_back_gtk_BR_Y] - p->scanner_surface[xsane_back_gtk_TL_Y];
+
+ preset_width = p->preset_width;
+ preset_height = p->preset_height;
+
+ if (preset_width > max_width)
+ {
+ preset_width = max_width;
+ }
+
+ if (preset_height > max_height)
+ {
+ preset_height = max_height;
+ }
+
+ if ( (width != preset_width) || (height != preset_height) )
+ {
+ p->scanner_surface[xsane_back_gtk_TL_X] = p->scanner_surface[xsane_back_gtk_TL_X];
+ p->surface[xsane_back_gtk_TL_X] = p->scanner_surface[xsane_back_gtk_TL_X];
+ p->image_surface[xsane_back_gtk_TL_X] = p->scanner_surface[xsane_back_gtk_TL_X];
+
+ p->scanner_surface[xsane_back_gtk_BR_X] = p->scanner_surface[xsane_back_gtk_TL_X] + preset_width;
+ p->surface[xsane_back_gtk_BR_X] = p->scanner_surface[xsane_back_gtk_TL_X] + preset_width;
+ p->image_surface[xsane_back_gtk_BR_X] = p->scanner_surface[xsane_back_gtk_TL_X] + preset_width;
+
+ p->scanner_surface[xsane_back_gtk_TL_Y] = p->scanner_surface[xsane_back_gtk_TL_Y];
+ p->surface[xsane_back_gtk_TL_Y] = p->scanner_surface[xsane_back_gtk_TL_Y];
+ p->image_surface[xsane_back_gtk_TL_Y] = p->scanner_surface[xsane_back_gtk_TL_Y];
+
+ p->scanner_surface[xsane_back_gtk_BR_Y] = p->scanner_surface[xsane_back_gtk_TL_Y] + preset_height;
+ p->surface[xsane_back_gtk_BR_Y] = p->scanner_surface[xsane_back_gtk_TL_Y] + preset_height;
+ p->image_surface[xsane_back_gtk_BR_Y] = p->scanner_surface[xsane_back_gtk_TL_Y] + preset_height;
+
+ surface_changed = 1;
+ }
+
+ if (p->surface_unit != unit)
+ {
+ surface_changed = 1;
+ p->surface_unit = unit;
+ }
+
+ if (p->surface_unit == SANE_UNIT_MM)
+ {
+ gtk_widget_set_sensitive(p->preset_area_option_menu, TRUE); /* enable preset area */
+ }
+ else
+ {
+ gtk_widget_set_sensitive(p->preset_area_option_menu, FALSE); /* disable preset area */
+ }
+
+ if (p->surface_type != type)
+ {
+ surface_changed = 1;
+ p->surface_type = type;
+ }
+
+ if (surface_changed)
+ {
+ /* guess the initial preview window size: */
+
+ width = p->surface[xsane_back_gtk_BR_X] - p->surface[xsane_back_gtk_TL_X];
+ height = p->surface[xsane_back_gtk_BR_Y] - p->surface[xsane_back_gtk_TL_Y];
+
+ if (p->surface_type == SANE_TYPE_INT)
+ {
+ width += 1.0;
+ height += 1.0;
+ }
+ else
+ {
+ width += SANE_UNFIX(1.0);
+ height += SANE_UNFIX(1.0);
+ }
+
+ assert(width > 0.0 && height > 0.0);
+
+ if (width >= INF || height >= INF)
+ {
+ p->aspect = 1.0;
+ }
+ else
+ {
+ p->aspect = width/height;
+ }
+ }
+ else if ( (p->image_height) && (p->image_width) )
+ {
+ p->aspect = p->image_width/(float) p->image_height;
+ }
+
+ if ( (surface_changed) && (p->preview_window_width == 0) )
+ {
+ p->preview_window_width = 0.5 * gdk_screen_width();
+ p->preview_window_height = 0.5 * gdk_screen_height();
+ }
+
+ preview_area_correct(p);
+
+ if (surface_changed)
+ {
+ gtk_widget_set_usize(GTK_WIDGET(p->window), p->preview_width, p->preview_height);
+ /* preview_area_resize is automatically called by signal handler */
+
+ preview_bound_selection(p); /* make sure selection is not larger than surface */
+ preview_restore_image(p); /* draw selected surface of the image */
+ }
+ else
+ {
+ preview_update_selection(p);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void preview_scan(Preview *p)
+{
+ double min, max, swidth, sheight, width, height, dpi = 0;
+ const SANE_Option_Descriptor *opt;
+ gint gwidth, gheight;
+ int i;
+
+ xsane.block_update_param = TRUE; /* do not change parameters each time */
+
+ preview_save_option(p, p->dialog->well_known.dpi, &p->saved_dpi, &p->saved_dpi_valid);
+ preview_save_option(p, p->dialog->well_known.dpi_x, &p->saved_dpi_x, &p->saved_dpi_x_valid);
+ preview_save_option(p, p->dialog->well_known.dpi_y, &p->saved_dpi_y, &p->saved_dpi_y_valid);
+
+ for (i = 0; i < 4; ++i)
+ {
+ preview_save_option(p, p->dialog->well_known.coord[i], &p->saved_coord[i], p->saved_coord_valid + i);
+ }
+ preview_save_option(p, p->dialog->well_known.bit_depth, &p->saved_bit_depth, &p->saved_bit_depth_valid);
+
+ /* determine dpi, if necessary: */
+
+ if (p->dialog->well_known.dpi > 0)
+ {
+ opt = sane_get_option_descriptor(p->dialog->dev, p->dialog->well_known.dpi);
+
+ gwidth = p->preview_width;
+ gheight = p->preview_height;
+
+ height = gheight;
+ width = height * p->aspect;
+
+ if (width > gwidth)
+ {
+ width = gwidth;
+ height = width / p->aspect;
+ }
+
+ swidth = (p->surface[xsane_back_gtk_BR_X] - p->surface[xsane_back_gtk_TL_X]);
+
+ if (swidth < INF)
+ {
+ dpi = MM_PER_INCH * width/swidth;
+ }
+ else
+ {
+ sheight = (p->surface[xsane_back_gtk_BR_Y] - p->surface[xsane_back_gtk_TL_Y]);
+ if (sheight < INF)
+ {
+ dpi = MM_PER_INCH * height/sheight;
+ }
+ else
+ {
+ dpi = 18.0;
+ }
+ }
+
+ xsane_get_bounds(opt, &min, &max);
+
+ if (dpi < min)
+ {
+ dpi = min;
+ }
+
+ if (dpi > max)
+ {
+ dpi = max;
+ }
+
+ xsane_set_resolution(p->dialog->well_known.dpi, dpi); /* set resolution to dpi or next higher value that is available */
+ xsane_set_resolution(p->dialog->well_known.dpi_x, dpi); /* set resolution to dpi or next higher value that is available */
+ xsane_set_resolution(p->dialog->well_known.dpi_y, dpi); /* set resolution to dpi or next higher value that is available */
+ }
+
+ /* set the scan window (necessary since backends may default to non-maximum size): */
+
+ for (i = 0; i < 4; ++i)
+ {
+ preview_set_option_float(p, p->dialog->well_known.coord[i], p->surface[i]);
+ }
+
+ preview_set_option_bool(p, p->dialog->well_known.preview, SANE_TRUE);
+
+ if ( (p->saved_bit_depth > 8) && (p->saved_bit_depth_valid) ) /* don't scan with more than 8bpp */
+ {
+ preview_set_option_int(p, p->dialog->well_known.bit_depth, 8);
+ }
+
+ xsane.block_update_param = FALSE;
+
+ /* OK, all set to go */
+ preview_scan_start(p);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_save_image_file(Preview *p, FILE *out)
+{
+ if (out)
+ {
+ /* always save it as a PPM image: */
+ fprintf(out, "P6\n# surface: %g %g %g %g %u %u\n%d %d\n255\n",
+ p->surface[0], p->surface[1], p->surface[2], p->surface[3],
+ p->surface_type, p->surface_unit, p->image_width, p->image_height);
+
+ fwrite(p->image_data_raw, 3, p->image_width*p->image_height, out);
+ fclose(out);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_save_image(Preview *p)
+{
+ char filename[PATH_MAX];
+ FILE *out;
+ int status;
+
+ if (!p->image_data_enh)
+ {
+ return;
+ }
+
+ if ( GROSSLY_EQUAL(p->max_scanner_surface[0], p->surface[0]) && /* full device surface */
+ GROSSLY_EQUAL(p->max_scanner_surface[1], p->surface[1]) &&
+ GROSSLY_EQUAL(p->max_scanner_surface[2], p->surface[2]) &&
+ GROSSLY_EQUAL(p->max_scanner_surface[3], p->surface[3]) )
+ {
+ status = preview_make_image_path(p, sizeof(filename), filename, 0);
+ }
+ else if ( GROSSLY_EQUAL(p->scanner_surface[0], p->surface[0]) && /* user defined surface */
+ GROSSLY_EQUAL(p->scanner_surface[1], p->surface[1]) &&
+ GROSSLY_EQUAL(p->scanner_surface[2], p->surface[2]) &&
+ GROSSLY_EQUAL(p->scanner_surface[3], p->surface[3]) )
+ {
+ status = preview_make_image_path(p, sizeof(filename), filename, 1);
+ }
+ else /* zoom area */
+ {
+ status = preview_make_image_path(p, sizeof(filename), filename, 2);
+ }
+
+ if (status >= 0)
+ {
+ /* save preview image */
+ remove(filename); /* remove existing preview */
+ umask(0177); /* creare temporary file with "-rw-------" permissions */
+ out = fopen(filename, "w");
+ umask(XSANE_DEFAULT_UMASK); /* define new file permissions */
+
+ preview_save_image_file(p, out);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void preview_destroy(Preview *p)
+{
+ int level;
+ int status;
+ char filename[PATH_MAX];
+
+ if (p->scanning)
+ {
+ preview_scan_done(p); /* don't save partial window */
+ }
+ else
+ {
+ preview_save_image(p);
+ }
+
+ if (!preferences.preserve_preview)
+ {
+ for(level = 0; level <= 2; level++)
+ {
+ status = preview_make_image_path(p, sizeof(filename), filename, level);
+ if (status >= 0)
+ {
+ remove(filename); /* remove existing preview */
+ }
+ }
+ }
+
+ if (p->image_data_enh)
+ {
+ free(p->image_data_enh);
+ p->image_data_enh = 0;
+ }
+
+ if (p->image_data_raw)
+ {
+ free(p->image_data_raw);
+ p->image_data_raw = 0;
+ }
+
+ if (p->preview_row)
+ {
+ free(p->preview_row);
+ p->preview_row = 0;
+ }
+
+ if (p->gc_selection)
+ {
+ gdk_gc_destroy(p->gc_selection);
+ }
+
+ if (p->gc_selection_maximum)
+ {
+ gdk_gc_destroy(p->gc_selection_maximum);
+ }
+
+ if (p->top)
+ {
+ gtk_widget_destroy(p->top);
+ }
+ free(p);
+
+ p = 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_zoom_not(GtkWidget *window, gpointer data)
+{
+ Preview *p=data;
+ int i;
+
+ for (i=0; i<4; i++)
+ {
+ p->surface[i] = p->scanner_surface[i];
+ }
+
+ preview_update_surface(p, 1);
+ gtk_widget_set_sensitive(p->zoom_not, FALSE); /* forbid unzoom */
+ gtk_widget_set_sensitive(p->zoom_out, FALSE); /* forbid zoom out */
+ gtk_widget_set_sensitive(p->zoom_undo,TRUE); /* allow zoom undo */
+
+ while (gtk_events_pending()) /* make sure all selection draw is done now */
+ {
+ gtk_main_iteration();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_zoom_out(GtkWidget *window, gpointer data)
+{
+ Preview *p=data;
+ int i;
+ float delta_width = (p->surface[2] - p->surface[0]) * 0.2;
+ float delta_height = (p->surface[3] - p->surface[1]) * 0.2;
+
+ for (i=0; i<4; i++)
+ {
+ p->old_surface[i] = p->surface[i];
+ }
+
+ p->surface[0] -= delta_width;
+ p->surface[1] -= delta_height;
+ p->surface[2] += delta_width;
+ p->surface[3] += delta_height;
+
+ if (p->surface[0] < p->scanner_surface[0])
+ {
+ p->surface[0] = p->scanner_surface[0];
+ }
+
+ if (p->surface[1] < p->scanner_surface[1])
+ {
+ p->surface[1] = p->scanner_surface[1];
+ }
+
+ if (p->surface[2] > p->scanner_surface[2])
+ {
+ p->surface[2] = p->scanner_surface[2];
+ }
+
+ if (p->surface[3] > p->scanner_surface[3])
+ {
+ p->surface[3] = p->scanner_surface[3];
+ }
+
+ preview_update_surface(p, 1);
+ gtk_widget_set_sensitive(p->zoom_not, TRUE); /* allow unzoom */
+ gtk_widget_set_sensitive(p->zoom_undo,TRUE); /* allow zoom undo */
+
+ while (gtk_events_pending()) /* make sure all selection draw is done now */
+ {
+ gtk_main_iteration();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_zoom_in(GtkWidget *window, gpointer data)
+{
+ Preview *p=data;
+ const SANE_Option_Descriptor *opt;
+ SANE_Status status;
+ SANE_Word val;
+ int i, optnum;
+
+ for (i=0; i<4; i++)
+ {
+ p->old_surface[i] = p->surface[i];
+
+ optnum = p->dialog->well_known.coord[i];
+ if (optnum > 0)
+ {
+ opt = sane_get_option_descriptor(p->dialog->dev, optnum);
+ status = sane_control_option(p->dialog->dev, optnum, SANE_ACTION_GET_VALUE, &val, 0);
+ if (status != SANE_STATUS_GOOD)
+ {
+ continue;
+ }
+
+ if (opt->type == SANE_TYPE_FIXED)
+ {
+ p->surface[i] = SANE_UNFIX(val);
+ }
+ else
+ {
+ p->surface[i] = val;
+ }
+ }
+ }
+
+ preview_update_surface(p, 1);
+ gtk_widget_set_sensitive(p->zoom_not, TRUE); /* allow unzoom */
+ gtk_widget_set_sensitive(p->zoom_out, TRUE); /* allow zoom out */
+ gtk_widget_set_sensitive(p->zoom_undo,TRUE); /* allow zoom undo */
+
+ while (gtk_events_pending()) /* make sure all selection draw is done now */
+ {
+ gtk_main_iteration();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_zoom_undo(GtkWidget *window, gpointer data)
+{
+ Preview *p=data;
+ int i;
+
+ for (i=0; i<4; i++)
+ {
+ p->surface[i] = p->old_surface[i];
+ }
+
+ preview_update_surface(p, 1);
+ gtk_widget_set_sensitive(p->zoom_not, TRUE); /* allow unzoom */
+ gtk_widget_set_sensitive(p->zoom_out, TRUE); /* allow zoom out */
+ gtk_widget_set_sensitive(p->zoom_undo, FALSE); /* forbid zoom undo */
+
+ while (gtk_events_pending()) /* make sure all selection draw is done now */
+ {
+ gtk_main_iteration();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_get_color(Preview *p, int x, int y, int *red, int *green, int *blue)
+{
+ int image_x, image_y;
+ float xscale_p2i, yscale_p2i;
+ int offset;
+
+ if (p->image_data_raw)
+ {
+ preview_get_scale_preview_to_image(p, &xscale_p2i, &yscale_p2i);
+
+ image_x = x * xscale_p2i;
+ image_y = y * yscale_p2i;
+
+ offset = 3 * (image_y * p->image_width + image_x);
+
+ if (!xsane.negative) /* positive */
+ {
+ *red = p->image_data_raw[offset ];
+ *green = p->image_data_raw[offset + 1];
+ *blue = p->image_data_raw[offset + 2];
+ }
+ else /* negative */
+ {
+ *red = 255 - p->image_data_raw[offset ];
+ *green = 255 - p->image_data_raw[offset + 1];
+ *blue = 255 - p->image_data_raw[offset + 2];
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_pipette_white(GtkWidget *window, gpointer data)
+{
+ Preview *p=data;
+ GdkCursor *cursor;
+ GdkColor fg;
+ GdkColor bg;
+ GdkPixmap *pixmap;
+ GdkPixmap *mask;
+
+ p->mode = MODE_PIPETTE_WHITE;
+
+ pixmap = gdk_bitmap_create_from_data(p->top->window, cursor_pipette_white, CURSOR_PIPETTE_WIDTH, CURSOR_PIPETTE_HEIGHT);
+ mask = gdk_bitmap_create_from_data(p->top->window, cursor_pipette_mask, CURSOR_PIPETTE_WIDTH, CURSOR_PIPETTE_HEIGHT);
+
+ fg.red = 0;
+ fg.green = 0;
+ fg.blue = 0;
+
+ bg.red = 65535;
+ bg.green = 65535;
+ bg.blue = 65535;
+
+ cursor = gdk_cursor_new_from_pixmap(pixmap, mask, &fg, &bg, CURSOR_PIPETTE_HOT_X, CURSOR_PIPETTE_HOT_Y);
+
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = -1;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_pipette_gray(GtkWidget *window, gpointer data)
+{
+ Preview *p=data;
+ GdkCursor *cursor;
+ GdkColor fg;
+ GdkColor bg;
+ GdkPixmap *pixmap;
+ GdkPixmap *mask;
+
+ p->mode = MODE_PIPETTE_GRAY;
+
+ pixmap = gdk_bitmap_create_from_data(p->top->window, cursor_pipette_gray, CURSOR_PIPETTE_WIDTH, CURSOR_PIPETTE_HEIGHT);
+ mask = gdk_bitmap_create_from_data(p->top->window, cursor_pipette_mask, CURSOR_PIPETTE_WIDTH, CURSOR_PIPETTE_HEIGHT);
+
+ fg.red = 0;
+ fg.green = 0;
+ fg.blue = 0;
+
+ bg.red = 65535;
+ bg.green = 65535;
+ bg.blue = 65535;
+
+ cursor = gdk_cursor_new_from_pixmap(pixmap, mask, &fg, &bg, CURSOR_PIPETTE_HOT_X, CURSOR_PIPETTE_HOT_Y);
+
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = -1;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_pipette_black(GtkWidget *window, gpointer data)
+{
+ Preview *p=data;
+ GdkCursor *cursor;
+ GdkColor fg;
+ GdkColor bg;
+ GdkPixmap *pixmap;
+ GdkPixmap *mask;
+
+ p->mode = MODE_PIPETTE_BLACK;
+
+ pixmap = gdk_bitmap_create_from_data(p->top->window, cursor_pipette_black, CURSOR_PIPETTE_WIDTH, CURSOR_PIPETTE_HEIGHT);
+ mask = gdk_bitmap_create_from_data(p->top->window, cursor_pipette_mask , CURSOR_PIPETTE_WIDTH, CURSOR_PIPETTE_HEIGHT);
+
+ fg.red = 0;
+ fg.green = 0;
+ fg.blue = 0;
+
+ bg.red = 65535;
+ bg.green = 65535;
+ bg.blue = 65535;
+
+ cursor = gdk_cursor_new_from_pixmap(pixmap, mask, &fg, &bg, CURSOR_PIPETTE_HOT_X, CURSOR_PIPETTE_HOT_Y);
+
+ gdk_window_set_cursor(p->window->window, cursor);
+ gdk_cursor_destroy(cursor);
+ p->cursornr = -1;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_full_preview_area(GtkWidget *widget, gpointer call_data)
+{
+ Preview *p = call_data;
+ int i;
+
+ p->selection.active = TRUE;
+
+ for (i=0; i<4; i++)
+ {
+ p->selection.coordinate[i] = p->surface[i];
+ }
+
+ preview_update_maximum_output_size(p);
+ preview_draw_selection(p);
+ preview_establish_selection(p);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void preview_preset_area_callback(GtkWidget *widget, gpointer call_data)
+{
+ Preview *p = call_data;
+ int selection;
+
+ selection = (int) gtk_object_get_data(GTK_OBJECT(widget), "Selection");
+
+ p->preset_width = preset_area[selection].width;
+ p->preset_height = preset_area[selection].height;
+
+ preview_update_surface(p, 0);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void preview_do_gamma_correction(Preview *p)
+{
+ int x,y;
+ int offset;
+
+ if (p->image_data_raw)
+ {
+ if ((p->image_data_raw) && (p->params.depth > 1) && (preview_gamma_data_red))
+ {
+ for (y=0; y < p->image_height; y++)
+ {
+ for (x=0; x < p->image_width; x++)
+ {
+ offset = 3 * (y * p->image_width + x);
+ p->image_data_enh[offset ] = preview_gamma_data_red [p->image_data_raw[offset ]];
+ p->image_data_enh[offset + 1] = preview_gamma_data_green[p->image_data_raw[offset + 1]];
+ p->image_data_enh[offset + 2] = preview_gamma_data_blue [p->image_data_raw[offset + 2]];
+ }
+ }
+ }
+
+ preview_display_partial_image(p);
+
+ p->previous_selection.active = FALSE; /* previous selection is not drawn */
+ p->previous_selection_maximum.active = FALSE;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void preview_calculate_histogram(Preview *p,
+ SANE_Int *count_raw, SANE_Int *count_raw_red, SANE_Int *count_raw_green, SANE_Int *count_raw_blue,
+ SANE_Int *count, SANE_Int *count_red, SANE_Int *count_green, SANE_Int *count_blue)
+{
+ int x, y;
+ int offset;
+ SANE_Int red_raw, green_raw, blue_raw;
+ SANE_Int red, green, blue;
+ SANE_Int min_x, max_x, min_y, max_y;
+ float xscale, yscale;
+
+ preview_get_scale_device_to_image(p, &xscale, &yscale);
+
+ min_x = (p->selection.coordinate[0] - p->surface[0]) * xscale;
+ min_y = (p->selection.coordinate[1] - p->surface[1]) * yscale;
+ max_x = (p->selection.coordinate[2] - p->surface[0]) * xscale;
+ max_y = (p->selection.coordinate[3] - p->surface[1]) * yscale;
+
+ if (min_x < 0)
+ {
+ min_x = 0;
+ }
+
+ if (max_x >= p->image_width)
+ {
+ max_x = p->image_width-1;
+ }
+
+ if (min_y < 0)
+ {
+ min_y = 0;
+ }
+
+ if (max_y >= p->image_height)
+ {
+ max_y = p->image_height-1;
+ }
+
+ if ((p->image_data_raw) && (p->params.depth > 1) && (preview_gamma_data_red))
+ {
+ for (y = min_y; y <= max_y; y++)
+ {
+ for (x = min_x; x <= max_x; x++)
+ {
+ offset = 3 * (y * p->image_width + x);
+ red_raw = p->image_data_raw[offset ];
+ green_raw = p->image_data_raw[offset + 1];
+ blue_raw = p->image_data_raw[offset + 2];
+
+ red = histogram_gamma_data_red [red_raw];
+ green = histogram_gamma_data_green[green_raw];
+ blue = histogram_gamma_data_blue [blue_raw];
+
+/* count_raw [(int) sqrt((red_raw*red_raw + green_raw*green_raw + blue_raw*blue_raw)/3.0)]++; */
+ count_raw [(int) ((red_raw + green_raw + blue_raw)/3)]++;
+ count_raw_red [red_raw]++;
+ count_raw_green[green_raw]++;
+ count_raw_blue [blue_raw]++;
+
+/* count [(int) sqrt((red*red + green*green + blue*blue)/3.0)]++; */
+ count [(int) ((red + green + blue)/3)]++;
+ count_red [red]++;
+ count_green[green]++;
+ count_blue [blue]++;
+ }
+ }
+ }
+ else /* no preview image => all colors = 1 */
+ {
+ int i;
+
+ for (i = 1; i <= 254; i++)
+ {
+ count_raw [i] = 0;
+ count_raw_red [i] = 0;
+ count_raw_green[i] = 0;
+ count_raw_blue [i] = 0;
+
+ count [i] = 0;
+ count_red [i] = 0;
+ count_green[i] = 0;
+ count_blue [i] = 0;
+ }
+
+ count_raw [0] = 10;
+ count_raw_red [0] = 10;
+ count_raw_green[0] = 10;
+ count_raw_blue [0] = 10;
+
+ count [0] = 10;
+ count_red [0] = 10;
+ count_green[0] = 10;
+ count_blue [0] = 10;
+
+ count_raw [255] = 10;
+ count_raw_red [255] = 10;
+ count_raw_green[255] = 10;
+ count_raw_blue [255] = 10;
+
+ count [255] = 10;
+ count_red [255] = 10;
+ count_green[255] = 10;
+ count_blue [255] = 10;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void preview_gamma_correction(Preview *p,
+ SANE_Int *gamma_red, SANE_Int *gamma_green, SANE_Int *gamma_blue,
+ SANE_Int *gamma_red_hist, SANE_Int *gamma_green_hist, SANE_Int *gamma_blue_hist)
+{
+ preview_gamma_data_red = gamma_red;
+ preview_gamma_data_green = gamma_green;
+ preview_gamma_data_blue = gamma_blue;
+
+ histogram_gamma_data_red = gamma_red_hist;
+ histogram_gamma_data_green = gamma_green_hist;
+ histogram_gamma_data_blue = gamma_blue_hist;
+
+ preview_do_gamma_correction(p);
+ preview_draw_selection(p);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void preview_area_resize(GtkWidget *widget)
+{
+ float min_x, max_x, delta_x;
+ float min_y, max_y, delta_y;
+ float xscale, yscale, f;
+ Preview *p;
+
+ p = gtk_object_get_data(GTK_OBJECT(widget), "PreviewPointer");
+
+ p->preview_window_width = widget->allocation.width;
+ p->preview_window_height = widget->allocation.height;
+
+ p->preview_width = widget->allocation.width;
+ p->preview_height = widget->allocation.height;
+
+ preview_area_correct(p); /* set preview dimensions (with right aspect) that they fit into the window */
+
+ if (p->preview_row) /* make sure preview_row is large enough for one line of the new size */
+ {
+ p->preview_row = realloc(p->preview_row, 3 * p->preview_window_width);
+ }
+ else
+ {
+ p->preview_row = malloc(3 * p->preview_window_width);
+ }
+
+ /* set the ruler ranges: */
+
+ min_x = p->surface[xsane_back_gtk_TL_X];
+ if (min_x <= -INF)
+ {
+ min_x = 0.0;
+ }
+
+ max_x = p->surface[xsane_back_gtk_BR_X];
+ if (max_x >= INF)
+ {
+ max_x = p->image_width - 1;
+ }
+
+ min_y = p->surface[xsane_back_gtk_TL_Y];
+ if (min_y <= -INF)
+ {
+ min_y = 0.0;
+ }
+
+ max_y = p->surface[xsane_back_gtk_BR_Y];
+ if (max_y >= INF)
+ {
+ max_y = p->image_height - 1;
+ }
+
+ /* convert mm to inches if that's what the user wants: */
+
+ if (p->surface_unit == SANE_UNIT_MM)
+ {
+ double factor = 1.0/preferences.length_unit;
+
+ min_x *= factor;
+ max_x *= factor;
+ min_y *= factor;
+ max_y *= factor;
+ }
+
+ preview_get_scale_preview_to_image(p, &xscale, &yscale);
+
+ if (p->image_width > 0)
+ {
+ f = xscale * p->preview_width / p->image_width;
+ }
+ else
+ {
+ f = 1.0;
+ }
+
+ min_x *= f;
+ max_x *= f;
+ delta_x = max_x - min_x;
+
+ gtk_ruler_set_range(GTK_RULER(p->hruler), min_x, min_x + delta_x*p->preview_window_width/p->preview_width,
+ min_x, /* max_size */ 20);
+
+ if (p->image_height > 0)
+ {
+ f = yscale * p->preview_height / p->image_height;
+ }
+ else
+ {
+ f = 1.0;
+ }
+
+ min_y *= f;
+ max_y *= f;
+ delta_y = max_y - min_y;
+
+ gtk_ruler_set_range(GTK_RULER(p->vruler), min_y, min_y + delta_y*p->preview_window_height/p->preview_height,
+ min_y, /* max_size */ 20);
+
+ preview_paint_image(p);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void preview_update_maximum_output_size(Preview *p)
+{
+ if ( (p->maximum_output_width >= INF) || (p->maximum_output_height >= INF) )
+ {
+ if (p->selection_maximum.active)
+ {
+ p->selection_maximum.active = FALSE;
+ }
+ }
+ else
+ {
+ p->previous_selection_maximum = p->selection_maximum;
+
+ p->selection_maximum.active = TRUE;
+ p->selection_maximum.coordinate[0] = p->selection.coordinate[0];
+ p->selection_maximum.coordinate[1] = p->selection.coordinate[1];
+ p->selection_maximum.coordinate[2] = p->selection.coordinate[0] + p->maximum_output_width;
+ p->selection_maximum.coordinate[3] = p->selection.coordinate[1] + p->maximum_output_height;
+
+ if (p->selection_maximum.coordinate[2] > p->max_scanner_surface[2])
+ {
+ p->selection_maximum.coordinate[2] = p->max_scanner_surface[2];
+ }
+
+ if (p->selection_maximum.coordinate[3] > p->max_scanner_surface[3])
+ {
+ p->selection_maximum.coordinate[3] = p->max_scanner_surface[3];
+ }
+
+ if ( (p->selection.coordinate[0] < p->selection_maximum.coordinate[0]) ||
+ (p->selection.coordinate[1] < p->selection_maximum.coordinate[1]) ||
+ (p->selection.coordinate[2] > p->selection_maximum.coordinate[2]) ||
+ (p->selection.coordinate[3] > p->selection_maximum.coordinate[3]) )
+ {
+ if (p->selection.coordinate[2] > p->selection_maximum.coordinate[2])
+ {
+ p->selection.coordinate[2] = p->selection_maximum.coordinate[2];
+ }
+
+ if (p->selection.coordinate[3] > p->selection_maximum.coordinate[3])
+ {
+ p->selection.coordinate[3] = p->selection_maximum.coordinate[3];
+ }
+ preview_draw_selection(p);
+ preview_establish_selection(p);
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void preview_set_maximum_output_size(Preview *p, float width, float height)
+{
+ /* witdh and height in device units */
+
+ p->maximum_output_width = width;
+ p->maximum_output_height = height;
+
+ preview_update_maximum_output_size(p);
+ preview_draw_selection(p);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
diff --git a/frontend/xsane-preview.h b/frontend/xsane-preview.h
new file mode 100644
index 0000000..fd452ee
--- /dev/null
+++ b/frontend/xsane-preview.h
@@ -0,0 +1,178 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-preview.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ------------------------------------------------------------------------------------------------------ */
+
+#ifndef xsanepreview_h
+#define xsanepreview_h
+
+/* ------------------------------------------------------------------------------------------------------ */
+
+#include <sys/types.h>
+
+#include <sane/config.h>
+#include <sane/sane.h>
+
+#define SELECTION_RANGE_IN 4
+#define SELECTION_RANGE_OUT 8
+#define XSANE_CURSOR_PREVIEW GDK_LEFT_PTR
+
+/* ------------------------------------------------------------------------------------------------------ */
+
+enum
+{
+ MODE_NORMAL,
+ MODE_PIPETTE_WHITE,
+ MODE_PIPETTE_GRAY,
+ MODE_PIPETTE_BLACK
+};
+
+/* ------------------------------------------------------------------------------------------------------ */
+
+typedef struct Batch_selection
+{
+ float coordinate[4]; /* batch selection coordinate (device coord) */
+ struct Batch_selection *next;
+} Batch_selection;
+
+typedef struct
+{
+ int active;
+ float coordinate[4]; /* selection coordinate (device coord) */
+} Tselection;
+
+/* ------------------------------------------------------------------------------------------------------ */
+
+typedef struct
+{
+ int mode;
+ GSGDialog *dialog; /* the dialog for this preview */
+
+ int cursornr;
+
+ SANE_Value_Type surface_type;
+ SANE_Unit surface_unit;
+ float surface[4]; /* the corners of the selected surface (device coords) */
+ float old_surface[4]; /* the corners of the old selected surface (device coords) */
+ float max_scanner_surface[4]; /* the scanner defined corners of the scanner surface (device coords) */
+ float scanner_surface[4]; /* the user defined corners of the scanner surface (device coords) */
+ float image_surface[4]; /* the corners of the surface (device coords) of the scanned image */
+ float aspect; /* the aspect ratio of the scan surface */
+
+ float preset_width; /* user selected maximum scan width */
+ float preset_height; /* user selected maximum scan height */
+
+ float maximum_output_width; /* maximum output width (photocopy) */
+ float maximum_output_height; /* maximum output height (photocopy) */
+
+ int saved_dpi_valid;
+ int saved_dpi_x_valid;
+ int saved_dpi_y_valid;
+ SANE_Word saved_dpi;
+ SANE_Word saved_dpi_x;
+ SANE_Word saved_dpi_y;
+ int saved_coord_valid[4];
+ SANE_Word saved_coord[4];
+ int saved_custom_gamma_valid;
+ SANE_Word saved_custom_gamma;
+ int saved_bit_depth_valid;
+ SANE_Word saved_bit_depth;
+
+ /* desired/user-selected preview-window size: */
+ int preview_width; /* used with for displaying the preview image */
+ int preview_height; /* used height for displaying the preview image */
+ int preview_window_width; /* width of the preview window */
+ int preview_window_height; /* height of the preview window */
+ u_char *preview_row;
+
+ int scanning;
+ time_t image_last_time_updated;
+ gint input_tag;
+ SANE_Parameters params;
+ int image_offset;
+ int image_x;
+ int image_y;
+ int image_width; /* width of preview image in pixels */
+ int image_height; /* height of preview image in pixel lines */
+ u_char *image_data_raw; /* 3 * image_width * image_height bytes */
+ u_char *image_data_enh; /* 3 * image_width * image_height bytes */
+
+ GdkGC *gc_selection;
+ GdkGC *gc_selection_maximum;
+ int selection_drag;
+ int selection_drag_edge;
+ int selection_xpos;
+ int selection_ypos;
+ int selection_xedge;
+ int selection_yedge;
+
+ Tselection selection; /* selected area to scan */
+ Tselection previous_selection; /* previous ... */
+ Tselection selection_maximum; /* maximum selection size (photocopy) */
+ Tselection previous_selection_maximum; /* previous ... */
+
+ Batch_selection *batch_selection;
+
+ GtkWidget *top; /* top-level widget */
+ GtkWidget *hruler;
+ GtkWidget *vruler;
+ GtkWidget *viewport;
+ GtkWidget *window; /* the preview window */
+ GtkWidget *start; /* the start button */
+ GtkWidget *cancel; /* the cancel button */
+
+ GtkWidget *button_box; /* hbox for the following buttons */
+ GtkWidget *pipette_white; /* pipette white button */
+ GtkWidget *pipette_gray; /* pipette gray button */
+ GtkWidget *pipette_black; /* pipette black button */
+ GtkWidget *zoom_not; /* zoom not button */
+ GtkWidget *zoom_out; /* zoom out button */
+ GtkWidget *zoom_in; /* zoom in button */
+ GtkWidget *zoom_undo; /* zoom undo button */
+ GtkWidget *preset_area_option_menu; /* menu for selection of preview area */
+}
+Preview;
+
+/* ------------------------------------------------------------------------------------------------------ */
+
+extern Preview *preview_new (GSGDialog *dialog); /* Create a new preview based on the info in DIALOG. */
+
+extern void preview_gamma_correction(Preview *p, /* Do gamma correction on preview data */
+ int gamma_red[], int gamma_green[], int gamma_blue[],
+ int gamma_red_hist[], int gamma_green_hist[], int gamma_blue_hist[]);
+
+extern void preview_update_surface(Preview *p, int surface_changed); /* params changed: update preview */
+
+extern void preview_scan(Preview *p); /* Acquire a preview image and display it. */
+
+extern void preview_destroy(Preview *p); /* Destroy a preview. */
+
+extern void preview_calculate_histogram(Preview *p, /* calculate histogram */
+ SANE_Int *count_raw, SANE_Int *count_raw_red, SANE_Int *count_raw_green, SANE_Int *count_raw_blue,
+ SANE_Int *count, SANE_Int *count_red, SANE_Int *count_green, SANE_Int *count_blue);
+
+extern void preview_area_resize(GtkWidget *widget); /* redraw preview rulers */
+void preview_set_maximum_output_size(Preview *p, float width, float height); /* set maximum outut size */
+
+/* ------------------------------------------------------------------------------------------------------ */
+
+#endif /* preview_h */
diff --git a/frontend/xsane-rc-io.c b/frontend/xsane-rc-io.c
new file mode 100644
index 0000000..520e97e
--- /dev/null
+++ b/frontend/xsane-rc-io.c
@@ -0,0 +1,903 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-rc-io.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+#ifdef _AIX
+# include <lalloca.h> /* MUST come first for AIX! */
+#endif
+#include <sane/config.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sane/sane.h>
+#include <sane/config.h>
+#include <ctype.h>
+#include <unistd.h>
+
+#ifdef HAVE_LIBC_H
+# include <libc.h> /* NeXTStep/OpenStep */
+#endif
+
+#include <sane/sane.h>
+#include "xsane-rc-io.h"
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_space(Wire *w, size_t howmuch)
+{
+ size_t nbytes, left_over;
+ int fd = w->io.fd;
+ ssize_t nread, nwritten;
+
+ if (w->buffer.curr + howmuch > w->buffer.end)
+ {
+ switch (w->direction)
+ {
+ case WIRE_ENCODE:
+ nbytes = w->buffer.curr - w->buffer.start;
+ w->buffer.curr = w->buffer.start;
+ while (nbytes > 0)
+ {
+ nwritten = (*w->io.write) (fd, w->buffer.curr, nbytes);
+ if (nwritten < 0)
+ {
+ w->status = errno;
+ return;
+ }
+ w->buffer.curr += nwritten;
+ nbytes -= nwritten;
+ }
+
+ w->buffer.curr = w->buffer.start;
+ w->buffer.end = w->buffer.start + w->buffer.size;
+ break;
+
+ case WIRE_DECODE:
+ left_over = w->buffer.end - w->buffer.curr;
+ if (left_over)
+ {
+ memcpy(w->buffer.start, w->buffer.curr, left_over);
+ }
+ w->buffer.curr = w->buffer.start;
+ w->buffer.end = w->buffer.start + left_over;
+
+ do
+ {
+ nread = (*w->io.read) (fd, w->buffer.end, w->buffer.size - left_over);
+ if (nread <= 0)
+ {
+ if (nread == 0)
+ {
+/* errno = EINVAL; */
+ errno = XSANE_EOF;
+ }
+ w->status = errno;
+ return;
+ }
+ left_over += nread;
+ w->buffer.end += nread;
+ } while (left_over < howmuch);
+ break;
+
+ case WIRE_FREE:
+ break;
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_void(Wire *w)
+{
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_array(Wire *w, SANE_Word *len_ptr, void **v, WireCodecFunc w_element, size_t element_size)
+{
+ SANE_Word len;
+ char *val;
+ int i;
+
+ if (w->direction == WIRE_FREE)
+ {
+ free(*v);
+ return;
+ }
+
+ if (w->direction == WIRE_ENCODE)
+ {
+ len = *len_ptr;
+ }
+
+ xsane_rc_io_w_word(w, &len);
+
+ if (w->direction == WIRE_DECODE)
+ {
+ *len_ptr = len;
+ if (len)
+ {
+ *v = malloc(len * element_size);
+
+ if (*v == 0)
+ {
+ /* Malloc failed, so return an error. */
+ w->status = ENOMEM;
+ return;
+ }
+ }
+ else
+ {
+ *v = 0;
+ }
+ }
+
+ val = *v;
+
+ for (i = 0; i < len; ++i)
+ {
+ (*w_element) (w, val);
+ val += element_size;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_ptr(Wire *w, void **v, WireCodecFunc w_value, size_t value_size)
+{
+ SANE_Word is_null;
+
+ if (w->direction == WIRE_FREE)
+ {
+ if (*v)
+ {
+ free(*v);
+ }
+ return;
+ }
+
+ if (w->direction == WIRE_ENCODE)
+ {
+ is_null = (*v == 0);
+ }
+
+ xsane_rc_io_w_word(w, &is_null);
+
+ if (!is_null)
+ {
+ if (w->direction == WIRE_DECODE)
+ {
+ *v = malloc(value_size);
+
+ if (*v == 0)
+ {
+ /* Malloc failed, so return an error. */
+ w->status = ENOMEM;
+ return;
+ }
+ }
+ (*w_value) (w, *v);
+ }
+ else if (w->direction == WIRE_DECODE)
+ {
+ *v = 0;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_status(Wire *w, SANE_Status *v)
+{
+ SANE_Word word = *v;
+
+ xsane_rc_io_w_word(w, &word);
+ if (w->direction == WIRE_DECODE)
+ {
+ *v = word;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_bool(Wire *w, SANE_Bool *v)
+{
+ SANE_Word word = *v;
+
+ xsane_rc_io_w_word(w, &word);
+ if (w->direction == WIRE_DECODE)
+ {
+ *v = word;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_constraint_type(Wire *w, SANE_Constraint_Type *v)
+{
+ SANE_Word word = *v;
+
+ xsane_rc_io_w_word(w, &word);
+ if (w->direction == WIRE_DECODE)
+ *v = word;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_value_type(Wire *w, SANE_Value_Type *v)
+{
+ SANE_Word word = *v;
+
+ xsane_rc_io_w_word(w, &word);
+ if (w->direction == WIRE_DECODE)
+ *v = word;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_unit(Wire *w, SANE_Unit *v)
+{
+ SANE_Word word = *v;
+
+ xsane_rc_io_w_word(w, &word);
+ if (w->direction == WIRE_DECODE)
+ {
+ *v = word;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_action(Wire *w, SANE_Action *v)
+{
+ SANE_Word word = *v;
+
+ xsane_rc_io_w_word(w, &word);
+ if (w->direction == WIRE_DECODE)
+ {
+ *v = word;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_frame(Wire *w, SANE_Frame *v)
+{
+ SANE_Word word = *v;
+
+ xsane_rc_io_w_word(w, &word);
+ if (w->direction == WIRE_DECODE)
+ {
+ *v = word;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_range(Wire *w, SANE_Range *v)
+{
+ xsane_rc_io_w_word(w, &v->min);
+ xsane_rc_io_w_word(w, &v->max);
+ xsane_rc_io_w_word(w, &v->quant);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_device(Wire *w, SANE_Device *v)
+{
+ xsane_rc_io_w_string(w, (SANE_String *) &v->name);
+ xsane_rc_io_w_string(w, (SANE_String *) &v->vendor);
+ xsane_rc_io_w_string(w, (SANE_String *) &v->model);
+ xsane_rc_io_w_string(w, (SANE_String *) &v->type);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_device_ptr(Wire *w, SANE_Device **v)
+{
+ xsane_rc_io_w_ptr(w, (void **) v, (WireCodecFunc) xsane_rc_io_w_device, sizeof (**v));
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_option_descriptor(Wire *w, SANE_Option_Descriptor *v)
+{
+ SANE_Word len;
+
+ xsane_rc_io_w_string(w, (SANE_String *) &v->name);
+ xsane_rc_io_w_string(w, (SANE_String *) &v->title);
+ xsane_rc_io_w_string(w, (SANE_String *) &v->desc);
+ xsane_rc_io_w_value_type(w, &v->type);
+ xsane_rc_io_w_unit(w, &v->unit);
+ xsane_rc_io_w_word(w, &v->size);
+ xsane_rc_io_w_word(w, &v->cap);
+ xsane_rc_io_w_constraint_type(w, &v->constraint_type);
+
+ switch (v->constraint_type)
+ {
+ case SANE_CONSTRAINT_NONE:
+ break;
+
+ case SANE_CONSTRAINT_RANGE:
+ xsane_rc_io_w_ptr(w, (void **) &v->constraint.range, (WireCodecFunc) xsane_rc_io_w_range, sizeof (SANE_Range));
+ break;
+
+ case SANE_CONSTRAINT_WORD_LIST:
+ if (w->direction == WIRE_ENCODE)
+ len = v->constraint.word_list[0] + 1;
+ xsane_rc_io_w_array(w, &len, (void **) &v->constraint.word_list, w->codec.w_word, sizeof(SANE_Word));
+ break;
+
+ case SANE_CONSTRAINT_STRING_LIST:
+ if (w->direction == WIRE_ENCODE)
+ {
+ for (len = 0; v->constraint.string_list[len]; ++len);
+ ++len; /* send NULL string, too */
+ }
+ xsane_rc_io_w_array(w, &len, (void **) &v->constraint.string_list, w->codec.w_string, sizeof(SANE_String));
+ break;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_option_descriptor_ptr(Wire *w, SANE_Option_Descriptor **v)
+{
+ xsane_rc_io_w_ptr(w, (void **) v, (WireCodecFunc) xsane_rc_io_w_option_descriptor, sizeof (**v));
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_parameters(Wire *w, SANE_Parameters *v)
+{
+ xsane_rc_io_w_frame(w, &v->format);
+ xsane_rc_io_w_bool(w, &v->last_frame);
+ xsane_rc_io_w_word(w, &v->bytes_per_line);
+ xsane_rc_io_w_word(w, &v->pixels_per_line);
+ xsane_rc_io_w_word(w, &v->lines);
+ xsane_rc_io_w_word(w, &v->depth);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_flush(Wire *w)
+{
+ w->status = 0;
+
+ if (w->direction == WIRE_ENCODE)
+ {
+ xsane_rc_io_w_space(w, w->buffer.size + 1);
+ }
+ else if (w->direction == WIRE_DECODE)
+ {
+ w->buffer.curr = w->buffer.end = w->buffer.start;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_set_dir(Wire *w, WireDirection dir)
+{
+ xsane_rc_io_w_flush(w);
+ w->direction = dir;
+ xsane_rc_io_w_flush(w);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_call(Wire *w, SANE_Word procnum, WireCodecFunc w_arg, void *arg, WireCodecFunc w_reply, void *reply)
+{
+ w->status = 0;
+ xsane_rc_io_w_set_dir(w, WIRE_ENCODE);
+
+ xsane_rc_io_w_word(w, &procnum);
+ (*w_arg) (w, arg);
+
+ if (w->status == 0)
+ {
+ xsane_rc_io_w_set_dir(w, WIRE_DECODE);
+ (*w_reply) (w, reply);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_reply(Wire *w, WireCodecFunc w_reply, void *reply)
+{
+ w->status = 0;
+ xsane_rc_io_w_set_dir(w, WIRE_ENCODE);
+ (*w_reply) (w, reply);
+ xsane_rc_io_w_flush(w);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_free(Wire *w, WireCodecFunc w_reply, void *reply)
+{
+ WireDirection saved_dir = w->direction;
+
+ w->direction = WIRE_FREE;
+ (*w_reply) (w, reply);
+ w->direction = saved_dir;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_init(Wire *w)
+{
+ w->status = 0;
+ w->direction = WIRE_ENCODE;
+ w->buffer.size = 8192;
+ w->buffer.start = malloc(w->buffer.size);
+
+ if (w->buffer.start == 0) /* Malloc failed, so return an error. */
+ {
+ w->status = ENOMEM;
+ }
+
+ w->buffer.curr = w->buffer.start;
+ w->buffer.end = w->buffer.start + w->buffer.size;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+static const char *hexdigit = "0123456789abcdef";
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_rc_io_skip_ws(Wire *w)
+{
+ while (1)
+ {
+ xsane_rc_io_w_space(w, 1);
+
+ if (w->status != 0)
+ {
+ return;
+ }
+
+ if (!isspace(*w->buffer.curr))
+ {
+ return;
+ }
+
+ ++w->buffer.curr;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_skip_newline(Wire *w)
+{
+ while (*w->buffer.curr != 10)
+ {
+ xsane_rc_io_w_space(w, 1);
+
+ if (w->status != 0)
+ {
+ return;
+ }
+ ++w->buffer.curr;
+ }
+ ++w->buffer.curr;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+static unsigned xsane_rc_io_get_digit(Wire *w)
+{
+ unsigned digit;
+
+ xsane_rc_io_w_space(w, 1);
+ digit = tolower(*w->buffer.curr++) - '0';
+
+ if (digit > 9)
+ {
+ digit -= 'a' - ('9' + 1);
+ }
+
+ if (digit > 0xf)
+ {
+ w->status = EINVAL;
+ return 0;
+ }
+ return digit;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+static SANE_Byte xsane_rc_io_get_byte(Wire *w)
+{
+ return xsane_rc_io_get_digit(w) << 4 | xsane_rc_io_get_digit(w);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_byte(Wire *w, SANE_Byte *v)
+{
+ SANE_Byte *b = v;
+
+ switch (w->direction)
+ {
+ case WIRE_ENCODE:
+ xsane_rc_io_w_space(w, 3);
+ *w->buffer.curr++ = hexdigit[(*b >> 4) & 0x0f];
+ *w->buffer.curr++ = hexdigit[(*b >> 0) & 0x0f];
+ *w->buffer.curr++ = '\n';
+ break;
+
+ case WIRE_DECODE:
+ xsane_rc_io_skip_ws(w);
+ *b = xsane_rc_io_get_byte(w);
+ break;
+
+ case WIRE_FREE:
+ break;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_char(Wire *w, SANE_Char *v)
+{
+ SANE_Char *c = v;
+
+ switch (w->direction)
+ {
+ case WIRE_ENCODE:
+ xsane_rc_io_w_space(w, 5);
+ *w->buffer.curr++ = '\'';
+
+ if (*c == '\'' || *c == '\\')
+ {
+ *w->buffer.curr++ = '\\';
+ }
+
+ *w->buffer.curr++ = *c;
+ *w->buffer.curr++ = '\'';
+ *w->buffer.curr++ = '\n';
+ break;
+
+ case WIRE_DECODE:
+ xsane_rc_io_w_space(w, 4);
+ if (*w->buffer.curr++ != '\'')
+ {
+ w->status = EINVAL;
+ return;
+ }
+ *c = *w->buffer.curr++;
+
+ if (*c == '\\')
+ {
+ xsane_rc_io_w_space(w, 2);
+ *c = *w->buffer.curr++;
+ }
+
+ if (*w->buffer.curr++ != '\'')
+ {
+ w->status = EINVAL;
+ return;
+ }
+ break;
+
+ case WIRE_FREE:
+ break;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_string(Wire *w, SANE_String *s)
+{
+ size_t len, alloced_len;
+ char * str, ch;
+ int done;
+
+ switch (w->direction)
+ {
+ case WIRE_ENCODE:
+ if (*s)
+ {
+ xsane_rc_io_w_space(w, 1);
+ *w->buffer.curr++ = '"';
+ str = *s;
+ while ((ch = *str++))
+ {
+ xsane_rc_io_w_space(w, 2);
+ if (ch == '"' || ch == '\\')
+ {
+ *w->buffer.curr++ = '\\';
+ }
+ *w->buffer.curr++ = ch;
+ }
+ *w->buffer.curr++ = '"';
+ }
+ else
+ {
+ xsane_rc_io_w_space(w, 5);
+ *w->buffer.curr++ = '(';
+ *w->buffer.curr++ = 'n';
+ *w->buffer.curr++ = 'i';
+ *w->buffer.curr++ = 'l';
+ *w->buffer.curr++ = ')';
+ }
+
+ xsane_rc_io_w_space(w, 1);
+ *w->buffer.curr++ = '\n';
+ break;
+
+ case WIRE_DECODE:
+ xsane_rc_io_skip_ws(w);
+ xsane_rc_io_w_space(w, 1);
+
+ if (w->status != 0)
+ {
+ *s = 0; /* make sure pointer does not point to an invalid address */
+ return;
+ }
+
+ ch = *w->buffer.curr++;
+ if (ch == '"')
+ {
+ alloced_len = len = 0;
+ str = 0;
+ done = 0;
+
+ do
+ {
+ xsane_rc_io_w_space(w, 1);
+
+ if (w->status != 0)
+ {
+ return;
+ }
+
+ ch = *w->buffer.curr++;
+ if (ch == '"')
+ {
+ done = 1;
+ }
+
+ if (ch == '\\')
+ {
+ xsane_rc_io_w_space(w, 1);
+ ch = *w->buffer.curr++;
+ }
+
+ if (len >= alloced_len)
+ {
+ alloced_len += 1024;
+ if (!str)
+ {
+ str = malloc(alloced_len);
+ }
+ else
+ {
+ str = realloc(str, alloced_len);
+ }
+
+ if (str == 0)
+ {
+ /* Malloc failed, so return an error. */
+ w->status = ENOMEM;
+ return;
+ }
+ }
+ str[len++] = ch;
+ }
+ while(!done);
+
+ str[len - 1] = '\0';
+ *s = realloc(str, len);
+
+ if (*s == 0)
+ {
+ /* Malloc failed, so return an error. */
+ w->status = ENOMEM;
+ return;
+ }
+ }
+ else if (ch == '(')
+ {
+ *s = 0; /* make sure pointer does not point to an invalid address */
+ xsane_rc_io_w_space(w, 4);
+ if ( *w->buffer.curr++ != 'n'
+ || *w->buffer.curr++ != 'i'
+ || *w->buffer.curr++ != 'l'
+ || *w->buffer.curr++ != ')')
+ {
+ w->status = EINVAL;
+ return;
+ }
+ }
+ else
+ {
+ w->status = EINVAL;
+ *s = 0; /* make sure pointer does not point to an invalid address */
+ return;
+ }
+ break;
+
+ case WIRE_FREE:
+ if (*s)
+ {
+ free(*s);
+ }
+ break;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_io_w_word(Wire *w, SANE_Word *v)
+{
+ SANE_Word val, *word = v;
+ int i, is_negative = 0;
+ char buf[16];
+
+ switch (w->direction)
+ {
+ case WIRE_ENCODE:
+ val = *word;
+ i = sizeof(buf) - 1;
+
+ if (val < 0)
+ {
+ is_negative = 1;
+ val = -val;
+ }
+
+ do
+ {
+ buf[i--] = '0' + (val % 10);
+ val /= 10;
+ }
+ while (val);
+
+ if (is_negative)
+ {
+ buf[i--] = '-';
+ }
+
+ xsane_rc_io_w_space(w, sizeof(buf) - i);
+ memcpy(w->buffer.curr, buf + i + 1, sizeof(buf) - i - 1);
+ w->buffer.curr += sizeof(buf) - i - 1;
+ *w->buffer.curr++ = '\n';
+ break;
+
+ case WIRE_DECODE:
+ xsane_rc_io_skip_ws(w);
+ val = 0;
+ xsane_rc_io_w_space(w, 1);
+ if (*w->buffer.curr == '-')
+ {
+ is_negative = 1;
+ ++w->buffer.curr;
+ }
+
+ while (1)
+ {
+ xsane_rc_io_w_space(w, 1);
+
+ if (w->status != 0)
+ {
+ return;
+ }
+
+ if (!isdigit (*w->buffer.curr))
+ {
+ break;
+ }
+
+ val = 10*val + (*w->buffer.curr++ - '0');
+ }
+ *word = is_negative ? -val : val;
+ break;
+
+ case WIRE_FREE:
+ break;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+#define PFIELD(p,offset,type) (*((type *)(((char *)(p)) + (offset))))
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_pref_string(Wire *w, void *p, long offset)
+{
+ SANE_String string;
+
+ if (w->direction == WIRE_ENCODE)
+ {
+ string = PFIELD(p, offset, char *);
+ }
+
+ xsane_rc_io_w_string(w, &string);
+
+ if (w->direction == WIRE_DECODE)
+ {
+ if (w->status == 0)
+ {
+ const char **field;
+
+ field = &PFIELD(p, offset, const char *);
+ if (*field)
+ {
+ free((char *) *field);
+ }
+ *field = string ? strdup (string) : 0;
+ }
+ xsane_rc_io_w_free(w, (WireCodecFunc) xsane_rc_io_w_string, &string);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_pref_double(Wire *w, void *p, long offset)
+{
+ SANE_Word word;
+
+ if (w->direction == WIRE_ENCODE)
+ {
+ word = SANE_FIX(PFIELD (p, offset, double));
+ }
+
+ xsane_rc_io_w_word (w, &word);
+
+ if (w->direction == WIRE_DECODE)
+ {
+ if (w->status == 0)
+ {
+ PFIELD(p, offset, double) = SANE_UNFIX (word);
+ }
+ xsane_rc_io_w_free(w, (WireCodecFunc) xsane_rc_io_w_word, &word);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+void xsane_rc_pref_int(Wire *w, void *p, long offset)
+{
+ SANE_Word word;
+
+ if (w->direction == WIRE_ENCODE)
+ {
+ word = PFIELD(p, offset, int);
+ }
+
+ xsane_rc_io_w_word (w, &word);
+
+ if (w->direction == WIRE_DECODE)
+ {
+ if (w->status == 0)
+ {
+ PFIELD(p, offset, int) = word;
+ }
+ xsane_rc_io_w_free(w, (WireCodecFunc) xsane_rc_io_w_word, &word);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------- */
diff --git a/frontend/xsane-rc-io.h b/frontend/xsane-rc-io.h
new file mode 100644
index 0000000..6fd5680
--- /dev/null
+++ b/frontend/xsane-rc-io.h
@@ -0,0 +1,123 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-rc-io.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+#ifndef xsane_rc_io_h
+#define xsane_rc_io_h
+
+#include <sys/types.h>
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#define XSANE_EOF -1
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+typedef enum
+ {
+ WIRE_ENCODE = 0,
+ WIRE_DECODE,
+ WIRE_FREE
+ }
+WireDirection;
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+struct Wire;
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+typedef void (*WireCodecFunc) (struct Wire *w, void *val_ptr);
+typedef ssize_t (*WireReadFunc) (int fd, void * buf, size_t len);
+typedef ssize_t (*WireWriteFunc) (int fd, const void * buf, size_t len);
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+typedef struct Wire
+ {
+ int version; /* protocol version in use */
+ WireDirection direction;
+ int status;
+ struct
+ {
+ WireCodecFunc w_byte;
+ WireCodecFunc w_char;
+ WireCodecFunc w_word;
+ WireCodecFunc w_string;
+ }
+ codec;
+ struct
+ {
+ size_t size;
+ char *curr;
+ char *start;
+ char *end;
+ }
+ buffer;
+ struct
+ {
+ int fd;
+ WireReadFunc read;
+ WireWriteFunc write;
+ }
+ io;
+ }
+Wire;
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+extern void xsane_rc_io_w_init(Wire *w);
+extern void xsane_rc_io_w_space(Wire *w, size_t howmuch);
+extern void xsane_rc_io_w_skip_newline(Wire *w);
+extern void xsane_rc_io_w_void(Wire *w);
+extern void xsane_rc_io_w_byte(Wire *w, SANE_Byte *v);
+extern void xsane_rc_io_w_char(Wire *w, SANE_Char *v);
+extern void xsane_rc_io_w_word(Wire *w, SANE_Word *v);
+extern void xsane_rc_io_w_string(Wire *w, SANE_String *v);
+extern void xsane_rc_io_w_status(Wire *w, SANE_Status *v);
+extern void xsane_rc_io_w_constraint_type(Wire *w, SANE_Constraint_Type *v);
+extern void xsane_rc_io_w_value_type(Wire *w, SANE_Value_Type *v);
+extern void xsane_rc_io_w_unit(Wire *w, SANE_Unit *v);
+extern void xsane_rc_io_w_action(Wire *w, SANE_Action *v);
+extern void xsane_rc_io_w_frame(Wire *w, SANE_Frame *v);
+extern void xsane_rc_io_w_range(Wire *w, SANE_Range *v);
+extern void xsane_rc_io_w_range_ptr(Wire *w, SANE_Range **v);
+extern void xsane_rc_io_w_device(Wire *w, SANE_Device *v);
+extern void xsane_rc_io_w_device_ptr(Wire *w, SANE_Device **v);
+extern void xsane_rc_io_w_option_descriptor(Wire *w, SANE_Option_Descriptor *v);
+extern void xsane_rc_io_w_option_descriptor_ptr(Wire *w, SANE_Option_Descriptor **v);
+extern void xsane_rc_io_w_parameters(Wire *w, SANE_Parameters *v);
+extern void xsane_rc_io_w_array(Wire *w, SANE_Word *len, void **v, WireCodecFunc w_element, size_t element_size);
+extern void xsane_rc_io_w_flush(Wire *w);
+extern void xsane_rc_io_w_set_dir(Wire *w, WireDirection dir);
+extern void xsane_rc_io_w_call(Wire *w, SANE_Word proc_num, WireCodecFunc w_arg, void *arg, WireCodecFunc w_reply, void *reply);
+extern void xsane_rc_io_w_reply(Wire *w, WireCodecFunc w_reply, void *reply);
+extern void xsane_rc_io_w_free(Wire *w, WireCodecFunc w_reply, void *reply);
+
+extern void xsane_rc_pref_string(Wire *w, void *p, long offset);
+extern void xsane_rc_pref_double(Wire *w, void *p, long offset);
+extern void xsane_rc_pref_int(Wire *w, void *p, long offset);
+
+/* ---------------------------------------------------------------------------------------------------------------- */
+
+#endif /* xsane_rc_io_wire_h */
diff --git a/frontend/xsane-save.c b/frontend/xsane-save.c
new file mode 100644
index 0000000..d9ac69a
--- /dev/null
+++ b/frontend/xsane-save.c
@@ -0,0 +1,975 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-save.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include "xsane.h"
+#include "xsane-preview.h"
+#include "xsane-back-gtk.h"
+#include "xsane-front-gtk.h"
+#include "xsane-text.h"
+
+#ifdef HAVE_LIBJPEG
+#include <jpeglib.h>
+#endif
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+#include <png.h>
+#include <zlib.h>
+#endif
+#endif
+
+#ifdef HAVE_LIBTIFF
+#include <tiffio.h>
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int cancel_save;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_cancel_save()
+{
+ cancel_save = 1;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_convert_text_to_filename(char **text)
+{
+ if (text)
+ {
+ char *filename = *text;
+ char buf[256];
+ int buflen=0;
+ int txtlen=0;
+
+ while((filename[txtlen] != 0) && (buflen<253))
+ {
+ switch (filename[txtlen])
+ {
+ case ' ':
+ buf[buflen++] = ':';
+ buf[buflen++] = '_';
+ txtlen++;
+ break;
+
+ case '/':
+ buf[buflen++] = ':';
+ buf[buflen++] = '%';
+ txtlen++;
+ break;
+
+ case '*':
+ buf[buflen++] = ':';
+ buf[buflen++] = '#';
+ txtlen++;
+ break;
+
+ case '?':
+ buf[buflen++] = ':';
+ buf[buflen++] = 'q';
+ txtlen++;
+ break;
+
+ case '\\':
+ buf[buflen++] = ':';
+ buf[buflen++] = '=';
+ txtlen++;
+ break;
+
+ case ';':
+ buf[buflen++] = ':';
+ buf[buflen++] = '!';
+ txtlen++;
+ break;
+
+ case '&':
+ buf[buflen++] = ':';
+ buf[buflen++] = '+';
+ txtlen++;
+ break;
+
+ case '<':
+ buf[buflen++] = ':';
+ buf[buflen++] = 's';
+ txtlen++;
+ break;
+
+ case '>':
+ buf[buflen++] = ':';
+ buf[buflen++] = 'g';
+ txtlen++;
+ break;
+
+ case '|':
+ buf[buflen++] = ':';
+ buf[buflen++] = 'p';
+ txtlen++;
+ break;
+
+ case ':':
+ buf[buflen++] = ':';
+ buf[buflen++] = ':';
+ txtlen++;
+ break;
+
+ default:
+ buf[buflen++] = filename[txtlen++];
+ break;
+ }
+ }
+ buf[buflen] = 0;
+ free(filename);
+ *text = strdup(buf);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_increase_counter_in_filename(char *filename, int skip)
+{
+ char *position_point;
+ char *position_counter;
+ char counter;
+ FILE *testfile;
+
+ while (1)
+ {
+ position_point = strrchr(filename, '.');
+ if (position_point)
+ {
+ position_counter = position_point-1;
+ }
+ else
+ {
+ position_counter = filename + strlen(filename) - 1;
+ }
+
+ if (!( (*position_counter >= '0') && (*position_counter <='9') ))
+ {
+ break; /* no counter found */
+ }
+
+ while ( (position_counter > filename) && (*position_counter >= '0') && (*position_counter <='9') )
+ {
+ counter = ++(*position_counter);
+ if (counter != ':')
+ {
+ break;
+ }
+ *position_counter = '0';
+ position_counter--;
+ }
+
+ if (!( (*position_counter >= '0') && (*position_counter <='9') )) /* overflow */
+ {
+ xsane_back_gtk_warning(WARN_COUNTER_OVERFLOW, FALSE);
+ break; /* last available number ("999") */
+ }
+
+ if (skip) /* test if filename already used */
+ {
+ testfile = fopen(filename, "r");
+ if (testfile) /* filename used: skip */
+ {
+ fclose(testfile);
+ }
+ else
+ {
+ break; /* filename not used, ok */
+ }
+ }
+ else /* do not test if filename already used */
+ {
+ break; /* filename ok */
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_save_ps_create_header(FILE *outfile, int color, int bits, int pixel_width, int pixel_height,
+ int left, int bottom, float width, float height,
+ int paperwidth, int paperheight, int rotate)
+{
+ int degree, position_left, position_bottom, box_left, box_bottom, box_right, box_top;
+
+ if (rotate) /* roatet with 90 degrees - eg for landscape mode */
+ {
+ degree = 90;
+ position_left = left;
+ position_bottom = bottom - paperwidth;
+ box_left = paperwidth - bottom - height * 72.0;
+ box_bottom = left;
+ box_right = (int) (box_left + height * 72.0);
+ box_top = (int) (box_bottom + width * 72.0);
+ }
+ else /* do not rotate, eg for portrait mode */
+ {
+ degree = 0;
+ position_left = left;
+ position_bottom = bottom;
+ box_left = left;
+ box_bottom = bottom;
+ box_right = (int) (box_left + width * 72.0);
+ box_top = (int) (box_bottom + height * 72.0);
+ }
+
+ fprintf(outfile, "%%!PS-Adobe-2.0 EPSF-2.0\n");
+ fprintf(outfile, "%%%%Creator: xsane version %s (sane %d.%d)\n", VERSION,
+ SANE_VERSION_MAJOR(xsane.sane_backend_versioncode),
+ SANE_VERSION_MINOR(xsane.sane_backend_versioncode));
+ fprintf(outfile, "%%%%BoundingBox: %d %d %d %d\n", box_left, box_bottom, box_right, box_top);
+ fprintf(outfile, "%%\n");
+ fprintf(outfile, "/origstate save def\n");
+ fprintf(outfile, "20 dict begin\n");
+
+ if (bits == 1)
+ {
+ fprintf(outfile, "/pix %d string def\n", (pixel_width+7)/8);
+ fprintf(outfile, "/grays %d string def\n", pixel_width);
+ fprintf(outfile, "/npixels 0 def\n");
+ fprintf(outfile, "/rgbindx 0 def\n");
+ }
+ else
+ {
+ fprintf(outfile, "/pix %d string def\n", pixel_width);
+ }
+
+
+ fprintf(outfile, "%d rotate\n", degree);
+ fprintf(outfile, "%d %d translate\n", position_left, position_bottom);
+ fprintf(outfile, "%f %f scale\n", width * 72.0, height * 72.0);
+ fprintf(outfile, "%d %d %d\n", pixel_width, pixel_height, bits);
+ fprintf(outfile, "[%d %d %d %d %d %d]\n", pixel_width, 0, 0, -pixel_height, 0 , pixel_height);
+ fprintf(outfile, "{currentfile pix readhexstring pop}\n");
+
+ if (color)
+ {
+ fprintf(outfile, "false 3 colorimage\n");
+ fprintf(outfile, "\n");
+ }
+ else
+ {
+ fprintf(outfile, "image\n");
+ fprintf(outfile, "\n");
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_save_ps_bw(FILE *outfile, FILE *imagefile, int pixel_width, int pixel_height)
+{
+ int x, y, count;
+ int bytes_per_line = (pixel_width+7)/8;
+
+ cancel_save = 0;
+
+ count = 0;
+ for (y = 0; y < pixel_height; y++)
+ {
+ for (x = 0; x < bytes_per_line; x++)
+ {
+ fprintf(outfile, "%02x", (fgetc(imagefile) ^ 255));
+ if (++count >= 40)
+ {
+ fprintf(outfile, "\n");
+ count = 0;
+ }
+ }
+ fprintf(outfile, "\n");
+ count = 0;
+ xsane_progress_update(xsane.progress, (float)y/pixel_height);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ if (cancel_save)
+ {
+ break;
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_save_ps_gray(FILE *outfile, FILE *imagefile, int pixel_width, int pixel_height)
+{
+ int x, y, count;
+
+ cancel_save = 0;
+
+ count = 0;
+ for (y=0; y<pixel_height; y++)
+ {
+ for (x=0; x<pixel_width; x++)
+ {
+ fprintf(outfile, "%02x", fgetc(imagefile));
+ if (++count >=40)
+ {
+ fprintf(outfile, "\n");
+ count = 0;
+ }
+ }
+ fprintf(outfile, "\n");
+ count = 0;
+ xsane_progress_update(xsane.progress, (float)y/pixel_height);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ if (cancel_save)
+ {
+ break;
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_save_ps_color(FILE *outfile, FILE *imagefile, int pixel_width, int pixel_height)
+{
+ int x, y, count;
+
+ cancel_save = 0;
+
+ count = 0;
+ for (y=0; y<pixel_height; y++)
+ {
+ for (x=0; x<pixel_width; x++)
+ {
+ fprintf(outfile, "%02x", fgetc(imagefile));
+ fprintf(outfile, "%02x", fgetc(imagefile));
+ fprintf(outfile, "%02x", fgetc(imagefile));
+ if (++count >=10)
+ {
+ fprintf(outfile, "\n");
+ count = 0;
+ }
+ }
+ fprintf(outfile, "\n");
+ count = 0;
+
+ xsane_progress_update(xsane.progress, (float)y/pixel_height);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ if (cancel_save)
+ {
+ break;
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_save_ps(FILE *outfile, FILE *imagefile,
+ int color, int bits,
+ int pixel_width, int pixel_height,
+ int left, int bottom,
+ float width, float height,
+ int paperheight, int paperwidth, int rotate)
+{
+ xsane_save_ps_create_header(outfile, color, bits, pixel_width, pixel_height,
+ left, bottom, width, height, paperheight, paperwidth, rotate);
+
+ if (color == 0) /* lineart, halftone, grayscale */
+ {
+ if (bits == 1) /* lineart, halftone */
+ {
+ xsane_save_ps_bw(outfile, imagefile, pixel_width, pixel_height);
+ }
+ else /* grayscale */
+ {
+ xsane_save_ps_gray(outfile, imagefile, pixel_width, pixel_height);
+ }
+ }
+ else /* color */
+ {
+ xsane_save_ps_color(outfile, imagefile, pixel_width, pixel_height);
+ }
+
+ fprintf(outfile, "\n");
+ fprintf(outfile, "showpage\n");
+ fprintf(outfile, "end\n");
+ fprintf(outfile, "origstate restore\n");
+ fprintf(outfile, "\n");
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifdef HAVE_LIBJPEG
+void xsane_save_jpeg(FILE *outfile, FILE *imagefile,
+ int color, int bits,
+ int pixel_width, int pixel_height,
+ int quality)
+{
+ char *data;
+ char buf[256];
+ int x,y;
+ int components = 1;
+ struct jpeg_compress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+ JSAMPROW row_pointer[1];
+
+ cancel_save = 0;
+
+ if (color)
+ {
+ components = 3;
+ }
+
+ data = malloc(pixel_width * components);
+
+ if (!data)
+ {
+ snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_NO_MEM);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ cinfo.err = jpeg_std_error(&jerr);
+ jpeg_create_compress(&cinfo);
+ jpeg_stdio_dest(&cinfo, outfile);
+ cinfo.image_width = pixel_width;
+ cinfo.image_height = pixel_height;
+ cinfo.input_components = components;
+ if (color)
+ {
+ cinfo.in_color_space = JCS_RGB;
+ }
+ else
+ {
+ cinfo.in_color_space = JCS_GRAYSCALE;
+ }
+ jpeg_set_defaults(&cinfo);
+ jpeg_set_quality(&cinfo, quality, TRUE);
+ jpeg_start_compress(&cinfo, TRUE);
+
+ for (y=0; y<pixel_height; y++)
+ {
+ xsane_progress_update(xsane.progress, (float)y/pixel_height);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ if (bits == 1)
+ {
+ int byte = 0;
+ int mask = 128;
+
+ for (x = 0; x < pixel_width; x++)
+ {
+
+ if ( (x % 8) == 0)
+ {
+ byte = fgetc(imagefile);
+ mask = 128;
+ }
+
+ if (byte & mask)
+ {
+ data[x] = 0;
+ }
+ else
+ {
+ data[x] = 255;
+ }
+ mask >>= 1;
+ }
+ }
+ else
+ {
+ fread(data, components, pixel_width, imagefile);
+ }
+ row_pointer[0] = data;
+ jpeg_write_scanlines(&cinfo, row_pointer, 1);
+ if (cancel_save)
+ {
+ break;
+ }
+ }
+
+ jpeg_finish_compress(&cinfo);
+ free(data);
+}
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifdef HAVE_LIBTIFF
+void xsane_save_tiff(const char *outfilename, FILE *imagefile,
+ int color, int bits,
+ int pixel_width, int pixel_height,
+ int compression, int quality)
+{
+ TIFF *tiffile;
+ char *data;
+ char buf[256];
+ int y, w;
+ int components;
+
+ cancel_save = 0;
+
+ if (color)
+ {
+ components = 3;
+ }
+ else
+ {
+ components = 1;
+ }
+
+ tiffile = TIFFOpen(outfilename, "w");
+ if (!tiffile)
+ {
+ snprintf(buf, sizeof(buf), "%s %s %s\n",ERR_DURING_SAVE, ERR_OPEN_FAILED, outfilename);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ data = malloc(pixel_width * components);
+
+ if (!data)
+ {
+ snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_NO_MEM);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ TIFFSetField(tiffile, TIFFTAG_IMAGEWIDTH, pixel_width);
+ TIFFSetField(tiffile, TIFFTAG_IMAGELENGTH, pixel_height);
+ TIFFSetField(tiffile, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
+ TIFFSetField(tiffile, TIFFTAG_BITSPERSAMPLE, bits);
+ TIFFSetField(tiffile, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
+ TIFFSetField(tiffile, TIFFTAG_COMPRESSION, compression);
+ TIFFSetField(tiffile, TIFFTAG_SAMPLESPERPIXEL, components);
+ TIFFSetField(tiffile, TIFFTAG_SOFTWARE, "xsane");
+#if 0
+ TIFFSetField(tiffile, TIFFTAG_DATATIME, "0.0.1900,0:0:00");
+ TIFFSetField(tiffile, TIFFTAG_XRESOLUTION, 100);
+ TIFFSetField(tiffile, TIFFTAG_YRESOLUTION, 100);
+#endif
+
+ if (compression == COMPRESSION_JPEG)
+ {
+ TIFFSetField(tiffile, TIFFTAG_JPEGQUALITY, quality);
+ }
+
+ if (color)
+ {
+ TIFFSetField(tiffile, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB);
+ }
+ else
+ {
+ if (bits == 1) /* lineart */
+ {
+ TIFFSetField(tiffile, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);
+ }
+ else /* grayscale */
+ {
+ TIFFSetField(tiffile, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
+ }
+ }
+
+ TIFFSetField(tiffile, TIFFTAG_ROWSPERSTRIP, TIFFDefaultStripSize(tiffile, -1));
+
+ w = TIFFScanlineSize(tiffile);
+
+ for (y = 0; y < pixel_height; y++)
+ {
+ xsane_progress_update(xsane.progress, (float) y / pixel_height);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ fread(data, 1, w, imagefile);
+
+ TIFFWriteScanline(tiffile, data, y, 0);
+
+ if (cancel_save)
+ {
+ break;
+ }
+ }
+
+ TIFFClose(tiffile);
+ free(data);
+}
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+void xsane_save_png(FILE *outfile, FILE *imagefile,
+ int color, int bits,
+ int pixel_width, int pixel_height,
+ int compression)
+{
+ png_structp png_ptr;
+ png_infop png_info_ptr;
+ png_bytep row_ptr;
+ png_color_8 sig_bit;
+ char *data;
+ char buf[256];
+ int colortype, components, byte_width;
+ int y;
+
+ cancel_save = 0;
+
+ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
+ if (!png_ptr)
+ {
+ snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_LIBTIFF);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ png_info_ptr = png_create_info_struct(png_ptr);
+ if (!png_info_ptr)
+ {
+ snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_LIBTIFF);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ if (setjmp(png_ptr->jmpbuf))
+ {
+ snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_LIBPNG);
+ xsane_back_gtk_error(buf, TRUE);
+ png_destroy_write_struct(&png_ptr, (png_infopp) 0);
+ return;
+ }
+
+ byte_width = pixel_width;
+
+ if (color == 4) /* RGBA */
+ {
+ components = 4;
+ colortype = PNG_COLOR_TYPE_RGB_ALPHA;
+ }
+ else if (color) /* RGB */
+ {
+ components = 3;
+ colortype = PNG_COLOR_TYPE_RGB;
+ }
+ else /* gray or black/white */
+ {
+ components = 1;
+ colortype = PNG_COLOR_TYPE_GRAY;
+ }
+
+ png_init_io(png_ptr, outfile);
+ png_set_compression_level(png_ptr, compression);
+ png_set_IHDR(png_ptr, png_info_ptr, pixel_width, pixel_height, bits,
+ colortype, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+
+ if (color >=3)
+ {
+ sig_bit.red = bits;
+ sig_bit.green = bits;
+ sig_bit.blue = bits;
+
+ if (color ==4)
+ {
+ sig_bit.alpha = bits;
+ }
+
+ }
+ else
+ {
+ sig_bit.gray = bits;
+
+ if (bits == 1)
+ {
+ byte_width = pixel_width/8;
+ png_set_invert_mono(png_ptr);
+ }
+ }
+
+ png_set_sBIT(png_ptr, png_info_ptr, &sig_bit);
+ png_write_info(png_ptr, png_info_ptr);
+ png_set_shift(png_ptr, &sig_bit);
+
+ data = malloc(pixel_width * components);
+
+ if (!data)
+ {
+ snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_NO_MEM);
+ xsane_back_gtk_error(buf, TRUE);
+ png_destroy_write_struct(&png_ptr, (png_infopp) 0);
+ return;
+ }
+
+ for (y = 0; y < pixel_height; y++)
+ {
+ xsane_progress_update(xsane.progress, (float) y / pixel_height);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ fread(data, components, byte_width, imagefile);
+
+ row_ptr = data;
+ png_write_rows(png_ptr, &row_ptr, 1);
+ if (cancel_save)
+ {
+ break;
+ }
+ }
+
+ free(data);
+ png_write_end(png_ptr, png_info_ptr);
+ png_destroy_write_struct(&png_ptr, (png_infopp) 0);
+
+}
+#endif
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+void xsane_save_png_16(FILE *outfile, FILE *imagefile,
+ int color, int bits,
+ int pixel_width, int pixel_height,
+ int compression)
+{
+ png_structp png_ptr;
+ png_infop png_info_ptr;
+ png_bytep row_ptr;
+ png_color_8 sig_bit; /* should be 16, but then I get a warning about wrong type */
+ char *data;
+ char buf[256];
+ int colortype, components;
+ int x,y;
+ guint16 val;
+
+ cancel_save = 0;
+
+ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
+ if (!png_ptr)
+ {
+ snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_LIBPNG);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ png_info_ptr = png_create_info_struct(png_ptr);
+ if (!png_info_ptr)
+ {
+ snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_LIBPNG);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ if (setjmp(png_ptr->jmpbuf))
+ {
+ snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_LIBPNG);
+ xsane_back_gtk_error(buf, TRUE);
+ png_destroy_write_struct(&png_ptr, (png_infopp) 0);
+ return;
+ }
+
+ if (color == 4) /* RGBA */
+ {
+ components = 4;
+ colortype = PNG_COLOR_TYPE_RGB_ALPHA;
+ }
+ else if (color) /* RGB */
+ {
+ components = 3;
+ colortype = PNG_COLOR_TYPE_RGB;
+ }
+ else /* gray or black/white */
+ {
+ components = 1;
+ colortype = PNG_COLOR_TYPE_GRAY;
+ }
+
+ png_init_io(png_ptr, outfile);
+ png_set_compression_level(png_ptr, compression);
+ png_set_IHDR(png_ptr, png_info_ptr, pixel_width, pixel_height, 16,
+ colortype, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+
+ sig_bit.red = bits;
+ sig_bit.green = bits;
+ sig_bit.blue = bits;
+ sig_bit.alpha = bits;
+ sig_bit.gray = bits;
+
+ png_set_sBIT(png_ptr, png_info_ptr, &sig_bit);
+ png_write_info(png_ptr, png_info_ptr);
+ png_set_shift(png_ptr, &sig_bit);
+ png_set_packing(png_ptr);
+
+ data = malloc(pixel_width * components * 2);
+
+ if (!data)
+ {
+ snprintf(buf, sizeof(buf), "%s %s", ERR_DURING_SAVE, ERR_NO_MEM);
+ xsane_back_gtk_error(buf, TRUE);
+ png_destroy_write_struct(&png_ptr, (png_infopp) 0);
+ return;
+ }
+
+ for (y = 0; y < pixel_height; y++)
+ {
+ xsane_progress_update(xsane.progress, (float)y/pixel_height);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ for (x = 0; x < pixel_width * components; x++) /* this must be changed in dependance of endianess */
+ {
+ fread(&val, 2, 1, imagefile); /* get data in machine order */
+ data[x*2+0] = val/256; /* write data in network order (MSB first) */
+ data[x*2+1] = val & 255;
+ }
+
+ row_ptr = data;
+ png_write_rows(png_ptr, &row_ptr, 1);
+ if (cancel_save)
+ {
+ break;
+ }
+ }
+
+ free(data);
+ png_write_end(png_ptr, png_info_ptr);
+ png_destroy_write_struct(&png_ptr, (png_infopp) 0);
+}
+#endif
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_save_pnm_16_gray(FILE *outfile, FILE *imagefile, int bits, int pixel_width, int pixel_height)
+{
+ int x,y;
+ guint16 val;
+ int count = 0;
+
+ cancel_save = 0;
+
+ /* write pgm ascii > 8 bpp */
+ fprintf(outfile, "P2\n# SANE data follows\n%d %d\n65535\n", pixel_width, pixel_height);
+
+ for (y=0; y<pixel_height; y++)
+ {
+ for (x=0; x<pixel_width; x++)
+ {
+ fread(&val, 2, 1, imagefile); /* get data in machine order */
+ fprintf(outfile, "%d ", val);
+
+ if (++count >= 10)
+ {
+ fprintf(outfile, "\n");
+ count = 0;
+ }
+ }
+ fprintf(outfile, "\n");
+ count = 0;
+
+ xsane_progress_update(xsane.progress, (float)y/pixel_height);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ if (cancel_save)
+ {
+ break;
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_save_pnm_16_color(FILE *outfile, FILE *imagefile, int bits, int pixel_width, int pixel_height)
+{
+ int x,y;
+ guint16 val;
+ int count = 0;
+
+ cancel_save = 0;
+
+ /* write ppm ascii > 8 bpp */
+ fprintf(outfile, "P3\n# SANE data follows\n%d %d\n65535\n", pixel_width, pixel_height);
+
+ for (y=0; y<pixel_height; y++)
+ {
+ for (x=0; x<pixel_width; x++)
+ {
+ fread(&val, 2, 1, imagefile); /* get data in machine order */
+ fprintf(outfile, "%d ", val);
+
+ fread(&val, 2, 1, imagefile);
+ fprintf(outfile, "%d ", val);
+
+ fread(&val, 2, 1, imagefile);
+ fprintf(outfile, "%d ", val);
+
+ if (++count >= 3)
+ {
+ fprintf(outfile, "\n");
+ count = 0;
+ }
+ }
+ fprintf(outfile, "\n");
+ count = 0;
+
+ xsane_progress_update(xsane.progress, (float)y/pixel_height);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ if (cancel_save)
+ {
+ break;
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_save_pnm_16(FILE *outfile, FILE *imagefile, int color, int bits, int pixel_width, int pixel_height)
+{
+ if (color)
+ {
+ xsane_save_pnm_16_color(outfile, imagefile, bits, pixel_width, pixel_height);
+ }
+ else
+ {
+ xsane_save_pnm_16_gray(outfile, imagefile, bits, pixel_width, pixel_height);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
diff --git a/frontend/xsane-save.h b/frontend/xsane-save.h
new file mode 100644
index 0000000..7ac856c
--- /dev/null
+++ b/frontend/xsane-save.h
@@ -0,0 +1,79 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-save.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_cancel_save();
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_convert_text_to_filename(char **filename);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+
+void xsane_increase_counter_in_filename(char *filename, int skip);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_save_ps(FILE *outfile, FILE *imagefile,
+ int color, int bits,
+ int pixel_width, int pixel_height,
+ int left, int bottom,
+ float width, float height,
+ int paperwidth, int paperheight, int landscape);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_save_jpeg(FILE *outfile, FILE *imagefile,
+ int color, int bits,
+ int pixel_width, int pixel_height,
+ int quality);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_save_tiff(const char *outfilename, FILE *imagefile,
+ int color, int bits,
+ int pixel_width, int pixel_height,
+ int compression, int quality);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_save_png(FILE *outfile, FILE *imagefile,
+ int color, int bits,
+ int pixel_width, int pixel_height,
+ int compression);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_save_png_16(FILE *outfile, FILE *imagefile,
+ int color, int bits,
+ int pixel_width, int pixel_height,
+ int compression);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_save_pnm_16(FILE *outfile, FILE *imagefile,
+ int color, int bits,
+ int pixel_width, int pixel_height);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
diff --git a/frontend/xsane-scan.c b/frontend/xsane-scan.c
new file mode 100644
index 0000000..d66ab28
--- /dev/null
+++ b/frontend/xsane-scan.c
@@ -0,0 +1,2369 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-scan.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include "xsane.h"
+#include "xsane-back-gtk.h"
+#include "xsane-front-gtk.h"
+#include "xsane-preferences.h"
+#include "xsane-preview.h"
+#include "xsane-save.h"
+#include "xsane-text.h"
+#include "xsane-gamma.h"
+#include "xsane-setup.h"
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+#include <png.h>
+#include <zlib.h>
+#endif
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifdef HAVE_LIBGIMP_GIMP_H
+
+#include <libgimp/gimp.h>
+
+static void xsane_gimp_query(void);
+static void xsane_gimp_run(char *name, int nparams, GParam * param, int *nreturn_vals, GParam ** return_vals);
+
+GPlugInInfo PLUG_IN_INFO =
+{
+ NULL, /* init_proc */
+ NULL, /* quit_proc */
+ xsane_gimp_query, /* query_proc */
+ xsane_gimp_run, /* run_proc */
+};
+
+#endif /* HAVE_LIBGIMP_GIMP_H */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* forward declarations: */
+
+static int xsane_generate_dummy_filename();
+#ifdef HAVE_LIBGIMP_GIMP_H
+static int xsane_decode_devname(const char *encoded_devname, int n, char *buf);
+static int xsane_encode_devname(const char *devname, int n, char *buf);
+void null_print_func(gchar *msg);
+static void xsane_gimp_advance(void);
+#endif
+static void xsane_read_image_data(gpointer data, gint source, GdkInputCondition cond);
+static RETSIGTYPE xsane_sigpipe_handler(int signal);
+static int xsane_test_multi_scan(void);
+void xsane_scan_done(SANE_Status status);
+void xsane_cancel(void);
+static void xsane_start_scan(void);
+void xsane_scan_dialog(GtkWidget * widget, gpointer call_data);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int xsane_generate_dummy_filename()
+{
+ /* returns TRUE if file is a temporary file */
+
+ if (xsane.dummy_filename)
+ {
+ free(xsane.dummy_filename);
+ }
+
+ if ( (xsane.xsane_mode == XSANE_COPY) || (xsane.xsane_mode == XSANE_FAX) || /* we have to do a conversion */
+ ( (xsane.xsane_mode == XSANE_SCAN) && (xsane.xsane_output_format != XSANE_PNM) &&
+ (xsane.xsane_output_format != XSANE_RAW16) && (xsane.xsane_output_format != XSANE_RGBA) ) )
+ {
+ char filename[PATH_MAX];
+
+ xsane_back_gtk_make_path(sizeof(filename), filename, 0, 0, "conversion-", dialog->dev_name, ".ppm", XSANE_PATH_TMP);
+ xsane.dummy_filename = strdup(filename);
+ return TRUE;
+ }
+ else /* no conversion following, save directly to the selected filename */
+ {
+ xsane.dummy_filename = strdup(xsane.output_filename);
+ return FALSE;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifdef HAVE_LIBGIMP_GIMP_H
+static int xsane_decode_devname(const char *encoded_devname, int n, char *buf)
+{
+ char *dst, *limit;
+ const char *src;
+ char ch, val;
+
+ limit = buf + n;
+ for (src = encoded_devname, dst = buf; *src; ++dst)
+ {
+ if (dst >= limit)
+ {
+ return -1;
+ }
+
+ ch = *src++;
+ /* don't use the ctype.h macros here since we don't want to allow anything non-ASCII here... */
+ if (ch != '-')
+ {
+ *dst = ch;
+ }
+ else /* decode */
+ {
+ ch = *src++;
+ if (ch == '-')
+ {
+ *dst = ch;
+ }
+ else
+ {
+ if (ch >= 'a' && ch <= 'f')
+ {
+ val = (ch - 'a') + 10;
+ }
+ else
+ {
+ val = (ch - '0');
+ }
+ val <<= 4;
+
+ ch = *src++;
+ if (ch >= 'a' && ch <= 'f')
+ {
+ val |= (ch - 'a') + 10;
+ }
+ else
+ {
+ val |= (ch - '0');
+ }
+
+ *dst = val;
+
+ ++src; /* simply skip terminating '-' for now... */
+ }
+ }
+ }
+
+ if (dst >= limit)
+ {
+ return -1;
+ }
+
+ *dst = '\0';
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int xsane_encode_devname(const char *devname, int n, char *buf)
+{
+ static const char hexdigit[] = "0123456789abcdef";
+ char *dst, *limit;
+ const char *src;
+ char ch;
+
+ limit = buf + n;
+ for (src = devname, dst = buf; *src; ++src)
+ {
+ if (dst >= limit)
+ {
+ return -1;
+ }
+
+ ch = *src;
+ /* don't use the ctype.h macros here since we don't want to allow anything non-ASCII here... */
+ if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
+ {
+ *dst++ = ch;
+ }
+ else /* encode */
+ {
+ if (dst + 4 >= limit)
+ {
+ return -1;
+ }
+
+ *dst++ = '-';
+ if (ch == '-')
+ {
+ *dst++ = '-';
+ }
+ else
+ {
+ *dst++ = hexdigit[(ch >> 4) & 0x0f];
+ *dst++ = hexdigit[(ch >> 0) & 0x0f];
+ *dst++ = '-';
+ }
+ }
+ }
+
+ if (dst >= limit)
+ {
+ return -1;
+ }
+
+ *dst = '\0';
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_gimp_query(void)
+{
+ static GParamDef args[] =
+ {
+ {PARAM_INT32, "run_mode", "Interactive, non-interactive"},
+ };
+ static GParamDef *return_vals = NULL;
+ static int nargs = sizeof(args) / sizeof(args[0]);
+ static int nreturn_vals = 0;
+ char mpath[1024];
+ char name[1024];
+ size_t len;
+ int i, j;
+
+ snprintf(name, sizeof(name), "%s", prog_name);
+#ifdef GIMP_CHECK_VERSION
+# if GIMP_CHECK_VERSION(1,1,9)
+ snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU_DIALOG);
+# else
+ snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU_DIALOG_OLD);
+# endif
+#else
+ snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU_DIALOG_OLD);
+#endif
+ gimp_install_procedure(name,
+ XSANE_GIMP_INSTALL_BLURB,
+ XSANE_GIMP_INSTALL_HELP,
+ XSANE_AUTHOR,
+ XSANE_COPYRIGHT,
+ XSANE_DATE,
+ mpath,
+ 0, /* "RGB, GRAY", */
+ PROC_EXTENSION,
+ nargs, nreturn_vals,
+ args, return_vals);
+
+ sane_init(&xsane.sane_backend_versioncode, (void *) xsane_authorization_callback);
+ if (SANE_VERSION_MAJOR(xsane.sane_backend_versioncode) != SANE_V_MAJOR)
+ {
+ fprintf(stderr, "\n\n"
+ "%s %s:\n"
+ " %s\n"
+ " %s %d\n"
+ " %s %d\n"
+ "%s\n\n",
+ prog_name, ERR_ERROR,
+ ERR_MAJOR_VERSION_NR_CONFLICT,
+ ERR_XSANE_MAJOR_VERSION, SANE_V_MAJOR,
+ ERR_BACKEND_MAJOR_VERSION, SANE_VERSION_MAJOR(xsane.sane_backend_versioncode),
+ ERR_PROGRAM_ABORTED);
+ return;
+ }
+
+ sane_get_devices(&devlist, SANE_FALSE);
+
+ for (i = 0; devlist[i]; ++i)
+ {
+ snprintf(name, sizeof(name), "%s-", prog_name);
+ if (xsane_encode_devname(devlist[i]->name, sizeof(name) - 6, name + 6) < 0)
+ {
+ continue; /* name too long... */
+ }
+
+#ifdef GIMP_CHECK_VERSION
+# if GIMP_CHECK_VERSION(1,1,9)
+ snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU);
+# else
+ snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU_OLD);
+# endif
+#else
+ snprintf(mpath, sizeof(mpath), "%s", XSANE_GIMP_MENU_OLD);
+#endif
+ len = strlen(mpath);
+ for (j = 0; devlist[i]->name[j]; ++j)
+ {
+ if (devlist[i]->name[j] == '/')
+ mpath[len++] = '\'';
+ else
+ mpath[len++] = devlist[i]->name[j];
+ }
+ mpath[len++] = '\0';
+
+ gimp_install_procedure(name,
+ XSANE_GIMP_INSTALL_BLURB,
+ XSANE_GIMP_INSTALL_HELP,
+ XSANE_AUTHOR,
+ XSANE_COPYRIGHT,
+ XSANE_DATE,
+ mpath,
+ "RGB, GRAY",
+ PROC_EXTENSION,
+ nargs, nreturn_vals,
+ args, return_vals);
+ }
+ sane_exit();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_gimp_run(char *name, int nparams, GParam * param, int *nreturn_vals, GParam ** return_vals)
+{
+ static GParam values[2];
+ GRunModeType run_mode;
+ char devname[1024];
+ char *args[2];
+ int nargs;
+
+ run_mode = param[0].data.d_int32;
+ xsane.mode = XSANE_GIMP_EXTENSION;
+
+ *nreturn_vals = 1;
+ *return_vals = values;
+
+ values[0].type = PARAM_STATUS;
+ values[0].data.d_status = STATUS_CALLING_ERROR;
+
+ nargs = 0;
+ args[nargs++] = "xsane";
+
+ seldev = -1;
+ if (strncmp(name, "xsane-", 6) == 0)
+ {
+ if (xsane_decode_devname(name + 6, sizeof(devname), devname) < 0)
+ {
+ return; /* name too long */
+ }
+ args[nargs++] = devname;
+ }
+
+ switch (run_mode)
+ {
+ case RUN_INTERACTIVE:
+ xsane_interface(nargs, args);
+ values[0].data.d_status = STATUS_SUCCESS;
+ break;
+
+ case RUN_NONINTERACTIVE:
+ /* Make sure all the arguments are there! */
+ break;
+
+ case RUN_WITH_LAST_VALS:
+ /* Possibly retrieve data */
+ break;
+
+ default:
+ break;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void null_print_func(gchar *msg)
+{
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_gimp_advance(void)
+{
+ if (++xsane.x >= xsane.param.pixels_per_line)
+ {
+ int tile_height = gimp_tile_height();
+
+ xsane.x = 0;
+ ++xsane.y;
+ if (xsane.y % tile_height == 0)
+ {
+ gimp_pixel_rgn_set_rect(&xsane.region, xsane.tile, 0, xsane.y - tile_height, xsane.param.pixels_per_line, tile_height);
+ if (xsane.param.format >= SANE_FRAME_RED && xsane.param.format <= SANE_FRAME_BLUE)
+ {
+ int height;
+
+ xsane.tile_offset %= 3;
+
+ if (!xsane.first_frame) /* get the data for the existing tile: */
+ {
+ height = tile_height;
+
+ if (xsane.y + height >= xsane.param.lines)
+ {
+ height = xsane.param.lines - xsane.y;
+ }
+
+ gimp_pixel_rgn_get_rect(&xsane.region, xsane.tile, 0, xsane.y, xsane.param.pixels_per_line, height);
+ }
+ }
+ else
+ {
+ xsane.tile_offset = 0;
+ }
+ }
+ }
+}
+
+#endif /* HAVE_LIBGIMP_GIMP_H */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_read_image_data(gpointer data, gint source, GdkInputCondition cond)
+{
+ SANE_Handle dev = xsane_back_gtk_dialog_get_device (dialog);
+ SANE_Status status;
+ SANE_Int len;
+ int i;
+ char buf[255];
+
+ if ( (xsane.param.depth == 1) || (xsane.param.depth == 8) )
+ {
+ static unsigned char buf8[32768];
+
+ while (1)
+ {
+ status = sane_read(dev, (SANE_Byte *) buf8, sizeof(buf8), &len);
+ if (status == SANE_STATUS_EOF)
+ {
+ if (!xsane.param.last_frame)
+ {
+ xsane_start_scan();
+ break; /* leave while loop */
+ }
+
+ xsane_scan_done(SANE_STATUS_EOF); /* image complete, stop scanning */
+ return;
+ }
+
+ if (status != SANE_STATUS_GOOD)
+ {
+ xsane_scan_done(status); /* status = return of sane_read */
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_DURING_READ, XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ if (!len)
+ {
+ break; /* out of data for now, leave while loop */
+ }
+
+ xsane.bytes_read += len;
+ xsane_progress_update(xsane.progress, xsane.bytes_read / (gfloat) xsane.num_bytes);
+
+ if (xsane.input_tag < 0)
+ {
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ }
+
+ switch (xsane.param.format)
+ {
+ case SANE_FRAME_GRAY:
+ if (xsane.mode == XSANE_STANDALONE)
+ {
+ int i;
+ char val;
+
+ if ((!xsane.scanner_gamma_gray) && (xsane.param.depth > 1))
+ {
+ for (i=0; i < len; ++i)
+ {
+ val = xsane.gamma_data[(int) buf8[i]];
+ fwrite(&val, 1, 1, xsane.out);
+ }
+ }
+ else
+ {
+ fwrite(buf8, 1, len, xsane.out);
+ }
+ }
+#ifdef HAVE_LIBGIMP_GIMP_H
+ else /* GIMP MODE GRAY 8 bit */
+ {
+ switch (xsane.param.depth)
+ {
+ case 1:
+ for (i = 0; i < len; ++i)
+ {
+ u_char mask;
+ int j;
+
+ mask = buf8[i];
+ for (j = 7; j >= 0; --j)
+ {
+ u_char gl = (mask & (1 << j)) ? 0x00 : 0xff;
+ xsane.tile[xsane.tile_offset++] = gl;
+ xsane_gimp_advance();
+ if (xsane.x == 0)
+ {
+ break;
+ }
+ }
+ }
+ break;
+
+ case 8:
+ if (!xsane.scanner_gamma_gray)
+ {
+ for (i = 0; i < len; ++i)
+ {
+ xsane.tile[xsane.tile_offset++] = xsane.gamma_data[(int) buf8[i]];
+ xsane_gimp_advance();
+ }
+ }
+ else
+ {
+ for (i = 0; i < len; ++i)
+ {
+ xsane.tile[xsane.tile_offset++] = buf8[i];
+ xsane_gimp_advance();
+ }
+ }
+ break;
+ }
+ }
+#endif /* HAVE_LIBGIMP_GIMP_H */
+ break;
+
+ case SANE_FRAME_RGB:
+ if (xsane.mode == XSANE_STANDALONE)
+ {
+ int i;
+ char val;
+
+ if (!xsane.scanner_gamma_color) /* gamma correction by xsane */
+ {
+ for (i=0; i < len; ++i)
+ {
+ if (dialog->pixelcolor == 0)
+ {
+ val = xsane.gamma_data_red[(int) buf8[i]];
+ dialog->pixelcolor++;
+ }
+ else if (dialog->pixelcolor == 1)
+ {
+ val = xsane.gamma_data_green[(int) buf8[i]];
+ dialog->pixelcolor++;
+ }
+ else
+ {
+ val = xsane.gamma_data_blue[(int) buf8[i]];
+ dialog->pixelcolor = 0;
+ }
+ fwrite(&val, 1, 1, xsane.out);
+ }
+ }
+ else /* gamma correction has been done by scanner */
+ {
+ fwrite(buf8, 1, len, xsane.out);
+ }
+ }
+#ifdef HAVE_LIBGIMP_GIMP_H
+ else /* GIMP MODE RGB 8 bit */
+ {
+ switch (xsane.param.depth)
+ {
+ case 1:
+ if (xsane.param.format == SANE_FRAME_RGB)
+ {
+ goto bad_depth;
+ }
+ for (i = 0; i < len; ++i)
+ {
+ u_char mask;
+ int j;
+
+ mask = buf8[i];
+ for (j = 0; j < 8; ++j)
+ {
+ u_char gl = (mask & 1) ? 0xff : 0x00;
+ mask >>= 1;
+ xsane.tile[xsane.tile_offset++] = gl;
+ xsane_gimp_advance();
+ if (xsane.x == 0)
+ break;
+ }
+ }
+ break;
+
+ case 8:
+ if (!xsane.scanner_gamma_color) /* gamma correction by xsane */
+ {
+ for (i = 0; i < len; ++i)
+ {
+ if (xsane.tile_offset % 3 == 0)
+ {
+ xsane.tile[xsane.tile_offset++] = xsane.gamma_data_red[(int) buf8[i]];
+ }
+ else if (xsane.tile_offset % 3 == 1)
+ {
+ xsane.tile[xsane.tile_offset++] = xsane.gamma_data_green[(int) buf8[i]];
+ }
+ else
+ {
+ xsane.tile[xsane.tile_offset++] = xsane.gamma_data_blue[(int) buf8[i]];
+ }
+
+ if (xsane.tile_offset % 3 == 0)
+ {
+ xsane_gimp_advance();
+ }
+ }
+ }
+ else /* gamma correction by scanner */
+ {
+ for (i = 0; i < len; ++i)
+ {
+ xsane.tile[xsane.tile_offset++] = buf8[i];
+ if (xsane.tile_offset % 3 == 0)
+ {
+ xsane_gimp_advance();
+ }
+ }
+ }
+ break;
+
+ default:
+ goto bad_depth;
+ break;
+ }
+ }
+#endif /* HAVE_LIBGIMP_GIMP_H */
+ break;
+
+ case SANE_FRAME_RED:
+ case SANE_FRAME_GREEN:
+ case SANE_FRAME_BLUE:
+ if (xsane.mode == XSANE_STANDALONE)
+ {
+ if (!xsane.scanner_gamma_color) /* gamma correction by xsane */
+ {
+ char val;
+ SANE_Int *gamma;
+
+ if (xsane.param.format == SANE_FRAME_RED)
+ {
+ gamma = xsane.gamma_data_red;
+ }
+ else if (xsane.param.format == SANE_FRAME_GREEN)
+ {
+ gamma = xsane.gamma_data_green;
+ }
+ else
+ {
+ gamma = xsane.gamma_data_blue;
+ }
+
+ for (i = 0; i < len; ++i)
+ {
+ val = gamma[(int) buf8[i]];
+ fwrite(&val, 1, 1, xsane.out);
+ fseek(xsane.out, 2, SEEK_CUR);
+ }
+ }
+ else /* gamma correction by scanner */
+ {
+ for (i = 0; i < len; ++i)
+ {
+ fwrite(&buf8[i], 1, 1, xsane.out);
+ fseek(xsane.out, 2, SEEK_CUR);
+ }
+ }
+ }
+#ifdef HAVE_LIBGIMP_GIMP_H
+ else /* GIMP MODE RED, GREEN, BLUE (3PASS) 8 bit */
+ {
+ switch (xsane.param.depth)
+ {
+ case 1:
+ for (i = 0; i < len; ++i)
+ {
+ u_char mask;
+ int j;
+
+ mask = buf8[i];
+ for (j = 0; j < 8; ++j)
+ {
+ u_char gl = (mask & 1) ? 0xff : 0x00;
+ mask >>= 1;
+ xsane.tile[xsane.tile_offset] = gl;
+ xsane.tile_offset += 3;
+ xsane_gimp_advance();
+ if (xsane.x == 0)
+ {
+ break;
+ }
+ }
+ }
+ break;
+
+ case 8:
+ if (!xsane.scanner_gamma_color) /* gamma correction by xsane */
+ {
+ SANE_Int *gamma;
+
+ if (xsane.param.format == SANE_FRAME_RED)
+ {
+ gamma = xsane.gamma_data_red;
+ }
+ else if (xsane.param.format == SANE_FRAME_GREEN)
+ {
+ gamma = xsane.gamma_data_green;
+ }
+ else
+ {
+ gamma = xsane.gamma_data_blue;
+ }
+
+ for (i = 0; i < len; ++i)
+ {
+ xsane.tile[xsane.tile_offset] = gamma[(int) buf8[i]];
+ xsane.tile_offset += 3;
+ xsane_gimp_advance();
+ }
+ }
+ else /* gamma correction by scanner */
+ {
+ for (i = 0; i < len; ++i)
+ {
+ xsane.tile[xsane.tile_offset] = buf8[i];
+ xsane.tile_offset += 3;
+ xsane_gimp_advance();
+ }
+ }
+ break;
+
+ default:
+ goto bad_depth;
+ break;
+ }
+ }
+#endif /* HAVE_LIBGIMP_GIMP_H */
+ break;
+
+#ifdef SUPPORT_RGBA
+ case SANE_FRAME_RGBA: /* Scanning including Infrared channel */
+ if (xsane.mode == XSANE_STANDALONE)
+ {
+ int i;
+ char val;
+
+ if (!xsane.scanner_gamma_color) /* gamma correction by xsane */
+ {
+ for (i=0; i < len; ++i)
+ {
+ if (dialog->pixelcolor == 0)
+ {
+ val = xsane.gamma_data_red[(int) buf8[i]];
+ dialog->pixelcolor++;
+ }
+ else if (dialog->pixelcolor == 1)
+ {
+ val = xsane.gamma_data_green[(int) buf8[i]];
+ dialog->pixelcolor++;
+ }
+ else if (dialog->pixelcolor == 2)
+ {
+ val = xsane.gamma_data_blue[(int) buf8[i]];
+ dialog->pixelcolor++;
+ }
+ else
+ {
+ val = buf8[i]; /* no gamma table for infrared channel */
+ dialog->pixelcolor = 0;
+ }
+ fwrite(&val, 1, 1, xsane.out);
+ }
+ }
+ else /* gamma correction has been done by scanner */
+ {
+ fwrite(buf8, 1, len, xsane.out);
+ }
+ }
+#ifdef HAVE_LIBGIMP_GIMP_H
+ else /* GIMP MODE RGBA 8 bit */
+ {
+ int i;
+
+
+ switch (xsane.param.depth)
+ {
+ case 8:
+ if (!xsane.scanner_gamma_color) /* gamma correction by xsane */
+ {
+ for (i=0; i < len; ++i)
+ {
+ if (xsane.tile_offset % 4 == 0)
+ {
+ xsane.tile[xsane.tile_offset++] = xsane.gamma_data_red[(int) buf8[i]];
+ }
+ else if (xsane.tile_offset % 4 == 1)
+ {
+ xsane.tile[xsane.tile_offset++] = xsane.gamma_data_green[(int) buf8[i]];
+ }
+ else if (xsane.tile_offset % 4 == 2)
+ {
+ xsane.tile[xsane.tile_offset++] = xsane.gamma_data_blue[(int) buf8[i]];
+ }
+ else
+ {
+ xsane.tile[xsane.tile_offset++] = buf8[i]; /* no gamma table for infrared channel */
+ }
+
+ if (xsane.tile_offset % 4 == 0)
+ {
+ xsane_gimp_advance();
+ }
+ }
+ }
+ else /* gamma correction has been done by scanner */
+ {
+ for (i = 0; i < len; ++i)
+ {
+ xsane.tile[xsane.tile_offset++] = buf8[i];
+ if (xsane.tile_offset % 4 == 0)
+ {
+ xsane_gimp_advance();
+ }
+ }
+ }
+ break;
+
+ default:
+ goto bad_depth;
+ break;
+ }
+ }
+#endif /* HAVE_LIBGIMP_GIMP_H */
+ break;
+#endif
+
+ default:
+ xsane_scan_done(-1); /* -1 = error */
+ fprintf(stderr, "xsane_read_image_data: %s %d\n", ERR_BAD_FRAME_FORMAT, xsane.param.format);
+ return;
+ break;
+ }
+ }
+ }
+ else if ( xsane.param.depth == 16 )
+ {
+ static guint16 buf16[32768];
+ char buf[255];
+ char last = 0;
+ int offset = 0;
+
+ while (1)
+ {
+ if (offset) /* if we have had an odd number of bytes */
+ {
+ buf16[0] = last;
+ status = sane_read(dev, (SANE_Byte *) (buf16 + 1), sizeof(buf16) - 1, &len);
+ if (len)
+ {
+ len++;
+ }
+ }
+ else /* last read we had an even number of bytes */
+ {
+ status = sane_read(dev, (SANE_Byte *) buf16, sizeof(buf16), &len);
+ }
+
+ if (len % 2) /* odd number of bytes */
+ {
+ len--;
+ last = buf16[len];
+ offset = 1;
+ }
+ else /* even number of bytes */
+ {
+ offset = 0;
+ }
+
+ if (status == SANE_STATUS_EOF)
+ {
+ if (!xsane.param.last_frame)
+ {
+ xsane_start_scan();
+ break; /* leave while loop */
+ }
+
+ xsane_scan_done(SANE_STATUS_EOF); /* image complete, stop scanning */
+ return;
+ }
+
+ if (status != SANE_STATUS_GOOD)
+ {
+ xsane_scan_done(status); /* status = return of sane_read */
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_DURING_READ, XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ if (!len) /* nothing read */
+ {
+ break; /* out of data for now, leave while loop */
+ }
+
+ xsane.bytes_read += len;
+ xsane_progress_update(xsane.progress, xsane.bytes_read / (gfloat) xsane.num_bytes);
+
+ if (xsane.input_tag < 0)
+ {
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ }
+
+ switch (xsane.param.format)
+ {
+ case SANE_FRAME_GRAY:
+ if (xsane.mode == XSANE_STANDALONE)
+ {
+ int i;
+ guint16 val;
+
+ if (!xsane.scanner_gamma_gray) /* gamma correction by xsane */
+ {
+ for (i=0; i < len/2; ++i)
+ {
+ val = xsane.gamma_data[buf16[i]];
+ fwrite(&val, 2, 1, xsane.out);
+ }
+ }
+ else /* gamma correction by scanner */
+ {
+ fwrite(buf16, 2, len/2, xsane.out);
+ }
+ }
+ break;
+
+ case SANE_FRAME_RGB:
+ if (xsane.mode == XSANE_STANDALONE)
+ {
+ int i;
+ guint16 val;
+
+ if (!xsane.scanner_gamma_color) /* gamma correction by xsane */
+ {
+ for (i=0; i < len/2; ++i)
+ {
+ if (dialog->pixelcolor == 0)
+ {
+ val = xsane.gamma_data_red[buf16[i]];
+ dialog->pixelcolor++;
+ }
+ else if (dialog->pixelcolor == 1)
+ {
+ val = xsane.gamma_data_green[buf16[i]];
+ dialog->pixelcolor++;
+ }
+ else
+ {
+ val = xsane.gamma_data_blue[buf16[i]];
+ dialog->pixelcolor = 0;
+ }
+ fwrite(&val, 2, 1, xsane.out);
+ }
+ }
+ else /* gamma correction by scanner */
+ {
+ fwrite(buf16, 2, len/2, xsane.out);
+ }
+ }
+ break;
+
+ case SANE_FRAME_RED:
+ case SANE_FRAME_GREEN:
+ case SANE_FRAME_BLUE:
+ if (xsane.mode == XSANE_STANDALONE)
+ {
+ for (i = 0; i < len/2; ++i)
+ {
+ fwrite(buf16 + i*2, 2, 1, xsane.out);
+ fseek(xsane.out, 4, SEEK_CUR);
+ }
+ }
+ break;
+
+#ifdef SUPPORT_RGBA
+ case SANE_FRAME_RGBA:
+ if (xsane.mode == XSANE_STANDALONE)
+ {
+ int i;
+ guint16 val;
+
+ if (!xsane.scanner_gamma_color)
+ {
+ for (i=0; i < len/2; ++i)
+ {
+ if (dialog->pixelcolor == 0)
+ {
+ val = xsane.gamma_data_red[buf16[i]];
+ dialog->pixelcolor++;
+ }
+ else if (dialog->pixelcolor == 1)
+ {
+ val = xsane.gamma_data_green[buf16[i]];
+ dialog->pixelcolor++;
+ }
+ else if (dialog->pixelcolor == 2)
+ {
+ val = xsane.gamma_data_blue[buf16[i]];
+ dialog->pixelcolor++;
+ }
+ else
+ {
+ val = buf16[i]; /* no gamma table for infrared channel */
+ dialog->pixelcolor = 0;
+ }
+ fwrite(&val, 2, 1, xsane.out);
+ }
+ }
+ else
+ {
+ fwrite(buf16, 2, len/2, xsane.out);
+ }
+ }
+ break;
+#endif
+
+ default:
+ xsane_scan_done(-1); /* -1 = error */
+ fprintf(stderr, "xsane_read_image_data: %s %d\n", ERR_BAD_FRAME_FORMAT, xsane.param.format);
+ return;
+ break;
+ }
+ }
+ }
+ else
+ {
+ xsane_scan_done(-1); /* -1 = error */
+ snprintf(buf, sizeof(buf), "%s %d.", ERR_BAD_DEPTH, xsane.param.depth);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ return;
+
+ /* ---------------------- */
+
+#ifdef HAVE_LIBGIMP_GIMP_H
+bad_depth:
+
+ xsane_scan_done(-1); /* -1 = error */
+ snprintf(buf, sizeof(buf), "%s %d.", ERR_BAD_DEPTH, xsane.param.depth);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+#endif
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static RETSIGTYPE xsane_sigpipe_handler(int signal)
+/* this is to catch a broken pipe while writing to printercommand */
+{
+ xsane_cancel_save(0);
+ xsane.broken_pipe = 1;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int xsane_test_multi_scan(void)
+{
+ char *set;
+ SANE_Status status;
+ const SANE_Option_Descriptor *opt;
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.scansource);
+ if (opt)
+ {
+ if (SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ if (opt->constraint_type == SANE_CONSTRAINT_STRING_LIST)
+ {
+ set = malloc(opt->size);
+ status = sane_control_option(dialog->dev, dialog->well_known.scansource, SANE_ACTION_GET_VALUE, set, 0);
+
+ if (status == SANE_STATUS_GOOD)
+ {
+ if (!strcmp(set, SANE_NAME_DOCUMENT_FEEDER))
+ {
+ return TRUE;
+ }
+ }
+ free(set);
+ }
+ }
+ }
+
+#if 0 /* this is planned for the next sane-standard */
+ if (xsane.param.bitfield & XSANE_PARAM_STATUS_MORE_IMAGES)
+ {
+ return TRUE;
+ }
+#endif
+
+ return FALSE;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_scan_done(SANE_Status status)
+{
+ if (xsane.input_tag >= 0)
+ {
+ gdk_input_remove(xsane.input_tag);
+ xsane.input_tag = -1;
+ }
+
+ if (xsane.progress) /* remove progressbar */
+ {
+ xsane_progress_free(xsane.progress);
+ xsane.progress = 0;
+ }
+
+ while(gtk_events_pending()) /* let gtk remove the progress bar and update everything that needs it */
+ {
+ gtk_main_iteration();
+ }
+
+
+ /* we have to free the gamma tables if we used software gamma correction */
+
+ if (xsane.gamma_data)
+ {
+ free(xsane.gamma_data);
+ xsane.gamma_data = 0;
+ }
+
+ if (xsane.gamma_data_red)
+ {
+ free(xsane.gamma_data_red);
+ free(xsane.gamma_data_green);
+ free(xsane.gamma_data_blue);
+
+ xsane.gamma_data_red = 0;
+ xsane.gamma_data_green = 0;
+ xsane.gamma_data_blue = 0;
+ }
+
+ if (xsane.out) /* close file - this is dummy_file but if there is no conversion it is the wanted file */
+ {
+ fclose(xsane.out);
+ xsane.out = 0;
+ }
+
+ if ( (status == SANE_STATUS_GOOD) || (status == SANE_STATUS_EOF) ) /* no error, do conversion etc. */
+ {
+ if (xsane.mode == XSANE_STANDALONE)
+ {
+ if ( (xsane.xsane_mode == XSANE_SCAN) && (xsane.xsane_output_format != XSANE_PNM) &&
+ (xsane.xsane_output_format != XSANE_RAW16) && (xsane.xsane_output_format != XSANE_RGBA) )
+ {
+ FILE *outfile;
+ FILE *infile;
+ char buf[256];
+
+ /* open progressbar */
+ snprintf(buf, sizeof(buf), PROGRESS_SAVING);
+ xsane.progress = xsane_progress_new(PROGRESS_CONVERTING_DATA, buf, (GtkSignalFunc) xsane_cancel_save, 0);
+ xsane_progress_update(xsane.progress, 0);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ infile = fopen(xsane.dummy_filename, "r");
+ if (infile != 0)
+ {
+ fseek(infile, xsane.header_size, SEEK_SET);
+
+#ifdef HAVE_LIBTIFF
+ if (xsane.xsane_output_format == XSANE_TIFF) /* routines that want to have filename for saving */
+ {
+ if (xsane.param.depth != 1)
+ {
+ remove(xsane.output_filename);
+ umask(preferences.image_umask); /* define image file permissions */
+ xsane_save_tiff(xsane.output_filename, infile, xsane.xsane_color, xsane.param.depth, xsane.param.pixels_per_line,
+ xsane.param.lines, preferences.tiff_compression_nr, preferences.jpeg_quality);
+ umask(XSANE_DEFAULT_UMASK); /* define new file permissions */
+ }
+ else
+ {
+ remove(xsane.output_filename);
+ umask(preferences.image_umask); /* define image file permissions */
+ xsane_save_tiff(xsane.output_filename, infile, xsane.xsane_color, xsane.param.depth, xsane.param.pixels_per_line,
+ xsane.param.lines, preferences.tiff_compression_1_nr, preferences.jpeg_quality);
+ umask(XSANE_DEFAULT_UMASK); /* define new file permissions */
+ }
+ }
+ else /* routines that want to have filedescriptor for saving */
+#endif
+ {
+ remove(xsane.output_filename);
+ umask(preferences.image_umask); /* define image file permissions */
+ outfile = fopen(xsane.output_filename, "w");
+ umask(XSANE_DEFAULT_UMASK); /* define new file permissions */
+
+ if (outfile != 0)
+ {
+ switch(xsane.xsane_output_format)
+ {
+#ifdef HAVE_LIBJPEG
+ case XSANE_JPEG:
+ xsane_save_jpeg(outfile, infile, xsane.xsane_color, xsane.param.depth, xsane.param.pixels_per_line,
+ xsane.param.lines, preferences.jpeg_quality);
+ break;
+#endif
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+ case XSANE_PNG:
+ if (xsane.param.depth <= 8)
+ {
+ xsane_save_png(outfile, infile, xsane.xsane_color, xsane.param.depth, xsane.param.pixels_per_line,
+ xsane.param.lines, preferences.png_compression);
+ }
+ else
+ {
+ xsane_save_png_16(outfile, infile, xsane.xsane_color, xsane.param.depth, xsane.param.pixels_per_line,
+ xsane.param.lines, preferences.png_compression);
+ }
+ break;
+#endif
+#endif
+
+ case XSANE_PNM16:
+ xsane_save_pnm_16(outfile, infile, xsane.xsane_color, xsane.param.depth, xsane.param.pixels_per_line,
+ xsane.param.lines);
+ break;
+
+ case XSANE_PS: /* save postscript, use original size */
+ {
+ float imagewidth = xsane.param.pixels_per_line/xsane.resolution_x; /* width in inch */
+ float imageheight = xsane.param.lines/xsane.resolution_y; /* height in inch */
+
+ if (preferences.psrotate) /* rotate: landscape */
+ {
+ xsane_save_ps(outfile, infile,
+ xsane.xsane_color /* gray, color */,
+ xsane.param.depth /* bits */,
+ xsane.param.pixels_per_line, xsane.param.lines, /* pixel_width, pixel_height */
+ (preferences.printer[preferences.printernr]->bottomoffset +
+ preferences.printer[preferences.printernr]->height) * 36.0/MM_PER_INCH - imagewidth * 36.0, /* left edge */
+ (preferences.printer[preferences.printernr]->leftoffset +
+ preferences.printer[preferences.printernr]->width) * 36.0/MM_PER_INCH - imageheight * 36.0, /* bottom edge */
+ imagewidth, imageheight,
+ (preferences.printer[preferences.printernr]->leftoffset +
+ preferences.printer[preferences.printernr]->width ) * 72.0/MM_PER_INCH, /* paperwidth */
+ (preferences.printer[preferences.printernr]->bottomoffset +
+ preferences.printer[preferences.printernr]->height) * 72.0/MM_PER_INCH, /* paperheight */
+ 1 /* landscape */);
+ }
+ else /* do not rotate: portrait */
+ {
+ xsane_save_ps(outfile, infile,
+ xsane.xsane_color /* gray, color */,
+ xsane.param.depth /* bits */,
+ xsane.param.pixels_per_line, xsane.param.lines, /* pixel_width, pixel_height */
+ (preferences.printer[preferences.printernr]->leftoffset +
+ preferences.printer[preferences.printernr]->width) * 36.0/MM_PER_INCH - imagewidth * 36.0,
+ (preferences.printer[preferences.printernr]->bottomoffset +
+ preferences.printer[preferences.printernr]->height) * 36.0/MM_PER_INCH - imageheight * 36.0,
+ imagewidth, imageheight,
+ (preferences.printer[preferences.printernr]->leftoffset +
+ preferences.printer[preferences.printernr]->width ) * 72.0/MM_PER_INCH, /* paperwidth */
+ (preferences.printer[preferences.printernr]->bottomoffset +
+ preferences.printer[preferences.printernr]->height) * 72.0/MM_PER_INCH, /* paperheight */
+ 0 /* portrait */);
+ }
+ }
+ break;
+
+
+ default:
+ snprintf(buf, sizeof(buf),"%s", ERR_UNKNOWN_SAVING_FORMAT);
+ xsane_back_gtk_error(buf, TRUE);
+ break;
+ }
+ fclose(outfile);
+ }
+ else
+ {
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, xsane.output_filename, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ }
+ }
+ fclose(infile);
+ remove(xsane.dummy_filename);
+ }
+ else
+ {
+ char buf[256];
+ snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, xsane.output_filename, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ }
+ xsane_progress_free(xsane.progress);
+ xsane.progress = 0;
+
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ }
+ else if (xsane.xsane_mode == XSANE_COPY)
+ {
+ FILE *outfile;
+ FILE *infile;
+ char buf[256];
+
+ xsane_update_int(xsane.copy_number_entry, &xsane.copy_number); /* get number of copies */
+ if (xsane.copy_number < 1)
+ {
+ xsane.copy_number = 1;
+ }
+
+ /* open progressbar */
+ snprintf(buf, sizeof(buf), PROGRESS_CONVERTING_PS);
+ xsane.progress = xsane_progress_new(PROGRESS_CONVERTING_DATA, buf, (GtkSignalFunc) xsane_cancel_save, 0);
+ xsane_progress_update(xsane.progress, 0);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ xsane.broken_pipe = 0;
+ infile = fopen(xsane.dummy_filename, "r");
+
+ snprintf(buf, sizeof(buf), "%s %s%d", preferences.printer[preferences.printernr]->command,
+ preferences.printer[preferences.printernr]->copy_number_option,
+ xsane.copy_number);
+ outfile = popen(buf, "w");
+/* outfile = popen(preferences.printer[preferences.printernr]->command, "w"); */
+ if ((outfile != 0) && (infile != 0)) /* copy mode, use zoom size */
+ {
+ struct SIGACTION act;
+ float imagewidth = xsane.param.pixels_per_line/(float)preferences.printer[preferences.printernr]->resolution; /* width in inch */
+ float imageheight = xsane.param.lines/(float)preferences.printer[preferences.printernr]->resolution; /* height in inch */
+
+ memset (&act, 0, sizeof (act)); /* define broken pipe handler */
+ act.sa_handler = xsane_sigpipe_handler;
+ sigaction (SIGPIPE, &act, 0);
+
+
+ fseek(infile, xsane.header_size, SEEK_SET);
+
+ if (preferences.psrotate) /* rotate: landscape */
+ {
+ xsane_save_ps(outfile, infile,
+ xsane.xsane_color /* gray, color */,
+ xsane.param.depth /* bits */,
+ xsane.param.pixels_per_line, xsane.param.lines, /* pixel_width, pixel_height */
+ (preferences.printer[preferences.printernr]->bottomoffset +
+ preferences.printer[preferences.printernr]->height) * 36.0/MM_PER_INCH - imagewidth * 36.0, /* left edge */
+ (preferences.printer[preferences.printernr]->leftoffset +
+ preferences.printer[preferences.printernr]->width) * 36.0/MM_PER_INCH - imageheight * 36.0, /* bottom edge */
+ imagewidth, imageheight,
+ (preferences.printer[preferences.printernr]->leftoffset +
+ preferences.printer[preferences.printernr]->width ) * 72.0/MM_PER_INCH, /* paperwidth */
+ (preferences.printer[preferences.printernr]->bottomoffset +
+ preferences.printer[preferences.printernr]->height) * 72.0/MM_PER_INCH, /* paperheight */
+ 1 /* landscape */);
+ }
+ else /* do not rotate: portrait */
+ {
+ xsane_save_ps(outfile, infile,
+ xsane.xsane_color /* gray, color */,
+ xsane.param.depth /* bits */,
+ xsane.param.pixels_per_line, xsane.param.lines, /* pixel_width, pixel_height */
+ (preferences.printer[preferences.printernr]->leftoffset +
+ preferences.printer[preferences.printernr]->width) * 36.0/MM_PER_INCH - imagewidth * 36.0, /* left edge */
+ (preferences.printer[preferences.printernr]->bottomoffset +
+ preferences.printer[preferences.printernr]->height) * 36.0/MM_PER_INCH - imageheight * 36.0, /* bottom edge */
+ imagewidth, imageheight,
+ (preferences.printer[preferences.printernr]->leftoffset +
+ preferences.printer[preferences.printernr]->width ) * 72.0/MM_PER_INCH, /* paperwidth */
+ (preferences.printer[preferences.printernr]->bottomoffset +
+ preferences.printer[preferences.printernr]->height) * 72.0/MM_PER_INCH, /* paperheight */
+ 0 /* portrait */);
+ }
+ }
+ else
+ {
+ char buf[256];
+
+ if (!infile)
+ {
+ snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, xsane.output_filename, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ }
+ else if (!outfile)
+ {
+ xsane_back_gtk_error(ERR_FAILED_PRINTER_PIPE, TRUE);
+ }
+ }
+
+ if (xsane.broken_pipe)
+ {
+ snprintf(buf, sizeof(buf), "%s \"%s\"", ERR_FAILED_EXEC_PRINTER_CMD, preferences.printer[preferences.printernr]->command);
+ xsane_back_gtk_error(buf, TRUE);
+ }
+
+ xsane_progress_free(xsane.progress);
+ xsane.progress = 0;
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ if (infile)
+ {
+ fclose(infile);
+ remove(xsane.dummy_filename);
+ }
+
+ if (outfile)
+ {
+ pclose(outfile);
+ }
+ }
+ else if (xsane.xsane_mode == XSANE_FAX)
+ {
+ FILE *outfile;
+ FILE *infile;
+ char buf[256];
+
+ /* open progressbar */
+ snprintf(buf, sizeof(buf), PROGRESS_SAVING_FAX);
+ xsane.progress = xsane_progress_new(PROGRESS_CONVERTING_DATA, buf, (GtkSignalFunc) xsane_cancel_save, 0);
+ xsane_progress_update(xsane.progress, 0);
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ infile = fopen(xsane.dummy_filename, "r");
+ if (infile != 0)
+ {
+ fseek(infile, xsane.header_size, SEEK_SET);
+
+ umask(preferences.image_umask); /* define image file permissions */
+ outfile = fopen(xsane.fax_filename, "w");
+ umask(XSANE_DEFAULT_UMASK); /* define new file permissions */
+ if (outfile != 0)
+ {
+ float imagewidth, imageheight;
+
+ imagewidth = xsane.param.pixels_per_line/xsane.resolution_x; /* width in inch */
+ imageheight = xsane.param.lines/xsane.resolution_y; /* height in inch */
+
+/* disabled ( 0 * ...) in the moment */
+ if (0 * preferences.psrotate) /* rotate: landscape */
+ {
+ xsane_save_ps(outfile, infile,
+ xsane.xsane_color /* gray, color */,
+ xsane.param.depth /* bits */,
+ xsane.param.pixels_per_line, xsane.param.lines, /* pixel_width, pixel_height */
+ (preferences.fax_bottomoffset + preferences.fax_height) * 36.0/MM_PER_INCH - imagewidth * 36.0, /* left edge */
+ (preferences.fax_leftoffset + preferences.fax_width) * 36.0/MM_PER_INCH - imageheight * 36.0, /* bottom edge */
+ imagewidth, imageheight,
+ (preferences.fax_leftoffset + preferences.fax_width ) * 72.0/MM_PER_INCH, /* paperwidth */
+ (preferences.fax_bottomoffset + preferences.fax_height) * 72.0/MM_PER_INCH, /* paperheight */
+ 1 /* landscape */);
+ }
+ else /* do not rotate: portrait */
+ {
+ xsane_save_ps(outfile, infile,
+ xsane.xsane_color /* gray, color */,
+ xsane.param.depth /* bits */,
+ xsane.param.pixels_per_line, xsane.param.lines, /* pixel_width, pixel_height */
+ (preferences.fax_leftoffset + preferences.fax_width) * 36.0/MM_PER_INCH - imagewidth * 36.0,
+ (preferences.fax_bottomoffset + preferences.fax_height) * 36.0/MM_PER_INCH - imageheight * 36.0,
+ imagewidth, imageheight,
+ (preferences.fax_leftoffset + preferences.fax_width ) * 72.0/MM_PER_INCH, /* paperwidth */
+ (preferences.fax_bottomoffset + preferences.fax_height) * 72.0/MM_PER_INCH, /* paperheight */
+ 0 /* portrait */);
+ }
+ fclose(outfile);
+ }
+ else
+ {
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, xsane.fax_filename, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ }
+
+ fclose(infile);
+ remove(xsane.dummy_filename);
+ }
+ else
+ {
+ char buf[256];
+ snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, xsane.fax_filename, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ }
+ xsane_progress_free(xsane.progress);
+ xsane.progress = 0;
+
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ }
+ }
+#ifdef HAVE_LIBGIMP_GIMP_H
+ else
+ {
+ int remaining;
+
+ /* GIMP mode */
+ if (xsane.y > xsane.param.lines)
+ {
+ xsane.y = xsane.param.lines;
+ }
+
+ remaining = xsane.y % gimp_tile_height();
+ if (remaining)
+ {
+ gimp_pixel_rgn_set_rect(&xsane.region, xsane.tile, 0, xsane.y - remaining, xsane.param.pixels_per_line, remaining);
+ }
+ gimp_drawable_flush(xsane.drawable);
+ gimp_display_new(xsane.image_ID);
+ gimp_drawable_detach(xsane.drawable);
+ free(xsane.tile);
+ xsane.tile = 0;
+ }
+#endif /* HAVE_LIBGIMP_GIMP_H */
+
+ xsane.header_size = 0;
+
+ if ( (preferences.increase_filename_counter) && (xsane.xsane_mode == XSANE_SCAN) && (xsane.mode == XSANE_STANDALONE) )
+ {
+ xsane_increase_counter_in_filename(preferences.filename, preferences.skip_existing_numbers);
+ gtk_entry_set_text(GTK_ENTRY(xsane.outputfilename_entry), (char *) preferences.filename);
+ }
+ else if (xsane.xsane_mode == XSANE_FAX)
+ {
+ GtkWidget *list_item;
+ char *page;
+ char *extension;
+
+ page = strdup(strrchr(xsane.fax_filename,'/')+1);
+ extension = strrchr(page, '.');
+ if (extension)
+ {
+ *extension = 0;
+ }
+ list_item = gtk_list_item_new_with_label(page);
+ gtk_object_set_data(GTK_OBJECT(list_item), "list_item_data", strdup(page));
+ gtk_container_add(GTK_CONTAINER(xsane.fax_list), list_item);
+ gtk_widget_show(list_item);
+
+ xsane_increase_counter_in_filename(xsane.fax_filename, preferences.skip_existing_numbers);
+ xsane_fax_project_save();
+ free(page);
+ }
+ }
+ else /* an error occured, remove the dummy_file */
+ {
+ if (xsane.dummy_filename) /* remove corrupt file */
+ {
+ remove(xsane.dummy_filename);
+ }
+ }
+
+ free(xsane.dummy_filename); /* no dummy_filename, needed if an error occurs */
+ xsane.dummy_filename = 0;
+
+ if (xsane.output_filename)
+ {
+ free(xsane.output_filename);
+ xsane.output_filename = 0;
+ }
+
+ if ( ( (status == SANE_STATUS_GOOD) || (status == SANE_STATUS_EOF) ) && (xsane_test_multi_scan()) )
+ {
+ /* multi scan (eg ADF): scan again */
+ /* stopped when: */
+ /* a) xsane_test_multi_scan returns false */
+ /* b) sane_start returns SANE_STATUS_NO_DOCS */
+ /* c) an error occurs */
+
+ gtk_signal_emit_by_name(xsane.start_button, "clicked"); /* press START button */
+ }
+ else /* last scan: update histogram */
+ {
+ xsane_set_sensitivity(TRUE); /* reactivate buttons etc */
+ sane_cancel(xsane_back_gtk_dialog_get_device(dialog)); /* stop scanning */
+ xsane_update_histogram();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_cancel(void)
+{
+ sane_cancel(xsane_back_gtk_dialog_get_device(dialog));
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_start_scan(void)
+{
+ SANE_Status status;
+ SANE_Handle dev = xsane_back_gtk_dialog_get_device(dialog);
+ const char *frame_type = 0;
+ char buf[256];
+ int fd;
+
+ xsane_clear_histogram(&xsane.histogram_raw);
+ xsane_clear_histogram(&xsane.histogram_enh);
+ xsane_set_sensitivity(FALSE);
+
+#ifdef HAVE_LIBGIMP_GIMP_H
+ if (xsane.mode == XSANE_GIMP_EXTENSION && xsane.tile)
+ {
+ int height, remaining;
+
+ /* write the last tile of the frame to the GIMP region: */
+
+ if (xsane.y > xsane.param.lines) /* sanity check */
+ {
+ xsane.y = xsane.param.lines;
+ }
+
+ remaining = xsane.y % gimp_tile_height();
+ if (remaining)
+ {
+ gimp_pixel_rgn_set_rect(&xsane.region, xsane.tile, 0, xsane.y - remaining, xsane.param.pixels_per_line, remaining);
+ }
+
+ /* initialize the tile with the first tile of the GIMP region: */
+
+ height = gimp_tile_height();
+ if (height >= xsane.param.lines)
+ {
+ height = xsane.param.lines;
+ }
+ gimp_pixel_rgn_get_rect(&xsane.region, xsane.tile, 0, 0, xsane.param.pixels_per_line, height);
+ }
+#endif /* HAVE_LIBGIMP_GIMP_H */
+
+ xsane.x = xsane.y = 0;
+
+ status = sane_start(dev);
+
+ if (status == SANE_STATUS_NO_DOCS) /* ADF out of docs */
+ {
+ xsane_scan_done(status); /* ok, stop multi image scan */
+ return;
+ }
+ else if (status != SANE_STATUS_GOOD) /* error */
+ {
+ xsane_scan_done(status);
+ snprintf(buf, sizeof(buf), "%s %s", ERR_FAILED_START_SCANNER, XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ status = sane_get_parameters(dev, &xsane.param);
+ if (status != SANE_STATUS_GOOD)
+ {
+ xsane_scan_done(status);
+ snprintf(buf, sizeof(buf), "%s %s", ERR_FAILED_GET_PARAMS, XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ xsane.num_bytes = xsane.param.lines * xsane.param.bytes_per_line;
+ xsane.bytes_read = 0;
+
+ switch (xsane.param.format)
+ {
+ case SANE_FRAME_RGB: frame_type = "RGB"; break;
+ case SANE_FRAME_RED: frame_type = "red"; break;
+ case SANE_FRAME_GREEN: frame_type = "green"; break;
+ case SANE_FRAME_BLUE: frame_type = "blue"; break;
+ case SANE_FRAME_GRAY: frame_type = "gray"; break;
+#ifdef SUPPORT_RGBA
+ case SANE_FRAME_RGBA: frame_type = "RGBA"; break;
+#endif
+ default: frame_type = "unknown"; break;
+ }
+
+ if (xsane.mode == XSANE_STANDALONE)
+ { /* We are running in standalone mode */
+ if (xsane_generate_dummy_filename()) /* create filename the scanned data is saved to */
+ {
+ /* temporary file */
+ umask(0177); /* creare temporary file with "-rw-------" permissions */
+ }
+ else
+ {
+ /* no temporary file */
+ umask(preferences.image_umask); /* define image file permissions */
+ }
+
+ if (!xsane.header_size) /* first pass of multi pass scan */
+ {
+ remove(xsane.dummy_filename); /* remove existing file */
+ xsane.out = fopen(xsane.dummy_filename, "w");
+ umask(XSANE_DEFAULT_UMASK); /* define new file permissions */
+
+ if (!xsane.out) /* error while opening the dummy_file for writing */
+ {
+ xsane_scan_done(-1); /* -1 = error */
+ snprintf(buf, sizeof(buf), "%s `%s': %s", ERR_OPEN_FAILED, xsane.output_filename, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ switch (xsane.param.format)
+ {
+ case SANE_FRAME_RGB:
+ case SANE_FRAME_RED:
+ case SANE_FRAME_GREEN:
+ case SANE_FRAME_BLUE:
+ switch (xsane.param.depth)
+ {
+ case 8: /* color 8 bit mode, write ppm header */
+ fprintf(xsane.out, "P6\n# SANE data follows\n%d %d\n255\n", xsane.param.pixels_per_line, xsane.param.lines);
+ break;
+
+ default: /* color, but not 8 bit mode, write as raw data because this is not defined in pnm */
+ fprintf(xsane.out, "SANE_RGB_RAW\n%d %d\n65535\n", xsane.param.pixels_per_line, xsane.param.lines);
+ break;
+ }
+ break;
+
+ case SANE_FRAME_GRAY:
+ switch (xsane.param.depth)
+ {
+ case 1: /* 1 bit lineart mode, write pbm header */
+ fprintf(xsane.out, "P4\n# SANE data follows\n%d %d\n", xsane.param.pixels_per_line, xsane.param.lines);
+ break;
+
+ case 8: /* 8 bit grayscale mode, write pgm header */
+ fprintf(xsane.out, "P5\n# SANE data follows\n%d %d\n255\n", xsane.param.pixels_per_line, xsane.param.lines);
+ break;
+
+ default: /* grayscale mode but not 1 or 8 bit, write as raw data because this is not defined in pnm */
+ fprintf(xsane.out, "SANE_GRAYSCALE_RAW\n%d %d\n65535\n", xsane.param.pixels_per_line, xsane.param.lines);
+ break;
+ }
+ break;
+
+#ifdef SUPPORT_RGBA
+ case SANE_FRAME_RGBA:
+ switch (xsane.param.depth)
+ {
+ case 8: /* 8 bit RGBA mode */
+ fprintf(xsane.out, "SANE_RGBA\n%d %d\n255\n", xsane.param.pixels_per_line, xsane.param.lines);
+ break;
+
+ default: /* 16 bit RGBA mode */
+ fprintf(xsane.out, "SANE_RGBA\n%d %d\n65535\n", xsane.param.pixels_per_line, xsane.param.lines);
+ break;
+ }
+ break;
+#endif
+
+ default:
+ /* unknown file format, do not write header */
+ break;
+ }
+ fflush(xsane.out);
+ xsane.header_size = ftell(xsane.out);
+ }
+
+ if (xsane.param.format >= SANE_FRAME_RED && xsane.param.format <= SANE_FRAME_BLUE)
+ {
+ fseek(xsane.out, xsane.header_size + xsane.param.format - SANE_FRAME_RED, SEEK_SET);
+ }
+
+ if (xsane.xsane_mode == XSANE_SCAN)
+ {
+ snprintf(buf, sizeof(buf), PROGRESS_RECEIVING_SCAN, _(frame_type), xsane.output_filename);
+ }
+ else if (xsane.xsane_mode == XSANE_COPY)
+ {
+ snprintf(buf, sizeof(buf), PROGRESS_RECEIVING_COPY, _(frame_type));
+ }
+ else if (xsane.xsane_mode == XSANE_FAX)
+ {
+ snprintf(buf, sizeof(buf), PROGRESS_RECEIVING_FAX, _(frame_type));
+ }
+ }
+#ifdef HAVE_LIBGIMP_GIMP_H
+ else
+ {
+ size_t tile_size;
+
+ /* We are running under the GIMP */
+
+ xsane.tile_offset = 0;
+ tile_size = xsane.param.pixels_per_line * gimp_tile_height();
+
+ switch(xsane.param.format)
+ {
+ case SANE_FRAME_RGB:
+ case SANE_FRAME_RED:
+ case SANE_FRAME_BLUE:
+ case SANE_FRAME_GREEN:
+ tile_size *= 3; /* 24 bits/pixel RGB */
+ break;
+#ifdef SUPPORT_RGBA
+ case SANE_FRAME_RGBA:
+ tile_size *= 4; /* 32 bits/pixel RGBA */
+ break;
+#endif
+ default:
+ break;
+ }
+
+ if (xsane.tile)
+ {
+ xsane.first_frame = 0;
+ }
+ else
+ {
+ GImageType image_type = RGB;
+ GDrawableType drawable_type = RGB_IMAGE;
+ gint32 layer_ID;
+
+ if (xsane.param.format == SANE_FRAME_GRAY)
+ {
+ image_type = GRAY;
+ drawable_type = GRAY_IMAGE;
+ }
+#ifdef SUPPORT_RGBA
+ else if (xsane.param.format == SANE_FRAME_RGBA)
+ {
+ image_type = RGB;
+ drawable_type = RGBA_IMAGE; /* interpret infrared as alpha */
+ }
+#endif
+
+
+ xsane.image_ID = gimp_image_new(xsane.param.pixels_per_line, xsane.param.lines, image_type);
+
+/* the following is supported since gimp-1.1.? */
+#ifdef GIMP_HAVE_RESOLUTION_INFO
+ if (xsane.resolution_x > 0)
+ {
+ gimp_image_set_resolution(xsane.image_ID, xsane.resolution_x ,xsane.resolution_y);
+ }
+/* gimp_image_set_unit(xsane.image_ID, unit?); */
+#endif
+
+ layer_ID = gimp_layer_new(xsane.image_ID, "Background",
+ xsane.param.pixels_per_line,
+ xsane.param.lines,
+ drawable_type, 100, NORMAL_MODE);
+ gimp_image_add_layer(xsane.image_ID, layer_ID, 0);
+
+ xsane.drawable = gimp_drawable_get(layer_ID);
+ gimp_pixel_rgn_init(&xsane.region, xsane.drawable, 0, 0,
+ xsane.drawable->width,
+ xsane.drawable->height, TRUE, FALSE);
+ xsane.tile = g_new(guchar, tile_size);
+ xsane.first_frame = 1;
+ }
+
+ if (xsane.param.format >= SANE_FRAME_RED && xsane.param.format <= SANE_FRAME_BLUE)
+ {
+ xsane.tile_offset = xsane.param.format - SANE_FRAME_RED;
+ }
+
+ snprintf(buf, sizeof(buf), PROGRESS_RECEIVING_GIMP, _(frame_type));
+ }
+#endif /* HAVE_LIBGIMP_GIMP_H */
+
+ dialog->pixelcolor = 0;
+
+ if (xsane.progress)
+ {
+ xsane_progress_free(xsane.progress);
+ }
+ xsane.progress = xsane_progress_new(PROGRESS_SCANNING, buf, (GtkSignalFunc) xsane_cancel, 0);
+
+ xsane.input_tag = -1;
+
+ if (sane_set_io_mode(dev, SANE_TRUE) == SANE_STATUS_GOOD && sane_get_select_fd(dev, &fd) == SANE_STATUS_GOOD)
+ {
+ xsane.input_tag = gdk_input_add(fd, GDK_INPUT_READ, xsane_read_image_data, 0);
+ }
+ else
+ {
+ xsane_read_image_data(0, -1, GDK_INPUT_READ);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* Invoked when the scan button is pressed */
+/* or by scan_done if automatic document feeder is selected */
+void xsane_scan_dialog(GtkWidget * widget, gpointer call_data)
+{
+ char buf[256];
+
+ sane_get_parameters(dialog->dev, &xsane.param); /* update xsane.param */
+
+ if (xsane.output_filename)
+ {
+ free(xsane.output_filename);
+ xsane.output_filename = 0;
+ }
+
+ if (xsane.filetype)
+ {
+ char buffer[256];
+
+ snprintf(buffer, sizeof(buffer), "%s%s", preferences.filename, xsane.filetype);
+ xsane.output_filename = strdup(buffer);
+ }
+ else
+ {
+ xsane.output_filename = strdup(preferences.filename);
+ }
+
+ if (xsane.mode == XSANE_STANDALONE) /* We are running in standalone mode */
+ {
+ char *extension;
+
+ if ( (xsane.xsane_mode == XSANE_SCAN) && (preferences.overwrite_warning) ) /* test if filename already used */
+ {
+ FILE *testfile;
+
+ testfile = fopen(xsane.output_filename, "r");
+ if (testfile) /* filename used: skip */
+ {
+ char buf[256];
+
+ fclose(testfile);
+ snprintf(buf, sizeof(buf), "File %s already exists\n", xsane.output_filename);
+ if (xsane_back_gtk_decision(ERR_HEADER_WARNING, (gchar **) warning_xpm, buf, BUTTON_OVERWRITE, BUTTON_CANCEL, TRUE /* wait */) == FALSE)
+ {
+ return;
+ }
+ }
+ }
+
+
+ extension = strrchr(xsane.output_filename, '.');
+ if (extension)
+ {
+ extension++; /* skip "." */
+ }
+
+ xsane.xsane_output_format = XSANE_UNKNOWN;
+
+ if (xsane.param.depth <= 8)
+ {
+ if (extension)
+ {
+ if ( (!strcasecmp(extension, "pnm")) || (!strcasecmp(extension, "ppm")) ||
+ (!strcasecmp(extension, "pgm")) || (!strcasecmp(extension, "pbm")) )
+ {
+ xsane.xsane_output_format = XSANE_PNM;
+ }
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+ else if (!strcasecmp(extension, "png"))
+ {
+ xsane.xsane_output_format = XSANE_PNG;
+ }
+#endif
+#endif
+#ifdef HAVE_LIBJPEG
+ else if ( (!strcasecmp(extension, "jpg")) || (!strcasecmp(extension, "jpeg")) )
+ {
+ xsane.xsane_output_format = XSANE_JPEG;
+ }
+#endif
+ else if (!strcasecmp(extension, "ps"))
+ {
+ xsane.xsane_output_format = XSANE_PS;
+ }
+#ifdef HAVE_LIBTIFF
+ else if ( (!strcasecmp(extension, "tif")) || (!strcasecmp(extension, "tiff")) )
+ {
+ xsane.xsane_output_format = XSANE_TIFF;
+ }
+#endif
+#ifdef SUPPORT_RGBA
+ else if (!strcasecmp(extension, "rgba"))
+ {
+ xsane.xsane_output_format = XSANE_RGBA;
+ }
+#endif
+ }
+ }
+ else /* depth >8 bpp */
+ {
+ if (extension)
+ {
+ if (!strcasecmp(extension, "raw"))
+ {
+ xsane.xsane_output_format = XSANE_RAW16;
+ }
+ else if ( (!strcasecmp(extension, "pnm")) || (!strcasecmp(extension, "ppm")) ||
+ (!strcasecmp(extension, "pgm")) || (!strcasecmp(extension, "pbm")) )
+ {
+ xsane.xsane_output_format = XSANE_PNM16;
+ }
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+ else if (!strcasecmp(extension, "png"))
+ {
+ xsane.xsane_output_format = XSANE_PNG;
+ }
+#endif
+#endif
+#ifdef SUPPORT_RGBA
+ else if (!strcasecmp(extension, "rgba"))
+ {
+ xsane.xsane_output_format = XSANE_RGBA;
+ }
+#endif
+ }
+ }
+
+ if (xsane.xsane_mode == XSANE_SCAN)
+ {
+ if (xsane.xsane_output_format == XSANE_UNKNOWN)
+ {
+ if (extension)
+ {
+ snprintf(buf, sizeof(buf), "Unsupported %d-bit output format: %s", xsane.param.depth, extension);
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "%s", ERR_NO_OUTPUT_FORMAT);
+ }
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+#ifdef SUPPORT_RGBA
+ else if ((xsane.xsane_output_format == XSANE_RGBA) && (xsane.param.format != SANE_FRAME_RGBA))
+ {
+ snprintf(buf, sizeof(buf), "No RGBA data format !!!"); /* user selected output format RGBA, scanner uses other format */
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+#endif
+ }
+#ifdef SUPPORT_RGBA
+ else if (xsane.param.format == SANE_FRAME_RGBA) /* no scanmode but format=rgba */
+ {
+ snprintf(buf, sizeof(buf), "Special format RGBA only supported in scan mode !!!");
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+#endif
+
+#ifdef SUPPORT_RGBA
+ if (xsane.param.format == SANE_FRAME_RGBA)
+ {
+ if ( (xsane.xsane_output_format != XSANE_RGBA) && (xsane.xsane_output_format != XSANE_PNG) )
+ {
+ snprintf(buf, sizeof(buf), "Image data of type SANE_FRAME_RGBA\ncan only be saved in rgba or png format");
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+ }
+#endif
+
+ if (xsane.xsane_mode == XSANE_FAX)
+ {
+ mkdir(preferences.fax_project, 7*64 + 0*8 + 0);
+ }
+ }
+#ifdef HAVE_LIBGIMP_GIMP_H
+ else /* We are running in gimp mode */
+ {
+ if ((xsane.param.depth != 1) && (xsane.param.depth != 8)) /* not support bit depth ? */
+ {
+ snprintf(buf, sizeof(buf), "%s %d.", ERR_GIMP_BAD_DEPTH, xsane.param.depth);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+ }
+#endif
+
+ if (xsane.dummy_filename) /* no dummy filename defined - necessary if an error occurs */
+ {
+ free(xsane.dummy_filename);
+ xsane.dummy_filename = 0;
+ }
+
+ if (xsane.param.depth > 1) /* if depth > 1 use gamma correction */
+ {
+ int size;
+ int gamma_gray_size, gamma_red_size, gamma_green_size, gamma_blue_size;
+ int gamma_gray_max, gamma_red_max, gamma_green_max, gamma_blue_max;
+ const SANE_Option_Descriptor *opt;
+
+ size = (int) pow(2, xsane.param.depth);
+ gamma_gray_size = size;
+ gamma_red_size = size;
+ gamma_green_size = size;
+ gamma_blue_size = size;
+
+ size--;
+ gamma_gray_max = size;
+ gamma_red_max = size;
+ gamma_green_max = size;
+ gamma_blue_max = size;
+
+ if (xsane.scanner_gamma_gray) /* gamma table for gray available */
+ {
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.gamma_vector);
+ gamma_gray_size = opt->size / sizeof(opt->type);
+ gamma_gray_max = opt->constraint.range->max;
+ }
+
+ if (xsane.scanner_gamma_color) /* gamma table for red, green and blue available */
+ {
+ double gamma_red, gamma_green, gamma_blue;
+
+ /* ok, scanner color gamma function is supported, so we do all conversions about that */
+ /* we do not need any gamma tables while scanning, so we can free them after sending */
+ /* the data to the scanner */
+
+ /* if also gray gamma function is supported, set this to 1.0 to get the right colors */
+ if (xsane.scanner_gamma_gray)
+ {
+ xsane.gamma_data = malloc(gamma_gray_size * sizeof(SANE_Int));
+ xsane_create_gamma_curve(xsane.gamma_data, 0, 1.0, 0.0, 0.0, gamma_gray_size, gamma_gray_max);
+ xsane_back_gtk_update_vector(dialog, dialog->well_known.gamma_vector, xsane.gamma_data);
+ free(xsane.gamma_data);
+ xsane.gamma_data = 0;
+ }
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.gamma_vector_r);
+ gamma_red_size = opt->size / sizeof(opt->type);
+ gamma_red_max = opt->constraint.range->max;
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.gamma_vector_g);
+ gamma_green_size = opt->size / sizeof(opt->type);
+ gamma_green_max = opt->constraint.range->max;
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.gamma_vector_b);
+ gamma_blue_size = opt->size / sizeof(opt->type);
+ gamma_blue_max = opt->constraint.range->max;
+
+ xsane.gamma_data_red = malloc(gamma_red_size * sizeof(SANE_Int));
+ xsane.gamma_data_green = malloc(gamma_green_size * sizeof(SANE_Int));
+ xsane.gamma_data_blue = malloc(gamma_blue_size * sizeof(SANE_Int));
+
+ if (xsane.xsane_mode == XSANE_COPY)
+ {
+ gamma_red = xsane.gamma * xsane.gamma_red * preferences.printer[preferences.printernr]->gamma * preferences.printer[preferences.printernr]->gamma_red;
+ gamma_green = xsane.gamma * xsane.gamma_green * preferences.printer[preferences.printernr]->gamma * preferences.printer[preferences.printernr]->gamma_green;
+ gamma_blue = xsane.gamma * xsane.gamma_blue * preferences.printer[preferences.printernr]->gamma * preferences.printer[preferences.printernr]->gamma_blue;
+ }
+ else
+ {
+ gamma_red = xsane.gamma * xsane.gamma_red;
+ gamma_green = xsane.gamma * xsane.gamma_green;
+ gamma_blue = xsane.gamma * xsane.gamma_blue;
+ }
+
+ xsane_create_gamma_curve(xsane.gamma_data_red, xsane.negative,
+ gamma_red,
+ xsane.brightness + xsane.brightness_red,
+ xsane.contrast + xsane.contrast_red, gamma_red_size, gamma_red_max);
+
+ xsane_create_gamma_curve(xsane.gamma_data_green, xsane.negative,
+ gamma_green,
+ xsane.brightness + xsane.brightness_green,
+ xsane.contrast + xsane.contrast_green, gamma_green_size, gamma_green_max);
+
+ xsane_create_gamma_curve(xsane.gamma_data_blue, xsane.negative,
+ gamma_blue,
+ xsane.brightness + xsane.brightness_blue,
+ xsane.contrast + xsane.contrast_blue , gamma_blue_size, gamma_blue_max);
+
+ xsane_back_gtk_update_vector(dialog, dialog->well_known.gamma_vector_r, xsane.gamma_data_red);
+ xsane_back_gtk_update_vector(dialog, dialog->well_known.gamma_vector_g, xsane.gamma_data_green);
+ xsane_back_gtk_update_vector(dialog, dialog->well_known.gamma_vector_b, xsane.gamma_data_blue);
+
+ free(xsane.gamma_data_red);
+ free(xsane.gamma_data_green);
+ free(xsane.gamma_data_blue);
+
+ xsane.gamma_data_red = 0;
+ xsane.gamma_data_green = 0;
+ xsane.gamma_data_blue = 0;
+ }
+ else if (xsane.scanner_gamma_gray) /* only scanner gray gamma function available */
+ {
+ double gamma;
+ /* ok, the scanner only supports gray gamma function */
+ /* if we are doing a grayscale scan everyting is ok, */
+ /* for a color scan the software has to do the gamma correction set by the component slider */
+
+ if (xsane.xsane_mode == XSANE_COPY)
+ {
+ gamma = xsane.gamma * preferences.printer[preferences.printernr]->gamma;
+ }
+ else
+ {
+ gamma = xsane.gamma;
+ }
+
+ xsane.gamma_data = malloc(gamma_gray_size * sizeof(SANE_Int));
+ xsane_create_gamma_curve(xsane.gamma_data, xsane.negative,
+ gamma, xsane.brightness, xsane.contrast,
+ gamma_gray_size, gamma_gray_max);
+
+ xsane_back_gtk_update_vector(dialog, dialog->well_known.gamma_vector, xsane.gamma_data);
+ free(xsane.gamma_data);
+ xsane.gamma_data = 0;
+
+ if (xsane.xsane_color) /* ok, we are doing a colorscan */
+ {
+ /* we have to create color gamma table for software conversion */
+ /* but we only have to use color slider values, because gray slider value */
+ /* is used by scanner gray gamma */
+
+ double gamma_red, gamma_green, gamma_blue;
+
+ xsane.gamma_data_red = malloc(gamma_red_size * sizeof(SANE_Int));
+ xsane.gamma_data_green = malloc(gamma_green_size * sizeof(SANE_Int));
+ xsane.gamma_data_blue = malloc(gamma_blue_size * sizeof(SANE_Int));
+
+ if (xsane.xsane_mode == XSANE_COPY)
+ {
+ gamma_red = xsane.gamma_red * preferences.printer[preferences.printernr]->gamma_red;
+ gamma_green = xsane.gamma_green * preferences.printer[preferences.printernr]->gamma_green;
+ gamma_blue = xsane.gamma_blue * preferences.printer[preferences.printernr]->gamma_blue;
+ }
+ else
+ {
+ gamma_red = xsane.gamma_red;
+ gamma_green = xsane.gamma_green;
+ gamma_blue = xsane.gamma_blue;
+ }
+
+ xsane_create_gamma_curve(xsane.gamma_data_red, 0,
+ gamma_red, xsane.brightness_red, xsane.contrast_red,
+ gamma_red_size, gamma_red_max);
+
+ xsane_create_gamma_curve(xsane.gamma_data_green, 0,
+ gamma_green, xsane.brightness_green, xsane.contrast_green,
+ gamma_green_size, gamma_green_max);
+
+ xsane_create_gamma_curve(xsane.gamma_data_blue, 0,
+ gamma_blue, xsane.brightness_blue, xsane.contrast_blue,
+ gamma_blue_size, gamma_blue_max);
+
+ /* gamma tables are freed after scan */
+ }
+
+ }
+ else /* scanner does not support any gamma correction */
+ {
+ /* ok, we have to do it on our own */
+
+ if (xsane.xsane_color == 0) /* no color scan */
+ {
+ double gamma;
+
+ if (xsane.xsane_mode == XSANE_COPY)
+ {
+ gamma = xsane.gamma * preferences.printer[preferences.printernr]->gamma;
+ }
+ else
+ {
+ gamma = xsane.gamma;
+ }
+
+ xsane.gamma_data = malloc(gamma_gray_size * sizeof(SANE_Int));
+ xsane_create_gamma_curve(xsane.gamma_data, xsane.negative,
+ gamma, xsane.brightness, xsane.contrast,
+ gamma_gray_size, gamma_gray_max);
+
+ /* gamma table is freed after scan */
+ }
+ else /* color scan */
+ {
+ double gamma_red, gamma_green, gamma_blue;
+ /* ok, we have to combin gray and color slider values */
+
+ xsane.gamma_data_red = malloc(gamma_red_size * sizeof(SANE_Int));
+ xsane.gamma_data_green = malloc(gamma_green_size * sizeof(SANE_Int));
+ xsane.gamma_data_blue = malloc(gamma_blue_size * sizeof(SANE_Int));
+
+ if (xsane.xsane_mode == XSANE_COPY)
+ {
+ gamma_red = xsane.gamma * xsane.gamma_red * preferences.printer[preferences.printernr]->gamma * preferences.printer[preferences.printernr]->gamma_red;
+ gamma_green = xsane.gamma * xsane.gamma_green * preferences.printer[preferences.printernr]->gamma * preferences.printer[preferences.printernr]->gamma_green;
+ gamma_blue = xsane.gamma * xsane.gamma_blue * preferences.printer[preferences.printernr]->gamma * preferences.printer[preferences.printernr]->gamma_blue;
+ }
+ else
+ {
+ gamma_red = xsane.gamma * xsane.gamma_red;
+ gamma_green = xsane.gamma * xsane.gamma_green;
+ gamma_blue = xsane.gamma * xsane.gamma_blue;
+ }
+
+ xsane_create_gamma_curve(xsane.gamma_data_red, xsane.negative,
+ gamma_red,
+ xsane.brightness + xsane.brightness_red,
+ xsane.contrast + xsane.contrast_red, gamma_red_size, gamma_red_max);
+
+ xsane_create_gamma_curve(xsane.gamma_data_green, xsane.negative,
+ gamma_green,
+ xsane.brightness + xsane.brightness_green,
+ xsane.contrast + xsane.contrast_green, gamma_green_size, gamma_green_max);
+
+ xsane_create_gamma_curve(xsane.gamma_data_blue, xsane.negative,
+ gamma_blue,
+ xsane.brightness + xsane.brightness_blue,
+ xsane.contrast + xsane.contrast_blue , gamma_blue_size, gamma_blue_max);
+
+ /* gamma tables are freed after scan */
+ }
+
+ }
+ }
+
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ xsane_start_scan();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
diff --git a/frontend/xsane-scan.h b/frontend/xsane-scan.h
new file mode 100644
index 0000000..75c5ff8
--- /dev/null
+++ b/frontend/xsane-scan.h
@@ -0,0 +1,35 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-scan.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include "sane/config.h"
+#include <sane/sane.h>
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+extern void null_print_func(gchar *msg);
+extern void xsane_scan_done(SANE_Status status);
+extern void xsane_cancel(void);
+extern void xsane_scan_dialog(GtkWidget * widget, gpointer call_data);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
diff --git a/frontend/xsane-setup.c b/frontend/xsane-setup.c
new file mode 100644
index 0000000..637ea91
--- /dev/null
+++ b/frontend/xsane-setup.c
@@ -0,0 +1,1565 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-setup.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include "xsane.h"
+#include "xsane-back-gtk.h"
+#include "xsane-front-gtk.h"
+#include "xsane-preferences.h"
+#include "xsane-preview.h"
+#include "xsane-save.h"
+#include "xsane-text.h"
+#include "xsane-gamma.h"
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+#include <png.h>
+#include <zlib.h>
+#endif
+#endif
+
+#ifdef HAVE_LIBTIFF
+#include <tiff.h>
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#define XSANE_GTK_NAME_IMAGE_PERMISSIONS "gtk_toggle_button_image_permissions"
+#define XSANE_GTK_NAME_DIRECTORY_PERMISSIONS "gtk_toggle_button_directory_permissions"
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+struct XsaneSetup xsane_setup;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* forward declarations: */
+
+void xsane_new_printer(void);
+void xsane_update_int(GtkWidget *widget, int *val);
+
+static void xsane_update_bool(GtkWidget *widget, int *val);
+static void xsane_update_scale(GtkWidget *widget, double *val);
+static void xsane_update_double(GtkWidget *widget, double *val);
+static void xsane_setup_printer_update(void);
+static void xsane_setup_printer_callback(GtkWidget *widget, gpointer data);
+static void xsane_setup_printer_menu_build(GtkWidget *option_menu);
+static void xsane_setup_printer_apply_changes(GtkWidget *widget, gpointer data);
+static void xsane_setup_printer_new(GtkWidget *widget, gpointer data);
+static void xsane_setup_printer_delete(GtkWidget *widget, gpointer data);
+static void xsane_setup_display_apply_changes(GtkWidget *widget, gpointer data);
+static void xsane_setup_saving_apply_changes(GtkWidget *widget, gpointer data);
+static void xsane_setup_fax_apply_changes(GtkWidget *widget, gpointer data);
+static void xsane_setup_options_ok_callback(GtkWidget *widget, gpointer data);
+
+void xsane_setup_dialog(GtkWidget *widget, gpointer data);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_new_printer(void)
+{
+ preferences.printernr = preferences.printerdefinitions++;
+
+ preferences.printer[preferences.printernr] = calloc(sizeof(Preferences_printer_t), 1);
+
+ preferences.printer[preferences.printernr]->name = strdup(PRINTERNAME);
+ preferences.printer[preferences.printernr]->command = strdup(PRINTERCOMMAND);
+ preferences.printer[preferences.printernr]->copy_number_option = strdup(PRINTERCOPYNUMBEROPTION);
+ preferences.printer[preferences.printernr]->resolution = 300;
+ preferences.printer[preferences.printernr]->width = 203.2;
+ preferences.printer[preferences.printernr]->height = 294.6;
+ preferences.printer[preferences.printernr]->leftoffset = 3.5;
+ preferences.printer[preferences.printernr]->bottomoffset = 3.5;
+ preferences.printer[preferences.printernr]->gamma = 1.0;
+ preferences.printer[preferences.printernr]->gamma_red = 1.0;
+ preferences.printer[preferences.printernr]->gamma_green = 1.0;
+ preferences.printer[preferences.printernr]->gamma_blue = 1.0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_update_int(GtkWidget *widget, int *val)
+{
+ char *start, *end;
+ int v;
+
+ start = gtk_entry_get_text(GTK_ENTRY(widget));
+ if (!start)
+ return;
+
+ v = (int) strtol(start, &end, 10);
+ if (end > start && v > 0)
+ {
+ *val = v;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_update_bool(GtkWidget *widget, int *val)
+{
+ *val = (GTK_TOGGLE_BUTTON(widget)->active != 0);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_update_scale(GtkWidget *widget, double *val)
+{
+ *val = GTK_ADJUSTMENT(widget)->value;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_update_double(GtkWidget *widget, double *val)
+{
+ char *start, *end;
+ double v;
+
+ start = gtk_entry_get_text(GTK_ENTRY(widget));
+ if (!start)
+ return;
+
+ v = strtod(start, &end);
+ if (end > start && v > 0.0)
+ {
+ *val = v;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_setup_printer_update()
+{
+ char buf[256];
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_name_entry),
+ (char *) preferences.printer[preferences.printernr]->name);
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_command_entry),
+ (char *) preferences.printer[preferences.printernr]->command);
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_copy_number_option_entry),
+ (char *) preferences.printer[preferences.printernr]->copy_number_option);
+
+ snprintf(buf, sizeof(buf), "%d", preferences.printer[preferences.printernr]->resolution);
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_resolution_entry), buf);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.printer[preferences.printernr]->width);
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_width_entry), buf);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.printer[preferences.printernr]->height);
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_height_entry), buf);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.printer[preferences.printernr]->leftoffset);
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_leftoffset_entry), buf);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.printer[preferences.printernr]->bottomoffset);
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_bottomoffset_entry), buf);
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma);
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_gamma_entry), buf);
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma_red);
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_gamma_red_entry), buf);
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma_green);
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_gamma_green_entry), buf);
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma_blue);
+ gtk_entry_set_text(GTK_ENTRY(xsane_setup.printer_gamma_blue_entry), buf);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_setup_printer_callback(GtkWidget *widget, gpointer data)
+{
+ preferences.printernr = (int) data;
+ xsane_setup_printer_update();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_setup_printer_menu_build(GtkWidget *option_menu)
+{
+ GtkWidget *printer_menu, *printer_item;
+ int i;
+
+ printer_menu = gtk_menu_new();
+
+ for (i=0; i < preferences.printerdefinitions; i++)
+ {
+ printer_item = gtk_menu_item_new_with_label(preferences.printer[i]->name);
+ gtk_container_add(GTK_CONTAINER(printer_menu), printer_item);
+ gtk_signal_connect(GTK_OBJECT(printer_item), "activate", (GtkSignalFunc) xsane_setup_printer_callback, (void *) i);
+ gtk_widget_show(printer_item);
+ }
+
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu), printer_menu);
+ gtk_option_menu_set_history(GTK_OPTION_MENU(option_menu), preferences.printernr);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_setup_printer_apply_changes(GtkWidget *widget, gpointer data)
+{
+ GtkWidget *option_menu = (GtkWidget *) data;
+
+ if (preferences.printer[preferences.printernr]->name)
+ {
+ free((void *) preferences.printer[preferences.printernr]->name);
+ }
+ preferences.printer[preferences.printernr]->name = strdup(gtk_entry_get_text(GTK_ENTRY(xsane_setup.printer_name_entry)));
+
+ if (preferences.printer[preferences.printernr]->command)
+ {
+ free((void *) preferences.printer[preferences.printernr]->command);
+ }
+ preferences.printer[preferences.printernr]->command = strdup(gtk_entry_get_text(GTK_ENTRY(xsane_setup.printer_command_entry)));
+
+ if (preferences.printer[preferences.printernr]->copy_number_option)
+ {
+ free((void *) preferences.printer[preferences.printernr]->copy_number_option);
+ }
+ preferences.printer[preferences.printernr]->copy_number_option =
+ strdup(gtk_entry_get_text(GTK_ENTRY(xsane_setup.printer_copy_number_option_entry)));
+
+ xsane_update_int(xsane_setup.printer_resolution_entry, &preferences.printer[preferences.printernr]->resolution);
+
+ xsane_update_double(xsane_setup.printer_width_entry, &preferences.printer[preferences.printernr]->width);
+ xsane_update_double(xsane_setup.printer_height_entry, &preferences.printer[preferences.printernr]->height);
+ xsane_update_double(xsane_setup.printer_leftoffset_entry, &preferences.printer[preferences.printernr]->leftoffset);
+ xsane_update_double(xsane_setup.printer_bottomoffset_entry, &preferences.printer[preferences.printernr]->bottomoffset);
+
+ xsane_update_double(xsane_setup.printer_gamma_entry, &preferences.printer[preferences.printernr]->gamma);
+ xsane_update_double(xsane_setup.printer_gamma_red_entry, &preferences.printer[preferences.printernr]->gamma_red);
+ xsane_update_double(xsane_setup.printer_gamma_green_entry, &preferences.printer[preferences.printernr]->gamma_green);
+ xsane_update_double(xsane_setup.printer_gamma_blue_entry, &preferences.printer[preferences.printernr]->gamma_blue);
+
+ if (option_menu)
+ {
+ xsane_setup_printer_menu_build(option_menu);
+ }
+
+ xsane_define_maximum_output_size();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_setup_printer_new(GtkWidget *widget, gpointer data)
+{
+ GtkWidget *option_menu = (GtkWidget *) data;
+
+ xsane_new_printer();
+ xsane_setup_printer_update();
+
+ xsane_setup_printer_menu_build(option_menu);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_setup_printer_delete(GtkWidget *widget, gpointer data)
+{
+ GtkWidget *option_menu = (GtkWidget *) data;
+ int i;
+
+ preferences.printerdefinitions--;
+
+ i = preferences.printernr;
+ while (i < preferences.printerdefinitions)
+ {
+ memcpy(preferences.printer[i], preferences.printer[i+1], sizeof(Preferences_printer_t));
+ i++;
+ }
+
+ if (preferences.printernr >= preferences.printerdefinitions)
+ {
+ preferences.printernr--;
+ }
+
+ if (preferences.printerdefinitions == 0)
+ {
+ xsane_new_printer();
+ preferences.printernr = 0;
+ }
+
+ xsane_setup_printer_update();
+
+ xsane_setup_printer_menu_build(option_menu);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifdef HAVE_LIBTIFF
+static void xsane_setup_tiff_compression_callback(GtkWidget *widget, gpointer data)
+{
+ xsane_setup.tiff_compression_nr = (int) data;
+}
+
+/* -------------------------------------- */
+
+static void xsane_setup_tiff_compression_1_callback(GtkWidget *widget, gpointer data)
+{
+ xsane_setup.tiff_compression_1_nr = (int) data;
+}
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_setup_display_apply_changes(GtkWidget *widget, gpointer data)
+{
+ xsane_update_bool(xsane_setup.main_window_fixed_button, &preferences.main_window_fixed);
+ xsane_update_bool(xsane_setup.preview_preserve_button, &preferences.preserve_preview);
+ xsane_update_bool(xsane_setup.preview_own_cmap_button, &preferences.preview_own_cmap);
+
+ xsane_update_double(xsane_setup.preview_gamma_entry, &preferences.preview_gamma);
+ xsane_update_double(xsane_setup.preview_gamma_red_entry, &preferences.preview_gamma_red);
+ xsane_update_double(xsane_setup.preview_gamma_green_entry, &preferences.preview_gamma_green);
+ xsane_update_double(xsane_setup.preview_gamma_blue_entry, &preferences.preview_gamma_blue);
+
+ preferences.doc_viewer = strdup(gtk_entry_get_text(GTK_ENTRY(xsane_setup.doc_viewer_entry)));
+
+ xsane_update_gamma();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_setup_saving_apply_changes(GtkWidget *widget, gpointer data)
+{
+#ifdef HAVE_LIBJPEG
+ xsane_update_scale(xsane_setup.jpeg_image_quality_scale, &preferences.jpeg_quality);
+#else
+#ifdef HAVE_LIBTIFF
+ xsane_update_scale(xsane_setup.jpeg_image_quality_scale, &preferences.jpeg_quality);
+#endif
+#endif
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+ xsane_update_scale(xsane_setup.pnm_image_compression_scale, &preferences.png_compression);
+#endif
+#endif
+
+#ifdef HAVE_LIBTIFF
+ preferences.tiff_compression_nr = xsane_setup.tiff_compression_nr;
+ preferences.tiff_compression_1_nr = xsane_setup.tiff_compression_1_nr;
+#endif
+
+ xsane_update_bool(xsane_setup.overwrite_warning_button, &preferences.overwrite_warning);
+ xsane_update_bool(xsane_setup.increase_filename_counter_button, &preferences.increase_filename_counter);
+ xsane_update_bool(xsane_setup.skip_existing_numbers_button, &preferences.skip_existing_numbers);
+ preferences.image_umask = 0777 - xsane_setup.image_permissions;
+ preferences.directory_umask = 0777 - xsane_setup.directory_permissions;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_setup_fax_apply_changes(GtkWidget *widget, gpointer data)
+{
+ if (preferences.fax_command)
+ {
+ free((void *) preferences.fax_command);
+ }
+ preferences.fax_command = strdup(gtk_entry_get_text(GTK_ENTRY(xsane_setup.fax_command_entry)));
+ preferences.fax_receiver_option = strdup(gtk_entry_get_text(GTK_ENTRY(xsane_setup.fax_receiver_option_entry)));
+ preferences.fax_postscript_option = strdup(gtk_entry_get_text(GTK_ENTRY(xsane_setup.fax_postscript_option_entry)));
+ preferences.fax_normal_option = strdup(gtk_entry_get_text(GTK_ENTRY(xsane_setup.fax_normal_option_entry)));
+ preferences.fax_fine_option = strdup(gtk_entry_get_text(GTK_ENTRY(xsane_setup.fax_fine_option_entry)));
+ preferences.fax_viewer = strdup(gtk_entry_get_text(GTK_ENTRY(xsane_setup.fax_viewer_entry)));
+
+ xsane_update_double(xsane_setup.fax_leftoffset_entry, &preferences.fax_leftoffset);
+ xsane_update_double(xsane_setup.fax_bottomoffset_entry, &preferences.fax_bottomoffset);
+ xsane_update_double(xsane_setup.fax_width_entry, &preferences.fax_width);
+ xsane_update_double(xsane_setup.fax_height_entry, &preferences.fax_height);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_setup_options_ok_callback(GtkWidget *widget, gpointer data)
+{
+ xsane_setup_printer_apply_changes(0, 0);
+ xsane_setup_display_apply_changes(0, 0);
+ xsane_setup_saving_apply_changes(0, 0);
+ xsane_setup_fax_apply_changes(0, 0);
+
+ xsane_pref_save();
+
+ gtk_widget_destroy((GtkWidget *)data); /* => xsane_destroy_setup_dialog_callback */
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_destroy_setup_dialog_callback(GtkWidget *widget, gpointer data)
+{
+ xsane_set_sensitivity(TRUE);
+ xsane_back_gtk_refresh_dialog(dialog);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_close_setup_dialog_callback(GtkWidget *widget, gpointer data)
+{
+ gtk_widget_destroy((GtkWidget *)data); /* => xsane_destroy_setup_dialog_callback */
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_permission_toggled(GtkWidget *widget, gpointer data)
+{
+ int mask = (int) data;
+ int *permission = 0;
+ gchar *name = gtk_widget_get_name(widget);
+
+ if (!strcmp(name, XSANE_GTK_NAME_IMAGE_PERMISSIONS))
+ {
+ permission = &xsane_setup.image_permissions;
+ }
+ else if (!strcmp(name, XSANE_GTK_NAME_DIRECTORY_PERMISSIONS))
+ {
+ permission = &xsane_setup.directory_permissions;
+ }
+
+ if (permission)
+ {
+ if (GTK_TOGGLE_BUTTON(widget)->active) /* set bit */
+ {
+ *permission = *permission | mask;
+ }
+ else /* erase bit */
+ {
+ *permission = *permission & (0777-mask);
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_permission_box(GtkWidget *parent, gchar *name, gchar *description, int *permission,
+ int header, int x_sensitivity, int user_sensitivity)
+{
+ GtkWidget *hbox, *button, *label, *hspace;
+
+
+ if (header)
+ {
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(parent), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new("user");
+ gtk_widget_set_usize(label, 75, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ label = gtk_label_new("group");
+ gtk_widget_set_usize(label, 75, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ label = gtk_label_new("all");
+ gtk_widget_set_usize(label, 75, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ gtk_widget_show(hbox);
+ }
+
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(parent), hbox, FALSE, FALSE, 2);
+
+ button = gtk_toggle_button_new_with_label("r");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *permission & 256 );
+ gtk_widget_set_usize(button, 21, 0);
+ gtk_widget_set_name(button, name);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_permission_toggled, (void *) 256);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
+ gtk_widget_show(button);
+ gtk_widget_set_sensitive(button, user_sensitivity);
+
+ button = gtk_toggle_button_new_with_label("w");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *permission & 128 );
+ gtk_widget_set_usize(button, 21, 0);
+ gtk_widget_set_name(button, name);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_permission_toggled, (void *) 128);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
+ gtk_widget_show(button);
+ gtk_widget_set_sensitive(button, user_sensitivity);
+
+ button = gtk_toggle_button_new_with_label("x");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *permission & 64 );
+ gtk_widget_set_usize(button, 21, 0);
+ gtk_widget_set_name(button, name);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_permission_toggled, (void *) 64);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
+ gtk_widget_show(button);
+ gtk_widget_set_sensitive(button, x_sensitivity & user_sensitivity);
+
+
+
+ hspace = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), hspace, FALSE, FALSE, 6);
+ gtk_widget_show(hspace);
+
+
+
+ button = gtk_toggle_button_new_with_label("r");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *permission & 32 );
+ gtk_widget_set_usize(button, 21, 0);
+ gtk_widget_set_name(button, name);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_permission_toggled, (void *) 32);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
+ gtk_widget_show(button);
+
+ button = gtk_toggle_button_new_with_label("w");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *permission & 16 );
+ gtk_widget_set_usize(button, 21, 0);
+ gtk_widget_set_name(button, name);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_permission_toggled, (void *) 16);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
+ gtk_widget_show(button);
+
+ button = gtk_toggle_button_new_with_label("x");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *permission & 8 );
+ gtk_widget_set_usize(button, 21, 0);
+ gtk_widget_set_name(button, name);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_permission_toggled, (void *) 8);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
+ gtk_widget_show(button);
+ gtk_widget_set_sensitive(button, x_sensitivity);
+
+
+
+ hspace = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), hspace, FALSE, FALSE, 6);
+ gtk_widget_show(hspace);
+
+
+
+ button = gtk_toggle_button_new_with_label("r");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *permission & 4 );
+ gtk_widget_set_usize(button, 21, 0);
+ gtk_widget_set_name(button, name);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_permission_toggled, (void *) 4);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
+ gtk_widget_show(button);
+
+ button = gtk_toggle_button_new_with_label("w");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *permission & 2 );
+ gtk_widget_set_usize(button, 21, 0);
+ gtk_widget_set_name(button, name);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_permission_toggled, (void *) 2);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
+ gtk_widget_show(button);
+
+ button = gtk_toggle_button_new_with_label("x");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), *permission & 1 );
+ gtk_widget_set_usize(button, 21, 0);
+ gtk_widget_set_name(button, name);
+ gtk_signal_connect(GTK_OBJECT(button), "toggled", (GtkSignalFunc) xsane_permission_toggled, (void *) 1);
+ gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 1);
+ gtk_widget_show(button);
+ gtk_widget_set_sensitive(button, x_sensitivity);
+
+
+
+ hspace = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), hspace, FALSE, FALSE, 5);
+ gtk_widget_show(hspace);
+
+
+
+ label = gtk_label_new(description);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ gtk_widget_show(hbox);
+
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_setup_dialog(GtkWidget *widget, gpointer data)
+{
+ GtkWidget *setup_dialog, *setup_vbox, *vbox, *hbox, *button, *label, *text, *frame, *notebook;
+ GtkWidget *printer_option_menu;
+ char buf[64];
+
+#ifdef HAVE_LIBTIFF
+ GtkWidget *tiff_compression_option_menu, *tiff_compression_menu, *tiff_compression_item;
+ int i, select = 1;
+
+ typedef struct tiff_compression_t
+ {
+ char *name;
+ int number;
+ } tiff_compression;
+
+#define TIFF_COMPRESSION_NUMBER 3
+#define TIFF_COMPRESSION1_NUMBER 6
+
+ tiff_compression tiff_compression_strings[TIFF_COMPRESSION_NUMBER];
+ tiff_compression tiff_compression1_strings[TIFF_COMPRESSION1_NUMBER];
+
+ tiff_compression_strings[0].name = MENU_ITEM_TIFF_COMP_NONE;
+ tiff_compression_strings[0].number = COMPRESSION_NONE;
+ tiff_compression_strings[1].name = MENU_ITEM_TIFF_COMP_JPEG;
+ tiff_compression_strings[1].number = COMPRESSION_JPEG;
+ tiff_compression_strings[2].name = MENU_ITEM_TIFF_COMP_PACKBITS;
+ tiff_compression_strings[2].number = COMPRESSION_PACKBITS;
+
+ tiff_compression1_strings[0].name = MENU_ITEM_TIFF_COMP_NONE;
+ tiff_compression1_strings[0].number = COMPRESSION_NONE;
+ tiff_compression1_strings[1].name = MENU_ITEM_TIFF_COMP_CCITTRLE;
+ tiff_compression1_strings[1].number = COMPRESSION_CCITTRLE;
+ tiff_compression1_strings[2].name = MENU_ITEM_TIFF_COMP_CCITFAX3;
+ tiff_compression1_strings[2].number = COMPRESSION_CCITTFAX3;
+ tiff_compression1_strings[3].name = MENU_ITEM_TIFF_COMP_CCITFAX4;
+ tiff_compression1_strings[3].number = COMPRESSION_CCITTFAX4;
+ tiff_compression1_strings[4].name = MENU_ITEM_TIFF_COMP_JPEG;
+ tiff_compression1_strings[4].number = COMPRESSION_JPEG;
+ tiff_compression1_strings[5].name = MENU_ITEM_TIFF_COMP_PACKBITS;
+ tiff_compression1_strings[5].number = COMPRESSION_PACKBITS;
+
+#endif /* HAVE_LIBTIFF */
+
+ xsane_set_sensitivity(FALSE);
+
+ setup_dialog = gtk_dialog_new();
+ snprintf(buf, sizeof(buf), "%s %s", prog_name, WINDOW_SETUP);
+ gtk_window_set_title(GTK_WINDOW(setup_dialog), buf);
+ gtk_signal_connect(GTK_OBJECT(setup_dialog), "destroy", (GtkSignalFunc) xsane_destroy_setup_dialog_callback, setup_dialog);
+ xsane_set_window_icon(setup_dialog, 0);
+
+ setup_vbox = GTK_DIALOG(setup_dialog)->vbox;
+
+ notebook = gtk_notebook_new();
+ gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
+ gtk_box_pack_start(GTK_BOX(setup_vbox), notebook, FALSE, FALSE, 0);
+ gtk_widget_show(notebook);
+
+
+
+
+ /* Printer options notebook page */
+
+ setup_vbox = gtk_vbox_new(FALSE, 5);
+
+ label = gtk_label_new(NOTEBOOK_COPY_OPTIONS);
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label);
+ gtk_widget_show(setup_vbox);
+
+ frame = gtk_frame_new(0);
+ gtk_container_set_border_width(GTK_CONTAINER(frame), 4);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
+ gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */
+ gtk_widget_show(frame);
+
+ vbox = gtk_vbox_new(FALSE, 1);
+ gtk_container_add(GTK_CONTAINER(frame), vbox);
+ gtk_widget_show(vbox);
+
+
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_SEL);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ printer_option_menu = gtk_option_menu_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, printer_option_menu, DESC_PRINTER_SETUP);
+ gtk_box_pack_end(GTK_BOX(hbox), printer_option_menu, FALSE, FALSE, 2);
+ gtk_widget_show(printer_option_menu);
+ gtk_widget_show(hbox);
+
+ xsane_setup_printer_menu_build(printer_option_menu);
+
+ /* printername : */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_NAME);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PRINTER_NAME);
+ gtk_widget_set_usize(text, 250, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.printer[preferences.printernr]->name);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_name_entry = text;
+
+ /* printcommand : */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_CMD);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PRINTER_COMMAND);
+ gtk_widget_set_usize(text, 250, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.printer[preferences.printernr]->command);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_command_entry = text;
+
+ /* copy number option : */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_COPY_NR_OPT);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_COPY_NUMBER_OPTION);
+ gtk_widget_set_usize(text, 250, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.printer[preferences.printernr]->copy_number_option);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_copy_number_option_entry = text;
+
+ /* printerresolution : */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_RES);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PRINTER_RESOLUTION);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%d", preferences.printer[preferences.printernr]->resolution);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_resolution_entry = text;
+
+
+ xsane_separator_new(vbox, 2);
+
+
+ /* printer width: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_WIDTH);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PRINTER_WIDTH);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.printer[preferences.printernr]->width);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_width_entry = text;
+
+ /* printer height: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_HEIGHT);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PRINTER_HEIGHT);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.printer[preferences.printernr]->height);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_height_entry = text;
+
+ /* printer left offset : */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_LEFT);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PRINTER_LEFTOFFSET);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.printer[preferences.printernr]->leftoffset);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_leftoffset_entry = text;
+
+ /* printer bottom offset : */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_BOTTOM);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PRINTER_BOTTOMOFFSET);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.printer[preferences.printernr]->bottomoffset);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_bottomoffset_entry = text;
+
+
+ xsane_separator_new(vbox, 2);
+
+
+ /* printer gamma: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_GAMMA);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PRINTER_GAMMA);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_gamma_entry = text;
+
+ /* printer gamma red: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_GAMMA_RED);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PRINTER_GAMMA_RED);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma_red);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_gamma_red_entry = text;
+
+ /* printer gamma green: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_GAMMA_GREEN);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PRINTER_GAMMA_GREEN);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma_green);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_gamma_green_entry = text;
+
+ /* printer gamma blue: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_PRINTER_GAMMA_BLUE);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PRINTER_GAMMA_BLUE);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.printer[preferences.printernr]->gamma_blue);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.printer_gamma_blue_entry = text;
+
+
+ xsane_separator_new(vbox, 4);
+
+ /* "apply" "add printer" "delete printer" */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ button = gtk_button_new_with_label(BUTTON_APPLY);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_printer_apply_changes, printer_option_menu);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ button = gtk_button_new_with_label(BUTTON_ADD_PRINTER);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_printer_new, printer_option_menu);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ button = gtk_button_new_with_label(BUTTON_DELETE_PRINTER);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_printer_delete, printer_option_menu);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ gtk_widget_show(hbox);
+
+
+
+
+ /* Saving options notebook page */
+
+ setup_vbox = gtk_vbox_new(FALSE, 5);
+
+ label = gtk_label_new(NOTEBOOK_SAVING_OPTIONS);
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label);
+ gtk_widget_show(setup_vbox);
+
+ frame = gtk_frame_new(0);
+ gtk_container_set_border_width(GTK_CONTAINER(frame), 4);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
+ gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */
+ gtk_widget_show(frame);
+
+ vbox = gtk_vbox_new(FALSE, 1);
+ gtk_container_add(GTK_CONTAINER(frame), vbox);
+ gtk_widget_show(vbox);
+
+ xsane_setup.image_permissions = 0777-preferences.image_umask;
+ xsane_permission_box(vbox, XSANE_GTK_NAME_IMAGE_PERMISSIONS, "Image-file permissions", &xsane_setup.image_permissions,
+ TRUE /* header */, FALSE /* x sens */, FALSE /* user sens */);
+
+ xsane_setup.directory_permissions = 0777-preferences.directory_umask;
+ xsane_permission_box(vbox, XSANE_GTK_NAME_DIRECTORY_PERMISSIONS, "Directory permissions", &xsane_setup.directory_permissions,
+ FALSE /* header */, TRUE /* x sens */, FALSE /* user sens */);
+
+ xsane_separator_new(vbox, 4);
+
+
+ /* overwrite warning */
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+ button = gtk_check_button_new_with_label(RADIO_BUTTON_OVERWRITE_WARNING);
+ xsane_back_gtk_set_tooltip(dialog->tooltips, button, DESC_OVERWRITE_WARNING);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), preferences.overwrite_warning);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 2);
+ gtk_widget_show(button);
+ gtk_widget_show(hbox);
+ xsane_setup.overwrite_warning_button = button;
+
+ /* increase filename counter */
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+ button = gtk_check_button_new_with_label(RADIO_BUTTON_INCREASE_COUNTER);
+ xsane_back_gtk_set_tooltip(dialog->tooltips, button, DESC_INCREASE_COUNTER);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), preferences.increase_filename_counter);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 2);
+ gtk_widget_show(button);
+ gtk_widget_show(hbox);
+ xsane_setup.increase_filename_counter_button = button;
+
+ /* increase filename counter */
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+ button = gtk_check_button_new_with_label(RADIO_BUTTON_SKIP_EXISTING_NRS);
+ xsane_back_gtk_set_tooltip(dialog->tooltips, button, DESC_SKIP_EXISTING);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), preferences.skip_existing_numbers);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 2);
+ gtk_widget_show(button);
+ gtk_widget_show(hbox);
+ xsane_setup.skip_existing_numbers_button = button;
+
+#ifdef HAVE_LIBJPEG
+ xsane_separator_new(vbox, 4);
+#else
+#ifdef HAVE_LIBTIFF
+ xsane_separator_new(vbox, 4);
+#else
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+ xsane_separator_new(vbox, 4);
+#endif
+#endif
+#endif
+#endif
+
+#ifdef HAVE_LIBJPEG
+ xsane_scale_new(GTK_BOX(vbox), TEXT_SETUP_JPEG_QUALITY, DESC_JPEG_QUALITY, 0.0, 100.0, 1.0, 1.0, 0.0, 0,
+ &preferences.jpeg_quality, (GtkObject **) &xsane_setup.jpeg_image_quality_scale, 0, TRUE);
+#else
+#ifdef HAVE_LIBTIFF
+ xsane_scale_new(GTK_BOX(vbox), TEXT_SETUP_JPEG_QUALITY, DESC_JPEG_QUALITY, 0.0, 100.0, 1.0, 1.0, 0.0, 0,
+ &preferences.jpeg_quality, (GtkObject **) &xsane_setup.jpeg_image_quality_scale, 0, TRUE);
+#endif
+#endif
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+ xsane_scale_new(GTK_BOX(vbox), TEXT_SETUP_PNG_COMPRESSION, DESC_PNG_COMPRESSION, 0.0, Z_BEST_COMPRESSION, 1.0, 1.0, 0.0, 0,
+ &preferences.png_compression, (GtkObject **) &xsane_setup.pnm_image_compression_scale, 0, TRUE);
+#endif
+#endif
+
+#ifdef HAVE_LIBTIFF
+ /* TIFF MULTI BIT IMAGES COMPRESSION */
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+ label = gtk_label_new(TEXT_SETUP_TIFF_COMPRESSION);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ tiff_compression_option_menu = gtk_option_menu_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, tiff_compression_option_menu, DESC_TIFF_COMPRESSION);
+ gtk_box_pack_end(GTK_BOX(hbox), tiff_compression_option_menu, FALSE, FALSE, 2);
+ gtk_widget_show(tiff_compression_option_menu);
+ gtk_widget_show(hbox);
+
+ tiff_compression_menu = gtk_menu_new();
+
+ for (i=1; i <= TIFF_COMPRESSION_NUMBER; i++)
+ {
+ tiff_compression_item = gtk_menu_item_new_with_label(tiff_compression_strings[i-1].name);
+ gtk_container_add(GTK_CONTAINER(tiff_compression_menu), tiff_compression_item);
+ gtk_signal_connect(GTK_OBJECT(tiff_compression_item), "activate",
+ (GtkSignalFunc) xsane_setup_tiff_compression_callback, (void *) tiff_compression_strings[i-1].number);
+ gtk_widget_show(tiff_compression_item);
+ if (tiff_compression_strings[i-1].number == preferences.tiff_compression_nr)
+ {
+ select = i-1;
+ }
+ }
+
+
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(tiff_compression_option_menu), tiff_compression_menu);
+ gtk_option_menu_set_history(GTK_OPTION_MENU(tiff_compression_option_menu), select);
+ xsane_setup.tiff_compression_nr = preferences.tiff_compression_nr;
+
+
+ /* TIFF ONE BIT IMAGES COMPRESSION */
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+ label = gtk_label_new(TEXT_SETUP_TIFF_COMPRESSION_1);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ tiff_compression_option_menu = gtk_option_menu_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, tiff_compression_option_menu, DESC_TIFF_COMPRESSION_1);
+ gtk_box_pack_end(GTK_BOX(hbox), tiff_compression_option_menu, FALSE, FALSE, 2);
+ gtk_widget_show(tiff_compression_option_menu);
+ gtk_widget_show(hbox);
+
+ tiff_compression_menu = gtk_menu_new();
+
+ for (i=1; i <= TIFF_COMPRESSION1_NUMBER; i++)
+ {
+ tiff_compression_item = gtk_menu_item_new_with_label(tiff_compression1_strings[i-1].name);
+ gtk_container_add(GTK_CONTAINER(tiff_compression_menu), tiff_compression_item);
+ gtk_signal_connect(GTK_OBJECT(tiff_compression_item), "activate",
+ (GtkSignalFunc) xsane_setup_tiff_compression_1_callback, (void *) tiff_compression1_strings[i-1].number);
+ gtk_widget_show(tiff_compression_item);
+ if (tiff_compression1_strings[i-1].number == preferences.tiff_compression_1_nr)
+ {
+ select = i-1;
+ }
+ }
+
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(tiff_compression_option_menu), tiff_compression_menu);
+ gtk_option_menu_set_history(GTK_OPTION_MENU(tiff_compression_option_menu), select);
+
+ xsane_setup.tiff_compression_1_nr = preferences.tiff_compression_1_nr;
+
+#endif
+
+ xsane_separator_new(vbox, 4);
+
+
+ /* apply button */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ button = gtk_button_new_with_label(BUTTON_APPLY);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_saving_apply_changes, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ gtk_widget_show(hbox);
+
+
+
+
+
+ /* Display options notebook page */
+
+ setup_vbox = gtk_vbox_new(FALSE, 5);
+
+ label = gtk_label_new(NOTEBOOK_DISPLAY_OPTIONS);
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label);
+ gtk_widget_show(setup_vbox);
+
+ frame = gtk_frame_new(0);
+ gtk_container_set_border_width(GTK_CONTAINER(frame), 4);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
+ gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */
+ gtk_widget_show(frame);
+
+ vbox = gtk_vbox_new(FALSE, 1);
+ gtk_container_add(GTK_CONTAINER(frame), vbox);
+ gtk_widget_show(vbox);
+
+ /* main window fixed: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+ button = gtk_check_button_new_with_label(RADIO_BUTTON_WINDOW_FIXED);
+ xsane_back_gtk_set_tooltip(dialog->tooltips, button, DESC_MAIN_WINDOW_FIXED);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), preferences.main_window_fixed);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 2);
+ gtk_widget_show(button);
+ gtk_widget_show(hbox);
+ xsane_setup.main_window_fixed_button = button;
+
+
+ /* preserve preview image: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+ button = gtk_check_button_new_with_label(RADIO_BUTTON_PRESERVE_PRVIEW);
+ xsane_back_gtk_set_tooltip(dialog->tooltips, button, DESC_PREVIEW_PRESERVE);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), preferences.preserve_preview);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 2);
+ gtk_widget_show(button);
+ gtk_widget_show(hbox);
+ xsane_setup.preview_preserve_button = button;
+
+
+ /* private colormap: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+ button = gtk_check_button_new_with_label(RADIO_BUTTON_PRIVATE_COLORMAP);
+ xsane_back_gtk_set_tooltip(dialog->tooltips, button, DESC_PREVIEW_COLORMAP);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), preferences.preview_own_cmap);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 2);
+ gtk_widget_show(button);
+ gtk_widget_show(hbox);
+ xsane_setup.preview_own_cmap_button = button;
+
+
+ xsane_separator_new(vbox, 2);
+
+
+ /* preview gamma correction value: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+ gtk_widget_show(hbox);
+
+ label = gtk_label_new(TEXT_SETUP_PREVIEW_GAMMA);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.preview_gamma);
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PREVIEW_GAMMA);
+ gtk_widget_set_usize(text, 50, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ xsane_setup.preview_gamma_entry = text;
+
+ /* red preview gamma correction value: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+ gtk_widget_show(hbox);
+
+ label = gtk_label_new(TEXT_SETUP_PREVIEW_GAMMA_RED);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.preview_gamma_red);
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PREVIEW_GAMMA_RED);
+ gtk_widget_set_usize(text, 50, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ xsane_setup.preview_gamma_red_entry = text;
+
+ /* green preview gamma correction value: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+ gtk_widget_show(hbox);
+
+ label = gtk_label_new(TEXT_SETUP_PREVIEW_GAMMA_GREEN);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.preview_gamma_green);
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PREVIEW_GAMMA_GREEN);
+ gtk_widget_set_usize(text, 50, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ xsane_setup.preview_gamma_green_entry = text;
+
+ /* blue preview gamma correction value: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+ gtk_widget_show(hbox);
+
+ label = gtk_label_new(TEXT_SETUP_PREVIEW_GAMMA_BLUE);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ snprintf(buf, sizeof(buf), "%1.2f", preferences.preview_gamma_blue);
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_PREVIEW_GAMMA_BLUE);
+ gtk_widget_set_usize(text, 50, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ xsane_setup.preview_gamma_blue_entry = text;
+
+
+ xsane_separator_new(vbox, 2);
+
+
+ /* docviewer */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_HELPFILE_VIEWER);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_DOC_VIEWER);
+ gtk_widget_set_usize(text, 250, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.doc_viewer);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.doc_viewer_entry = text;
+
+
+ xsane_separator_new(vbox, 4);
+
+
+ /* apply button */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ button = gtk_button_new_with_label(BUTTON_APPLY);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_display_apply_changes, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ gtk_widget_show(hbox);
+
+
+
+
+ /* Fax options notebook page */
+
+ setup_vbox = gtk_vbox_new(FALSE, 5);
+
+ label = gtk_label_new(NOTEBOOK_FAX_OPTIONS);
+ gtk_notebook_append_page(GTK_NOTEBOOK(notebook), setup_vbox, label);
+ gtk_widget_show(setup_vbox);
+
+ frame = gtk_frame_new(0);
+ gtk_container_set_border_width(GTK_CONTAINER(frame), 4);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
+ gtk_box_pack_start(GTK_BOX(setup_vbox), frame, TRUE, TRUE, 0); /* sizeable framehight */
+ gtk_widget_show(frame);
+
+ vbox = gtk_vbox_new(FALSE, 1);
+ gtk_container_add(GTK_CONTAINER(frame), vbox);
+ gtk_widget_show(vbox);
+
+ /* faxcommand : */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_FAX_COMMAND);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAX_COMMAND);
+ gtk_widget_set_usize(text, 250, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.fax_command);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.fax_command_entry = text;
+
+
+ /* fax receiver option: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_FAX_RECEIVER_OPTION);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAX_RECEIVER_OPT);
+ gtk_widget_set_usize(text, 50, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.fax_receiver_option);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.fax_receiver_option_entry = text;
+
+
+/* fax postscript option: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_FAX_POSTSCRIPT_OPT);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAX_POSTSCRIPT_OPT);
+ gtk_widget_set_usize(text, 50, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.fax_postscript_option);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.fax_postscript_option_entry = text;
+
+
+ /* fax normal mode option : */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_FAX_NORMAL_MODE_OPT);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAX_NORMAL_OPT);
+ gtk_widget_set_usize(text, 50, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.fax_normal_option);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.fax_normal_option_entry = text;
+
+
+ /* fax fine mode option : */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_FAX_FINE_MODE_OPT);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAX_FINE_OPT);
+ gtk_widget_set_usize(text, 50, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.fax_fine_option);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.fax_fine_option_entry = text;
+
+
+ xsane_separator_new(vbox, 2);
+
+
+ /* faxviewer */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_FAX_VIEWER);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAX_VIEWER);
+ gtk_widget_set_usize(text, 250, 0);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.fax_viewer);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.fax_viewer_entry = text;
+
+
+ xsane_separator_new(vbox, 4);
+
+ /* fax width: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_FAX_WIDTH);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAX_WIDTH);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.fax_width);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.fax_width_entry = text;
+
+ /* fax height: */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_FAX_HEIGHT);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAX_HEIGHT);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.fax_height);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.fax_height_entry = text;
+
+ /* fax left offset : */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_FAX_LEFT);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAX_LEFTOFFSET);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.fax_leftoffset);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.fax_leftoffset_entry = text;
+
+ /* fax bottom offset : */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ label = gtk_label_new(TEXT_SETUP_FAX_BOTTOM);
+ gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show(label);
+
+ text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAX_BOTTOMOFFSET);
+ gtk_widget_set_usize(text, 50, 0);
+ snprintf(buf, sizeof(buf), "%3.2f", preferences.fax_bottomoffset);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), text, FALSE, FALSE, 2);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+ xsane_setup.fax_bottomoffset_entry = text;
+
+ xsane_separator_new(vbox, 4);
+
+ /* apply button */
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ button = gtk_button_new_with_label(BUTTON_APPLY);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_fax_apply_changes, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ gtk_widget_show(hbox);
+
+
+
+
+ /* fill in action area: */
+ hbox = GTK_DIALOG(setup_dialog)->action_area;
+
+ button = gtk_button_new_with_label(BUTTON_OK);
+ GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_setup_options_ok_callback, setup_dialog);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_grab_default(button);
+ gtk_widget_show(button);
+
+ button = gtk_button_new_with_label(BUTTON_CANCEL);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_close_setup_dialog_callback, setup_dialog);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ gtk_widget_show(setup_dialog);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
diff --git a/frontend/xsane-setup.h b/frontend/xsane-setup.h
new file mode 100644
index 0000000..411faa8
--- /dev/null
+++ b/frontend/xsane-setup.h
@@ -0,0 +1,33 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-setup.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include <sane/sane.h>
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+extern void xsane_new_printer(void);
+extern void xsane_update_int(GtkWidget *widget, int *val);
+extern void xsane_setup_dialog(GtkWidget *widget, gpointer data);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
diff --git a/frontend/xsane-style.rc b/frontend/xsane-style.rc
new file mode 100644
index 0000000..de6662d
--- /dev/null
+++ b/frontend/xsane-style.rc
@@ -0,0 +1,34 @@
+# style <name> [= <name>]
+# {
+# <option>
+# }
+#
+# widget <widget_set> style <style_name>
+# widget_class <widget_class_set> style <style_name>
+# accelerator <widget_name> <accelerator>
+
+style "progressbar"
+{
+ bg[PRELIGHT] = { 22500, 53280, 22500 } # green
+}
+
+style "curve"
+{
+ fg[NORMAL] = { 58000, 0, 0 } # red
+}
+
+style "font"
+{
+ font = "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*"
+}
+
+style "fixed font"
+{
+ font = "-misc-fixed-medium-r-semicondensed--13-*-*-*-*-*-*-*"
+}
+
+widget "*GtkCurve" style "curve"
+widget "*GtkProgressBar" style "progressbar"
+# widget "*" style "font"
+widget "*GtkRadioButton*" style "fixed font"
+
diff --git a/frontend/xsane-text.h b/frontend/xsane-text.h
new file mode 100644
index 0000000..5cc3367
--- /dev/null
+++ b/frontend/xsane-text.h
@@ -0,0 +1,417 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane-text.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ------------------------------------------------------------------------ */
+
+#ifndef XSANE_TEXT_H
+#define XSANE_TEXT_H
+
+#define XSANE_STRSTATUS(status) _(sane_strstatus(status))
+#define _BGT(text) dgettext(xsane.backend, text)
+
+#define WINDOW_ABOUT _("About")
+#define WINDOW_AUTHORIZE _("authorization")
+#define WINDOW_INFO _("info")
+#define WINDOW_BATCH_SCAN _("batch scan")
+#define WINDOW_FAX_PROJECT _("fax project")
+#define WINDOW_FAX_RENAME _("rename fax page")
+#define WINDOW_SETUP _("setup")
+#define WINDOW_HISTOGRAM _("Histogram")
+#define WINDOW_STANDARD_OPTIONS _("Standard options")
+#define WINDOW_ADVANCED_OPTIONS _("Advanced options")
+#define WINDOW_DEVICE_SELECTION _("device selection")
+#define WINDOW_PREVIEW _("Preview")
+#define WINDOW_OUTPUT_FILENAME _("output filename")
+#define WINDOW_SAVE_SETTINGS _("save device settings")
+#define WINDOW_LOAD_SETTINGS _("load device settings")
+
+#define MENU_FILE _("File")
+#define MENU_PREFERENCES _("Preferences")
+#define MENU_VIEW _("View")
+#define MENU_HELP _("Help")
+
+#define MENU_ITEM_ABOUT _("About")
+#define MENU_ITEM_INFO _("Info")
+#define MENU_ITEM_EXIT _("Exit")
+
+#define FRAME_RAW_IMAGE _("Raw image")
+#define FRAME_ENHANCED_IMAGE _("Enhanced image")
+
+#define BUTTON_START _("Start")
+#define BUTTON_OK _("Ok")
+#define BUTTON_APPLY _("Apply")
+#define BUTTON_CANCEL _("Cancel")
+#define BUTTON_CLOSE _("Close")
+#define BUTTON_OVERWRITE _("Overwrite")
+#define BUTTON_ADD_AREA _("Add area")
+#define BUTTON_DELETE _("Delete")
+#define BUTTON_SHOW _("Show")
+#define BUTTON_RENAME _("Rename")
+#define BUTTON_CREATE_PROJECT _("Create project")
+#define BUTTON_SEND_PROJECT _("Send project")
+#define BUTTON_DELETE_PROJECT _("Delete project")
+#define BUTTON_ADD_PRINTER _("Add printer")
+#define BUTTON_DELETE_PRINTER _("Delete printer")
+#define BUTTON_PREVIEW_ACQUIRE _("Acquire Preview")
+#define BUTTON_PREVIEW_CANCEL _("Cancel Preview")
+
+#define RADIO_BUTTON_FINE_MODE _("Fine mode")
+#define RADIO_BUTTON_OVERWRITE_WARNING _("Overwrite warning")
+#define RADIO_BUTTON_INCREASE_COUNTER _("Increase filename counter")
+#define RADIO_BUTTON_SKIP_EXISTING_NRS _("Skip existing numbers")
+#define RADIO_BUTTON_WINDOW_FIXED _("Main window size fixed")
+#define RADIO_BUTTON_PRESERVE_PRVIEW _("Preserve preview image")
+#define RADIO_BUTTON_PRIVATE_COLORMAP _("Use private colormap")
+
+#define TEXT_AVAILABLE_DEVICES _("Available devices:")
+#define TEXT_XSANE_OPTIONS _("XSane options")
+#define TEXT_XSANE_MODE _("XSane mode")
+#define TEXT_SCANNER_BACKEND _("Scanner and backend:")
+#define TEXT_VENDOR _("Vendor:")
+#define TEXT_MODEL _("Model:")
+#define TEXT_TYPE _("Type:")
+#define TEXT_DEVICE _("Device:")
+#define TEXT_LOADED_BACKEND _("Loaded backend:")
+#define TEXT_SANE_VERSION _("Sane version:")
+#define TEXT_RECENT_VALUES _("Recent values:")
+#define TEXT_GAMMA_CORR_BY _("Gamma correction by:")
+#define TEXT_SCANNER _("scanner")
+#define TEXT_SOFTWARE_XSANE _("software (xsane)")
+#define TEXT_NONE _("none")
+#define TEXT_GAMMA_INPUT_DEPTH _("Gamma input depth:")
+#define TEXT_GAMMA_OUTPUT_DEPTH _("Gamma output depth:")
+#define TEXT_SCANNER_OUTPUT_DEPTH _("Scanner output depth:")
+#define TEXT_OUTPUT_FORMATS _("XSane output formats:")
+#define TEXT_8BIT_FORMATS _("8 bit output formats:")
+#define TEXT_16BIT_FORMATS _("16 bit output formats:")
+#define TEXT_AUTHORIZATION_REQ _("Authorization required for")
+#define TEXT_USERNAME _("Username :")
+#define TEXT_PASSWORD _("Password :")
+#define TEXT_INVALID_PARAMS _("Invalid parameters.")
+#define TEXT_VERSION _("version:")
+#define TEXT_PACKAGE _("package")
+#define TEXT_WITH_GIMP_SUPPORT _("with GIMP support")
+#define TEXT_WITHOUT_GIMP_SUPPORT _("without GIMP support")
+#define TEXT_GIMP_VERSION _("compiled with GIMP-")
+#define TEXT_UNKNOWN _("unknown")
+#define TEXT_EMAIL _("Email:")
+#define TEXT_FILE _("File:")
+
+#define TEXT_INFO_BOX _("0x0: 0KB")
+
+#define TEXT_SETUP_PRINTER_SEL _("Printer selection:")
+#define TEXT_SETUP_PRINTER_NAME _("Name:")
+#define TEXT_SETUP_PRINTER_CMD _("Command:")
+#define TEXT_SETUP_COPY_NR_OPT _("Copy number option:")
+#define TEXT_SETUP_PRINTER_RES _("Resolution (dpi):")
+#define TEXT_SETUP_PRINTER_WIDTH _("Width [mm]:")
+#define TEXT_SETUP_PRINTER_HEIGHT _("Height [mm]:")
+#define TEXT_SETUP_PRINTER_LEFT _("Left offset [mm]:")
+#define TEXT_SETUP_PRINTER_BOTTOM _("Bottom offset [mm]:")
+#define TEXT_SETUP_PRINTER_GAMMA _("Printer gamma value:")
+#define TEXT_SETUP_PRINTER_GAMMA_RED _("Printer gamma red:")
+#define TEXT_SETUP_PRINTER_GAMMA_GREEN _("Printer gamma green:")
+#define TEXT_SETUP_PRINTER_GAMMA_BLUE _("Printer gamma blue:")
+#define TEXT_SETUP_JPEG_QUALITY _("JPEG image quality")
+#define TEXT_SETUP_PNG_COMPRESSION _("PNG image compression")
+#define TEXT_SETUP_TIFF_COMPRESSION _("TIFF multi bit image compression")
+#define TEXT_SETUP_TIFF_COMPRESSION_1 _("TIFF lineart image compression")
+#define TEXT_SETUP_PREVIEW_GAMMA _("Preview gamma:")
+#define TEXT_SETUP_PREVIEW_GAMMA_RED _("Preview gamma red:")
+#define TEXT_SETUP_PREVIEW_GAMMA_GREEN _("Preview gamma green:")
+#define TEXT_SETUP_PREVIEW_GAMMA_BLUE _("Preview gamma blue:")
+#define TEXT_SETUP_HELPFILE_VIEWER _("Helpfile viewer (HTML):")
+#define TEXT_SETUP_FAX_COMMAND _("Command:")
+#define TEXT_SETUP_FAX_RECEIVER_OPTION _("Receiver option:")
+#define TEXT_SETUP_FAX_POSTSCRIPT_OPT _("Postscriptfile option:")
+#define TEXT_SETUP_FAX_NORMAL_MODE_OPT _("Normal mode option:")
+#define TEXT_SETUP_FAX_FINE_MODE_OPT _("Fine mode option:")
+#define TEXT_SETUP_FAX_VIEWER _("Viewer (Postscript):")
+#define TEXT_SETUP_FAX_WIDTH _("Width [mm]:")
+#define TEXT_SETUP_FAX_HEIGHT _("Height [mm]:")
+#define TEXT_SETUP_FAX_LEFT _("Left offset [mm]:")
+#define TEXT_SETUP_FAX_BOTTOM _("Bottom offset [mm]:")
+
+#define NOTEBOOK_COPY_OPTIONS _("Copy options")
+#define NOTEBOOK_SAVING_OPTIONS _("Saving options")
+#define NOTEBOOK_DISPLAY_OPTIONS _("Display options")
+#define NOTEBOOK_FAX_OPTIONS _("Fax options")
+
+#define MENU_ITEM_SCAN _("Scan")
+#define MENU_ITEM_COPY _("Copy")
+#define MENU_ITEM_FAX _("Fax")
+
+#define MENU_ITEM_SHOW_TOOLTIPS _("Show tooltips")
+#define MENU_ITEM_SHOW_PREVIEW _("Show preview")
+#define MENU_ITEM_SHOW_HISTOGRAM _("Show histogram")
+#define MENU_ITEM_SHOW_STANDARDOPTIONS _("Show standard options")
+#define MENU_ITEM_SHOW_ADVANCEDOPTIONS _("Show advanced options")
+
+#define MENU_ITEM_SETUP _("Setup")
+#define MENU_ITEM_LENGTH_UNIT _("Length unit")
+#define SUBMENU_ITEM_LENGTH_MILLIMETERS _("millimeters")
+#define SUBMENU_ITEM_LENGTH_CENTIMETERS _("centimeters")
+#define SUBMENU_ITEM_LENGTH_INCHES _("inches")
+#define MENU_ITEM_UPDATE_POLICY _("Update policy")
+#define SUBMENU_ITEM_POLICY_CONTINUOUS _("continuous")
+#define SUBMENU_ITEM_POLICY_DISCONTINU _("discontinuous")
+#define SUBMENU_ITEM_POLICY_DELAYED _("delayed")
+#define MENU_ITEM_SHOW_RESOLUTIONLIST _("Show resolution list")
+#define MENU_ITEM_PAGE_ROTATE _("Rotate postscript")
+#define MENU_ITEM_SAVE_DEVICE_SETTINGS _("Save device settings")
+#define MENU_ITEM_LOAD_DEVICE_SETTINGS _("Load device settings")
+
+#define MENU_ITEM_XSANE_DOC _("Xsane doc")
+#define MENU_ITEM_BACKEND_DOC _("Backend doc")
+#define MENU_ITEM_AVAILABLE_BACKENDS _("Available backends")
+#define MENU_ITEM_SCANTIPS _("Scantips")
+#define MENU_ITEM_PROBLEMS _("Problems?")
+
+#define MENU_ITEM_TIFF_COMP_NONE _("no compression")
+#define MENU_ITEM_TIFF_COMP_CCITTRLE _("CCITT 1D Huffman compression")
+#define MENU_ITEM_TIFF_COMP_CCITFAX3 _("CCITT Group 3 Fax compression")
+#define MENU_ITEM_TIFF_COMP_CCITFAX4 _("CCITT Group 4 Fax compression")
+#define MENU_ITEM_TIFF_COMP_JPEG _("JPEG DCT compression")
+#define MENU_ITEM_TIFF_COMP_PACKBITS _("pack bits")
+
+#define MENU_ITEM_FILETYPE_JPEG _(".jpeg")
+#define MENU_ITEM_FILETYPE_PNG _(".png")
+#define MENU_ITEM_FILETYPE_PNM _(".pnm")
+#define MENU_ITEM_FILETYPE_PS _(".ps")
+#define MENU_ITEM_FILETYPE_RAW _(".raw")
+#define MENU_ITEM_FILETYPE_TIFF _(".tiff")
+#define MENU_ITEM_FILETYPE_BY_EXT _("by ext")
+
+#define PROGRESS_SAVING _("Saving image")
+#define PROGRESS_SAVING_FAX _("Saving fax image")
+#define PROGRESS_CONVERTING_DATA _("Converting data....")
+#define PROGRESS_CONVERTING_PS _("Converting to postscript")
+#define PROGRESS_SCANNING _("Scanning")
+#define PROGRESS_RECEIVING_SCAN _("Receiving %s data for `%s'...")
+#define PROGRESS_RECEIVING_COPY _("Receiving %s data for photocopy ...")
+#define PROGRESS_RECEIVING_FAX _("Receiving %s data for fax ...")
+#define PROGRESS_RECEIVING_GIMP _("Receiving %s data for GIMP...")
+
+
+#define DESC_XSANE_MODE _("Use XSane for SCANning, photoCOPYing, FAXing...")
+
+#define DESC_BROWSE_FILENAME _("Browse for image filename")
+#define DESC_FILENAME _("Filename for scanned image")
+#define DESC_FILETYPE _("Filename extension and type of image format")
+#define DESC_FAXPROJECT _("Enter name of fax project")
+#define DESC_FAXPAGENAME _("Enter new name for faxpage")
+#define DESC_FAXRECEIVER _("Enter receiver phone number or address")
+
+#define DESC_PRINTER_SELECT _("Select printer definition")
+
+#define DESC_RESOLUTION _("Set scan resolution")
+#define DESC_RESOLUTION_X _("Set scan resolution for x direction")
+#define DESC_RESOLUTION_Y _("Set scan resolution for y direction")
+#define DESC_ZOOM _("Set zoomfactor")
+#define DESC_ZOOM_X _("Set zoomfactor for x direction")
+#define DESC_ZOOM_Y _("Set zoomfactor for y direction")
+#define DESC_COPY_NUMBER _("Set number of copies")
+
+#define DESC_NEGATIVE _("Negative: Invert colors for scanning negatives\n" \
+ "e.g. swap black and white")
+
+#define DESC_GAMMA _("Set gamma value")
+#define DESC_GAMMA_R _("Set gamma value for red component")
+#define DESC_GAMMA_G _("Set gamma value for green component")
+#define DESC_GAMMA_B _("Set gamma value for blue component")
+
+#define DESC_BRIGHTNESS _("Set brightness")
+#define DESC_BRIGHTNESS_R _("Set brightness for red component")
+#define DESC_BRIGHTNESS_G _("Set brightness for green component")
+#define DESC_BRIGHTNESS_B _("Set brightness for blue component")
+
+#define DESC_CONTRAST _("Set contrast")
+#define DESC_CONTRAST_R _("Set contrast for red component")
+#define DESC_CONTRAST_G _("Set contrast for green component")
+#define DESC_CONTRAST_B _("Set contrast for blue component")
+
+#define DESC_RGB_DEFAULT _("RGB default: Set enhancement values for red, green and blue to default values:\n" \
+ " gamma = 1.0\n" \
+ " brightness = 0\n" \
+ " contrast = 0")
+
+#define DESC_ENH_AUTO _("Autoadjust gamma, brightness and contrast in dependance of selected area")
+#define DESC_ENH_DEFAULT _("Set default enhancement values:\n" \
+ "gamma = 1.0\n" \
+ "brightness = 0\n" \
+ "contrast = 0")
+#define DESC_ENH_RESTORE _("Restore enhancement values from preferences")
+#define DESC_ENH_STORE _("Store active enhancement values to preferences")
+
+#define DESC_HIST_INTENSITY _("Show histogram of intensity/gray")
+#define DESC_HIST_RED _("Show histogram of red component")
+#define DESC_HIST_GREEN _("Show histogram of green component")
+#define DESC_HIST_BLUE _("Show histogram of blue component")
+#define DESC_HIST_PIXEL _("Display histogram with lines instead of pixels")
+#define DESC_HIST_LOG _("Show logarithm of pixelcount")
+
+#define DESC_PRINTER_SETUP _("Select definition to change")
+#define DESC_PRINTER_NAME _("Define a name for the selection of this definition")
+#define DESC_PRINTER_COMMAND _("Enter command to be executed in copy mode (e.g. \"lpr -\")")
+#define DESC_COPY_NUMBER_OPTION _("Enter option for copy numbers")
+#define DESC_PRINTER_RESOLUTION _("Resolution with which images are printed and saved in postscript")
+#define DESC_PRINTER_WIDTH _("Width of printable area in mm")
+#define DESC_PRINTER_HEIGHT _("Height of printable area in mm")
+#define DESC_PRINTER_LEFTOFFSET _("Left offset from the edge of the paper to the printable area in mm")
+#define DESC_PRINTER_BOTTOMOFFSET _("Bottom offset from the edge of the paper to the printable area in mm")
+#define DESC_PRINTER_GAMMA _("Additional gamma value for photocopy")
+#define DESC_PRINTER_GAMMA_RED _("Additional gamma value for red component for photocopy")
+#define DESC_PRINTER_GAMMA_GREEN _("Additional gamma value for green component for photocopy")
+#define DESC_PRINTER_GAMMA_BLUE _("Additional gamma value for blue component for photocopy")
+#define DESC_JPEG_QUALITY _("Quality in percent if image is saved as jpeg or tiff with jpeg compression")
+#define DESC_PNG_COMPRESSION _("Compression if image is saved as png")
+#define DESC_TIFF_COMPRESSION _("Compression type if multi bit image is saved as tiff")
+#define DESC_TIFF_COMPRESSION_1 _("Compression type if lineart image is saved as tiff")
+#define DESC_OVERWRITE_WARNING _("Warn before overwriting an existing file")
+#define DESC_INCREASE_COUNTER _("If the filename is of the form \"name-001.ext\" " \
+ "(where the number of digits is free) " \
+ "the number is increased after a scan is finished")
+#define DESC_SKIP_EXISTING _("If filename counter is automatically increased, used numbers are skipped")
+#define DESC_MAIN_WINDOW_FIXED _("Use fixed main window size or scrolled, resizable main window")
+#define DESC_PREVIEW_PRESERVE _("Preserve preview image for next program start")
+#define DESC_PREVIEW_COLORMAP _("Use an own colormap for preview if display depth is 8 bpp")
+#define DESC_PREVIEW_GAMMA _("Set gamma correction value for preview image")
+#define DESC_PREVIEW_GAMMA_RED _("Set gamma correction value for red component of preview image")
+#define DESC_PREVIEW_GAMMA_GREEN _("Set gamma correction value for green component of preview image")
+#define DESC_PREVIEW_GAMMA_BLUE _("Set gamma correction value for blue component of preview image")
+#define DESC_DOC_VIEWER _("Enter command to be executed to display helpfiles, must be a html-viewer!")
+
+#define DESC_FAX_COMMAND _("Enter command to be executed in fax mode")
+#define DESC_FAX_RECEIVER_OPT _("Enter option to specify receiver")
+#define DESC_FAX_POSTSCRIPT_OPT _("Enter option to specify postscript files following")
+#define DESC_FAX_NORMAL_OPT _("Enter option to specify normal mode (low resolution)")
+#define DESC_FAX_FINE_OPT _("Enter option to specify fine mode (high resolution)")
+#define DESC_FAX_VIEWER _("Enter command to be executed to view a fax")
+#define DESC_FAX_FINE_MODE _("Use high vertical resolution (196 lpi instead of 98 lpi)")
+#define DESC_FAX_WIDTH _("Width of printable area in mm")
+#define DESC_FAX_HEIGHT _("Height of printable area in mm")
+#define DESC_FAX_LEFTOFFSET _("Left offset from the edge of the paper to the printable area in mm")
+#define DESC_FAX_BOTTOMOFFSET _("Bottom offset from the edge of the paper to the printable area in mm")
+
+#define DESC_PIPETTE_WHITE _("Pick white point")
+#define DESC_PIPETTE_GRAY _("Pick gray point")
+#define DESC_PIPETTE_BLACK _("Pick black point")
+
+#define DESC_ZOOM_FULL _("Use full scanarea")
+#define DESC_ZOOM_OUT _("Zoom 20% out")
+#define DESC_ZOOM_IN _("Zoom into selected area")
+#define DESC_ZOOM_UNDO _("Undo last zoom")
+
+#define DESC_FULL_PREVIEW_AREA _("Select visible area")
+
+
+#define ERR_HOME_DIR _("Failed to determine home directory:")
+#define ERR_FILENAME_TOO_LONG _("Filename too long")
+#define ERR_SET_OPTION _("Failed to set value of option")
+#define ERR_GET_OPTION _("Failed to obtain value of option")
+#define ERR_OPTION_COUNT _("Error obtaining option count")
+#define ERR_DEVICE_OPEN_FAILED _("Failed to open device")
+#define ERR_NO_DEVICES _("no devices available")
+#define ERR_DURING_READ _("Error during read:")
+#define ERR_DURING_SAVE _("Error during save:")
+#define ERR_BAD_DEPTH _("Can't handle depth")
+#define ERR_GIMP_BAD_DEPTH _("GIMP can't handle depth")
+#define ERR_UNKNOWN_SAVING_FORMAT _("Unknown file format for saving")
+#define ERR_OPEN_FAILED _("Failed to open")
+#define ERR_FAILED_PRINTER_PIPE _("Failed to open pipe for executing printercommand")
+#define ERR_FAILED_EXEC_PRINTER_CMD _("Failed to execute printercommand:")
+#define ERR_FAILED_START_SCANNER _("Failed to start scanner:")
+#define ERR_FAILED_GET_PARAMS _("Failed to get parameters:")
+#define ERR_NO_OUTPUT_FORMAT _("No output format given")
+#define ERR_NO_MEM _("out of memory")
+#define ERR_LIBTIFF _("LIBTIFF reports error")
+#define ERR_LIBPNG _("LIBPNG reports error")
+#define ERR_UNKNOWN_TYPE _("unknown type")
+#define ERR_UNKNOWN_CONSTRAINT_TYPE _("unknown constraint type")
+#define ERR_FAILD_EXEC_DOC_VIEWER _("Failed to execute documentation viewer:")
+#define ERR_FAILD_EXEC_FAX_VIEWER _("Failed to execute fax viewer:")
+#define ERR_FAILED_EXEC_FAX_CMD _("Failed to execute faxcommand:")
+#define ERR_BAD_FRAME_FORMAT _("bad frame format")
+#define ERR_FAILED_SET_RESOLUTION _("unable to set resolution")
+
+#define ERR_ERROR _("error")
+#define ERR_MAJOR_VERSION_NR_CONFLICT _("Sane major version number mismatch!")
+#define ERR_XSANE_MAJOR_VERSION _("xsane major version =")
+#define ERR_BACKEND_MAJOR_VERSION _("backend major version =")
+#define ERR_PROGRAM_ABORTED _("*** PROGRAM ABORTED ***")
+
+#define ERR_FAILED_ALLOCATE_IMAGE _("Failed to allocate image memory:")
+#define ERR_PREVIEW_BAD_DEPTH _("Preview cannot handle bit depth")
+#define ERR_GIMP_SUPPORT_MISSING _("GIMP support missing")
+
+#define WARN_COUNTER_OVERFLOW _("Filename counter overflow")
+#define WARN_NO_VALUE_CONSTRAINT _("warning: option has no value constraint")
+
+#define ERR_BUTTON_OK _("Ok")
+#define ERR_HEADER_ERROR _("Error")
+#define ERR_HEADER_WARNING _("Warning")
+
+#define ERR_FAILED_CREATE_FILE _("Failed to create file:")
+#define ERR_LOAD_DEVICE_SETTINGS _("Error while loading device settings:")
+#define ERR_NO_DRC_FILE _("is not a device-rc-file !!!")
+#define ERR_NETSCAPE_EXECUTE_FAIL _("Failed to execute netscape!")
+#define ERR_SENDFAX_RECEIVER_MISSING _("Send fax: no receiver defined")
+
+#define ERR_CREATED_FOR_DEVICE _("has been created for device")
+#define ERR_USED_FOR_DEVICE _("you want to use it for device")
+#define ERR_MAY_CAUSE_PROBLEMS _("this may cause problems!")
+
+#define TEXT_USAGE _("Usage:")
+#define TEXT_USAGE_OPTIONS _("[OPTION]... [DEVICE]")
+#define TEXT_HELP _(\
+"Start up graphical user interface to access SANE (Scanner Access Now Easy) devices.\n\
+\n\
+-h, --help display this help message and exit\n\
+-v, --version print version information\n\
+\n\
+-d, --device-settings file load device settings from file (without \".drc\")\n\
+\n\
+-s, --scan start with scan-mode active\n\
+-c, --copy start with copy-mode active\n\
+-f, --fax start with fax-mode active\n\
+-n, --no-mode-selection disable menu for xsane mode selection\n\
+\n\
+-F, --Fixed fixed main window size (overwrite preferences value)\n\
+-R, --Resizeable resizable, scrolled main window (overwrite preferences value)\n\
+\n\
+--display X11-display redirect output to X11-display\n\
+--no-xshm do not use shared memory images\n\
+--sync request a synchronous connection with the X11 server\
+")
+
+/* strings for gimp plugin */
+
+#define XSANE_GIMP_INSTALL_BLURB _("Front-end to the SANE interface")
+#define XSANE_GIMP_INSTALL_HELP _("This function provides access to scanners and other image acquisition devices through the SANE (Scanner Access Now Easy) interface.")
+
+/* Menu path must not be translated, this is done by the gimp. Only translate the text behind the last "/" */
+#define XSANE_GIMP_MENU_DIALOG _("<Toolbox>/File/Acquire/XSane: Device dialog...")
+#define XSANE_GIMP_MENU _("<Toolbox>/File/Acquire/XSane: ")
+#define XSANE_GIMP_MENU_DIALOG_OLD _("<Toolbox>/Xtns/XSane/Device dialog...")
+#define XSANE_GIMP_MENU_OLD _("<Toolbox>/Xtns/XSane/")
+
+#endif
diff --git a/frontend/xsane.c b/frontend/xsane.c
new file mode 100644
index 0000000..6302168
--- /dev/null
+++ b/frontend/xsane.c
@@ -0,0 +1,4794 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane.c
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#include "xsane.h"
+#include "xsane-back-gtk.h"
+#include "xsane-front-gtk.h"
+#include "xsane-preview.h"
+#include "xsane-save.h"
+#include "xsane-gamma.h"
+#include "xsane-setup.h"
+#include "xsane-scan.h"
+#include "xsane-rc-io.h"
+#include "xsane-device-preferences.h"
+#include "xsane-preferences.h"
+#include "xsane-icons.h"
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+#include <png.h>
+#include <zlib.h>
+#endif
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+struct option long_options[] =
+{
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'v'},
+ {"device-settings", required_argument, 0, 'd'},
+ {"scan", no_argument, 0, 's'},
+ {"copy", no_argument, 0, 'c'},
+ {"no-mode-selection", no_argument, 0, 'n'},
+ {"fax", no_argument, 0, 'f'},
+ {"Fixed", no_argument, 0, 'F'},
+ {"Resizeable", no_argument, 0, 'R'},
+ {0, }
+};
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+int xsane_back_gtk_message_dialog_active = 0;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+const char *prog_name = 0;
+const char *device_text = 0;
+GtkWidget *choose_device_dialog = 0;
+GSGDialog *dialog = 0;
+const SANE_Device **devlist = 0;
+gint seldev = -1; /* The selected device */
+gint ndevs; /* The number of available devices */
+struct Xsane xsane;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+int xsane_scanmode_number[] = { XSANE_SCAN, XSANE_COPY, XSANE_FAX };
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#define XSANE_GTK_NAME_RESOLUTION "GtkMenuResolution"
+#define XSANE_GTK_NAME_X_RESOLUTION "GtkMenuXResolution"
+#define XSANE_GTK_NAME_Y_RESOLUTION "GtkMenuYResolution"
+
+#define XSANE_GTK_NAME_ZOOM "GtkMenuZoom"
+#define XSANE_GTK_NAME_X_ZOOM "GtkMenuXZoom"
+#define XSANE_GTK_NAME_Y_ZOOM "GtkMenuYZoom"
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* forward declarations: */
+
+static int xsane_option_defined(char *string);
+static int xsane_parse_options(char *options, char *argv[]);
+static void xsane_update_param(GSGDialog *dialog, void *arg);
+static void xsane_zoom_update(GtkAdjustment *adj_data, double *val);
+static void xsane_resolution_scale_update(GtkAdjustment *adj_data, double *val);
+static void xsane_gamma_changed(GtkAdjustment *adj_data, double *val);
+static void xsane_modus_callback(GtkWidget *xsane_parent, int *num);
+static void xsane_filetype_callback(GtkWidget *widget, gpointer data);
+static void xsane_outputfilename_changed_callback(GtkWidget *widget, gpointer data);
+static void xsane_browse_filename_callback(GtkWidget *widget, gpointer data);
+static void xsane_outputfilename_new(GtkWidget *vbox);
+static void xsane_faxreceiver_changed_callback(GtkWidget *widget, gpointer data);
+static void xsane_faxproject_changed_callback(GtkWidget *widget, gpointer data);
+static void xsane_fax_fine_mode_callback(GtkWidget * widget);
+static void xsane_enhancement_rgb_default_callback(GtkWidget * widget);
+static void xsane_enhancement_negative_callback(GtkWidget * widget);
+static void xsane_auto_enhancement_callback(GtkWidget * widget);
+static void xsane_show_standard_options_callback(GtkWidget * widget);
+static void xsane_show_advanced_options_callback(GtkWidget * widget);
+static void xsane_show_histogram_callback(GtkWidget * widget);
+static void xsane_printer_callback(GtkWidget *widget, gpointer data);
+static void xsane_update_preview(GSGDialog *dialog, void *arg);
+void xsane_pref_save(void);
+static void xsane_pref_restore(void);
+static void xsane_quit(void);
+static void xsane_exit(void);
+static gint xsane_standard_option_win_delete(GtkWidget *widget, gpointer data);
+static gint xsane_advanced_option_win_delete(GtkWidget *widget, gpointer data);
+static gint xsane_scan_win_delete(GtkWidget *w, gpointer data);
+static gint xsane_preview_window_destroyed(GtkWidget *widget, gpointer call_data);
+static void xsane_show_preview_callback(GtkWidget * widget, gpointer call_data);
+static GtkWidget *xsane_files_build_menu(void);
+static void xsane_set_pref_unit_callback(GtkWidget *widget, gpointer data);
+static void xsane_set_update_policy_callback(GtkWidget *widget, gpointer data);
+static gint xsane_close_info_callback(GtkWidget *widget, gpointer data);
+static void xsane_info_dialog(GtkWidget *widget, gpointer data);
+static void xsane_about_dialog(GtkWidget *widget, gpointer data);
+static SANE_Status xsane_get_area_value(int option, float *val, SANE_Int *unit);
+#ifdef XSANE_TEST
+static void xsane_batch_scan_delete_callback(GtkWidget *widget, gpointer list);
+static void xsane_batch_scan_add_callback(GtkWidget *widget, gpointer list);
+static void xsane_batch_scan_dialog(GtkWidget *widget, gpointer data);
+#endif
+static void xsane_fax_dialog(void);
+static void xsane_fax_dialog_close(void);
+static void xsane_fax_project_delete(void);
+void xsane_fax_project_save(void);
+static void xsane_fax_project_load(void);
+static void xsane_fax_project_create(void);
+static void xsane_pref_toggle_tooltips(GtkWidget *widget, gpointer data);
+static void xsane_show_doc(GtkWidget *widget, gpointer data);
+static void xsane_fax_entrys_swap(GtkWidget *list_item_1, GtkWidget *list_item_2);
+static void xsane_fax_entry_move_up_callback(GtkWidget *widget, gpointer list);
+static void xsane_fax_entry_move_down_callback(GtkWidget *widget, gpointer list);
+static void xsane_fax_entry_rename_callback(GtkWidget *widget, gpointer list);
+static void xsane_fax_entry_delete_callback(GtkWidget *widget, gpointer list);
+static void xsane_fax_show_callback(GtkWidget *widget, gpointer data);
+static void xsane_fax_send(void);
+static GtkWidget *xsane_view_build_menu(void);
+static GtkWidget *xsane_pref_build_menu(void);
+static GtkWidget *xsane_help_build_menu(void);
+static void xsane_device_dialog(void);
+static void xsane_choose_dialog_ok_callback(void);
+static void xsane_select_device_by_key_callback(GtkWidget * widget, gpointer data);
+static void xsane_select_device_by_mouse_callback(GtkWidget * widget, GdkEventButton *event, gpointer data);
+static gint32 xsane_choose_device(void);
+static void xsane_usage(void);
+static void xsane_init(int argc, char **argv);
+void xsane_interface(int argc, char **argv);
+int main(int argc, char ** argv);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int xsane_option_defined(char *string)
+{
+ if (string)
+ {
+ while (*string == ' ') /* skip spaces */
+ {
+ string++;
+ }
+ if (*string != 0)
+ {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int xsane_parse_options(char *options, char *argv[])
+{
+ int optpos = 0;
+ int bufpos = 0;
+ int arg = 0;
+ char buf[256];
+
+ while (options[optpos] != 0)
+ {
+ switch(options[optpos])
+ {
+ case ' ':
+ buf[bufpos] = 0;
+ argv[arg++] = strdup(buf);
+ bufpos = 0;
+ optpos++;
+ break;
+
+ case '\"':
+ optpos++; /* skip " */
+ while ((options[optpos] != 0) && (options[optpos] != '\"'))
+ {
+ buf[bufpos++] = options[optpos++];
+ }
+ optpos++; /* skip " */
+ break;
+
+ default:
+ buf[bufpos++] = options[optpos++];
+ break;
+ }
+ }
+ buf[bufpos] = 0;
+ argv[arg++] = strdup(buf);
+ return arg;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* Update the info line with the latest size information and update histogram. */
+static void xsane_update_param(GSGDialog *dialog, void *arg)
+{
+ SANE_Parameters params;
+ gchar buf[200];
+
+ if (!xsane.info_label)
+ {
+ return;
+ }
+
+ if (xsane.block_update_param) /* if we change more than one value, we only want to update all once */
+ {
+ return;
+ }
+
+ if (sane_get_parameters(xsane_back_gtk_dialog_get_device(dialog), &params) == SANE_STATUS_GOOD)
+ {
+ float size = params.bytes_per_line * params.lines;
+ const char *unit = "B";
+
+ if (params.format >= SANE_FRAME_RED && params.format <= SANE_FRAME_BLUE)
+ {
+ size *= 3.0;
+ }
+
+ if (size >= 1024.0 * 1024.0)
+ {
+ size /= 1024.0 * 1024.0;
+ unit = "MB";
+ }
+ else if (size >= 1024.0)
+ {
+ size /= 1024.0;
+ unit = "KB";
+ }
+ snprintf(buf, sizeof(buf), "(%d x %d): %5.1f %s", params.pixels_per_line, params.lines, size, unit);
+
+ if (params.format == SANE_FRAME_GRAY)
+ {
+ xsane.xsane_color = 0;
+ }
+#ifdef SUPPORT_RGBA
+ else if (params.format == SANE_FRAME_RGBA)
+ {
+ xsane.xsane_color = 4;
+ }
+#endif
+ else /* RGB */
+ {
+ xsane.xsane_color = 3;
+ }
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), TEXT_INVALID_PARAMS);
+ }
+
+ gtk_label_set(GTK_LABEL(xsane.info_label), buf);
+
+
+ if (xsane.preview)
+ {
+ preview_update_surface(xsane.preview, 0);
+ }
+
+ xsane_update_histogram();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_gamma_changed(GtkAdjustment *adj_data, double *val)
+{
+ *val = adj_data->value;
+ xsane_enhancement_by_gamma();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_modus_callback(GtkWidget *xsane_parent, int *num)
+{
+
+ if (xsane.filetype) /* add extension to filename */
+ {
+ char buffer[256];
+
+ snprintf(buffer, sizeof(buffer), "%s%s", preferences.filename, xsane.filetype);
+ free(preferences.filename);
+ free(xsane.filetype);
+ xsane.filetype = 0;
+ preferences.filename = strdup(buffer);
+ }
+
+ xsane.xsane_mode = *num;
+ xsane_refresh_dialog(dialog);
+
+ if (xsane.xsane_mode != XSANE_FAX)
+ {
+ xsane_fax_dialog_close();
+ gtk_widget_set_sensitive(GTK_WIDGET(xsane.start_button), TRUE);
+ }
+
+ xsane_define_maximum_output_size();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_filetype_callback(GtkWidget *widget, gpointer data)
+{
+ if (data)
+ {
+ char *extension, *filename;
+
+ extension = strrchr(preferences.filename, '.');
+
+ if ((extension) && (extension != preferences.filename))
+ {
+ if ( (!strcasecmp(extension, ".pnm")) || (!strcasecmp(extension, ".raw"))
+ || (!strcasecmp(extension, ".png")) || (!strcasecmp(extension, ".ps"))
+ || (!strcasecmp(extension, ".rgba"))
+ || (!strcasecmp(extension, ".tiff")) || (!strcasecmp(extension, ".tif"))
+ || (!strcasecmp(extension, ".jpg")) || (!strcasecmp(extension, ".jpeg"))
+ ) /* remove filetype extension */
+ {
+ filename = preferences.filename;
+ *extension = 0; /* remove extension */
+ preferences.filename = strdup(filename); /* filename without extension */
+ free(filename); /* free unused memory */
+ }
+ }
+ }
+ else if (xsane.filetype)
+ {
+ char buffer[256];
+
+ snprintf(buffer, sizeof(buffer), "%s%s", preferences.filename, xsane.filetype);
+ free(preferences.filename);
+ free(xsane.filetype);
+ xsane.filetype = 0;
+ preferences.filename = strdup(buffer);
+ }
+
+ if (data)
+ {
+ xsane.filetype = strdup((char *) data); /* set extension for filename */
+ }
+
+ gtk_entry_set_text(GTK_ENTRY(xsane.outputfilename_entry), preferences.filename);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_outputfilename_changed_callback(GtkWidget *widget, gpointer data)
+{
+ if (preferences.filename)
+ {
+ free((void *) preferences.filename);
+ }
+ preferences.filename = strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
+}
+
+/* ----------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_browse_filename_callback(GtkWidget *widget, gpointer data)
+{
+ char filename[1024];
+ char windowname[256];
+
+ xsane_set_sensitivity(FALSE);
+
+ if (xsane.filetype) /* set filetype to "by ext." */
+ {
+ char buffer[256];
+
+ snprintf(buffer, sizeof(buffer), "%s%s", preferences.filename, xsane.filetype);
+ free(preferences.filename);
+ free(xsane.filetype);
+ xsane.filetype = 0;
+ preferences.filename = strdup(buffer);
+ }
+
+ if (preferences.filename) /* make sure a correct filename is defined */
+ {
+ strncpy(filename, preferences.filename, sizeof(filename));
+ filename[sizeof(filename) - 1] = '\0';
+ }
+ else /* no filename given, take standard filename */
+ {
+ strcpy(filename, OUTFILENAME);
+ }
+
+ snprintf(windowname, sizeof(windowname), "%s %s %s", prog_name, WINDOW_OUTPUT_FILENAME, device_text);
+
+ umask(preferences.directory_umask); /* define new file permissions */
+ xsane_back_gtk_get_filename(windowname, filename, sizeof(filename), filename, TRUE);
+ umask(XSANE_DEFAULT_UMASK); /* define new file permissions */
+
+ gtk_entry_set_text(GTK_ENTRY(xsane.outputfilename_entry), filename);
+
+ if (preferences.filename)
+ {
+ free((void *) preferences.filename);
+ }
+
+ xsane_set_sensitivity(TRUE);
+
+ preferences.filename = strdup(filename);
+
+ gtk_option_menu_set_history(GTK_OPTION_MENU(xsane.filetype_option_menu), 0); /* set menu to "by ext" */
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_outputfilename_new(GtkWidget *vbox)
+{
+ GtkWidget *hbox;
+ GtkWidget *text;
+ GtkWidget *button;
+ GtkWidget *xsane_filetype_menu, *xsane_filetype_item;
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
+ gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 2);
+
+ button = xsane_button_new_with_pixmap(hbox, file_xpm, DESC_BROWSE_FILENAME, (GtkSignalFunc) xsane_browse_filename_callback, 0);
+
+ text = gtk_entry_new_with_max_length(255);
+ gtk_widget_set_usize(text, 80, 0); /* set minimum size */
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FILENAME);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.filename);
+ gtk_box_pack_start(GTK_BOX(hbox), text, TRUE, TRUE, 4);
+ gtk_signal_connect(GTK_OBJECT(text), "changed", (GtkSignalFunc) xsane_outputfilename_changed_callback, 0);
+
+ xsane.outputfilename_entry = text;
+
+ xsane_filetype_menu = gtk_menu_new();
+
+ xsane_filetype_item = gtk_menu_item_new_with_label(MENU_ITEM_FILETYPE_BY_EXT);
+ gtk_container_add(GTK_CONTAINER(xsane_filetype_menu), xsane_filetype_item);
+ gtk_signal_connect(GTK_OBJECT(xsane_filetype_item), "activate",
+ (GtkSignalFunc) xsane_filetype_callback, NULL);
+ gtk_widget_show(xsane_filetype_item);
+
+#ifdef HAVE_LIBJPEG
+ xsane_filetype_item = gtk_menu_item_new_with_label(MENU_ITEM_FILETYPE_JPEG);
+ gtk_container_add(GTK_CONTAINER(xsane_filetype_menu), xsane_filetype_item);
+ gtk_signal_connect(GTK_OBJECT(xsane_filetype_item), "activate",
+ (GtkSignalFunc) xsane_filetype_callback, MENU_ITEM_FILETYPE_JPEG);
+ gtk_widget_show(xsane_filetype_item);
+#endif
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+ xsane_filetype_item = gtk_menu_item_new_with_label(MENU_ITEM_FILETYPE_PNG);
+ gtk_container_add(GTK_CONTAINER(xsane_filetype_menu), xsane_filetype_item);
+ gtk_signal_connect(GTK_OBJECT(xsane_filetype_item), "activate",
+ (GtkSignalFunc) xsane_filetype_callback, MENU_ITEM_FILETYPE_PNG);
+ gtk_widget_show(xsane_filetype_item);
+#endif
+#endif
+
+ xsane_filetype_item = gtk_menu_item_new_with_label(MENU_ITEM_FILETYPE_PNM);
+ gtk_container_add(GTK_CONTAINER(xsane_filetype_menu), xsane_filetype_item);
+ gtk_signal_connect(GTK_OBJECT(xsane_filetype_item), "activate",
+ (GtkSignalFunc) xsane_filetype_callback, MENU_ITEM_FILETYPE_PNM);
+ gtk_widget_show(xsane_filetype_item);
+
+ xsane_filetype_item = gtk_menu_item_new_with_label(MENU_ITEM_FILETYPE_PS);
+ gtk_container_add(GTK_CONTAINER(xsane_filetype_menu), xsane_filetype_item);
+ gtk_signal_connect(GTK_OBJECT(xsane_filetype_item), "activate",
+ (GtkSignalFunc) xsane_filetype_callback, MENU_ITEM_FILETYPE_PS);
+ gtk_widget_show(xsane_filetype_item);
+
+ xsane_filetype_item = gtk_menu_item_new_with_label(MENU_ITEM_FILETYPE_RAW);
+ gtk_container_add(GTK_CONTAINER(xsane_filetype_menu), xsane_filetype_item);
+ gtk_signal_connect(GTK_OBJECT(xsane_filetype_item), "activate",
+ (GtkSignalFunc) xsane_filetype_callback, MENU_ITEM_FILETYPE_RAW);
+ gtk_widget_show(xsane_filetype_item);
+
+#ifdef HAVE_LIBTIFF
+ xsane_filetype_item = gtk_menu_item_new_with_label(MENU_ITEM_FILETYPE_TIFF);
+ gtk_container_add(GTK_CONTAINER(xsane_filetype_menu), xsane_filetype_item);
+ gtk_signal_connect(GTK_OBJECT(xsane_filetype_item), "activate",
+ (GtkSignalFunc) xsane_filetype_callback, MENU_ITEM_FILETYPE_TIFF);
+ gtk_widget_show(xsane_filetype_item);
+#endif
+
+ xsane.filetype_option_menu = gtk_option_menu_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, xsane.filetype_option_menu, DESC_FILETYPE);
+ gtk_box_pack_end(GTK_BOX(hbox), xsane.filetype_option_menu, FALSE, FALSE, 2);
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(xsane.filetype_option_menu), xsane_filetype_menu);
+ gtk_option_menu_set_history(GTK_OPTION_MENU(xsane.filetype_option_menu), 0);
+ gtk_widget_show(xsane.filetype_option_menu);
+
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_faxreceiver_changed_callback(GtkWidget *widget, gpointer data)
+{
+ if (xsane.fax_receiver)
+ {
+ free((void *) xsane.fax_receiver);
+ }
+ xsane.fax_receiver = strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
+
+ xsane_fax_project_save();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_faxproject_changed_callback(GtkWidget *widget, gpointer data)
+{
+ if (preferences.fax_project)
+ {
+ free((void *) preferences.fax_project);
+ }
+ preferences.fax_project = strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
+
+ xsane_fax_project_load();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_fine_mode_callback(GtkWidget * widget)
+{
+ xsane.fax_fine_mode = (GTK_TOGGLE_BUTTON(widget)->active != 0);
+
+ if (xsane.fax_fine_mode)
+ {
+ xsane.resolution = 196;
+ xsane.resolution_x = 98;
+ xsane.resolution_y = 196;
+ }
+ else
+ {
+ xsane.resolution = 98;
+ xsane.resolution_x = 98;
+ xsane.resolution_y = 98;
+ }
+
+ xsane_set_all_resolutions();
+
+ xsane_update_param(dialog, 0);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_enhancement_rgb_default_callback(GtkWidget * widget)
+{
+ xsane.enhancement_rgb_default = (GTK_TOGGLE_BUTTON(widget)->active != 0);
+
+ if (xsane.enhancement_rgb_default)
+ {
+ xsane.gamma_red = 1.0;
+ xsane.gamma_green = 1.0;
+ xsane.gamma_blue = 1.0;
+
+ xsane.brightness_red = 0.0;
+ xsane.brightness_green = 0.0;
+ xsane.brightness_blue = 0.0;
+
+ xsane.contrast_red = 0.0;
+ xsane.contrast_green = 0.0;
+ xsane.contrast_blue = 0.0;
+
+ xsane.slider_red.value[0] = 0.0;
+ xsane.slider_red.value[1] = 50.0;
+ xsane.slider_red.value[2] = 100.0;
+
+ xsane.slider_green.value[0] = 0.0;
+ xsane.slider_green.value[1] = 50.0;
+ xsane.slider_green.value[2] = 100.0;
+
+ xsane.slider_blue.value[0] = 0.0;
+ xsane.slider_blue.value[1] = 50.0;
+ xsane.slider_blue.value[2] = 100.0;
+ }
+ else
+ {
+ xsane.slider_red.value[0] = xsane.slider_gray.value[0];
+ xsane.slider_red.value[1] = xsane.slider_gray.value[1];
+ xsane.slider_red.value[2] = xsane.slider_gray.value[2];
+
+ xsane.slider_green.value[0] = xsane.slider_gray.value[0];
+ xsane.slider_green.value[1] = xsane.slider_gray.value[1];
+ xsane.slider_green.value[2] = xsane.slider_gray.value[2];
+
+ xsane.slider_blue.value[0] = xsane.slider_gray.value[0];
+ xsane.slider_blue.value[1] = xsane.slider_gray.value[1];
+ xsane.slider_blue.value[2] = xsane.slider_gray.value[2];
+ }
+
+ xsane_update_sliders();
+ xsane_update_gamma();
+ xsane_refresh_dialog(dialog);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_enhancement_negative_callback(GtkWidget * widget)
+{
+ double v0;
+
+ if (xsane.negative != (GTK_TOGGLE_BUTTON(widget)->active != 0));
+ {
+ v0 = xsane.slider_gray.value[0];
+ xsane.slider_gray.value[0] = 100.0 - xsane.slider_gray.value[2];
+ xsane.slider_gray.value[1] = 100.0 - xsane.slider_gray.value[1];
+ xsane.slider_gray.value[2] = 100.0 - v0;
+
+ if (!xsane.enhancement_rgb_default)
+ {
+ v0 = xsane.slider_red.value[0];
+ xsane.slider_red.value[0] = 100.0 - xsane.slider_red.value[2];
+ xsane.slider_red.value[1] = 100.0 - xsane.slider_red.value[1];
+ xsane.slider_red.value[2] = 100.0 - v0;
+
+ v0 = xsane.slider_green.value[0];
+ xsane.slider_green.value[0] = 100.0 - xsane.slider_green.value[2];
+ xsane.slider_green.value[1] = 100.0 - xsane.slider_green.value[1];
+ xsane.slider_green.value[2] = 100.0 - v0;
+
+ v0 = xsane.slider_blue.value[0];
+ xsane.slider_blue.value[0] = 100.0 - xsane.slider_blue.value[2];
+ xsane.slider_blue.value[1] = 100.0 - xsane.slider_blue.value[1];
+ xsane.slider_blue.value[2] = 100.0 - v0;
+ }
+ }
+
+ xsane.negative = (GTK_TOGGLE_BUTTON(widget)->active != 0);
+
+ xsane_update_sliders();
+ xsane_enhancement_by_histogram();
+ xsane_update_gamma();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_auto_enhancement_callback(GtkWidget * widget)
+{
+ xsane_calculate_histogram();
+
+ xsane.slider_gray.value[0] = xsane.auto_black;
+ xsane.slider_gray.value[1] = xsane.auto_gray;
+ xsane.slider_gray.value[2] = xsane.auto_white;
+
+ if (xsane.enhancement_rgb_default) /* set same values for color components */
+ {
+ xsane.slider_red.value[0] = xsane.auto_black;
+ xsane.slider_red.value[1] = xsane.auto_gray;
+ xsane.slider_red.value[2] = xsane.auto_white;
+
+ xsane.slider_green.value[0] = xsane.auto_black;
+ xsane.slider_green.value[1] = xsane.auto_gray;
+ xsane.slider_green.value[2] = xsane.auto_white;
+
+ xsane.slider_blue.value[0] = xsane.auto_black;
+ xsane.slider_blue.value[1] = xsane.auto_gray;
+ xsane.slider_blue.value[2] = xsane.auto_white;
+ }
+ else /* set different values for each color component */
+ {
+ xsane.slider_red.value[0] = xsane.auto_black_red;
+ xsane.slider_red.value[1] = xsane.auto_gray_red;
+ xsane.slider_red.value[2] = xsane.auto_white_red;
+
+ xsane.slider_green.value[0] = xsane.auto_black_green;
+ xsane.slider_green.value[1] = xsane.auto_gray_green;
+ xsane.slider_green.value[2] = xsane.auto_white_green;
+
+ xsane.slider_blue.value[0] = xsane.auto_black_blue;
+ xsane.slider_blue.value[1] = xsane.auto_gray_blue;
+ xsane.slider_blue.value[2] = xsane.auto_white_blue;
+ }
+
+ xsane_enhancement_by_histogram();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_show_standard_options_callback(GtkWidget * widget)
+{
+ preferences.show_standard_options = (GTK_CHECK_MENU_ITEM(widget)->active != 0);
+ if (preferences.show_standard_options)
+ {
+ gtk_widget_show(xsane.standard_options_shell);
+ }
+ else
+ {
+ gtk_widget_hide(xsane.standard_options_shell);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_show_advanced_options_callback(GtkWidget * widget)
+{
+ preferences.show_advanced_options = (GTK_CHECK_MENU_ITEM(widget)->active != 0);
+ if (preferences.show_advanced_options)
+ {
+ gtk_widget_show(xsane.advanced_options_shell);
+ }
+ else
+ {
+ gtk_widget_hide(xsane.advanced_options_shell);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_show_resolution_list_callback(GtkWidget *widget)
+{
+ preferences.show_resolution_list = (GTK_CHECK_MENU_ITEM(widget)->active != 0);
+ xsane_refresh_dialog(0);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_page_rotate_callback(GtkWidget *widget)
+{
+ preferences.psrotate = (GTK_CHECK_MENU_ITEM(widget)->active != 0);
+ xsane_define_maximum_output_size();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_show_histogram_callback(GtkWidget * widget)
+{
+ preferences.show_histogram = (GTK_CHECK_MENU_ITEM(widget)->active != 0);
+ if (preferences.show_histogram)
+ {
+ xsane_update_histogram();
+ gtk_widget_show(xsane.histogram_dialog);
+ }
+ else
+ {
+ gtk_widget_hide(xsane.histogram_dialog);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_printer_callback(GtkWidget *widget, gpointer data)
+{
+ preferences.printernr = (int) data;
+ xsane_back_gtk_refresh_dialog(dialog);
+ xsane_define_maximum_output_size();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_resolution_scale_update(GtkAdjustment *adj_data, double *val)
+{
+#if 1
+/* gtk does not make sure that the value is quantisized correct */
+ float diff, old, new, quant;
+
+ quant = adj_data->step_increment;
+
+ if (quant != 0)
+ {
+ new = adj_data->value;
+ old = *val;
+ diff = quant*((int) ((new - old)/quant));
+
+ *val = old + diff;
+ adj_data->value = *val;
+ }
+#else
+ *val = adj_data->value;
+#endif
+
+ xsane_set_all_resolutions();
+
+ xsane_update_param(dialog, 0);
+ xsane.zoom = xsane.resolution / preferences.printer[preferences.printernr]->resolution;
+ xsane.zoom_x = xsane.resolution_x / preferences.printer[preferences.printernr]->resolution;
+ xsane.zoom_y = xsane.resolution_y / preferences.printer[preferences.printernr]->resolution;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_resolution_list_callback(GtkWidget *widget, gpointer data)
+{
+ GSGMenuItem *menu_item = data;
+ GSGDialogElement *elem = menu_item->elem;
+ GSGDialog *dialog = elem->dialog;
+ SANE_Word val;
+ gchar *name = gtk_widget_get_name(widget->parent);
+
+ sscanf(menu_item->label, "%d", &val);
+
+ if (!strcmp(name, XSANE_GTK_NAME_RESOLUTION))
+ {
+ xsane.resolution = val;
+ xsane.resolution_x = val;
+ xsane.resolution_y = val;
+
+ xsane_set_resolution(dialog->well_known.dpi, xsane.resolution);
+ xsane_set_resolution(dialog->well_known.dpi_x, xsane.resolution_x);
+ xsane_set_resolution(dialog->well_known.dpi_y, xsane.resolution_y);
+
+ xsane.zoom = xsane.resolution / preferences.printer[preferences.printernr]->resolution;
+ xsane.zoom_x = xsane.resolution_x / preferences.printer[preferences.printernr]->resolution;
+ xsane.zoom_y = xsane.resolution_y / preferences.printer[preferences.printernr]->resolution;
+ }
+ else if (!strcmp(name, XSANE_GTK_NAME_X_RESOLUTION))
+ {
+ xsane.resolution = val;
+ xsane.resolution_x = val;
+ xsane_set_resolution(dialog->well_known.dpi_x, xsane.resolution_x);
+ xsane.zoom = xsane.resolution / preferences.printer[preferences.printernr]->resolution;
+ }
+ else if (!strcmp(name, XSANE_GTK_NAME_Y_RESOLUTION))
+ {
+ xsane.resolution_y = val;
+ xsane_set_resolution(dialog->well_known.dpi_y, xsane.resolution_y);
+ xsane.zoom = xsane.resolution / preferences.printer[preferences.printernr]->resolution;
+ }
+
+ xsane_update_param(dialog, 0);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int xsane_resolution_widget_new(GtkWidget *parent, int well_known_option, double *resolution, const char *image_xpm[],
+ const gchar *desc, const gchar *widget_name)
+{
+ GtkObject *resolution_widget;
+ const SANE_Option_Descriptor *opt;
+
+ opt = sane_get_option_descriptor(dialog->dev, well_known_option);
+
+ if (!opt)
+ {
+ return -1; /* options does not exist */
+ }
+ else
+ {
+ if (SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ switch (opt->constraint_type)
+ {
+ case SANE_CONSTRAINT_RANGE:
+ {
+ SANE_Word quant=0;
+ SANE_Word min=0;
+ SANE_Word max=0;
+ SANE_Word val=0;
+
+ gtk_widget_set_sensitive(xsane.show_resolution_list_widget, TRUE);
+ sane_control_option(dialog->dev, well_known_option, SANE_ACTION_GET_VALUE, &val, 0);
+
+ switch (opt->type)
+ {
+ case SANE_TYPE_INT:
+ min = opt->constraint.range->min;
+ max = opt->constraint.range->max;
+ quant = opt->constraint.range->quant;
+ break;
+
+ case SANE_TYPE_FIXED:
+ min = SANE_UNFIX(opt->constraint.range->min);
+ max = SANE_UNFIX(opt->constraint.range->max);
+ quant = SANE_UNFIX(opt->constraint.range->quant);
+ val = SANE_UNFIX(val);
+ break;
+
+ default:
+ fprintf(stderr, "zoom_scale_update: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ }
+
+ if (quant == 0)
+ {
+ quant = 1;
+ }
+
+ if (!(*resolution)) /* no prefered value */
+ {
+ *resolution = val; /* set backend predefined value */
+ }
+
+ if (!preferences.show_resolution_list) /* user wants slider */
+ {
+ xsane_scale_new_with_pixmap(GTK_BOX(parent), image_xpm, desc,
+ min, max, quant, quant, 0.0, 0, resolution, &resolution_widget,
+ well_known_option, xsane_resolution_scale_update, SANE_OPTION_IS_SETTABLE(opt->cap));
+ }
+ else /* user wants list instead of slider */
+ {
+ SANE_Int max_items = 20;
+ char **str_list;
+ char str[16];
+ int i;
+ int j = 0;
+ SANE_Word wanted_res;
+ SANE_Word val = max;
+ int res = max;
+ double mul;
+
+ sane_control_option(dialog->dev, well_known_option, SANE_ACTION_GET_VALUE, &wanted_res, 0);
+ if (opt->type == SANE_TYPE_FIXED)
+ {
+ wanted_res = (int) SANE_UNFIX(wanted_res);
+ }
+
+ if (*resolution) /* prefered value */
+ {
+ wanted_res = *resolution; /* set frontend prefered value */
+ }
+
+ str_list = malloc((max_items + 1) * sizeof(str_list[0]));
+
+ sprintf(str, "%d", max);
+ str_list[j++] = strdup(str);
+
+ i=9;
+ while ((j < max_items) && (res > 50) && (res > min) && (i > 0))
+ {
+ mul = ((double) i) / (i+1);
+ res = (int) (max * mul);
+ if (res/mul == max)
+ {
+ sprintf(str, "%d", res);
+ str_list[j++] = strdup(str);
+ if (res >= wanted_res)
+ {
+ val = res;
+ }
+ }
+ i--;
+ }
+
+ i = 3;
+ while ((j < max_items) && (res > 50) && (res > min))
+ {
+ mul = 1.0/i;
+ res = max * mul;
+ if (res/mul == max)
+ {
+ sprintf(str, "%d", res);
+ str_list[j++] = strdup(str);
+ if (res >= wanted_res)
+ {
+ val = res;
+ }
+ }
+ i++;
+ }
+
+ str_list[j] = 0;
+ sprintf(str, "%d", (int) val);
+
+ xsane_option_menu_new_with_pixmap(GTK_BOX(parent), image_xpm, desc, str_list, str, &resolution_widget, well_known_option,
+ xsane_resolution_list_callback, SANE_OPTION_IS_SETTABLE(opt->cap), widget_name);
+
+ free(str_list);
+ *resolution = val;
+ xsane_set_resolution(well_known_option, *resolution);
+ }
+ }
+ break;
+
+ case SANE_CONSTRAINT_WORD_LIST:
+ {
+ /* use a "list-selection" widget */
+ SANE_Int items;
+ char **str_list;
+ char str[16];
+ int j;
+ SANE_Word val=0;
+
+ gtk_widget_set_sensitive(xsane.show_resolution_list_widget, FALSE);
+
+ items = opt->constraint.word_list[0];
+ str_list = malloc((items + 1) * sizeof(str_list[0]));
+ switch (opt->type)
+ {
+ case SANE_TYPE_INT:
+ for (j = 0; j < items; ++j)
+ {
+ sprintf(str, "%d", opt->constraint.word_list[j + 1]);
+ str_list[j] = strdup(str);
+ }
+ str_list[j] = 0;
+ sane_control_option(dialog->dev, well_known_option, SANE_ACTION_GET_VALUE, &val, 0);
+ sprintf(str, "%d", (int) val);
+ break;
+
+ case SANE_TYPE_FIXED:
+ for (j = 0; j < items; ++j)
+ {
+ sprintf(str, "%d", (int) SANE_UNFIX(opt->constraint.word_list[j + 1]));
+ str_list[j] = strdup(str);
+ }
+ str_list[j] = 0;
+ sane_control_option(dialog->dev, well_known_option, SANE_ACTION_GET_VALUE, &val, 0);
+ sprintf(str, "%d", (int) SANE_UNFIX(val));
+ break;
+
+ default:
+ fprintf(stderr, "resolution_word_list_creation: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ }
+
+
+ xsane_option_menu_new_with_pixmap(GTK_BOX(parent), image_xpm, desc,
+ str_list, str, &resolution_widget, well_known_option,
+ xsane_resolution_list_callback, SANE_OPTION_IS_SETTABLE(opt->cap), widget_name);
+ free(str_list);
+ }
+ break;
+
+ default:
+ break;
+ } /* constraint type */
+
+ return 0; /* everything is ok */
+
+ } /* if resolution option active */
+
+ return 1; /* not active */
+
+ } /* if (opt) */
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_zoom_update(GtkAdjustment *adj_data, double *val)
+{
+ *val=adj_data->value;
+
+ /* update all resolutions */
+ xsane.resolution = xsane.zoom * preferences.printer[preferences.printernr]->resolution;
+ xsane.resolution_x = xsane.zoom_x * preferences.printer[preferences.printernr]->resolution;
+ xsane.resolution_y = xsane.zoom_y * preferences.printer[preferences.printernr]->resolution;
+
+ xsane_set_all_resolutions();
+
+ xsane_update_param(dialog, 0);
+
+ xsane_define_maximum_output_size();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static int xsane_zoom_widget_new(GtkWidget *parent, int well_known_option, double *zoom, double resolution,
+ const char *image_xpm[], const gchar *desc)
+{
+ const SANE_Option_Descriptor *opt;
+ double output_resolution = preferences.printer[preferences.printernr]->resolution;
+
+ opt = sane_get_option_descriptor(dialog->dev, well_known_option);
+ if (!opt)
+ {
+ return -1; /* option not available */
+ }
+ else
+ {
+ if (SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ double min = 0.0;
+ double max = 0.0;
+ SANE_Word val = 0.0;
+
+ sane_control_option(dialog->dev, well_known_option, SANE_ACTION_GET_VALUE, &val, 0);
+
+ switch (opt->constraint_type)
+ {
+ case SANE_CONSTRAINT_RANGE:
+ switch (opt->type)
+ {
+ case SANE_TYPE_INT:
+ min = ((double) opt->constraint.range->min) / output_resolution;
+ max = ((double) opt->constraint.range->max) / output_resolution;
+ break;
+
+ case SANE_TYPE_FIXED:
+ min = SANE_UNFIX(opt->constraint.range->min) / output_resolution;
+ max = SANE_UNFIX(opt->constraint.range->max) / output_resolution;
+ val = SANE_UNFIX(val);
+ break;
+
+ default:
+ fprintf(stderr, "zoom_scale_update: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ }
+ break;
+
+ case SANE_CONSTRAINT_WORD_LIST:
+ xsane_get_bounds(opt, &min, &max);
+ min = min / output_resolution;
+ max = max / output_resolution;
+ break;
+
+ default:
+ fprintf(stderr, "zoom_scale_update: %s %d\n", ERR_UNKNOWN_CONSTRAINT_TYPE, opt->constraint_type);
+ }
+
+ if (resolution == 0) /* no prefered value */
+ {
+ resolution = val; /* set backend predefined value */
+ }
+
+ *zoom = resolution / output_resolution;
+
+ xsane_scale_new_with_pixmap(GTK_BOX(parent), image_xpm, desc, min, max, 0.01, 0.01, 0.1, 2,
+ zoom, &xsane.zoom_widget, well_known_option, xsane_zoom_update,
+ SANE_OPTION_IS_SETTABLE(opt->cap));
+
+ return 0; /* everything is ok */
+ }
+ return 1; /* option not active */
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+GtkWidget *xsane_update_xsane_callback()
+{
+ /* creates the XSane option window */
+
+ GtkWidget *xsane_vbox, *xsane_hbox;
+ GtkWidget *xsane_modus_menu;
+ GtkWidget *xsane_modus_item;
+ GtkWidget *xsane_modus_option_menu;
+ GtkWidget *xsane_vbox_xsane_modus;
+ GtkWidget *xsane_hbox_xsane_modus;
+ GtkWidget *xsane_label;
+ GtkWidget *xsane_text;
+ GtkWidget *xsane_hbox_xsane_enhancement;
+ GtkWidget *xsane_frame;
+ GtkWidget *xsane_button;
+ gchar buf[200];
+
+ /* xsane main options */
+
+ xsane_hbox = gtk_hbox_new(FALSE, 2);
+ gtk_widget_show(xsane_hbox);
+ xsane_vbox = gtk_vbox_new(/* homogeneous */ FALSE, 0);
+ gtk_widget_show(xsane_vbox);
+/* gtk_box_pack_start(GTK_BOX(xsane_hbox), xsane_vbox, FALSE, FALSE, 0); */ /* make scales fixed */
+ gtk_box_pack_start(GTK_BOX(xsane_hbox), xsane_vbox, TRUE, TRUE, 0); /* make scales sizeable */
+
+ /* XSane Frame */
+
+ xsane_frame = gtk_frame_new(TEXT_XSANE_OPTIONS);
+ gtk_container_set_border_width(GTK_CONTAINER(xsane_frame), 4);
+ gtk_frame_set_shadow_type(GTK_FRAME(xsane_frame), GTK_SHADOW_ETCHED_IN);
+/* gtk_box_pack_start(GTK_BOX(xsane_vbox), xsane_frame, FALSE, FALSE, 0); */ /* fixed frameheight */
+ gtk_box_pack_start(GTK_BOX(xsane_vbox), xsane_frame, TRUE, TRUE, 0); /* sizeable framehight */
+ gtk_widget_show(xsane_frame);
+
+/* xsane_vbox_xsane_modus = gtk_vbox_new(FALSE, 5); */
+ xsane_vbox_xsane_modus = gtk_vbox_new(FALSE, 1);
+ gtk_container_add(GTK_CONTAINER(xsane_frame), xsane_vbox_xsane_modus);
+ gtk_widget_show(xsane_vbox_xsane_modus);
+
+/* scan copy fax selection */
+
+ if ( (xsane.mode == XSANE_STANDALONE) && (xsane.mode_selection) ) /* display xsane mode selection menu */
+ {
+ xsane_hbox_xsane_modus = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(xsane_hbox_xsane_modus), 2);
+ gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), xsane_hbox_xsane_modus, FALSE, FALSE, 0);
+
+ xsane_label = gtk_label_new(TEXT_XSANE_MODE);
+ gtk_box_pack_start(GTK_BOX(xsane_hbox_xsane_modus), xsane_label, FALSE, FALSE, 2);
+ gtk_widget_show(xsane_label);
+
+ xsane_modus_menu = gtk_menu_new();
+
+ xsane_modus_item = gtk_menu_item_new_with_label(MENU_ITEM_SCAN);
+ gtk_widget_set_usize(xsane_modus_item, 60, 0);
+ gtk_container_add(GTK_CONTAINER(xsane_modus_menu), xsane_modus_item);
+ gtk_signal_connect(GTK_OBJECT(xsane_modus_item), "activate",
+ (GtkSignalFunc) xsane_modus_callback, &xsane_scanmode_number[XSANE_SCAN]);
+ gtk_widget_show(xsane_modus_item);
+
+ xsane_modus_item = gtk_menu_item_new_with_label(MENU_ITEM_COPY);
+ gtk_container_add(GTK_CONTAINER(xsane_modus_menu), xsane_modus_item);
+ gtk_signal_connect(GTK_OBJECT(xsane_modus_item), "activate",
+ (GtkSignalFunc) xsane_modus_callback, &xsane_scanmode_number[XSANE_COPY]);
+ gtk_widget_show(xsane_modus_item);
+
+ xsane_modus_item = gtk_menu_item_new_with_label(MENU_ITEM_FAX);
+ gtk_container_add(GTK_CONTAINER(xsane_modus_menu), xsane_modus_item);
+ gtk_signal_connect(GTK_OBJECT(xsane_modus_item), "activate",
+ (GtkSignalFunc) xsane_modus_callback, &xsane_scanmode_number[XSANE_FAX]);
+ gtk_widget_show(xsane_modus_item);
+
+ xsane_modus_option_menu = gtk_option_menu_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, xsane_modus_option_menu, DESC_XSANE_MODE);
+ gtk_box_pack_end(GTK_BOX(xsane_hbox_xsane_modus), xsane_modus_option_menu, FALSE, FALSE, 2);
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(xsane_modus_option_menu), xsane_modus_menu);
+ gtk_option_menu_set_history(GTK_OPTION_MENU(xsane_modus_option_menu), xsane.xsane_mode);
+ gtk_widget_show(xsane_modus_option_menu);
+ gtk_widget_show(xsane_hbox_xsane_modus);
+
+ dialog->xsanemode_widget = xsane_modus_option_menu;
+ }
+
+ {
+ GtkWidget *pixmapwidget;
+ GdkBitmap *mask;
+ GdkPixmap *pixmap;
+ GtkWidget *hbox;
+ const SANE_Option_Descriptor *opt;
+
+
+ /* colormode */
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.scanmode);
+ if (opt)
+ {
+ if (SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
+ gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 2);
+
+ pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) colormode_xpm);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
+ gdk_pixmap_unref(pixmap);
+ gtk_widget_show(pixmapwidget);
+
+ switch (opt->constraint_type)
+ {
+ case SANE_CONSTRAINT_STRING_LIST:
+ {
+ char *set;
+ SANE_Status status;
+
+ /* use a "list-selection" widget */
+ set = malloc(opt->size);
+ status = sane_control_option(dialog->dev, dialog->well_known.scanmode, SANE_ACTION_GET_VALUE, set, 0);
+
+ xsane_option_menu_new(hbox, (char **) opt->constraint.string_list, set, dialog->well_known.scanmode,
+ _BGT(opt->desc), 0, SANE_OPTION_IS_SETTABLE(opt->cap), 0);
+ }
+ break;
+
+ default:
+ fprintf(stderr, "scanmode_selection: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ }
+ gtk_widget_show(hbox);
+ }
+ }
+
+
+ /* input selection */
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.scansource);
+ if (opt)
+ {
+ if (SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
+ gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 2);
+
+ pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) scanner_xpm);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
+ gdk_pixmap_unref(pixmap);
+ gtk_widget_show(pixmapwidget);
+
+ switch (opt->constraint_type)
+ {
+ case SANE_CONSTRAINT_STRING_LIST:
+ {
+ char *set;
+ SANE_Status status;
+
+ /* use a "list-selection" widget */
+ set = malloc(opt->size);
+ status = sane_control_option(dialog->dev, dialog->well_known.scansource, SANE_ACTION_GET_VALUE, set, 0);
+
+ xsane_option_menu_new(hbox, (char **) opt->constraint.string_list, set, dialog->well_known.scansource,
+ _BGT(opt->desc), 0, SANE_OPTION_IS_SETTABLE(opt->cap), 0);
+ }
+ break;
+
+ default:
+ fprintf(stderr, "scansource_selection: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ }
+ gtk_widget_show(hbox);
+ }
+ }
+
+ }
+
+ if (xsane.xsane_mode == XSANE_SCAN)
+ {
+ xsane.copy_number_entry = 0;
+
+ if (xsane.mode == XSANE_STANDALONE)
+ {
+ xsane_outputfilename_new(xsane_vbox_xsane_modus);
+ }
+
+ /* resolution selection */
+ if (!xsane_resolution_widget_new(xsane_vbox_xsane_modus, dialog->well_known.dpi_x, &xsane.resolution_x, resolution_x_xpm,
+ DESC_RESOLUTION_X, XSANE_GTK_NAME_X_RESOLUTION)) /* draw x resolution widget if possible */
+ {
+ xsane_resolution_widget_new(xsane_vbox_xsane_modus, dialog->well_known.dpi_y, &xsane.resolution_y, resolution_y_xpm,
+ DESC_RESOLUTION_Y, XSANE_GTK_NAME_Y_RESOLUTION); /* ok, also draw y resolution widget */
+ }
+ else /* no x resolution, so lets draw common resolution widget */
+ {
+ xsane_resolution_widget_new(xsane_vbox_xsane_modus, dialog->well_known.dpi, &xsane.resolution, resolution_xpm,
+ DESC_RESOLUTION, XSANE_GTK_NAME_RESOLUTION);
+ }
+ }
+ else if (xsane.xsane_mode == XSANE_COPY)
+ {
+ GtkWidget *pixmapwidget, *hbox, *xsane_printer_option_menu, *xsane_printer_menu, *xsane_printer_item;
+ GdkBitmap *mask;
+ GdkPixmap *pixmap;
+ int i;
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
+ gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), hbox, FALSE, FALSE, 2);
+
+ pixmap = gdk_pixmap_create_from_xpm_d(xsane.histogram_dialog->window, &mask, xsane.bg_trans, (gchar **) printer_xpm);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
+ gdk_pixmap_unref(pixmap);
+ gtk_widget_show(pixmapwidget);
+
+ xsane_printer_menu = gtk_menu_new();
+
+ for (i=0; i < preferences.printerdefinitions; i++)
+ {
+ xsane_printer_item = gtk_menu_item_new_with_label(preferences.printer[i]->name);
+ gtk_container_add(GTK_CONTAINER(xsane_printer_menu), xsane_printer_item);
+ gtk_signal_connect(GTK_OBJECT(xsane_printer_item), "activate", (GtkSignalFunc) xsane_printer_callback, (void *) i);
+ gtk_widget_show(xsane_printer_item);
+ }
+
+ xsane_printer_option_menu = gtk_option_menu_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, xsane_printer_option_menu, DESC_PRINTER_SELECT);
+ gtk_box_pack_end(GTK_BOX(hbox), xsane_printer_option_menu, FALSE, FALSE, 2);
+ gtk_widget_show(xsane_printer_option_menu);
+ gtk_widget_show(hbox);
+
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(xsane_printer_option_menu), xsane_printer_menu);
+ gtk_option_menu_set_history(GTK_OPTION_MENU(xsane_printer_option_menu), preferences.printernr);
+
+ /* number of copies */
+ xsane_text = gtk_entry_new();
+ xsane_back_gtk_set_tooltip(dialog->tooltips, xsane_text, DESC_COPY_NUMBER);
+ gtk_widget_set_usize(xsane_text, 25, 0);
+ snprintf(buf, sizeof(buf), "%d", xsane.copy_number);
+ gtk_entry_set_text(GTK_ENTRY(xsane_text), (char *) buf);
+ gtk_box_pack_end(GTK_BOX(hbox), xsane_text, FALSE, FALSE, 10);
+ gtk_widget_show(xsane_text);
+ gtk_widget_show(hbox);
+ xsane.copy_number_entry = xsane_text;
+
+ /* zoom selection */
+ if (!xsane_zoom_widget_new(xsane_vbox_xsane_modus, dialog->well_known.dpi_x, &xsane.zoom_x,
+ xsane.resolution_x, zoom_x_xpm, DESC_ZOOM_X))
+ {
+ xsane_zoom_widget_new(xsane_vbox_xsane_modus, dialog->well_known.dpi_y, &xsane.zoom_y,
+ xsane.resolution_y, zoom_y_xpm, DESC_ZOOM_Y);
+ }
+ else
+ {
+ xsane_zoom_widget_new(xsane_vbox_xsane_modus, dialog->well_known.dpi, &xsane.zoom,
+ xsane.resolution, zoom_xpm, DESC_ZOOM);
+ }
+ }
+ else /* XSANE_FAX */
+ {
+ const SANE_Option_Descriptor *opt;
+
+ xsane.copy_number_entry = 0;
+ xsane.resolution = 98;
+ xsane.resolution_x = 98;
+ xsane.resolution_y = 98;
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.dpi);
+ if (!opt)
+ {
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.dpi_x);
+ }
+
+ if (opt)
+ {
+ if (SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ xsane_button = gtk_check_button_new_with_label(RADIO_BUTTON_FINE_MODE);
+ xsane_back_gtk_set_tooltip(dialog->tooltips, xsane_button, DESC_FAX_FINE_MODE);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(xsane_button), xsane.fax_fine_mode);
+ gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), xsane_button, FALSE, FALSE, 2);
+ gtk_widget_show(xsane_button);
+ gtk_signal_connect(GTK_OBJECT(xsane_button), "clicked", (GtkSignalFunc) xsane_fax_fine_mode_callback, 0);
+
+ if (xsane.fax_fine_mode)
+ {
+ xsane.resolution = 196;
+ xsane.resolution_x = 98;
+ xsane.resolution_y = 196;
+ }
+
+ xsane_set_all_resolutions();
+ }
+ }
+ xsane_fax_dialog();
+ }
+
+ /* test if scanner gamma table is selected */
+
+ xsane.scanner_gamma_gray = FALSE;
+ if (dialog->well_known.gamma_vector >0)
+ {
+ const SANE_Option_Descriptor *opt;
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.gamma_vector);
+ if (SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ xsane.scanner_gamma_gray = TRUE;
+ }
+ }
+
+ xsane.scanner_gamma_color = FALSE;
+ if (dialog->well_known.gamma_vector_r >0)
+ {
+ const SANE_Option_Descriptor *opt;
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.gamma_vector_r);
+ if (SANE_OPTION_IS_ACTIVE(opt->cap))
+ {
+ xsane.scanner_gamma_color = TRUE;
+ }
+ }
+
+
+
+ /* XSane Frame Enhancement */
+
+ sane_get_parameters(dialog->dev, &xsane.param); /* update xsane.param */
+
+ if (xsane.param.depth == 1)
+ {
+ return(xsane_hbox);
+ }
+
+ xsane.slider_gray.active = XSANE_SLIDER_ACTIVE; /* mark slider active */
+
+ if ( (xsane.xsane_color) && (!xsane.enhancement_rgb_default) )
+ {
+ xsane_separator_new(xsane_vbox_xsane_modus, 2);
+ }
+
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), Gamma_xpm, DESC_GAMMA,
+ XSANE_GAMMA_MIN, XSANE_GAMMA_MAX, 0.01, 0.01, 0.0, 2,
+ &xsane.gamma, &xsane.gamma_widget, 0, xsane_gamma_changed, TRUE);
+ if ( (xsane.xsane_color) && (!xsane.enhancement_rgb_default) )
+ {
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), Gamma_red_xpm, DESC_GAMMA_R,
+ XSANE_GAMMA_MIN, XSANE_GAMMA_MAX, 0.01, 0.01, 0.0, 2,
+ &xsane.gamma_red , &xsane.gamma_red_widget, 0, xsane_gamma_changed, TRUE);
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), Gamma_green_xpm, DESC_GAMMA_G,
+ XSANE_GAMMA_MIN, XSANE_GAMMA_MAX, 0.01, 0.01, 0.0, 2,
+ &xsane.gamma_green, &xsane.gamma_green_widget, 0, xsane_gamma_changed, TRUE);
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), Gamma_blue_xpm, DESC_GAMMA_B,
+ XSANE_GAMMA_MIN, XSANE_GAMMA_MAX, 0.01, 0.01, 0.0, 2,
+ &xsane.gamma_blue , &xsane.gamma_blue_widget, 0, xsane_gamma_changed, TRUE);
+
+ xsane_separator_new(xsane_vbox_xsane_modus, 2);
+ }
+
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), brightness_xpm, DESC_BRIGHTNESS,
+ XSANE_BRIGHTNESS_MIN, XSANE_BRIGHTNESS_MAX, 1.0, 1.0, 0.0, 0,
+ &xsane.brightness, &xsane.brightness_widget, 0, xsane_gamma_changed, TRUE);
+ if ( (xsane.xsane_color) && (!xsane.enhancement_rgb_default) )
+ {
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), brightness_red_xpm, DESC_BRIGHTNESS_R,
+ XSANE_BRIGHTNESS_MIN, XSANE_BRIGHTNESS_MAX, 1.0, 1.0, 0.0, 0,
+ &xsane.brightness_red , &xsane.brightness_red_widget, 0, xsane_gamma_changed, TRUE);
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), brightness_green_xpm, DESC_BRIGHTNESS_G,
+ XSANE_BRIGHTNESS_MIN, XSANE_BRIGHTNESS_MAX, 1.0, 1.0, 0.0, 0,
+ &xsane.brightness_green, &xsane.brightness_green_widget, 0, xsane_gamma_changed, TRUE);
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), brightness_blue_xpm, DESC_BRIGHTNESS_B,
+ XSANE_BRIGHTNESS_MIN, XSANE_BRIGHTNESS_MAX, 1.0, 1.0, 0.0, 0,
+ &xsane.brightness_blue, &xsane.brightness_blue_widget, 0, xsane_gamma_changed, TRUE);
+
+ xsane_separator_new(xsane_vbox_xsane_modus, 2);
+ }
+
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), contrast_xpm, DESC_CONTRAST,
+ XSANE_CONTRAST_GRAY_MIN, XSANE_CONTRAST_MAX, 1.0, 1.0, 0.0, 0,
+ &xsane.contrast, &xsane.contrast_widget, 0, xsane_gamma_changed, TRUE);
+ if ( (xsane.xsane_color) && (!xsane.enhancement_rgb_default) )
+ {
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), contrast_red_xpm, DESC_CONTRAST_R,
+ XSANE_CONTRAST_MIN, XSANE_CONTRAST_MAX, 1.0, 1.0, 0.0, 0,
+ &xsane.contrast_red , &xsane.contrast_red_widget, 0, xsane_gamma_changed, TRUE);
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), contrast_green_xpm, DESC_CONTRAST_G,
+ XSANE_CONTRAST_MIN, XSANE_CONTRAST_MAX, 1.0, 1.0, 0.0, 0,
+ &xsane.contrast_green, &xsane.contrast_green_widget, 0, xsane_gamma_changed, TRUE);
+ xsane_scale_new_with_pixmap(GTK_BOX(xsane_vbox_xsane_modus), contrast_blue_xpm, DESC_CONTRAST_B,
+ XSANE_CONTRAST_MIN, XSANE_CONTRAST_MAX, 1.0, 1.0, 0.0, 0,
+ &xsane.contrast_blue, &xsane.contrast_blue_widget, 0, xsane_gamma_changed, TRUE);
+ }
+
+ xsane_separator_new(xsane_vbox_xsane_modus, 2);
+
+ /* create lower button box (rgb default, negative ,... */
+ xsane_hbox_xsane_enhancement = gtk_hbox_new(TRUE, 4);
+ gtk_container_set_border_width(GTK_CONTAINER(xsane_hbox_xsane_enhancement), 4);
+ gtk_box_pack_start(GTK_BOX(xsane_vbox_xsane_modus), xsane_hbox_xsane_enhancement, FALSE, FALSE, 0);
+ gtk_widget_show(xsane_hbox_xsane_enhancement);
+
+ if (xsane.xsane_color)
+ {
+ xsane_toggle_button_new_with_pixmap(xsane_hbox_xsane_enhancement, rgb_default_xpm, DESC_RGB_DEFAULT,
+ &xsane.enhancement_rgb_default, xsane_enhancement_rgb_default_callback);
+ }
+
+ xsane_toggle_button_new_with_pixmap(xsane_hbox_xsane_enhancement, negative_xpm, DESC_NEGATIVE,
+ &xsane.negative, xsane_enhancement_negative_callback);
+
+ xsane_button_new_with_pixmap(xsane_hbox_xsane_enhancement, enhance_xpm, DESC_ENH_AUTO,
+ xsane_auto_enhancement_callback, 0);
+
+ xsane_button_new_with_pixmap(xsane_hbox_xsane_enhancement, default_enhancement_xpm, DESC_ENH_DEFAULT,
+ xsane_enhancement_restore_default, 0);
+
+ xsane_button_new_with_pixmap(xsane_hbox_xsane_enhancement, restore_enhancement_xpm, DESC_ENH_RESTORE,
+ xsane_enhancement_restore, 0);
+
+ xsane_button_new_with_pixmap(xsane_hbox_xsane_enhancement, store_enhancement_xpm, DESC_ENH_STORE,
+ xsane_enhancement_store, 0);
+
+ xsane_update_histogram();
+
+ return(xsane_hbox);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_update_preview(GSGDialog *dialog, void *arg)
+{
+ if (xsane.preview)
+ {
+ preview_update_surface(xsane.preview, 0);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_pref_save(void)
+{
+ char filename[PATH_MAX];
+ int fd;
+
+ /* first save xsane-specific preferences: */
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, "xsane", 0, ".rc", XSANE_PATH_LOCAL_SANE);
+ umask(XSANE_DEFAULT_UMASK); /* define new file permissions */
+ fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+ if (fd < 0)
+ {
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s %s.", ERR_FAILED_CREATE_FILE, strerror(errno));
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+ preferences_save(fd);
+ close(fd);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_pref_restore(void)
+{
+ char filename[PATH_MAX];
+ int fd;
+
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, "xsane", 0, ".rc", XSANE_PATH_LOCAL_SANE);
+ fd = open(filename, O_RDONLY);
+
+ if (fd >= 0)
+ {
+ preferences_restore(fd);
+ close(fd);
+ }
+ else /* no local sane file, look for system file */
+ {
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, "xsane", 0, ".rc", XSANE_PATH_SYSTEM);
+ fd = open(filename, O_RDONLY);
+
+ if (fd >= 0)
+ {
+ preferences_restore(fd);
+ close(fd);
+ }
+ }
+
+ if (!preferences.filename)
+ {
+ preferences.filename = strdup(OUTFILENAME);
+ }
+
+ if (preferences.printerdefinitions == 0)
+ {
+ xsane_new_printer();
+ }
+
+ if (!preferences.fax_project)
+ {
+ preferences.fax_project = strdup(FAXPROJECT);
+ }
+
+ if (!preferences.fax_command)
+ {
+ preferences.fax_command = strdup(FAXCOMMAND);
+ }
+
+ if (!preferences.fax_receiver_option)
+ {
+ preferences.fax_receiver_option = strdup(FAXRECEIVEROPT);
+ }
+
+ if (!preferences.fax_postscript_option)
+ {
+ preferences.fax_postscript_option = strdup(FAXPOSTSCRIPTOPT);
+ }
+
+ if (!preferences.fax_normal_option)
+ {
+ preferences.fax_normal_option = strdup(FAXNORMALOPT);
+ }
+
+ if (!preferences.fax_fine_option)
+ {
+ preferences.fax_fine_option = strdup(FAXFINEOPT);
+ }
+
+ if (!preferences.fax_viewer)
+ {
+ preferences.fax_viewer = strdup(FAXVIEWER);
+ }
+
+ if (!preferences.doc_viewer)
+ {
+ preferences.doc_viewer = strdup(DOCVIEWER);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_quit(void)
+{
+ if (xsane.preview)
+ {
+ Preview *preview = xsane.preview;
+ xsane.preview = 0;
+ preview_destroy(preview);
+ }
+
+ while (xsane_back_gtk_message_dialog_active)
+ {
+ gtk_main_iteration();
+ }
+
+ if (dialog && xsane_back_gtk_dialog_get_device(dialog))
+ {
+ sane_close(xsane_back_gtk_dialog_get_device(dialog));
+ }
+
+ sane_exit();
+ gtk_main_quit();
+
+ if (xsane.preview_gamma_data_red)
+ {
+ free(xsane.preview_gamma_data_red);
+ free(xsane.preview_gamma_data_green);
+ free(xsane.preview_gamma_data_blue);
+
+ xsane.preview_gamma_data_red = 0;
+ xsane.preview_gamma_data_green = 0;
+ xsane.preview_gamma_data_blue = 0;
+ }
+
+#ifdef HAVE_LIBGIMP_GIMP_H
+ if (xsane.mode == XSANE_GIMP_EXTENSION)
+ {
+ gimp_quit();
+ }
+#endif
+ exit(0);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_exit(void) /* this is called when xsane exits before gtk_main is called */
+{
+ while (xsane_back_gtk_message_dialog_active)
+ {
+ gtk_main_iteration();
+ }
+
+ sane_exit();
+
+#ifdef HAVE_LIBGIMP_GIMP_H
+ if (xsane.mode == XSANE_GIMP_EXTENSION)
+ {
+ gimp_quit();
+ }
+#endif
+ exit(0);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static gint xsane_standard_option_win_delete(GtkWidget *widget, gpointer data)
+{
+ gtk_widget_hide(widget);
+ preferences.show_standard_options = FALSE;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.show_standard_options_widget), preferences.show_standard_options);
+ return TRUE;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static gint xsane_advanced_option_win_delete(GtkWidget *widget, gpointer data)
+{
+ gtk_widget_hide(widget);
+ preferences.show_advanced_options = FALSE;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.show_advanced_options_widget), preferences.show_advanced_options);
+ return TRUE;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* Invoked when window manager's "delete" (or "close") function is invoked. */
+static gint xsane_scan_win_delete(GtkWidget *w, gpointer data)
+{
+ xsane_scan_done(-1); /* stop scanner when still scanning */
+
+ if (xsane.filetype) /* add extension to filename */
+ {
+ char buffer[256];
+
+ snprintf(buffer, sizeof(buffer), "%s%s", preferences.filename, xsane.filetype);
+ free(preferences.filename);
+ free(xsane.filetype);
+ xsane.filetype = 0;
+ preferences.filename = strdup(buffer);
+ }
+
+ xsane_pref_save();
+ xsane_quit();
+ return FALSE;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static gint xsane_preview_window_destroyed(GtkWidget *widget, gpointer call_data)
+{
+ gtk_widget_hide(widget);
+ xsane.show_preview = FALSE;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.show_preview_widget), FALSE);
+ return TRUE;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_show_preview_callback(GtkWidget * widget, gpointer call_data)
+{
+ if (GTK_CHECK_MENU_ITEM(widget)->active)
+ {
+ gtk_widget_show(xsane.preview->top);
+ xsane.show_preview = TRUE;
+ }
+ else
+ {
+ gtk_widget_hide(xsane.preview->top);
+ xsane.show_preview = FALSE;
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static GtkWidget *xsane_files_build_menu(void)
+{
+ GtkWidget *menu, *item;
+
+ menu = gtk_menu_new();
+
+ item = gtk_menu_item_new();
+ gtk_container_add(GTK_CONTAINER(menu), item);
+ gtk_widget_show(item);
+
+
+ /* XSane about dialog */
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_ABOUT);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_about_dialog, 0);
+ gtk_widget_show(item);
+
+
+ /* XSane info dialog */
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_INFO);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_info_dialog, 0);
+ gtk_widget_show(item);
+
+
+ /* Exit */
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_EXIT);
+ gtk_container_add(GTK_CONTAINER(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_scan_win_delete, 0);
+ gtk_widget_show(item);
+
+ return menu;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_set_pref_unit_callback(GtkWidget *widget, gpointer data)
+{
+ const char *unit = data;
+ double unit_conversion_factor = 1.0;
+
+ gtk_signal_handler_block_by_func(GTK_OBJECT(xsane.length_unit_mm), (GtkSignalFunc) xsane_set_pref_unit_callback, "mm");
+ gtk_signal_handler_block_by_func(GTK_OBJECT(xsane.length_unit_cm), (GtkSignalFunc) xsane_set_pref_unit_callback, "cm");
+ gtk_signal_handler_block_by_func(GTK_OBJECT(xsane.length_unit_in), (GtkSignalFunc) xsane_set_pref_unit_callback, "in");
+
+ if (strcmp(unit, "mm") == 0)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.length_unit_mm), TRUE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.length_unit_cm), FALSE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.length_unit_in), FALSE);
+ }
+ else if (strcmp(unit, "cm") == 0)
+ {
+ unit_conversion_factor = 10.0;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.length_unit_mm), FALSE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.length_unit_cm), TRUE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.length_unit_in), FALSE);
+ }
+ else if (strcmp(unit, "in") == 0)
+ {
+ unit_conversion_factor = 25.4;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.length_unit_mm), FALSE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.length_unit_cm), FALSE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.length_unit_in), TRUE);
+ }
+
+ gtk_signal_handler_unblock_by_func(GTK_OBJECT(xsane.length_unit_mm), (GtkSignalFunc) xsane_set_pref_unit_callback, "mm");
+ gtk_signal_handler_unblock_by_func(GTK_OBJECT(xsane.length_unit_cm), (GtkSignalFunc) xsane_set_pref_unit_callback, "cm");
+ gtk_signal_handler_unblock_by_func(GTK_OBJECT(xsane.length_unit_in), (GtkSignalFunc) xsane_set_pref_unit_callback, "in");
+
+ preferences.length_unit = unit_conversion_factor;
+
+ xsane_refresh_dialog(dialog);
+ if (xsane.preview)
+ {
+ preview_area_resize(xsane.preview->window);
+ }
+
+ xsane_pref_save();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_set_update_policy_callback(GtkWidget *widget, gpointer data)
+{
+ GtkUpdateType policy = (GtkUpdateType) data;
+
+ gtk_signal_handler_block_by_func(GTK_OBJECT(xsane.update_policy_continu), (GtkSignalFunc) xsane_set_update_policy_callback,
+ (void *) GTK_UPDATE_CONTINUOUS);
+ gtk_signal_handler_block_by_func(GTK_OBJECT(xsane.update_policy_discont), (GtkSignalFunc) xsane_set_update_policy_callback,
+ (void *) GTK_UPDATE_DISCONTINUOUS);
+ gtk_signal_handler_block_by_func(GTK_OBJECT(xsane.update_policy_delayed), (GtkSignalFunc) xsane_set_update_policy_callback,
+ (void *) GTK_UPDATE_DELAYED);
+
+ if (policy == GTK_UPDATE_CONTINUOUS)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.update_policy_continu), TRUE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.update_policy_discont), FALSE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.update_policy_delayed), FALSE);
+ }
+ else if (policy == GTK_UPDATE_DISCONTINUOUS)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.update_policy_continu), FALSE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.update_policy_discont), TRUE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.update_policy_delayed), FALSE);
+ }
+ else if (policy == GTK_UPDATE_DELAYED)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.update_policy_continu), FALSE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.update_policy_discont), FALSE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.update_policy_delayed), TRUE);
+ }
+
+ gtk_signal_handler_unblock_by_func(GTK_OBJECT(xsane.update_policy_continu), (GtkSignalFunc) xsane_set_update_policy_callback,
+ (void *) GTK_UPDATE_CONTINUOUS);
+ gtk_signal_handler_unblock_by_func(GTK_OBJECT(xsane.update_policy_discont), (GtkSignalFunc) xsane_set_update_policy_callback,
+ (void *) GTK_UPDATE_DISCONTINUOUS);
+ gtk_signal_handler_unblock_by_func(GTK_OBJECT(xsane.update_policy_delayed), (GtkSignalFunc) xsane_set_update_policy_callback,
+ (void *) GTK_UPDATE_DELAYED);
+
+ preferences.gtk_update_policy = policy;
+ xsane_pref_save();
+
+ xsane_back_gtk_refresh_dialog(dialog);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static gint xsane_close_info_callback(GtkWidget *widget, gpointer data)
+{
+ GtkWidget *dialog = data;
+
+ gtk_widget_destroy(dialog);
+
+ xsane_set_sensitivity(TRUE);
+
+ xsane_update_histogram();
+
+ return FALSE;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_info_dialog(GtkWidget *widget, gpointer data)
+{
+ GtkWidget *info_dialog, *vbox, *button, *label, *frame, *framebox, *hbox, *table;
+ char buf[256];
+ char *bufptr;
+
+ sane_get_parameters(dialog->dev, &xsane.param); /* update xsane.param */
+
+ info_dialog = gtk_window_new(GTK_WINDOW_DIALOG);
+ gtk_window_set_position(GTK_WINDOW(info_dialog), GTK_WIN_POS_CENTER);
+ gtk_window_set_policy(GTK_WINDOW(info_dialog), FALSE, FALSE, FALSE);
+ gtk_signal_connect(GTK_OBJECT(info_dialog), "destroy", GTK_SIGNAL_FUNC(xsane_close_info_callback), info_dialog);
+ snprintf(buf, sizeof(buf), "%s %s %s", prog_name, WINDOW_INFO, device_text);
+ gtk_window_set_title(GTK_WINDOW(info_dialog), buf);
+
+ xsane_set_window_icon(info_dialog, 0);
+
+ vbox = gtk_vbox_new(/* not homogeneous */ FALSE, 5);
+ gtk_container_add(GTK_CONTAINER(info_dialog), vbox);
+ gtk_widget_show(vbox);
+
+ frame = gtk_frame_new(TEXT_SCANNER_BACKEND);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
+ gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
+ gtk_widget_show(frame);
+
+ framebox = gtk_vbox_new(/* not homogeneous */ FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(frame), framebox);
+ gtk_widget_show(framebox);
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(framebox), hbox, TRUE, TRUE, 5);
+ gtk_widget_show(hbox);
+
+ table = gtk_table_new(6, 2, FALSE);
+ gtk_box_pack_start(GTK_BOX(hbox), table, FALSE, FALSE, 5);
+ gtk_widget_show(table);
+
+ snprintf(buf, sizeof(buf), TEXT_VENDOR);
+ label = xsane_info_table_text_new(table, buf, 0, 0);
+ snprintf(buf, sizeof(buf), "%s", devlist[seldev]->vendor);
+ label = xsane_info_table_text_new(table, buf, 1, 0);
+
+ snprintf(buf, sizeof(buf), TEXT_MODEL);
+ label = xsane_info_table_text_new(table, buf, 0, 1);
+ snprintf(buf, sizeof(buf), "%s", devlist[seldev]->model);
+ label = xsane_info_table_text_new(table, buf, 1, 1);
+
+ snprintf(buf, sizeof(buf), TEXT_TYPE);
+ label = xsane_info_table_text_new(table, buf, 0, 2);
+ snprintf(buf, sizeof(buf), "%s", devlist[seldev]->type);
+ label = xsane_info_table_text_new(table, buf, 1, 2);
+
+ snprintf(buf, sizeof(buf), TEXT_DEVICE);
+ label = xsane_info_table_text_new(table, buf, 0, 3);
+ bufptr = strrchr(devlist[seldev]->name, ':');
+ if (bufptr)
+ {
+ snprintf(buf, sizeof(buf), "%s", bufptr+1);
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), devlist[seldev]->name);
+ }
+ label = xsane_info_table_text_new(table, buf, 1, 3);
+
+ snprintf(buf, sizeof(buf), "%s", devlist[seldev]->name);
+ bufptr = strrchr(buf, ':');
+ if (bufptr)
+ {
+ *bufptr = 0;
+ label = xsane_info_table_text_new(table, buf, 1, 4);
+ snprintf(buf, sizeof(buf), TEXT_LOADED_BACKEND);
+ label = xsane_info_table_text_new(table, buf, 0, 4);
+ }
+
+ snprintf(buf, sizeof(buf), TEXT_SANE_VERSION);
+ label = xsane_info_table_text_new(table, buf, 0, 5);
+ snprintf(buf, sizeof(buf), "%d.%d build %d",SANE_VERSION_MAJOR(xsane.sane_backend_versioncode),
+ SANE_VERSION_MINOR(xsane.sane_backend_versioncode),
+ SANE_VERSION_BUILD(xsane.sane_backend_versioncode));
+ label = xsane_info_table_text_new(table, buf, 1, 5);
+
+
+ frame = gtk_frame_new(TEXT_RECENT_VALUES);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
+ gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
+ gtk_widget_show(frame);
+
+ framebox = gtk_vbox_new(/* not homogeneous */ FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(frame), framebox);
+ gtk_widget_show(framebox);
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(framebox), hbox, TRUE, TRUE, 5);
+ gtk_widget_show(hbox);
+
+ table = gtk_table_new(4, 2, FALSE);
+ gtk_box_pack_start(GTK_BOX(hbox), table, FALSE, FALSE, 5);
+ gtk_widget_show(table);
+
+ if ((xsane.xsane_color) && (xsane.scanner_gamma_color)) /* color gamma correction by scanner */
+ {
+ const SANE_Option_Descriptor *opt;
+
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_CORR_BY);
+ label = xsane_info_table_text_new(table, buf, 0, 0);
+ snprintf(buf, sizeof(buf), TEXT_SCANNER);
+ label = xsane_info_table_text_new(table, buf, 1, 0);
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.gamma_vector_r);
+
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_INPUT_DEPTH);
+ label = xsane_info_table_text_new(table, buf, 0, 1);
+ snprintf(buf, sizeof(buf), "%d bit", (int) (0.5 + log((double)opt->size / sizeof(opt->type)) / log(2.0)));
+ label = xsane_info_table_text_new(table, buf, 1, 1);
+
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_OUTPUT_DEPTH);
+ label = xsane_info_table_text_new(table, buf, 0, 2);
+ snprintf(buf, sizeof(buf), "%d bit", (int) (0.5 + log(opt->constraint.range->max+1.0) / log(2.0)));
+ label = xsane_info_table_text_new(table, buf, 1, 2);
+ }
+ else if ((!xsane.xsane_color) && (xsane.scanner_gamma_gray)) /* gray gamma correction by scanner */
+ {
+ const SANE_Option_Descriptor *opt;
+
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_CORR_BY);
+ label = xsane_info_table_text_new(table, buf, 0, 0);
+ snprintf(buf, sizeof(buf), TEXT_SCANNER);
+ label = xsane_info_table_text_new(table, buf, 1, 0);
+
+ opt = sane_get_option_descriptor(dialog->dev, dialog->well_known.gamma_vector);
+
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_INPUT_DEPTH);
+ label = xsane_info_table_text_new(table, buf, 0, 1);
+ snprintf(buf, sizeof(buf), "%d bit", (int) (0.5 + log((double)opt->size / sizeof(opt->type)) / log(2.0)));
+ label = xsane_info_table_text_new(table, buf, 1, 1);
+
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_OUTPUT_DEPTH);
+ label = xsane_info_table_text_new(table, buf, 0, 2);
+ snprintf(buf, sizeof(buf), "%d bit", (int) (0.5 + log(opt->constraint.range->max+1.0) / log(2.0)));
+ label = xsane_info_table_text_new(table, buf, 1, 2);
+ }
+ else if (xsane.param.depth != 1) /* gamma correction by xsane */
+ {
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_CORR_BY);
+ label = xsane_info_table_text_new(table, buf, 0, 0);
+ snprintf(buf, sizeof(buf), TEXT_SOFTWARE_XSANE);
+ label = xsane_info_table_text_new(table, buf, 1, 0);
+
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_INPUT_DEPTH);
+ label = xsane_info_table_text_new(table, buf, 0, 1);
+ snprintf(buf, sizeof(buf), "%d bit", xsane.param.depth);
+ label = xsane_info_table_text_new(table, buf, 1, 1);
+
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_OUTPUT_DEPTH);
+ label = xsane_info_table_text_new(table, buf, 0, 2);
+/* snprintf(buf, sizeof(buf), "%d bit", 8); */
+ snprintf(buf, sizeof(buf), "%d bit", xsane.param.depth);
+ label = xsane_info_table_text_new(table, buf, 1, 2);
+ }
+ else /* no gamma enhancement */
+ {
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_CORR_BY);
+ label = xsane_info_table_text_new(table, buf, 0, 0);
+ snprintf(buf, sizeof(buf), TEXT_NONE);
+ label = xsane_info_table_text_new(table, buf, 1, 0);
+
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_INPUT_DEPTH);
+ label = xsane_info_table_text_new(table, buf, 0, 1);
+ snprintf(buf, sizeof(buf), TEXT_NONE);
+ label = xsane_info_table_text_new(table, buf, 1, 1);
+
+ snprintf(buf, sizeof(buf), TEXT_GAMMA_OUTPUT_DEPTH);
+ label = xsane_info_table_text_new(table, buf, 0, 2);
+ snprintf(buf, sizeof(buf), TEXT_NONE);
+ label = xsane_info_table_text_new(table, buf, 1, 2);
+ }
+
+ snprintf(buf, sizeof(buf), TEXT_SCANNER_OUTPUT_DEPTH);
+ label = xsane_info_table_text_new(table, buf, 0, 3);
+ snprintf(buf, sizeof(buf), "%d bit", xsane.param.depth);
+ label = xsane_info_table_text_new(table, buf, 1, 3);
+
+ frame = gtk_frame_new(TEXT_OUTPUT_FORMATS);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
+ gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 5);
+ gtk_widget_show(frame);
+
+ framebox = gtk_vbox_new(/* not homogeneous */ FALSE, 0);
+ gtk_container_add(GTK_CONTAINER(frame), framebox);
+ gtk_widget_show(framebox);
+
+ hbox = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(framebox), hbox, TRUE, TRUE, 5);
+ gtk_widget_show(hbox);
+
+ table = gtk_table_new(2, 2, FALSE);
+ gtk_box_pack_start(GTK_BOX(hbox), table, FALSE, FALSE, 5);
+ gtk_widget_show(table);
+
+ snprintf(buf, sizeof(buf), TEXT_8BIT_FORMATS);
+ label = xsane_info_table_text_new(table, buf, 0, 0);
+
+ bufptr=buf;
+
+#ifdef HAVE_LIBJPEG
+ sprintf(bufptr, "JPEG, ");
+ bufptr += strlen(bufptr);
+#endif
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+ sprintf(bufptr, "PNG, ");
+ bufptr += strlen(bufptr);
+#endif
+#endif
+
+ sprintf(bufptr, "PNM, ");
+ bufptr += strlen(bufptr);
+
+ sprintf(bufptr, "PS, ");
+ bufptr += strlen(bufptr);
+
+#ifdef SUPPORT_RGBA
+ sprintf(bufptr, "RGBA, ");
+ bufptr += strlen(bufptr);
+#endif
+
+#ifdef HAVE_LIBTIFF
+ sprintf(bufptr, "TIFF, ");
+ bufptr += strlen(bufptr);
+#endif
+
+ bufptr--;
+ bufptr--;
+ *bufptr = 0; /* erase last comma */
+
+ label = xsane_info_table_text_new(table, buf, 1, 0);
+
+ snprintf(buf, sizeof(buf), TEXT_16BIT_FORMATS);
+ label = xsane_info_table_text_new(table, buf, 0, 1);
+
+ bufptr=buf;
+
+#ifdef HAVE_LIBPNG
+#ifdef HAVE_LIBZ
+ sprintf(bufptr, "PNG, ");
+ bufptr += strlen(bufptr);
+#endif
+#endif
+
+ sprintf(bufptr, "PNM, ");
+ bufptr += strlen(bufptr);
+
+ sprintf(bufptr, "RAW, ");
+ bufptr += strlen(bufptr);
+
+#ifdef SUPPORT_RGBA
+ sprintf(bufptr, "RGBA, ");
+ bufptr += strlen(bufptr);
+#endif
+
+ bufptr--;
+ bufptr--;
+ *bufptr = 0; /* erase last comma */
+
+ label = xsane_info_table_text_new(table, buf, 1, 1);
+
+/* gtk_label_set((GtkLabel *)label, "HALLO"); */
+
+ button = gtk_button_new_with_label(BUTTON_CLOSE);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_close_info_callback, info_dialog);
+ gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
+ gtk_widget_show(button);
+
+ gtk_widget_show(info_dialog);
+
+ xsane_clear_histogram(&xsane.histogram_raw);
+ xsane_clear_histogram(&xsane.histogram_enh);
+
+ xsane_set_sensitivity(FALSE);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_about_dialog(GtkWidget *widget, gpointer data)
+{
+ GtkWidget *about_dialog, *vbox, *button, *label;
+ char buf[256];
+ GtkWidget *pixmapwidget;
+ GdkBitmap *mask;
+ GdkPixmap *pixmap;
+ GtkStyle *style;
+ GdkColor *bg_trans;
+
+
+ about_dialog = gtk_window_new(GTK_WINDOW_DIALOG);
+ gtk_window_set_position(GTK_WINDOW(about_dialog), GTK_WIN_POS_CENTER);
+ gtk_window_set_policy(GTK_WINDOW(about_dialog), FALSE, FALSE, FALSE);
+ gtk_signal_connect(GTK_OBJECT(about_dialog), "destroy", GTK_SIGNAL_FUNC(xsane_close_info_callback), about_dialog);
+ snprintf(buf, sizeof(buf), "%s %s", WINDOW_ABOUT, prog_name);
+ gtk_window_set_title(GTK_WINDOW(about_dialog), buf);
+
+ xsane_set_window_icon(about_dialog, 0);
+
+ vbox = gtk_vbox_new(/* not homogeneous */ FALSE, 5);
+ gtk_container_add(GTK_CONTAINER(about_dialog), vbox);
+ gtk_widget_show(vbox);
+
+ /* xsane logo */
+ gtk_widget_realize(about_dialog);
+
+ style = gtk_widget_get_style(about_dialog);
+ bg_trans = &style->bg[GTK_STATE_NORMAL];
+
+ snprintf(buf, sizeof(buf), "%s/xsane-logo.xpm", STRINGIFY(PATH_SANE_DATA_DIR));
+ pixmap = gdk_pixmap_create_from_xpm(about_dialog->window, &mask, bg_trans, buf);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_box_pack_start(GTK_BOX(vbox), pixmapwidget, FALSE, FALSE, 2);
+ gtk_widget_show(pixmapwidget);
+ gdk_pixmap_unref(pixmap);
+
+ xsane_separator_new(vbox, 5);
+
+ snprintf(buf, sizeof(buf), "XSane %s %s\n", TEXT_VERSION, XSANE_VERSION);
+ label = gtk_label_new(buf);
+ gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+ gtk_widget_show(label);
+
+ snprintf(buf, sizeof(buf), "(c) %s %s\n", XSANE_DATE, XSANE_COPYRIGHT);
+ label = gtk_label_new(buf);
+ gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+ gtk_widget_show(label);
+
+ snprintf(buf, sizeof(buf), "%s %s\n", TEXT_EMAIL, XSANE_EMAIL);
+ label = gtk_label_new(buf);
+ gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+ gtk_widget_show(label);
+
+ button = gtk_button_new_with_label(BUTTON_CLOSE);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_close_info_callback, about_dialog);
+ gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
+ gtk_widget_show(button);
+
+ gtk_widget_show(about_dialog);
+
+ xsane_clear_histogram(&xsane.histogram_raw);
+ xsane_clear_histogram(&xsane.histogram_enh);
+
+ xsane_set_sensitivity(FALSE);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static SANE_Status xsane_get_area_value(int option, float *val, SANE_Int *unit)
+{
+ const SANE_Option_Descriptor *opt;
+ SANE_Handle dev;
+ SANE_Word word;
+
+ if (option <= 0)
+ {
+ return -1;
+ }
+
+ if (sane_control_option(dialog->dev, option, SANE_ACTION_GET_VALUE, &word, 0) == SANE_STATUS_GOOD)
+ {
+ dev = dialog->dev;
+ opt = sane_get_option_descriptor(dev, option);
+
+ if (unit)
+ {
+ *unit = opt->unit;
+ }
+
+ if (val)
+ {
+ if (opt->type == SANE_TYPE_FIXED)
+ {
+ *val = (float) word / 65536.0;
+ }
+ else
+ {
+ *val = (float) word;
+ }
+ }
+
+ return 0;
+ }
+ else if (val)
+ {
+ *val = 0;
+ }
+ return -2;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifdef XSANE_TEST
+static void xsane_batch_scan_delete_callback(GtkWidget *widget, gpointer list)
+{
+ gtk_list_remove_items(GTK_LIST(list), GTK_LIST(list)->selection);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_batch_scan_add_callback(GtkWidget *widget, gpointer list)
+{
+ GtkWidget *list_item;
+ float tlx, tly, brx, bry;
+ SANE_Int unit;
+ char buf[255];
+
+
+ xsane_get_area_value(dialog->well_known.coord[0], &tlx, &unit);
+ xsane_get_area_value(dialog->well_known.coord[1], &tly, &unit);
+ xsane_get_area_value(dialog->well_known.coord[2], &brx, &unit);
+ xsane_get_area_value(dialog->well_known.coord[3], &bry, &unit);
+
+ if (unit == SANE_UNIT_MM)
+ {
+ snprintf(buf, sizeof(buf), " top left (%7.2fmm, %7.2fmm), bottom right (%7.2fmm, %7.2fmm)", tlx, tly, brx, bry);
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), " top left (%5.0fpx, %5.0fpx), bottom right (%5.0fpx, %5.0fpx)", tlx, tly, brx, bry);
+ }
+
+ list_item = gtk_list_item_new_with_label(buf);
+ gtk_object_set_data(GTK_OBJECT(list_item), "list_item_data", strdup(buf));
+ gtk_container_add(GTK_CONTAINER(list), list_item);
+ gtk_widget_show(list_item);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_batch_scan_dialog(GtkWidget *widget, gpointer data)
+{
+ GtkWidget *batch_scan_dialog, *batch_scan_vbox, *hbox, *button, *scrolled_window, *list;
+ char buf[64];
+
+ batch_scan_dialog = gtk_dialog_new();
+ snprintf(buf, sizeof(buf), "%s %s", prog_name, WINDOW_BATCH_SCAN);
+ gtk_window_set_title(GTK_WINDOW(batch_scan_dialog), buf);
+
+ batch_scan_vbox = GTK_DIALOG(batch_scan_dialog)->vbox;
+
+ scrolled_window = gtk_scrolled_window_new(0, 0);
+ gtk_widget_set_usize(scrolled_window, 400, 200);
+ gtk_container_add(GTK_CONTAINER(batch_scan_vbox), scrolled_window);
+ gtk_widget_show(scrolled_window);
+
+ list = gtk_list_new();
+
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window), list);
+
+ gtk_widget_show(list);
+
+
+ /* fill in action area: */
+ hbox = GTK_DIALOG(batch_scan_dialog)->action_area;
+
+ button = gtk_button_new_with_label(BUTTON_OK);
+ GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_close_dialog_callback, batch_scan_dialog);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_grab_default(button);
+ gtk_widget_show(button);
+
+ button = gtk_button_new_with_label(BUTTON_ADD_AREA);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_batch_scan_add_callback, list);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ button = gtk_button_new_with_label(BUTTON_DELETE);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_batch_scan_delete_callback, list);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ gtk_widget_show(batch_scan_dialog);
+}
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_dialog_delete()
+{
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_dialog()
+{
+ GtkWidget *fax_dialog, *fax_scan_vbox, *fax_project_vbox, *hbox, *fax_project_exists_hbox, *button;
+ GtkWidget *scrolled_window, *list;
+ char buf[64];
+ GtkWidget *pixmapwidget, *text;
+ GdkBitmap *mask;
+ GdkPixmap *pixmap;
+
+
+ if (xsane.fax_dialog)
+ {
+ return; /* window already is open */
+ }
+
+ fax_dialog = gtk_dialog_new();
+ snprintf(buf, sizeof(buf), "%s %s", prog_name, WINDOW_FAX_PROJECT);
+ gtk_window_set_title(GTK_WINDOW(fax_dialog), buf);
+ gtk_signal_connect(GTK_OBJECT(fax_dialog), "delete_event", (GtkSignalFunc) xsane_fax_dialog_delete, 0);
+ xsane_set_window_icon(fax_dialog, 0);
+
+ fax_scan_vbox = GTK_DIALOG(fax_dialog)->vbox;
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
+ gtk_box_pack_start(GTK_BOX(fax_scan_vbox), hbox, FALSE, FALSE, 2);
+
+ pixmap = gdk_pixmap_create_from_xpm_d(xsane.shell->window, &mask, xsane.bg_trans, (gchar **) fax_xpm);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
+ gdk_pixmap_unref(pixmap);
+
+ text = gtk_entry_new_with_max_length(128);
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAXPROJECT);
+ gtk_entry_set_text(GTK_ENTRY(text), (char *) preferences.fax_project);
+ gtk_box_pack_start(GTK_BOX(hbox), text, TRUE, TRUE, 4);
+ gtk_signal_connect(GTK_OBJECT(text), "changed", (GtkSignalFunc) xsane_faxproject_changed_callback, 0);
+
+ xsane.fax_project_entry = text;
+
+ gtk_widget_show(pixmapwidget);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+
+ fax_project_vbox = gtk_vbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(fax_scan_vbox), fax_project_vbox, TRUE, TRUE, 0);
+ gtk_widget_show(fax_project_vbox);
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
+ gtk_box_pack_start(GTK_BOX(fax_project_vbox), hbox, FALSE, FALSE, 2);
+
+ gtk_widget_realize(fax_dialog);
+
+ pixmap = gdk_pixmap_create_from_xpm_d(fax_dialog->window, &mask, xsane.bg_trans, (gchar **) faxreceiver_xpm);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_box_pack_start(GTK_BOX(hbox), pixmapwidget, FALSE, FALSE, 2);
+ gdk_pixmap_unref(pixmap);
+
+ text = gtk_entry_new_with_max_length(128);
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAXRECEIVER);
+ gtk_box_pack_start(GTK_BOX(hbox), text, TRUE, TRUE, 4);
+ gtk_signal_connect(GTK_OBJECT(text), "changed", (GtkSignalFunc) xsane_faxreceiver_changed_callback, 0);
+
+ xsane.fax_receiver_entry = text;
+
+ gtk_widget_show(pixmapwidget);
+ gtk_widget_show(text);
+ gtk_widget_show(hbox);
+
+
+ scrolled_window = gtk_scrolled_window_new(0, 0);
+ gtk_widget_set_usize(scrolled_window, 200, 100);
+ gtk_container_add(GTK_CONTAINER(fax_project_vbox), scrolled_window);
+ gtk_widget_show(scrolled_window);
+
+ list = gtk_list_new();
+/* gtk_list_set_selection_mode(list, GTK_SELECTION_BROWSE); */
+
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window), list);
+
+ gtk_widget_show(list);
+
+ xsane.fax_list = list;
+
+
+ hbox = gtk_hbox_new(FALSE, 2);
+ gtk_container_set_border_width(GTK_CONTAINER(hbox), 2);
+ gtk_box_pack_start(GTK_BOX(fax_project_vbox), hbox, FALSE, FALSE, 2);
+
+ button = gtk_button_new_with_label(BUTTON_SHOW);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_fax_show_callback, list);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ button = gtk_button_new_with_label(BUTTON_RENAME);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_fax_entry_rename_callback, list);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ button = gtk_button_new_with_label(BUTTON_DELETE);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_fax_entry_delete_callback, list);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ xsane_button_new_with_pixmap(hbox, move_up_xpm, 0, (GtkSignalFunc) xsane_fax_entry_move_up_callback, list);
+ xsane_button_new_with_pixmap(hbox, move_down_xpm, 0, (GtkSignalFunc) xsane_fax_entry_move_down_callback, list);
+
+ gtk_widget_show(hbox);
+
+ xsane.fax_project_box = fax_project_vbox;
+
+ /* fill in action area: */
+ hbox = GTK_DIALOG(fax_dialog)->action_area;
+
+ fax_project_exists_hbox = gtk_hbox_new(FALSE, 2);
+ gtk_box_pack_start(GTK_BOX(hbox), fax_project_exists_hbox, TRUE, TRUE, 0);
+
+ button = gtk_button_new_with_label(BUTTON_SEND_PROJECT);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_fax_send, 0);
+ gtk_box_pack_start(GTK_BOX(fax_project_exists_hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ button = gtk_button_new_with_label(BUTTON_DELETE_PROJECT);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_fax_project_delete, 0);
+ gtk_box_pack_start(GTK_BOX(fax_project_exists_hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ gtk_widget_show(fax_project_exists_hbox);
+ xsane.fax_project_exists = fax_project_exists_hbox;
+
+ button = gtk_button_new_with_label(BUTTON_CREATE_PROJECT);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_fax_project_create, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ xsane.fax_project_not_exists = button;
+
+ xsane.fax_dialog = fax_dialog;
+
+ xsane_fax_project_load();
+
+ gtk_widget_show(fax_dialog);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_dialog_close()
+{
+ if (xsane.fax_dialog == 0)
+ {
+ return;
+ }
+
+ gtk_widget_destroy(xsane.fax_dialog);
+
+ xsane.fax_dialog = 0;
+ xsane.fax_list = 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_project_load()
+{
+ FILE *projectfile;
+ char page[256];
+ char buf[256];
+ GtkWidget *list_item;
+ int i;
+ char c;
+
+ gtk_signal_disconnect_by_func(GTK_OBJECT(xsane.fax_receiver_entry), GTK_SIGNAL_FUNC(xsane_faxreceiver_changed_callback), 0);
+ gtk_list_remove_items(GTK_LIST(xsane.fax_list), GTK_LIST(xsane.fax_list)->children);
+
+ snprintf(buf, sizeof(buf), "%s/project-list", preferences.fax_project);
+ projectfile = fopen(buf, "r");
+
+ if ((!projectfile) || (feof(projectfile)))
+ {
+ snprintf(buf, sizeof(buf), "%s/page-001.ps", preferences.fax_project);
+ xsane.fax_filename=strdup(buf);
+
+ xsane.fax_receiver=strdup("");
+ gtk_entry_set_text(GTK_ENTRY(xsane.fax_receiver_entry), (char *) xsane.fax_receiver);
+
+ gtk_widget_set_sensitive(xsane.fax_project_box, FALSE);
+ gtk_widget_hide(xsane.fax_project_exists);
+ gtk_widget_show(xsane.fax_project_not_exists);
+ gtk_widget_set_sensitive(GTK_WIDGET(xsane.start_button), FALSE);
+ }
+ else
+ {
+ i=0;
+ c=0;
+ while ((i<255) && (c != 10) && (c != EOF)) /* first line is receiver phone number or address */
+ {
+ c = fgetc(projectfile);
+ page[i++] = c;
+ }
+ page[i-1] = 0;
+
+ xsane.fax_receiver=strdup(page);
+ gtk_entry_set_text(GTK_ENTRY(xsane.fax_receiver_entry), (char *) xsane.fax_receiver);
+
+
+ i=0;
+ c=0;
+ while ((i<255) && (c != 10) && (c != EOF)) /* second line is next fax filename */
+ {
+ c = fgetc(projectfile);
+ page[i++] = c;
+ }
+ page[i-1] = 0;
+
+ snprintf(buf, sizeof(buf), "%s/%s", preferences.fax_project, page);
+ xsane.fax_filename=strdup(buf);
+
+ while (!feof(projectfile))
+ {
+ i=0;
+ c=0;
+
+ while ((i<255) && (c != 10) && (c != EOF))
+ {
+ c = fgetc(projectfile);
+ page[i++] = c;
+ }
+ page[i-1]=0;
+
+ if (c > 1)
+ {
+ list_item = gtk_list_item_new_with_label(page);
+ gtk_object_set_data(GTK_OBJECT(list_item), "list_item_data", strdup(page));
+ gtk_container_add(GTK_CONTAINER(xsane.fax_list), list_item);
+ gtk_widget_show(list_item);
+ }
+ }
+ gtk_widget_set_sensitive(xsane.fax_project_box, TRUE);
+ gtk_widget_show(xsane.fax_project_exists);
+ gtk_widget_hide(xsane.fax_project_not_exists);
+ gtk_widget_set_sensitive(GTK_WIDGET(xsane.start_button), TRUE);
+ }
+
+ if (projectfile)
+ {
+ fclose(projectfile);
+ }
+
+ gtk_signal_connect(GTK_OBJECT(xsane.fax_receiver_entry), "changed", (GtkSignalFunc) xsane_faxreceiver_changed_callback, 0);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_project_delete()
+{
+ char *page;
+ char file[256];
+ GList *list = (GList *) GTK_LIST(xsane.fax_list)->children;
+ GtkObject *list_item;
+
+ while (list)
+ {
+ list_item = GTK_OBJECT(list->data);
+ page = strdup((char *) gtk_object_get_data(list_item, "list_item_data"));
+ xsane_convert_text_to_filename(&page);
+ snprintf(file, sizeof(file), "%s/%s.ps", preferences.fax_project, page);
+ free(page);
+ remove(file);
+ list = list->next;
+ }
+ snprintf(file, sizeof(file), "%s/project-list", preferences.fax_project);
+ remove(file);
+ snprintf(file, sizeof(file), "%s", preferences.fax_project);
+ rmdir(file);
+
+ xsane_fax_project_load();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_fax_project_save()
+{
+ FILE *projectfile;
+ char *page;
+ char buf[256];
+ GList *list = (GList *) GTK_LIST(xsane.fax_list)->children;
+ GtkObject *list_item;
+
+ umask(preferences.directory_umask); /* define new file permissions */
+ mkdir(preferences.fax_project, 0777); /* make sure directory exists */
+
+ snprintf(buf, sizeof(buf), "%s/project-list", preferences.fax_project);
+ umask(preferences.image_umask); /* define image file permissions */
+ projectfile = fopen(buf, "w");
+ umask(XSANE_DEFAULT_UMASK); /* define new file permissions */
+
+ if (xsane.fax_receiver)
+ {
+ fprintf(projectfile, "%s\n", xsane.fax_receiver); /* first line is receiver phone number or address */
+ }
+ else
+ {
+ fprintf(projectfile, "\n");
+ }
+
+ if (xsane.fax_filename)
+ {
+ fprintf(projectfile, "%s\n", strrchr(xsane.fax_filename, '/')+1); /* second line is next fax filename */
+ }
+ else
+ {
+ fprintf(projectfile, "\n");
+ }
+
+
+ while (list)
+ {
+ list_item = GTK_OBJECT(list->data);
+ page = (char *) gtk_object_get_data(list_item, "list_item_data");
+ fprintf(projectfile, "%s\n", page);
+ list = list->next;
+ }
+ fclose(projectfile);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_project_create()
+{
+ if (strlen(preferences.fax_project))
+ {
+ xsane_fax_project_save();
+ xsane_fax_project_load();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_pref_toggle_tooltips(GtkWidget *widget, gpointer data)
+{
+ preferences.tooltips_enabled = (GTK_CHECK_MENU_ITEM(widget)->active != 0);
+ xsane_back_gtk_set_tooltips(dialog, preferences.tooltips_enabled);
+ xsane_pref_save();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_show_doc_via_nsr(GtkWidget *widget, gpointer data) /* show via netscape remote */
+{
+ char *name = (char *) data;
+ char buf[256];
+ FILE *ns_pipe;
+ pid_t pid;
+ char *arg[3];
+
+ snprintf(buf, sizeof(buf), "netscape -no-about-splash -remote \"openFile(%s/%s-doc.html)\" 2>&1", STRINGIFY(PATH_SANE_DATA_DIR), name);
+ ns_pipe = popen(buf, "r");
+
+ if (ns_pipe)
+ {
+ while (!feof(ns_pipe))
+ {
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ fgetc(ns_pipe); /* remove char from pipe */
+ }
+
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ if (pclose(ns_pipe)) /* netscape not running, start it */
+ {
+ snprintf(buf, sizeof(buf), "%s/%s-doc.html", STRINGIFY(PATH_SANE_DATA_DIR), name);
+ arg[0] = "netscape";
+ arg[1] = buf;
+ arg[2] = 0;
+
+ pid = fork();
+
+ if (pid == 0) /* new process */
+ {
+ execvp(arg[0], arg); /* does not return if successfully */
+ fprintf(stderr, "%s %s\n", ERR_FAILD_EXEC_DOC_VIEWER, preferences.doc_viewer);
+ _exit(0); /* do not use exit() here! otherwise gtk gets in trouble */
+ }
+ }
+ }
+ else /* execution failed */
+ {
+ snprintf(buf, sizeof(buf), "%s", ERR_NETSCAPE_EXECUTE_FAIL);
+ xsane_back_gtk_error(buf, TRUE);
+ }
+
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_show_doc(GtkWidget *widget, gpointer data)
+{
+ char *name = (char *) data;
+ char buf[256];
+ pid_t pid;
+ char *arg[3];
+
+ if (!strcmp(preferences.doc_viewer, DOCVIEWERNETSCAPEREMOTE))
+ {
+ xsane_show_doc_via_nsr(widget, data);
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "%s/%s-doc.html", STRINGIFY(PATH_SANE_DATA_DIR), name);
+ arg[0] = preferences.doc_viewer;
+ arg[1] = buf;
+ arg[2] = 0;
+
+ pid = fork();
+
+ if (pid == 0) /* new process */
+ {
+ execvp(arg[0], arg); /* does not return if successfully */
+ fprintf(stderr, "%s %s\n", ERR_FAILD_EXEC_DOC_VIEWER, preferences.doc_viewer);
+ _exit(0); /* do not use exit() here! otherwise gtk gets in trouble */
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_entrys_swap(GtkWidget *list_item_1, GtkWidget *list_item_2)
+{
+ char *text1;
+ char *text2;
+
+ text1 = (char *) gtk_object_get_data(GTK_OBJECT(list_item_1), "list_item_data");
+ text2 = (char *) gtk_object_get_data(GTK_OBJECT(list_item_2), "list_item_data");
+
+ gtk_label_set(GTK_LABEL(gtk_container_children(GTK_CONTAINER(list_item_1))->data), text2);
+ gtk_label_set(GTK_LABEL(gtk_container_children(GTK_CONTAINER(list_item_2))->data), text1);
+ gtk_object_set_data(GTK_OBJECT(list_item_1), "list_item_data", text2);
+ gtk_object_set_data(GTK_OBJECT(list_item_2), "list_item_data", text1);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_entry_move_up_callback(GtkWidget *widget, gpointer list)
+{
+ GList *select;
+ GList *item = GTK_LIST(list)->children;
+ GtkWidget *list_item_1;
+ GtkWidget *list_item_2;
+ int position;
+ int newpos;
+
+ select = GTK_LIST(list)->selection;
+ if (select)
+ {
+ list_item_1 = select->data;
+
+ position = gtk_list_child_position(GTK_LIST(list), list_item_1);
+ position--; /* move up */
+ newpos = position;
+
+ if (position >= 0)
+ {
+ while (position>0)
+ {
+ item = item->next;
+ position--;
+ }
+
+ list_item_2 = item->data;
+ if (list_item_2)
+ {
+ xsane_fax_entrys_swap(list_item_1, list_item_2);
+ gtk_list_select_item(GTK_LIST(list), newpos);
+ xsane_fax_project_save();
+ }
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_entry_move_down_callback(GtkWidget *widget, gpointer list)
+{
+ GList *select;
+ GList *item = GTK_LIST(list)->children;
+ GtkWidget *list_item_1;
+ GtkWidget *list_item_2;
+ int position;
+ int newpos;
+
+ select = GTK_LIST(list)->selection;
+ if (select)
+ {
+ list_item_1 = select->data;
+
+ position = gtk_list_child_position(GTK_LIST(list), list_item_1);
+ position++; /* move down */
+ newpos = position;
+
+ while ((position>0) && (item))
+ {
+ item = item->next;
+ position--;
+ }
+
+ if (item)
+ {
+ list_item_2 = item->data;
+ if (list_item_2)
+ {
+ xsane_fax_entrys_swap(list_item_1, list_item_2);
+ gtk_list_select_item(GTK_LIST(list), newpos);
+ xsane_fax_project_save();
+ }
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+int xsane_fax_entry_rename;
+
+static void xsane_fax_entry_rename_button_callback(GtkWidget *widget, gpointer data)
+{
+ xsane_fax_entry_rename = (int) data;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_entry_rename_callback(GtkWidget *widget, gpointer list)
+{
+ GtkWidget *list_item;
+ GList *select;
+ char *oldpage;
+ char *newpage;
+ char oldfile[256];
+ char newfile[256];
+
+ select = GTK_LIST(list)->selection;
+ if (select)
+ {
+ GtkWidget *rename_dialog;
+ GtkWidget *text;
+ GtkWidget *button;
+ GtkWidget *vbox, *hbox;
+ char buf[256];
+
+ list_item = select->data;
+ oldpage = strdup((char *) gtk_object_get_data(GTK_OBJECT(list_item), "list_item_data"));
+
+ xsane_set_sensitivity(FALSE);
+
+ rename_dialog = gtk_dialog_new();
+ gtk_window_set_position(GTK_WINDOW(rename_dialog), GTK_WIN_POS_CENTER);
+ gtk_window_set_policy(GTK_WINDOW(rename_dialog), FALSE, FALSE, FALSE);
+ snprintf(buf, sizeof(buf), "%s %s", prog_name, WINDOW_FAX_RENAME);
+ gtk_window_set_title(GTK_WINDOW(rename_dialog), buf);
+ gtk_signal_connect(GTK_OBJECT(rename_dialog), "delete_event", (GtkSignalFunc) xsane_fax_entry_rename_button_callback, (void *) -1);
+ gtk_widget_show(rename_dialog);
+
+ vbox = GTK_DIALOG(rename_dialog)->vbox;
+
+ text = gtk_entry_new_with_max_length(64);
+ xsane_back_gtk_set_tooltip(dialog->tooltips, text, DESC_FAXPAGENAME);
+ gtk_entry_set_text(GTK_ENTRY(text), oldpage);
+ gtk_widget_set_usize(text, 300, 0);
+ gtk_box_pack_start(GTK_BOX(vbox), text, TRUE, TRUE, 4);
+ gtk_widget_show(text);
+
+
+ hbox = GTK_DIALOG(rename_dialog)->action_area;
+
+ button = gtk_button_new_with_label("OK");
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_fax_entry_rename_button_callback, (void *) 1);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ button = gtk_button_new_with_label("Cancel");
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_fax_entry_rename_button_callback, (void *) -1);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+
+ xsane_fax_entry_rename = 0;
+
+ while (xsane_fax_entry_rename == 0)
+ {
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+ }
+
+ newpage = strdup(gtk_entry_get_text(GTK_ENTRY(text)));
+
+ if (xsane_fax_entry_rename == 1)
+ {
+ gtk_label_set(GTK_LABEL(gtk_container_children(GTK_CONTAINER(list_item))->data), newpage);
+ gtk_object_set_data(GTK_OBJECT(list_item), "list_item_data", strdup(newpage));
+
+ xsane_convert_text_to_filename(&oldpage);
+ xsane_convert_text_to_filename(&newpage);
+ snprintf(oldfile, sizeof(oldfile), "%s/%s.ps", preferences.fax_project, oldpage);
+ snprintf(newfile, sizeof(newfile), "%s/%s.ps", preferences.fax_project, newpage);
+
+ rename(oldfile, newfile);
+
+ xsane_fax_project_save();
+ }
+
+ free(oldpage);
+ free(newpage);
+
+ gtk_widget_destroy(rename_dialog);
+
+ xsane_set_sensitivity(TRUE);
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_entry_delete_callback(GtkWidget *widget, gpointer list)
+{
+ GtkObject *list_item;
+ GList *select;
+ char *page;
+ char file[256];
+
+ select = GTK_LIST(list)->selection;
+ if (select)
+ {
+ list_item = GTK_OBJECT(select->data);
+ page = strdup((char *) gtk_object_get_data(list_item, "list_item_data"));
+ xsane_convert_text_to_filename(&page);
+ snprintf(file, sizeof(file), "%s/%s.ps", preferences.fax_project, page);
+ free(page);
+ remove(file);
+ gtk_widget_destroy(GTK_WIDGET(list_item));
+ xsane_fax_project_save();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_show_callback(GtkWidget *widget, gpointer list)
+{
+ GtkObject *list_item;
+ GList *select;
+ pid_t pid;
+ char *arg[100];
+ char *page;
+ char buf[256];
+ int argnr;
+
+ select = GTK_LIST(list)->selection;
+ if (select)
+ {
+ argnr = xsane_parse_options(preferences.fax_viewer, arg);
+
+ list_item = GTK_OBJECT(select->data);
+ page = (char *) gtk_object_get_data(list_item, "list_item_data");
+ page = strdup(page);
+ xsane_convert_text_to_filename(&page);
+ snprintf(buf, sizeof(buf), "%s/%s.ps", preferences.fax_project, page);
+ free(page);
+ arg[argnr++] = buf;
+ arg[argnr] = 0;
+
+ pid = fork();
+
+ if (pid == 0) /* new process */
+ {
+ execvp(arg[0], arg); /* does not return if successfully */
+ fprintf(stderr, "%s %s\n", ERR_FAILD_EXEC_FAX_VIEWER, preferences.fax_viewer);
+ _exit(0); /* do not use exit() here! otherwise gtk gets in trouble */
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_fax_send()
+{
+ char *page;
+ GList *list = (GList *) GTK_LIST(xsane.fax_list)->children;
+ GtkObject *list_item;
+ pid_t pid;
+ char *arg[1000];
+ char buf[256];
+ int argnr = 0;
+ int i;
+
+ if (list)
+ {
+ if (!xsane_option_defined(xsane.fax_receiver))
+ {
+ snprintf(buf, sizeof(buf), "%s\n", ERR_SENDFAX_RECEIVER_MISSING);
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ argnr = xsane_parse_options(preferences.fax_command, arg);
+
+ if (xsane.fax_fine_mode) /* fine mode */
+ {
+ if (xsane_option_defined(preferences.fax_fine_option))
+ {
+ arg[argnr++] = strdup(preferences.fax_fine_option);
+ }
+ }
+ else /* normal mode */
+ {
+ if (xsane_option_defined(preferences.fax_normal_option))
+ {
+ arg[argnr++] = strdup(preferences.fax_normal_option);
+ }
+ }
+
+ if (xsane_option_defined(preferences.fax_receiver_option))
+ {
+ arg[argnr++] = strdup(preferences.fax_receiver_option);
+ }
+ arg[argnr++] = strdup(xsane.fax_receiver);
+
+ if (xsane_option_defined(preferences.fax_postscript_option))
+ {
+ arg[argnr++] = strdup(preferences.fax_postscript_option);
+ }
+
+ while ((list) && (argnr<999)) /* add pages to options */
+ {
+ list_item = GTK_OBJECT(list->data);
+ page = strdup((char *) gtk_object_get_data(list_item, "list_item_data"));
+ xsane_convert_text_to_filename(&page);
+ snprintf(buf, sizeof(buf), "%s/%s.ps", preferences.fax_project, page);
+ free(page);
+ arg[argnr++] = strdup(buf);
+ list = list->next;
+ }
+
+ arg[argnr] = 0;
+
+ pid = fork();
+
+ if (pid == 0) /* new process */
+ {
+ execvp(arg[0], arg); /* does not return if successfully */
+ fprintf(stderr, "%s %s\n", ERR_FAILED_EXEC_FAX_CMD, preferences.fax_command);
+ _exit(0); /* do not use exit() here! otherwise gtk gets in trouble */
+ }
+
+ for (i=0; i<argnr; i++)
+ {
+ free(arg[i]);
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static GtkWidget *xsane_view_build_menu(void)
+{
+ GtkWidget *menu, *item;
+
+ menu = gtk_menu_new();
+
+
+ /* show tooltips */
+
+ item = gtk_check_menu_item_new_with_label(MENU_ITEM_SHOW_TOOLTIPS);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), preferences.tooltips_enabled);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+ gtk_signal_connect(GTK_OBJECT(item), "toggled", (GtkSignalFunc) xsane_pref_toggle_tooltips, 0);
+
+
+ /* insert separator: */
+
+ item = gtk_menu_item_new();
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+
+
+ /* show preview */
+
+ xsane.show_preview_widget = gtk_check_menu_item_new_with_label(MENU_ITEM_SHOW_PREVIEW);
+ gtk_menu_append(GTK_MENU(menu), xsane.show_preview_widget);
+ gtk_widget_show(xsane.show_preview_widget);
+ gtk_signal_connect(GTK_OBJECT(xsane.show_preview_widget), "toggled", (GtkSignalFunc) xsane_show_preview_callback, 0);
+
+ /* show histogram */
+
+ xsane.show_histogram_widget = gtk_check_menu_item_new_with_label(MENU_ITEM_SHOW_HISTOGRAM);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.show_histogram_widget), preferences.show_histogram);
+ gtk_menu_append(GTK_MENU(menu), xsane.show_histogram_widget);
+ gtk_widget_show(xsane.show_histogram_widget);
+ gtk_signal_connect(GTK_OBJECT(xsane.show_histogram_widget), "toggled", (GtkSignalFunc) xsane_show_histogram_callback, 0);
+
+
+ /* show standard options */
+
+ xsane.show_standard_options_widget = gtk_check_menu_item_new_with_label(MENU_ITEM_SHOW_STANDARDOPTIONS);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.show_standard_options_widget), preferences.show_standard_options);
+ gtk_menu_append(GTK_MENU(menu), xsane.show_standard_options_widget);
+ gtk_widget_show(xsane.show_standard_options_widget);
+ gtk_signal_connect(GTK_OBJECT(xsane.show_standard_options_widget), "toggled", (GtkSignalFunc) xsane_show_standard_options_callback, 0);
+
+
+ /* show advanced options */
+
+ xsane.show_advanced_options_widget = gtk_check_menu_item_new_with_label(MENU_ITEM_SHOW_ADVANCEDOPTIONS);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.show_advanced_options_widget), preferences.show_advanced_options);
+ gtk_menu_append(GTK_MENU(menu), xsane.show_advanced_options_widget);
+ gtk_widget_show(xsane.show_advanced_options_widget);
+ gtk_signal_connect(GTK_OBJECT(xsane.show_advanced_options_widget), "toggled",
+ (GtkSignalFunc) xsane_show_advanced_options_callback, 0);
+
+ return menu;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static GtkWidget *xsane_pref_build_menu(void)
+{
+ GtkWidget *menu, *item, *submenu, *subitem;
+
+ menu = gtk_menu_new();
+
+
+ /* XSane setup dialog */
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_SETUP);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_setup_dialog, 0);
+ gtk_widget_show(item);
+
+ /* insert separator: */
+
+ item = gtk_menu_item_new();
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+
+
+#ifdef XSANE_TEST
+ /* XSane batch scan dialog */
+
+ item = gtk_menu_item_new_with_label("Batch scan");
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_batch_scan_dialog, 0);
+ gtk_widget_show(item);
+
+ /* insert separator: */
+
+ item = gtk_menu_item_new();
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+#endif
+
+
+ /* length unit */
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_LENGTH_UNIT);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+
+ submenu = gtk_menu_new();
+
+ subitem = gtk_check_menu_item_new_with_label(SUBMENU_ITEM_LENGTH_MILLIMETERS);
+ gtk_menu_append(GTK_MENU(submenu), subitem);
+ if (preferences.length_unit == 1.0)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(subitem), TRUE);
+ }
+ gtk_signal_connect(GTK_OBJECT(subitem), "activate", (GtkSignalFunc) xsane_set_pref_unit_callback, "mm");
+ gtk_widget_show(subitem);
+ xsane.length_unit_mm = subitem;
+
+ subitem = gtk_check_menu_item_new_with_label(SUBMENU_ITEM_LENGTH_CENTIMETERS);
+ gtk_menu_append(GTK_MENU(submenu), subitem);
+ if (preferences.length_unit == 10.0)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(subitem), TRUE);
+ }
+ gtk_signal_connect(GTK_OBJECT(subitem), "activate", (GtkSignalFunc) xsane_set_pref_unit_callback, "cm");
+ gtk_widget_show(subitem);
+ xsane.length_unit_cm = subitem;
+
+ subitem = gtk_check_menu_item_new_with_label(SUBMENU_ITEM_LENGTH_INCHES);
+ gtk_menu_append(GTK_MENU(submenu), subitem);
+ if (preferences.length_unit == 25.4)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(subitem), TRUE);
+ }
+ gtk_signal_connect(GTK_OBJECT(subitem), "activate", (GtkSignalFunc) xsane_set_pref_unit_callback, "in");
+ gtk_widget_show(subitem);
+ xsane.length_unit_in = subitem;
+
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);
+
+ xsane.length_unit_widget = item;
+
+
+ /* insert separator: */
+
+ item = gtk_menu_item_new();
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+
+ /* update policy */
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_UPDATE_POLICY);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+
+ submenu = gtk_menu_new();
+
+ subitem = gtk_check_menu_item_new_with_label(SUBMENU_ITEM_POLICY_CONTINUOUS);
+ gtk_menu_append(GTK_MENU(submenu), subitem);
+ if (preferences.gtk_update_policy == GTK_UPDATE_CONTINUOUS)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(subitem), TRUE);
+ }
+ gtk_signal_connect(GTK_OBJECT(subitem), "activate", (GtkSignalFunc) xsane_set_update_policy_callback, (void *) GTK_UPDATE_CONTINUOUS);
+ gtk_widget_show(subitem);
+ xsane.update_policy_continu = subitem;
+
+ subitem = gtk_check_menu_item_new_with_label(SUBMENU_ITEM_POLICY_DISCONTINU);
+ gtk_menu_append(GTK_MENU(submenu), subitem);
+ if (preferences.gtk_update_policy == GTK_UPDATE_DISCONTINUOUS)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(subitem), TRUE);
+ }
+ gtk_signal_connect(GTK_OBJECT(subitem), "activate", (GtkSignalFunc) xsane_set_update_policy_callback, (void *) GTK_UPDATE_DISCONTINUOUS);
+ gtk_widget_show(subitem);
+ xsane.update_policy_discont = subitem;
+
+ subitem = gtk_check_menu_item_new_with_label(SUBMENU_ITEM_POLICY_DELAYED);
+ gtk_menu_append(GTK_MENU(submenu), subitem);
+ if (preferences.gtk_update_policy == GTK_UPDATE_DELAYED)
+ {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(subitem), TRUE);
+ }
+ gtk_signal_connect(GTK_OBJECT(subitem), "activate", (GtkSignalFunc) xsane_set_update_policy_callback, (void *) GTK_UPDATE_DELAYED);
+ gtk_widget_show(subitem);
+ xsane.update_policy_delayed = subitem;
+
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);
+
+
+ /* insert separator: */
+
+ item = gtk_menu_item_new();
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+
+
+ /* show resolution list */
+
+ xsane.show_resolution_list_widget = gtk_check_menu_item_new_with_label(MENU_ITEM_SHOW_RESOLUTIONLIST);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.show_resolution_list_widget), preferences.show_resolution_list);
+ gtk_menu_append(GTK_MENU(menu), xsane.show_resolution_list_widget);
+ gtk_widget_show(xsane.show_resolution_list_widget);
+ gtk_signal_connect(GTK_OBJECT(xsane.show_resolution_list_widget), "toggled",
+ (GtkSignalFunc) xsane_show_resolution_list_callback, 0);
+
+
+ /* insert separator: */
+
+ item = gtk_menu_item_new();
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+
+
+ /* page orientation */
+
+ item = gtk_check_menu_item_new_with_label(MENU_ITEM_PAGE_ROTATE);
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), preferences.psrotate);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+ gtk_signal_connect(GTK_OBJECT(item), "toggled", (GtkSignalFunc) xsane_page_rotate_callback, 0);
+
+
+
+ /* insert separator: */
+
+ item = gtk_menu_item_new();
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+
+ /* Save device setting */
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_SAVE_DEVICE_SETTINGS);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_device_preferences_save, 0);
+ gtk_widget_show(item);
+
+ /* Load device setting */
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_LOAD_DEVICE_SETTINGS);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_device_preferences_load, 0);
+ gtk_widget_show(item);
+
+ return menu;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static GtkWidget *xsane_help_build_menu(void)
+{
+ GtkWidget *menu, *item;
+
+ menu = gtk_menu_new();
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_XSANE_DOC);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_show_doc, (void *) "sane-xsane");
+ gtk_widget_show(item);
+
+ item = gtk_menu_item_new();
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+
+ if (xsane.backend)
+ {
+ item = gtk_menu_item_new_with_label(MENU_ITEM_BACKEND_DOC);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_show_doc, (void *) xsane.backend);
+ gtk_widget_show(item);
+ }
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_AVAILABLE_BACKENDS);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_show_doc, (void *) "sane-backends");
+ gtk_widget_show(item);
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_PROBLEMS);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_show_doc, (void *) "sane-problems");
+ gtk_widget_show(item);
+
+ item = gtk_menu_item_new();
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_widget_show(item);
+
+ item = gtk_menu_item_new_with_label(MENU_ITEM_SCANTIPS);
+ gtk_menu_append(GTK_MENU(menu), item);
+ gtk_signal_connect(GTK_OBJECT(item), "activate", (GtkSignalFunc) xsane_show_doc, (void *) "sane-scantips");
+ gtk_widget_show(item);
+
+ return menu;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_panel_build(GSGDialog *dialog)
+{
+ GtkWidget *xsane_hbox;
+ GtkWidget *standard_hbox, *standard_vbox;
+ GtkWidget *advanced_hbox, *advanced_vbox;
+ GtkWidget *parent, *vbox, *button, *label;
+ const SANE_Option_Descriptor *opt;
+ SANE_Handle dev = dialog->dev;
+ double dval, dmin, dmax, dquant;
+ char *buf, str[16], title[256];
+ GSGDialogElement *elem;
+ SANE_Word quant, val;
+ SANE_Status status;
+ SANE_Int num_words;
+ char **str_list;
+ int i, j;
+ int num_vector_opts = 0;
+ int *vector_opts;
+
+ xsane_hbox = 0;
+
+ /* reset well-known options: */
+ dialog->well_known.scanmode = -1;
+ dialog->well_known.scansource = -1;
+ dialog->well_known.preview = -1;
+ dialog->well_known.dpi = -1;
+ dialog->well_known.dpi_x = -1;
+ dialog->well_known.dpi_y = -1;
+ dialog->well_known.coord[xsane_back_gtk_TL_X] = -1;
+ dialog->well_known.coord[xsane_back_gtk_TL_Y] = -1;
+ dialog->well_known.coord[xsane_back_gtk_BR_X] = -1;
+ dialog->well_known.coord[xsane_back_gtk_BR_Y] = -1;
+ dialog->well_known.gamma_vector = -1;
+ dialog->well_known.gamma_vector_r = -1;
+ dialog->well_known.gamma_vector_g = -1;
+ dialog->well_known.gamma_vector_b = -1;
+ dialog->well_known.bit_depth = -1;
+
+
+ /* standard options */
+ standard_hbox = gtk_hbox_new(FALSE, 2);
+ gtk_widget_show(standard_hbox);
+ standard_vbox = gtk_vbox_new(/* homogeneous */ FALSE, 0);
+ gtk_widget_show(standard_vbox);
+/* gtk_box_pack_start(GTK_BOX(standard_hbox), standard_vbox, FALSE, FALSE, 0); */ /* make frame fixed */
+ gtk_box_pack_start(GTK_BOX(standard_hbox), standard_vbox, TRUE, TRUE, 0); /* make frame sizeable */
+
+ /* advanced options */
+ advanced_hbox = gtk_hbox_new(FALSE, 2);
+ gtk_widget_show(advanced_hbox);
+ advanced_vbox = gtk_vbox_new(/* homogeneous */ FALSE, 0);
+ gtk_widget_show(advanced_vbox);
+/* gtk_box_pack_start(GTK_BOX(advanced_hbox), advanced_vbox, FALSE, FALSE, 0); */ /* make frame fixed */
+ gtk_box_pack_start(GTK_BOX(advanced_hbox), advanced_vbox, TRUE, TRUE, 0); /* make frame sizeable */
+
+
+ vector_opts = alloca(dialog->num_elements * sizeof (int));
+
+ parent = standard_vbox;
+ for (i = 1; i < dialog->num_elements; ++i)
+ {
+ opt = sane_get_option_descriptor (dev, i);
+ if (!SANE_OPTION_IS_ACTIVE(opt->cap))
+ continue;
+
+ /* pick up well-known options as we go: */
+ if (opt->name)
+ {
+ if (strcmp(opt->name, SANE_NAME_PREVIEW) == 0 && opt->type == SANE_TYPE_BOOL)
+ {
+ dialog->well_known.preview = i;
+ continue;
+ }
+ else if (strcmp(opt->name, SANE_NAME_SCAN_RESOLUTION) == 0
+ && opt->unit == SANE_UNIT_DPI && (opt->type == SANE_TYPE_INT || opt->type == SANE_TYPE_FIXED))
+ dialog->well_known.dpi = i;
+ else if (strcmp(opt->name, SANE_NAME_SCAN_X_RESOLUTION) == 0
+ && opt->unit == SANE_UNIT_DPI && (opt->type == SANE_TYPE_INT || opt->type == SANE_TYPE_FIXED))
+ dialog->well_known.dpi_x = i;
+ else if (strcmp(opt->name, SANE_NAME_SCAN_Y_RESOLUTION) == 0
+ && opt->unit == SANE_UNIT_DPI && (opt->type == SANE_TYPE_INT || opt->type == SANE_TYPE_FIXED))
+ dialog->well_known.dpi_y = i;
+ else if (strcmp (opt->name, SANE_NAME_SCAN_MODE) == 0)
+ dialog->well_known.scanmode = i;
+ else if (strcmp (opt->name, SANE_NAME_SCAN_SOURCE) == 0)
+ dialog->well_known.scansource = i;
+ else if (strcmp (opt->name, SANE_NAME_SCAN_TL_X) == 0)
+ dialog->well_known.coord[xsane_back_gtk_TL_X] = i;
+ else if (strcmp (opt->name, SANE_NAME_SCAN_TL_Y) == 0)
+ dialog->well_known.coord[xsane_back_gtk_TL_Y] = i;
+ else if (strcmp (opt->name, SANE_NAME_SCAN_BR_X) == 0)
+ dialog->well_known.coord[xsane_back_gtk_BR_X] = i;
+ else if (strcmp (opt->name, SANE_NAME_SCAN_BR_Y) == 0)
+ dialog->well_known.coord[xsane_back_gtk_BR_Y] = i;
+ else if (strcmp (opt->name, SANE_NAME_GAMMA_VECTOR) == 0)
+ dialog->well_known.gamma_vector = i;
+ else if (strcmp (opt->name, SANE_NAME_GAMMA_VECTOR_R) == 0)
+ dialog->well_known.gamma_vector_r = i;
+ else if (strcmp (opt->name, SANE_NAME_GAMMA_VECTOR_G) == 0)
+ dialog->well_known.gamma_vector_g = i;
+ else if (strcmp (opt->name, SANE_NAME_GAMMA_VECTOR_B) == 0)
+ dialog->well_known.gamma_vector_b = i;
+ else if (strcmp (opt->name, SANE_NAME_BIT_DEPTH) == 0)
+ dialog->well_known.bit_depth = i;
+ }
+
+ elem = dialog->element + i;
+ elem->dialog = dialog;
+
+
+ if (opt->unit == SANE_UNIT_NONE)
+ {
+ snprintf(title, sizeof(title), "%s", _BGT(opt->title));
+ }
+ else
+ {
+ snprintf(title, sizeof(title), "%s [%s]", _BGT(opt->title), xsane_back_gtk_unit_string(opt->unit));
+ }
+
+ switch (opt->type)
+ {
+ case SANE_TYPE_GROUP:
+ /* group a set of options */
+ vbox = standard_vbox;
+ if (opt->cap & SANE_CAP_ADVANCED)
+ {
+ vbox = advanced_vbox;
+ }
+ parent = xsane_back_gtk_group_new(vbox, title);
+ elem->widget = parent;
+ break;
+
+ case SANE_TYPE_BOOL:
+ assert(opt->size == sizeof(SANE_Word));
+ status = sane_control_option(dialog->dev, i, SANE_ACTION_GET_VALUE, &val, 0);
+ if (status != SANE_STATUS_GOOD)
+ {
+ goto get_value_failed;
+ }
+ xsane_back_gtk_button_new(parent, title, val, elem, dialog->tooltips, _BGT(opt->desc), SANE_OPTION_IS_SETTABLE(opt->cap));
+ gtk_widget_show(parent->parent);
+ break;
+
+ case SANE_TYPE_INT:
+ if (opt->size != sizeof(SANE_Word))
+ {
+ vector_opts[num_vector_opts++] = i;
+ break;
+ }
+ status = sane_control_option(dialog->dev, i, SANE_ACTION_GET_VALUE, &val, 0);
+ if (status != SANE_STATUS_GOOD)
+ {
+ goto get_value_failed;
+ }
+
+ switch (opt->constraint_type)
+ {
+ case SANE_CONSTRAINT_RANGE:
+ if ( (strcmp(opt->name, SANE_NAME_SCAN_RESOLUTION) ) && /* do not show resolution */
+ (strcmp(opt->name, SANE_NAME_SCAN_X_RESOLUTION)) && /* do not show x-resolution */
+ (strcmp(opt->name, SANE_NAME_SCAN_Y_RESOLUTION)) ) /* do not show y-resolution */
+ {
+ /* use a scale */
+ quant = opt->constraint.range->quant;
+ if (quant == 0)
+ quant = 1;
+ xsane_back_gtk_scale_new(parent, title, val, opt->constraint.range->min, opt->constraint.range->max, quant,
+ (opt->cap & SANE_CAP_AUTOMATIC), elem, dialog->tooltips, _BGT(opt->desc), SANE_OPTION_IS_SETTABLE(opt->cap));
+ gtk_widget_show(parent->parent);
+ }
+ break;
+
+ case SANE_CONSTRAINT_WORD_LIST:
+ if ( (strcmp(opt->name, SANE_NAME_SCAN_RESOLUTION) ) && /* do not show resolution */
+ (strcmp(opt->name, SANE_NAME_SCAN_X_RESOLUTION)) && /* do not show x-resolution */
+ (strcmp(opt->name, SANE_NAME_SCAN_Y_RESOLUTION)) ) /* do not show y-resolution */
+ {
+ /* use a "list-selection" widget */
+ num_words = opt->constraint.word_list[0];
+ str_list = malloc((num_words + 1) * sizeof(str_list[0]));
+ for (j = 0; j < num_words; ++j)
+ {
+ sprintf(str, "%d", opt->constraint.word_list[j + 1]);
+ str_list[j] = strdup(str);
+ }
+ str_list[j] = 0;
+ sprintf(str, "%d", val);
+ xsane_back_gtk_option_menu_new(parent, title, str_list, str, elem, dialog->tooltips, _BGT(opt->desc),
+ SANE_OPTION_IS_SETTABLE(opt->cap));
+ free(str_list);
+ gtk_widget_show(parent->parent);
+ }
+ break;
+
+ default:
+ fprintf(stderr, "xsane_panel_build: %s %d!\n", ERR_UNKNOWN_CONSTRAINT_TYPE, opt->constraint_type);
+ break;
+ }
+ break;
+
+ case SANE_TYPE_FIXED:
+ if (opt->size != sizeof (SANE_Word))
+ {
+ vector_opts[num_vector_opts++] = i;
+ break;
+ }
+ status = sane_control_option(dialog->dev, i, SANE_ACTION_GET_VALUE, &val, 0);
+ if (status != SANE_STATUS_GOOD)
+ {
+ goto get_value_failed;
+ }
+
+ switch (opt->constraint_type)
+ {
+ case SANE_CONSTRAINT_RANGE:
+ if ( (strcmp(opt->name, SANE_NAME_SCAN_RESOLUTION) ) && /* do not show resolution */
+ (strcmp(opt->name, SANE_NAME_SCAN_X_RESOLUTION)) && /* do not show x-resolution */
+ (strcmp(opt->name, SANE_NAME_SCAN_Y_RESOLUTION)) ) /* do not show y-resolution */
+ {
+ /* use a scale */
+ quant = opt->constraint.range->quant;
+ if (quant == 0)
+ quant = 1;
+ dval = SANE_UNFIX(val);
+ dmin = SANE_UNFIX(opt->constraint.range->min);
+ dmax = SANE_UNFIX(opt->constraint.range->max);
+ dquant = SANE_UNFIX(quant);
+ if (opt->unit == SANE_UNIT_MM)
+ {
+ dval /= preferences.length_unit;
+ dmin /= preferences.length_unit;
+ dmax /= preferences.length_unit;
+ dquant /= preferences.length_unit;
+ }
+ xsane_back_gtk_scale_new(parent, title, dval, dmin, dmax, dquant, (opt->cap & SANE_CAP_AUTOMATIC), elem,
+ dialog->tooltips, _BGT(opt->desc), SANE_OPTION_IS_SETTABLE(opt->cap));
+ gtk_widget_show(parent->parent);
+ }
+ break;
+
+ case SANE_CONSTRAINT_WORD_LIST:
+ if ( (strcmp(opt->name, SANE_NAME_SCAN_RESOLUTION) ) && /* do not show resolution */
+ (strcmp(opt->name, SANE_NAME_SCAN_X_RESOLUTION)) && /* do not show x-resolution */
+ (strcmp(opt->name, SANE_NAME_SCAN_Y_RESOLUTION)) ) /* do not show y-resolution */
+ {
+ /* use a "list-selection" widget */
+ num_words = opt->constraint.word_list[0];
+ str_list = malloc ((num_words + 1) * sizeof (str_list[0]));
+ for (j = 0; j < num_words; ++j)
+ {
+ sprintf(str, "%g", SANE_UNFIX(opt->constraint.word_list[j + 1]));
+ str_list[j] = strdup (str);
+ }
+ str_list[j] = 0;
+ sprintf(str, "%g", SANE_UNFIX (val));
+ xsane_back_gtk_option_menu_new(parent, title, str_list, str, elem, dialog->tooltips, _BGT(opt->desc), SANE_OPTION_IS_SETTABLE(opt->cap));
+ free (str_list);
+ gtk_widget_show(parent->parent);
+ }
+ break;
+
+ default:
+ fprintf(stderr, "xsane_panel_build: %s %d!\n", ERR_UNKNOWN_CONSTRAINT_TYPE, opt->constraint_type);
+ break;
+ }
+ break;
+
+ case SANE_TYPE_STRING:
+ buf = malloc (opt->size);
+ status = sane_control_option(dialog->dev, i, SANE_ACTION_GET_VALUE, buf, 0);
+ if (status != SANE_STATUS_GOOD)
+ {
+ free (buf);
+ goto get_value_failed;
+ }
+
+ switch (opt->constraint_type)
+ {
+ case SANE_CONSTRAINT_STRING_LIST:
+ if ( (strcmp (opt->name, SANE_NAME_SCAN_MODE) != 0) && /* do not show scanmode */
+ (strcmp (opt->name, SANE_NAME_SCAN_SOURCE) != 0) ) /* do not show scansource */
+ {
+ /* use a "list-selection" widget */
+ xsane_back_gtk_option_menu_new(parent, title, (char **) opt->constraint.string_list, buf,
+ elem, dialog->tooltips, _BGT(opt->desc), SANE_OPTION_IS_SETTABLE(opt->cap));
+ gtk_widget_show (parent->parent);
+ }
+ break;
+
+ case SANE_CONSTRAINT_NONE:
+ xsane_back_gtk_text_entry_new(parent, title, buf, elem, dialog->tooltips, _BGT(opt->desc), SANE_OPTION_IS_SETTABLE(opt->cap));
+ gtk_widget_show (parent->parent);
+ break;
+
+ default:
+ fprintf(stderr, "xsane_panel_build: %s %d!\n", ERR_UNKNOWN_CONSTRAINT_TYPE, opt->constraint_type);
+ break;
+ }
+ free (buf);
+ break;
+
+ case SANE_TYPE_BUTTON:
+ button = gtk_button_new();
+ gtk_signal_connect(GTK_OBJECT (button), "clicked", (GtkSignalFunc) xsane_back_gtk_push_button_callback, elem);
+ xsane_back_gtk_set_tooltip(dialog->tooltips, button, _BGT(opt->desc));
+
+ label = gtk_label_new(title);
+ gtk_container_add(GTK_CONTAINER (button), label);
+
+ gtk_box_pack_start(GTK_BOX (parent), button, FALSE, TRUE, 0);
+
+ gtk_widget_show(label);
+ gtk_widget_show(button);
+
+ gtk_widget_set_sensitive(button, SANE_OPTION_IS_SETTABLE(opt->cap));
+
+ elem->widget = button;
+ gtk_widget_show(parent->parent);
+ break;
+
+ default:
+ fprintf(stderr, "xsane_panel_build: %s %d\n", ERR_UNKNOWN_TYPE, opt->type);
+ break;
+ }
+ continue;
+
+ get_value_failed:
+ {
+ char msg[256];
+
+ sprintf(msg, "%s %s: %s.", ERR_GET_OPTION, opt->name, XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(msg, TRUE);
+ }
+ }
+
+ if ((dialog->well_known.dpi_x == -1) && (dialog->well_known.dpi_y != -1))
+ {
+ dialog->well_known.dpi_x = dialog->well_known.dpi;
+ }
+
+ xsane_hbox = xsane_update_xsane_callback();
+
+ gtk_container_add(GTK_CONTAINER(dialog->xsane_window), xsane_hbox);
+ gtk_container_add(GTK_CONTAINER(dialog->standard_window), standard_hbox);
+ gtk_container_add(GTK_CONTAINER(dialog->advanced_window), advanced_hbox);
+
+ dialog->xsane_hbox = xsane_hbox;
+ dialog->standard_hbox = standard_hbox;
+ dialog->advanced_hbox = advanced_hbox;
+
+ xsane_update_histogram();
+/*
+ xsane_draw_slider_level(&xsane.slider_gray);
+ xsane_draw_slider_level(&xsane.slider_red);
+ xsane_draw_slider_level(&xsane.slider_green);
+ xsane_draw_slider_level(&xsane.slider_blue);
+*/
+ xsane_update_sliders();
+
+ if (xsane.length_unit_widget)
+ {
+ int unit;
+
+ status = xsane_get_area_value(dialog->well_known.coord[0], 0, &unit);
+
+ if ( (unit == SANE_UNIT_PIXEL) || (status) )
+ {
+ gtk_widget_set_sensitive(xsane.length_unit_widget, FALSE);
+ }
+ else
+ {
+ gtk_widget_set_sensitive(xsane.length_unit_widget, TRUE);
+ }
+ }
+
+ /* now add in vector editor, if necessary: */
+/*
+ if (num_vector_opts)
+ vector_new (dialog, custom_gamma_vbox, num_vector_opts, vector_opts);
+*/
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* Create the main dialog box. */
+
+static void xsane_device_dialog(void)
+{
+ GtkWidget *hbox, *button, *frame, *infobox;
+ GtkWidget *main_dialog_window, *standard_dialog_window, *advanced_dialog_window;
+ GtkWidget *menubar, *menubar_item;
+ const gchar *devname;
+ char buf[256];
+ char windowname[255];
+ char devicetext[255];
+ char *textptr;
+ GtkWidget *xsane_window;
+ GtkWidget *xsane_vbox_main;
+ GtkWidget *xsane_vbox_standard;
+ GtkWidget *xsane_vbox_advanced;
+ GdkColormap *colormap;
+ SANE_Int num_elements;
+ SANE_Status status;
+ SANE_Handle dev;
+
+
+ devname = devlist[seldev]->name;
+
+ status = sane_open(devname, &dev);
+ if (status != SANE_STATUS_GOOD)
+ {
+ snprintf(buf, sizeof(buf), "%s `%s':\n %s.", ERR_DEVICE_OPEN_FAILED, devname, XSANE_STRSTATUS(status));
+ xsane_back_gtk_error(buf, TRUE);
+ return;
+ }
+
+ if (sane_control_option(dev, 0, SANE_ACTION_GET_VALUE, &num_elements, 0) != SANE_STATUS_GOOD)
+ {
+ xsane_back_gtk_error(ERR_OPTION_COUNT, TRUE);
+ sane_close(dev);
+ return;
+ }
+
+ snprintf(buf, sizeof(buf), "%s", devlist[seldev]->name); /* generate "sane-BACKENDNAME" */
+ textptr = strrchr(buf, ':'); /* format is midend:midend:midend:backend:device or backend:device */
+ if (textptr)
+ {
+ *textptr = 0; /* erase ":device" at end of text */
+ textptr = strrchr(buf, ':');
+ if (textptr) /* midend:backend:device */
+ {
+ textptr++;
+ }
+ else /* backend:device */
+ {
+ textptr = buf;
+ }
+
+ xsane.backend = malloc(strlen(textptr)+6);
+ sprintf(xsane.backend, "sane-%s", textptr); /* add "sane-" */
+
+ bindtextdomain(xsane.backend, LOCALEDIR); /* set path for backend translation texts */
+ }
+
+ /* create device-text for window titles */
+
+ snprintf(devicetext, sizeof(devicetext), "%s", devlist[seldev]->model);
+ textptr = devicetext + strlen(devicetext);
+ while (*(textptr-1) == ' ') /* erase spaces at end of text */
+ {
+ textptr--;
+ }
+
+ *textptr = ':';
+ textptr++;
+ *textptr = 0;
+
+ if (!strncmp(devname, "net:", 4)) /* network device ? */
+ {
+ sprintf(textptr, "net:");
+ textptr = devicetext + strlen(devicetext);
+ }
+
+ snprintf(buf, sizeof(buf), ":%s", devname);
+ snprintf(buf, sizeof(buf), "/%s", (strrchr(buf, ':')+1));
+ sprintf(textptr, (strrchr(buf, '/')+1));
+
+ device_text = strdup(devicetext);
+
+
+ /* if no preferences filename is given on commandline create one from devicenaname */
+
+ if (!xsane.device_set_filename)
+ {
+ if (!strcmp(devlist[seldev]->vendor, TEXT_UNKNOWN))
+ {
+ snprintf(buf, sizeof(buf), "%s", devlist[seldev]->name);
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "%s:%s", devlist[seldev]->vendor, devlist[seldev]->model);
+ }
+ xsane.device_set_filename = strdup(buf); /* set preferences filename */
+ }
+
+
+ xsane_pref_restore(); /* restore preferences */
+
+ if (xsane.main_window_fixed == -1) /* no command line option given */
+ {
+ xsane.main_window_fixed = preferences.main_window_fixed;
+ }
+
+
+ /* create the xsane dialog box */
+
+ xsane.shell = gtk_dialog_new();
+ gtk_widget_set_uposition(xsane.shell, XSANE_SHELL_POS_X, XSANE_SHELL_POS_Y);
+ sprintf(windowname, "%s %s %s", prog_name, XSANE_VERSION, device_text);
+ gtk_window_set_title(GTK_WINDOW(xsane.shell), (char *) windowname);
+ gtk_signal_connect(GTK_OBJECT(xsane.shell), "delete_event", GTK_SIGNAL_FUNC(xsane_scan_win_delete), 0);
+
+ xsane_set_window_icon(xsane.shell, 0);
+
+ /* set the main vbox */
+
+ xsane_window = GTK_DIALOG(xsane.shell)->vbox;
+ gtk_widget_show(xsane_window); /* normally not necessary, but to be sure */
+
+ /* create the menubar */
+
+ menubar = gtk_menu_bar_new();
+ gtk_box_pack_start(GTK_BOX(xsane_window), menubar, FALSE, FALSE, 0);
+
+ /* "Files" submenu: */
+ menubar_item = gtk_menu_item_new_with_label(MENU_FILE);
+ gtk_container_add(GTK_CONTAINER(menubar), menubar_item);
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubar_item), xsane_files_build_menu());
+ gtk_widget_show(menubar_item);
+
+ /* "Preferences" submenu: */
+ menubar_item = gtk_menu_item_new_with_label(MENU_PREFERENCES);
+ gtk_container_add(GTK_CONTAINER(menubar), menubar_item);
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubar_item), xsane_pref_build_menu());
+ gtk_widget_show(menubar_item);
+
+ /* "View" submenu: */
+ menubar_item = gtk_menu_item_new_with_label(MENU_VIEW);
+ gtk_container_add(GTK_CONTAINER(menubar), menubar_item);
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubar_item), xsane_view_build_menu());
+ gtk_widget_show(menubar_item);
+
+
+ /* "Help" submenu: */
+ menubar_item = gtk_menu_item_new_with_label(MENU_HELP);
+ gtk_container_add(GTK_CONTAINER(menubar), menubar_item);
+ gtk_menu_item_right_justify((GtkMenuItem *) menubar_item);
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menubar_item), xsane_help_build_menu());
+ gtk_widget_show(menubar_item);
+
+ gtk_widget_show(menubar);
+
+ if (xsane.main_window_fixed) /* fixed window: use it like it is */
+ {
+ /* shrink grow auto_shrink */
+ gtk_window_set_policy(GTK_WINDOW(xsane.shell), FALSE, FALSE, TRUE); /* auto size */
+
+ xsane_vbox_main = gtk_vbox_new(TRUE, 5); /* we need this to set the wanted borders */
+ gtk_container_set_border_width(GTK_CONTAINER(xsane_vbox_main), 5);
+ gtk_container_add(GTK_CONTAINER(xsane_window), xsane_vbox_main);
+ }
+ else /* scrolled window: create a scrolled window and put it into the xsane dialog box */
+ {
+ gtk_window_set_default_size(GTK_WINDOW(xsane.shell), XSANE_SHELL_WIDTH, XSANE_SHELL_HEIGHT); /* set default size */
+
+ /* shrink grow auto_shrink */
+ gtk_window_set_policy(GTK_WINDOW(xsane.shell), TRUE, TRUE, FALSE); /* allow resizing */
+
+ xsane.main_dialog_scrolled = gtk_scrolled_window_new(0, 0);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(xsane.main_dialog_scrolled),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+ gtk_container_add(GTK_CONTAINER(xsane_window), xsane.main_dialog_scrolled);
+ gtk_widget_show(xsane.main_dialog_scrolled);
+
+ xsane_vbox_main = gtk_vbox_new(TRUE, 5);
+ gtk_container_set_border_width(GTK_CONTAINER(xsane_vbox_main), 5);
+ gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(xsane.main_dialog_scrolled), xsane_vbox_main);
+ }
+
+ /* create a subwindow so the standard dialog keeps its position on rebuilds: */
+ main_dialog_window = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(xsane_vbox_main), main_dialog_window, TRUE, TRUE, 0);
+ gtk_widget_show(main_dialog_window);
+
+ gtk_widget_show(xsane_vbox_main);
+
+
+ /* create the scanner standard options dialog box */
+
+ xsane.standard_options_shell = gtk_window_new(GTK_WINDOW_DIALOG);
+ gtk_widget_set_uposition(xsane.standard_options_shell, XSANE_STD_OPTIONS_POS_X, XSANE_STD_OPTIONS_POS_Y);
+ sprintf(windowname, "%s %s", WINDOW_STANDARD_OPTIONS, device_text);
+ gtk_window_set_title(GTK_WINDOW(xsane.standard_options_shell), (char *) windowname);
+
+ /* shrink grow auto_shrink */
+ gtk_window_set_policy(GTK_WINDOW(xsane.standard_options_shell), FALSE, FALSE, TRUE);
+ gtk_signal_connect(GTK_OBJECT(xsane.standard_options_shell), "delete_event",
+ GTK_SIGNAL_FUNC(xsane_standard_option_win_delete), 0);
+
+ xsane_set_window_icon(xsane.standard_options_shell, 0);
+
+ xsane_vbox_standard = gtk_vbox_new(TRUE, 5);
+ gtk_container_set_border_width(GTK_CONTAINER(xsane_vbox_standard), 5);
+ gtk_container_add(GTK_CONTAINER(xsane.standard_options_shell), xsane_vbox_standard);
+ gtk_widget_show(xsane_vbox_standard);
+
+ /* create a subwindow so the standard dialog keeps its position on rebuilds: */
+ standard_dialog_window = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(xsane_vbox_standard), standard_dialog_window, TRUE, TRUE, 0);
+ gtk_widget_show(standard_dialog_window);
+
+
+
+ /* create the scanner advanced options dialog box */
+
+ xsane.advanced_options_shell = gtk_window_new(GTK_WINDOW_DIALOG);
+ gtk_widget_set_uposition(xsane.advanced_options_shell, XSANE_ADV_OPTIONS_POS_X, XSANE_ADV_OPTIONS_POS_Y);
+ sprintf(windowname, "%s %s",WINDOW_ADVANCED_OPTIONS, device_text);
+ gtk_window_set_title(GTK_WINDOW(xsane.advanced_options_shell), (char *) windowname);
+
+ /* shrink grow auto_shrink */
+ gtk_window_set_policy(GTK_WINDOW(xsane.advanced_options_shell), FALSE, FALSE, TRUE);
+ gtk_signal_connect(GTK_OBJECT(xsane.advanced_options_shell), "delete_event",
+ GTK_SIGNAL_FUNC(xsane_advanced_option_win_delete), 0);
+
+ xsane_set_window_icon(xsane.advanced_options_shell, 0);
+
+ xsane_vbox_advanced = gtk_vbox_new(TRUE, 5);
+ gtk_container_set_border_width(GTK_CONTAINER(xsane_vbox_advanced), 5);
+ gtk_container_add(GTK_CONTAINER(xsane.advanced_options_shell), xsane_vbox_advanced);
+ gtk_widget_show(xsane_vbox_advanced);
+
+ /* create a subwindow so the advanced dialog keeps its position on rebuilds: */
+ advanced_dialog_window = gtk_hbox_new(/* homogeneous */ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(xsane_vbox_advanced), advanced_dialog_window, TRUE, TRUE, 0);
+ gtk_widget_show(advanced_dialog_window);
+
+
+ dialog = malloc(sizeof (*dialog));
+ if (!dialog)
+ {
+ printf("Could not create dialog\n");
+ return;
+ }
+
+ /* fill in dialog structure */
+
+ memset(dialog, 0, sizeof(*dialog));
+
+ dialog->xsane_window = main_dialog_window;
+ dialog->standard_window = standard_dialog_window;
+ dialog->advanced_window = advanced_dialog_window;
+ dialog->dev = dev;
+ dialog->dev_name = strdup(devname);
+ dialog->num_elements = num_elements;
+ dialog->option_reload_callback = xsane_update_preview;
+ dialog->option_reload_arg = 0;
+ dialog->param_change_callback = xsane_update_param;
+ dialog->param_change_arg = 0;
+
+ dialog->element = malloc(num_elements * sizeof(dialog->element[0]));
+ memset(dialog->element, 0, num_elements * sizeof(dialog->element[0]));
+
+
+
+
+ /* realize xsane main dialog */
+ /* normally a realize should be ok, but then
+ the default size of the scrollwed window is ignored
+ so we use a widget_show in that case */
+
+ if (xsane.main_window_fixed)
+ {
+ gtk_widget_realize(xsane.shell);
+ }
+ else
+ {
+ gtk_widget_show(xsane.shell);
+ /* the disadavantage of this is that the main window does
+ not have the focus when every window is shown */
+ }
+
+
+ /* define tooltips colors */
+
+ dialog->tooltips = gtk_tooltips_new();
+ colormap = gdk_window_get_colormap(xsane.shell->window);
+
+/* I don`t know why the following does not work with gtk-1.2.x */
+/* but the gimp has the same problems ;-) */
+ /* use black as foreground: */
+ dialog->tooltips_fg.red = 0;
+ dialog->tooltips_fg.green = 0;
+ dialog->tooltips_fg.blue = 0;
+ gdk_color_alloc(colormap, &dialog->tooltips_fg);
+
+ /* postit yellow (khaki) as background: */
+ dialog->tooltips_bg.red = 61669;
+ dialog->tooltips_bg.green = 59113;
+ dialog->tooltips_bg.blue = 35979;
+ gdk_color_alloc(colormap, &dialog->tooltips_bg);
+
+/* as long as gtk_tooltips_set_colors() does not work : */
+#if 1
+ gtk_tooltips_force_window(dialog->tooltips);
+ {
+ GtkStyle *current_style = gtk_style_copy(gtk_widget_get_style(dialog->tooltips->tip_window));
+
+ current_style->bg[GTK_STATE_NORMAL] = dialog->tooltips_bg;
+ current_style->fg[GTK_STATE_NORMAL] = dialog->tooltips_fg;
+ gtk_widget_set_style(dialog->tooltips->tip_window, current_style);
+ }
+#else
+ gtk_tooltips_set_colors(dialog->tooltips, &dialog->tooltips_bg, &dialog->tooltips_fg);
+#endif
+ xsane_back_gtk_set_tooltips(dialog, preferences.tooltips_enabled);
+
+
+
+ /* create histogram dialog and set colors */
+ xsane_create_histogram_dialog(device_text); /* create the histogram dialog */
+
+
+ /* The bottom row of info and start button */
+
+#if 0
+ hbox = GTK_DIALOG(xsane.shell)->action_area;
+#endif
+
+ hbox = gtk_hbox_new(FALSE, 5);
+ gtk_box_pack_end(GTK_BOX(GTK_DIALOG(xsane.shell)->action_area), hbox, TRUE, TRUE, 0);
+ gtk_widget_show(hbox);
+
+ /* Info frame */
+ frame = gtk_frame_new(0);
+ gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
+#if 0
+ gtk_box_pack_start(GTK_BOX(hbox), frame, FALSE, FALSE, 0);
+#endif
+ gtk_box_pack_start(GTK_BOX(hbox), frame, TRUE, TRUE, 0);
+ gtk_widget_show(frame);
+
+ infobox = gtk_hbox_new(FALSE, 5);
+ gtk_container_set_border_width(GTK_CONTAINER(infobox), 2);
+ gtk_container_add(GTK_CONTAINER(frame), infobox);
+ gtk_widget_show(infobox);
+
+ xsane.info_label = gtk_label_new(TEXT_INFO_BOX);
+ gtk_box_pack_start(GTK_BOX(infobox), xsane.info_label, FALSE, FALSE, 0);
+#if 0
+ gtk_box_pack_start(GTK_BOX(infobox), xsane.info_label, TRUE, TRUE, 0);
+#endif
+ gtk_widget_show(xsane.info_label);
+
+
+ /* The Scan button */
+ button = gtk_button_new_with_label(BUTTON_START);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_scan_dialog, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+ xsane.start_button = GTK_OBJECT(button);
+
+
+ /* create backend dependend options */
+ xsane_panel_build(dialog);
+
+
+ /* create preview dialog */
+ xsane.preview = preview_new(dialog);
+ gtk_signal_connect(GTK_OBJECT(xsane.preview->top), "delete_event", GTK_SIGNAL_FUNC(xsane_preview_window_destroyed), 0);
+
+
+ xsane_device_preferences_restore(); /* restore device-settings */
+
+ xsane_update_param(dialog, 0);
+
+ gtk_widget_realize(xsane.standard_options_shell); /* is needed for saving window geometry */
+ gtk_widget_realize(xsane.advanced_options_shell);
+
+ if (preferences.show_standard_options)
+ {
+ gtk_widget_show(xsane.standard_options_shell);
+ }
+
+ if (preferences.show_advanced_options)
+ {
+ gtk_widget_show(xsane.advanced_options_shell);
+ }
+
+ gtk_widget_show(xsane.shell); /* call as last so focus is on it */
+
+ while (gtk_events_pending())
+ {
+ gtk_main_iteration();
+ }
+
+ xsane_device_preferences_restore(); /* restore device-settings */
+
+ xsane_update_sliders();
+
+ if (xsane.show_preview)
+ {
+ gtk_widget_show(xsane.preview->top);
+ }
+ else
+ {
+ gtk_widget_hide(xsane.preview->top);
+ }
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(xsane.show_preview_widget), xsane.show_preview);
+
+ xsane_set_all_resolutions(); /* make sure resolution, resolution_x and resolution_y are up to date */
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_choose_dialog_ok_callback(void)
+{
+ gtk_signal_disconnect_by_func(GTK_OBJECT(choose_device_dialog), GTK_SIGNAL_FUNC(xsane_quit), 0);
+ gtk_widget_destroy(choose_device_dialog);
+ xsane_device_dialog();
+
+ if (!dialog)
+ {
+ xsane_quit();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_select_device_by_key_callback(GtkWidget * widget, gpointer data)
+{
+ seldev = (long) data;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_select_device_by_mouse_callback(GtkWidget * widget, GdkEventButton *event, gpointer data)
+{
+ seldev = (long) data;
+ if (event->type == GDK_2BUTTON_PRESS && event->button == 1)
+ {
+ xsane_choose_dialog_ok_callback();
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static gint32 xsane_choose_device(void)
+{
+ GtkWidget *main_vbox, *vbox, *hbox, *button, *device_frame, *device_vbox, *pixmapwidget;
+ GdkBitmap *mask;
+ GdkPixmap *pixmap;
+ GtkStyle *style;
+ GdkColor *bg_trans;
+ GSList *owner;
+ gint i;
+ const SANE_Device *adev;
+ char buf[256];
+ char vendor[9];
+ char model[17];
+ char type[20];
+ int j;
+
+ choose_device_dialog = gtk_dialog_new();
+ gtk_window_set_position(GTK_WINDOW(choose_device_dialog), GTK_WIN_POS_CENTER);
+ gtk_window_set_policy(GTK_WINDOW(choose_device_dialog), FALSE, FALSE, FALSE);
+ gtk_signal_connect(GTK_OBJECT(choose_device_dialog), "destroy", GTK_SIGNAL_FUNC(xsane_quit), 0);
+ snprintf(buf, sizeof(buf), "%s %s", prog_name, WINDOW_DEVICE_SELECTION);
+ gtk_window_set_title(GTK_WINDOW(choose_device_dialog), buf);
+
+ main_vbox = GTK_DIALOG(choose_device_dialog)->vbox;
+
+ vbox = gtk_vbox_new(FALSE, 5);
+ gtk_container_set_border_width(GTK_CONTAINER(vbox), 3);
+ gtk_box_pack_start(GTK_BOX(main_vbox), vbox, TRUE, TRUE, 0);
+ gtk_widget_show(vbox);
+
+ /* xsane logo */
+ gtk_widget_realize(choose_device_dialog);
+
+ style = gtk_widget_get_style(choose_device_dialog);
+ bg_trans = &style->bg[GTK_STATE_NORMAL];
+
+ snprintf(buf, sizeof(buf), "%s/xsane-logo.xpm", STRINGIFY(PATH_SANE_DATA_DIR));
+ pixmap = gdk_pixmap_create_from_xpm(choose_device_dialog->window, &mask, bg_trans, buf);
+ pixmapwidget = gtk_pixmap_new(pixmap, mask);
+ gtk_box_pack_start(GTK_BOX(vbox), pixmapwidget, FALSE, FALSE, 2);
+ gtk_widget_show(pixmapwidget);
+ gdk_pixmap_unref(pixmap);
+
+ xsane_set_window_icon(choose_device_dialog, (gchar **) 0);
+
+ xsane_separator_new(vbox, 5);
+
+
+ /* list the drivers with radiobuttons */
+ device_frame = gtk_frame_new(TEXT_AVAILABLE_DEVICES);
+ gtk_box_pack_start(GTK_BOX(vbox), device_frame, FALSE, FALSE, 2);
+ gtk_widget_show(device_frame);
+
+ device_vbox = gtk_vbox_new(FALSE, 5);
+ gtk_container_set_border_width(GTK_CONTAINER(device_vbox), 3);
+ gtk_container_add(GTK_CONTAINER(device_frame), device_vbox);
+
+ owner = 0;
+ for (i = 0; i < ndevs; i++)
+ {
+ adev = devlist[i];
+
+ strncpy(vendor, adev->vendor, sizeof(vendor)-1);
+ vendor[sizeof(vendor)-1] = 0;
+ for (j = strlen(vendor); j < sizeof(vendor)-1; j++)
+ {
+ vendor[j] = ' ';
+ }
+
+ strncpy(model, adev->model, sizeof(model)-1);
+ model[sizeof(model)-1] = 0;
+ for (j = strlen(model); j < sizeof(model)-1; j++)
+ {
+ model[j] = ' ';
+ }
+
+ strncpy(type, _(adev->type), sizeof(type)-1); /* allow translation of device type */
+ type[sizeof(type)-1] = 0;
+ for (j = strlen(type); j < sizeof(type)-1; j++)
+ {
+ type[j] = ' ';
+ }
+
+ snprintf(buf, sizeof(buf), "%s %s %s [%s]", vendor, model, type, adev->name);
+ button = gtk_radio_button_new_with_label(owner, (char *) buf);
+ gtk_signal_connect(GTK_OBJECT(button), "button_press_event",
+ (GtkSignalFunc) xsane_select_device_by_mouse_callback, (void *) (long) i);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked",
+ (GtkSignalFunc) xsane_select_device_by_key_callback, (void *) (long) i);
+ gtk_box_pack_start(GTK_BOX(device_vbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+ owner = gtk_radio_button_group(GTK_RADIO_BUTTON(button));;
+ }
+ gtk_widget_show(device_vbox);
+
+ /* The bottom row of buttons */
+ hbox = GTK_DIALOG(choose_device_dialog)->action_area;
+
+ /* The OK button */
+ button = gtk_button_new_with_label(BUTTON_OK);
+ GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_choose_dialog_ok_callback, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_grab_default(button);
+ gtk_widget_show(button);
+
+ /* The Cancel button */
+ button = gtk_button_new_with_label(BUTTON_CANCEL);
+ gtk_signal_connect(GTK_OBJECT(button), "clicked", (GtkSignalFunc) xsane_quit, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
+ gtk_widget_show(choose_device_dialog);
+
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_usage(void)
+{
+ printf("%s %s %s\n", TEXT_USAGE, prog_name, TEXT_USAGE_OPTIONS);
+ printf("\n%s\n\n", TEXT_HELP);
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+static void xsane_init(int argc, char **argv)
+{
+ char filename[PATH_MAX];
+ struct stat st;
+
+ gtk_init(&argc, &argv);
+#ifdef HAVE_LIBGIMP_GIMP_H
+ gtk_rc_parse(gimp_gtkrc());
+
+ gdk_set_use_xshm(gimp_use_xshm());
+#endif
+
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, "xsane-style", 0, ".rc", XSANE_PATH_LOCAL_SANE);
+ if (stat(filename, &st) >= 0)
+ {
+ gtk_rc_parse(filename);
+ }
+ else /* no local xsane-style.rc, look for system file */
+ {
+ xsane_back_gtk_make_path(sizeof(filename), filename, "xsane", 0, "xsane-style", 0, ".rc", XSANE_PATH_SYSTEM);
+ if (stat(filename, &st) >= 0)
+ {
+ gtk_rc_parse(filename);
+ }
+ }
+
+ sane_init(&xsane.sane_backend_versioncode, (void *) xsane_authorization_callback);
+ if (SANE_VERSION_MAJOR(xsane.sane_backend_versioncode) != SANE_V_MAJOR)
+ {
+ fprintf(stderr, "\n\n"
+ "%s %s:\n"
+ " %s\n"
+ " %s %d\n"
+ " %s %d\n"
+ "%s\n\n",
+ prog_name, ERR_ERROR,
+ ERR_MAJOR_VERSION_NR_CONFLICT,
+ ERR_XSANE_MAJOR_VERSION, SANE_V_MAJOR,
+ ERR_BACKEND_MAJOR_VERSION, SANE_VERSION_MAJOR(xsane.sane_backend_versioncode),
+ ERR_PROGRAM_ABORTED);
+ return;
+ }
+
+ if (argc > 1)
+ {
+ int ch;
+
+ while((ch = getopt_long(argc, argv, "cd:fghnsvFR", long_options, 0)) != EOF)
+ {
+ switch(ch)
+ {
+ case 'g': /* This options is set when xsane is called from the */
+ /* GIMP. If xsane is compiled without GIMP support */
+ /* then you get the error message when GIMP does */
+ /* query or tries to start the xsane plugin! */
+#ifndef HAVE_LIBGIMP_GIMP_H
+ printf("%s: %s\n", argv[0], ERR_GIMP_SUPPORT_MISSING);
+ exit(0);
+#endif
+ break;
+
+ case 'v': /* --version */
+#ifdef HAVE_LIBGIMP_GIMP_H
+ printf("%s-%s, %s \"%s\", SANE-%d.%d, %s, %s%s\n",
+ prog_name,
+ XSANE_VERSION,
+ TEXT_PACKAGE,
+ PACKAGE_VERSION,
+ SANE_VERSION_MAJOR(xsane.sane_backend_versioncode),
+ SANE_VERSION_MINOR(xsane.sane_backend_versioncode),
+ TEXT_WITH_GIMP_SUPPORT,
+ TEXT_GIMP_VERSION,
+ GIMP_VERSION);
+#else
+ printf("%s-%s, %s \"%s\", SANE-%d.%d, %s\n",
+ prog_name,
+ XSANE_VERSION,
+ TEXT_PACKAGE,
+ PACKAGE_VERSION,
+ SANE_VERSION_MAJOR(xsane.sane_backend_versioncode),
+ SANE_VERSION_MINOR(xsane.sane_backend_versioncode),
+ TEXT_WITHOUT_GIMP_SUPPORT);
+#endif
+ exit(0);
+
+ case 'd': /* --device-settings */
+ xsane.device_set_filename = strdup(optarg);
+ break;
+
+ case 's': /* --scan */
+ xsane.xsane_mode = XSANE_SCAN;
+ break;
+
+ case 'c': /* --copy */
+ xsane.xsane_mode = XSANE_COPY;
+ break;
+
+ case 'n': /* --No-modes-election */
+ xsane.mode_selection = 0;
+ break;
+
+ case 'f': /* --fax */
+ xsane.xsane_mode = XSANE_FAX;
+ break;
+
+ case 'F': /* --Fixed */
+ xsane.main_window_fixed = 1;
+ break;
+
+ case 'R': /* --Resizeable */
+ xsane.main_window_fixed = 0;
+ break;
+
+ case 'h': /* --help */
+ default:
+ xsane_usage();
+ exit(0);
+ }
+ }
+ }
+
+ sane_get_devices(&devlist, SANE_FALSE /* local and network devices */);
+
+ /* if devicename is given try to identify it, if not found, open device list */
+ if (optind < argc)
+ {
+ int ndevs;
+
+ for (ndevs = 0; devlist[ndevs]; ++ndevs)
+ {
+ if (!strncmp(devlist[ndevs]->name, argv[argc - 1], strlen(argv[argc - 1])))
+ {
+ seldev = ndevs;
+ break;
+ }
+ }
+
+ if ((seldev < 0) && (argc > 1))
+ {
+ static SANE_Device dev;
+ static const SANE_Device *device_list[] = { &dev, 0 };
+
+ memset(&dev, 0, sizeof(dev));
+ dev.name = argv[argc - 1];
+ dev.vendor = TEXT_UNKNOWN;
+ dev.type = TEXT_UNKNOWN;
+ dev.model = TEXT_UNKNOWN;
+
+ devlist = device_list;
+ seldev = 0;
+ }
+ }
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+void xsane_interface(int argc, char **argv)
+{
+ xsane.info_label = 0;
+
+ xsane_init(argc, argv); /* initialize xsane variables if command line option is given, set seldev */
+
+ for (ndevs = 0; devlist[ndevs]; ++ndevs); /* count available devices */
+
+ if (seldev >= 0) /* device name is given on cammand line */
+ {
+ xsane_device_dialog(); /* open device seldev */
+
+ if (!dialog)
+ {
+ xsane_exit();
+ }
+ }
+ else /* no device name given on command line */
+ {
+ if (ndevs > 0) /* devices available */
+ {
+ seldev = 0;
+ if (ndevs == 1)
+ {
+ xsane_device_dialog(); /* open device seldev */
+ if (!dialog)
+ {
+ xsane_exit();
+ }
+ }
+ else
+ {
+ xsane_choose_device(); /* open device selection window and get device */
+ }
+ }
+ else /* ndevs == 0, no devices available */
+ {
+ char buf[256];
+
+ snprintf(buf, sizeof(buf), "%s: %s\n", prog_name, ERR_NO_DEVICES);
+ xsane_back_gtk_error(buf, TRUE);
+ xsane_exit();
+ }
+ }
+
+ gtk_main();
+ sane_exit();
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+int main(int argc, char **argv)
+{
+ dialog = 0;
+ memset(&xsane, 0, sizeof(xsane)); /* set all values in xsane to 0 */
+
+ umask(XSANE_DEFAULT_UMASK); /* define permissions of new files */
+
+ xsane.sensitivity = TRUE;
+
+ xsane.main_window_fixed = -1; /* no command line option given, use preferences or fixed */
+
+ xsane.mode = XSANE_STANDALONE;
+ xsane.xsane_mode = XSANE_SCAN;
+ xsane.xsane_output_format = XSANE_PNM;
+ xsane.mode_selection = 1; /* enable selection of xsane mode */
+
+ xsane.input_tag = -1; /* no input tag */
+
+ xsane.histogram_lines = 1;
+
+ xsane.zoom = 1.0;
+ xsane.zoom_x = 1.0;
+ xsane.zoom_y = 1.0;
+ xsane.resolution = 0.0;
+ xsane.resolution_x = 0.0;
+ xsane.resolution_y = 0.0;
+ xsane.copy_number = 1;
+
+ xsane.gamma = 1.0;
+ xsane.gamma_red = 1.0;
+ xsane.gamma_green = 1.0;
+ xsane.gamma_blue = 1.0;
+ xsane.brightness = 0.0;
+ xsane.brightness_red = 0.0;
+ xsane.brightness_green = 0.0;
+ xsane.brightness_blue = 0.0;
+ xsane.contrast = 0.0;
+ xsane.contrast_red = 0.0;
+ xsane.contrast_green = 0.0;
+ xsane.contrast_blue = 0.0;
+ xsane.slider_gray.value[2] = 100.0;
+ xsane.slider_gray.value[1] = 50.0;
+ xsane.slider_gray.value[0] = 0.0;
+ xsane.slider_red.value[2] = 100.0;
+ xsane.slider_red.value[1] = 50.0;
+ xsane.slider_red.value[0] = 0.0;
+ xsane.slider_green.value[2] = 100.0;
+ xsane.slider_green.value[1] = 50.0;
+ xsane.slider_green.value[0] = 0.0;
+ xsane.slider_blue.value[2] = 100.0;
+ xsane.slider_blue.value[1] = 50.0;
+ xsane.slider_blue.value[0] = 0.0;
+ xsane.auto_white = 100.0;
+ xsane.auto_gray = 50.0;
+ xsane.auto_black = 0.0;
+
+ xsane.histogram_red = 1;
+ xsane.histogram_green = 1;
+ xsane.histogram_blue = 1;
+ xsane.histogram_int = 1;
+ xsane.histogram_log = 1;
+
+ xsane.xsane_color = TRUE;
+ xsane.scanner_gamma_color = FALSE;
+ xsane.scanner_gamma_gray = FALSE;
+ xsane.enhancement_rgb_default = TRUE;
+
+ prog_name = strrchr(argv[0], '/');
+ if (prog_name)
+ {
+ ++prog_name;
+ }
+ else
+ {
+ prog_name = argv[0];
+ }
+#if 0
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+#endif
+ bindtextdomain(prog_name, LOCALEDIR);
+ textdomain(prog_name);
+
+#ifdef HAVE_LIBGIMP_GIMP_H
+ {
+ GPrintFunc old_print_func;
+ int result;
+
+ /* Temporarily install a print function that discards all output.
+ This is to avoid annoying "you must run this program under
+ gimp" messages when xsane gets invoked in stand-alone
+ mode. */
+ old_print_func = g_set_print_handler((GPrintFunc) null_print_func);
+
+ /* gimp_main() returns 1 if xsane wasn't invoked by GIMP */
+ result = gimp_main(argc, argv);
+ g_set_message_handler(old_print_func);
+ if (result)
+ {
+ xsane_interface(argc, argv);
+ }
+ }
+#else
+ xsane_interface(argc, argv);
+#endif
+ return 0;
+}
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
diff --git a/frontend/xsane.h b/frontend/xsane.h
new file mode 100644
index 0000000..69e6d2c
--- /dev/null
+++ b/frontend/xsane.h
@@ -0,0 +1,513 @@
+/* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend
+
+ xsane.h
+
+ Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+ Copyright (C) 1998-2000 Oliver Rauch
+ This file is part of the XSANE package.
+
+ 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 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifndef XSANE_H
+#define XSANE_H
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* #define XSANE_TEST */
+/* #define SUPPORT_RGBA */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#define XSANE_VERSION "0.50"
+#define XSANE_AUTHOR "Oliver Rauch"
+#define XSANE_COPYRIGHT "Oliver Rauch"
+#define XSANE_DATE "1998-2000"
+#define XSANE_EMAIL "Oliver.Rauch@Wolfsburg.DE"
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#define PATH_SANE_TMP "/tmp"
+// #define XSANE_DEFAULT_UMASK 0157
+#define XSANE_DEFAULT_UMASK 0007
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+/* needed for most of the xsane sources: */
+
+#ifdef _AIX
+# include <lalloca.h>
+#endif
+
+#include <assert.h>
+#include <errno.h>
+#include <memory.h>
+#include <pwd.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <signal.h>
+#include <getopt.h>
+#include <time.h>
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <sane/sane.h>
+#include <sane/saneopts.h>
+
+#include "sane/config.h"
+#include "sane/sanei_signal.h"
+
+#include "xsane-text.h"
+#include "xsane-icons.h"
+
+#ifdef ENABLE_NLS
+# include <libintl.h>
+# define _(String) gettext (String)
+# ifdef gettext_noop
+# define N_(String) gettext_noop (String)
+# else
+# define N_(String) (String)
+# endif
+#else
+/* Stubs that do something close enough. */
+# define textdomain(String) (String)
+# define gettext(String) (String)
+# define dgettext(Domain,Message) (Message)
+# define dcgettext(Domain,Message,Type) (Message)
+# define bindtextdomain(Domain,Directory) (Domain)
+# define _(String) (String)
+# define N_(String) (String)
+#endif
+
+/* ----------------------------- */
+
+/* needed for xsane.h */
+#include "xsane-back-gtk.h"
+#include "xsane-preferences.h"
+#include "xsane-preview.h"
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifdef HAVE_LIBGIMP_GIMP_H
+# include <libgimp/gimp.h>
+
+# ifdef HAVE_LIBGIMP_GIMPFEATURES_H
+# include <libgimp/gimpfeatures.h>
+# else
+# define GIMP_CHECK_VERSION(major, minor, micro) 0
+# endif /* HAVE_LIBGIMP_GIMPFEATURES_H */
+
+#endif /* HAVE_LIBGIMP_GIMP_H */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+enum { XSANE_SCAN, XSANE_COPY, XSANE_FAX };
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+extern void xsane_pref_save(void);
+extern void xsane_interface(int argc, char **argv);
+extern void xsane_fax_project_save(void);
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+extern const char *prog_name;
+extern const char *device_text;
+extern GtkWidget *choose_device_dialog;
+extern GSGDialog *dialog;
+extern const SANE_Device **devlist;
+extern gint seldev; /* The selected device */
+extern gint ndevs; /* The number of available devices */
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+extern int xsane_scanmode_number[];
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifndef PATH_MAX
+# define PATH_MAX 1024
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#define OUTFILENAME "out.pnm"
+#define FAXPROJECT "faxproject"
+#define FAXFILENAME "page-001.fax"
+#define PRINTERNAME "new printer"
+#define PRINTERCOMMAND "lpr -"
+#define PRINTERCOPYNUMBEROPTION "-#"
+#define FAXCOMMAND "sendfax"
+#define FAXRECEIVEROPT "-d"
+#define FAXPOSTSCRIPTOPT ""
+#define FAXNORMALOPT "-l"
+#define FAXFINEOPT "-m"
+#define FAXVIEWER "xv"
+#define DOCVIEWERNETSCAPEREMOTE "netscape-remote"
+#define DOCVIEWER DOCVIEWERNETSCAPEREMOTE
+
+#define XSANE_BRIGHTNESS_MIN -400.0
+#define XSANE_BRIGHTNESS_MAX 400.0
+#define XSANE_CONTRAST_GRAY_MIN -100.0
+#define XSANE_CONTRAST_MIN -400.0
+#define XSANE_CONTRAST_MAX 400.0
+#define XSANE_GAMMA_MIN 0.3
+#define XSANE_GAMMA_MAX 3.0
+
+#define HIST_WIDTH 256
+#define HIST_HEIGHT 100
+#define XSANE_SHELL_WIDTH 296
+#define XSANE_SHELL_HEIGHT 451
+#define XSANE_SHELL_POS_X 1
+#define XSANE_SHELL_POS_Y 50
+#define XSANE_HISTOGRAM_POS_X 280
+#define XSANE_HISTOGRAM_POS_Y 50
+#define XSANE_STD_OPTIONS_POS_X 1
+#define XSANE_STD_OPTIONS_POS_Y 400
+#define XSANE_ADV_OPTIONS_POS_X 280
+#define XSANE_ADV_OPTIONS_POS_Y 420
+#define XSANE_PREVIEW_POS_X 560
+#define XSANE_PREVIEW_POS_Y 50
+#define XSANE_PREVIEW_WIDTH 100
+#define XSANE_PREVIEW_HEIGHT 100
+
+#define XSANE_SLIDER_ACTIVE 0
+#define XSANE_SLIDER_INACTIVE 4
+#define XSANE_SLIDER_WIDTH 260
+#define XSANE_SLIDER_HEIGHT 10
+#define XSANE_SLIDER_OFFSET 2
+#define XSANE_SLIDER_EVENTS GDK_EXPOSURE_MASK | GDK_ENTER_NOTIFY_MASK | \
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | \
+ GDK_BUTTON1_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK
+#define INF 5.0e9
+#define MM_PER_INCH 25.4
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#ifndef SANE_NAME_DOCUMENT_FEEDER
+#define SANE_NAME_DOCUMENT_FEEDER "Automatic Document Feeder"
+#endif
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#define STRINGIFY1(x) #x
+#define STRINGIFY(x) STRINGIFY1(x)
+
+#define NELEMS(a) ((int)(sizeof (a) / sizeof (a[0])))
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+enum
+{
+ XSANE_UNKNOWN, XSANE_PNM, XSANE_JPEG, XSANE_PNG, XSANE_PS, XSANE_TIFF, XSANE_RGBA,
+ XSANE_RAW16, XSANE_PNM16
+};
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+enum
+{
+ XSANE_STANDALONE, XSANE_GIMP_EXTENSION
+};
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+typedef struct XsaneProgress_t
+{
+ GtkSignalFunc callback;
+ gpointer callback_data;
+ GtkWidget *shell;
+ GtkWidget *pbar;
+} XsaneProgress_t;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+typedef struct XsanePixmap
+{
+ GtkWidget *frame;
+ GdkPixmap *pixmap;
+ GtkWidget *pixmapwid;
+} XsanePixmap;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+typedef struct XsaneSlider
+{
+ int position[3];
+ double value[3];
+ double min, max;
+ int active;
+ GtkWidget *preview;
+ int r, g, b;
+} XsaneSlider;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+typedef struct Xsane
+{
+ SANE_Int sane_backend_versioncode;
+ char *backend;
+ char *device_set_filename;
+ char *filetype;
+ char *output_filename;
+ char *dummy_filename;
+
+ SANE_Int sensitivity;
+
+ /* dialogs */
+ GtkWidget *shell;
+ GtkWidget *standard_options_shell;
+ GtkWidget *advanced_options_shell;
+ GtkWidget *main_dialog_scrolled;
+ GtkWidget *histogram_dialog;
+ GtkWidget *fax_dialog;
+ GtkWidget *fax_list;
+
+ GtkWidget *fax_project_box;
+ GtkWidget *fax_project_exists;
+ GtkWidget *fax_project_not_exists;
+
+ GdkPixmap *window_icon_pixmap;
+ GdkBitmap *window_icon_mask;
+
+ /* window position and geometry */
+ SANE_Int shell_posx;
+ SANE_Int shell_posy;
+ SANE_Int shell_height;
+ SANE_Int shell_width;
+ SANE_Int standard_options_shell_posx;
+ SANE_Int standard_options_shell_posy;
+ SANE_Int advanced_options_shell_posx;
+ SANE_Int advanced_options_shell_posy;
+ SANE_Int histogram_dialog_posx;
+ SANE_Int histogram_dialog_posy;
+ SANE_Int preview_dialog_posx;
+ SANE_Int preview_dialog_posy;
+ SANE_Int preview_dialog_width;
+ SANE_Int preview_dialog_height;
+
+ GtkWidget *hruler;
+ GtkWidget *vruler;
+ GtkWidget *info_label;
+ GtkObject *start_button;
+ Preview *preview;
+ gint32 mode;
+
+ int main_window_fixed;
+ int mode_selection;
+
+ /* various scanning related state: */
+ size_t num_bytes;
+ size_t bytes_read;
+ XsaneProgress_t *progress;
+ int input_tag;
+ SANE_Parameters param;
+ int x, y;
+
+ /* for standalone mode: */
+ GtkWidget *filename_entry;
+ GtkWidget *fax_project_entry;
+ GtkWidget *fax_receiver_entry;
+ GtkWidget *filetype_option_menu;
+ FILE *out;
+ int xsane_mode;
+ int xsane_output_format;
+ long header_size;
+
+ /* histogram window */
+ struct XsanePixmap histogram_raw;
+ struct XsanePixmap histogram_enh;
+
+ struct XsaneSlider slider_gray;
+ struct XsaneSlider slider_red;
+ struct XsaneSlider slider_green;
+ struct XsaneSlider slider_blue;
+
+ int negative;
+ double gamma;
+ double gamma_red;
+ double gamma_green;
+ double gamma_blue;
+ double brightness;
+ double brightness_red;
+ double brightness_green;
+ double brightness_blue;
+ double contrast;
+ double contrast_red;
+ double contrast_green;
+ double contrast_blue;
+
+ double auto_white;
+ double auto_gray;
+ double auto_black;
+ double auto_white_red;
+ double auto_gray_red;
+ double auto_black_red;
+ double auto_white_green;
+ double auto_gray_green;
+ double auto_black_green;
+ double auto_white_blue;
+ double auto_gray_blue;
+ double auto_black_blue;
+
+ int histogram_red;
+ int histogram_green;
+ int histogram_blue;
+ int histogram_int;
+ int histogram_lines;
+ int histogram_log;
+
+ /* colors */
+ GdkGC *gc_red;
+ GdkGC *gc_green;
+ GdkGC *gc_blue;
+ GdkGC *gc_black;
+ GdkGC *gc_trans;
+ GdkGC *gc_backg;
+ GdkColor *bg_trans;
+
+ int copy_number;
+ double zoom;
+ double zoom_x;
+ double zoom_y;
+ double resolution;
+ double resolution_x;
+ double resolution_y;
+
+ GtkWidget *length_unit_widget;
+ GtkWidget *length_unit_mm;
+ GtkWidget *length_unit_cm;
+ GtkWidget *length_unit_in;
+ GtkWidget *update_policy_continu;
+ GtkWidget *update_policy_discont;
+ GtkWidget *update_policy_delayed;
+ GtkWidget *show_preview_widget;
+ GtkWidget *show_histogram_widget;
+ GtkWidget *show_standard_options_widget;
+ GtkWidget *show_advanced_options_widget;
+ GtkWidget *show_resolution_list_widget;
+ GtkObject *zoom_widget;
+ GtkObject *gamma_widget;
+ GtkObject *gamma_red_widget;
+ GtkObject *gamma_green_widget;
+ GtkObject *gamma_blue_widget;
+ GtkObject *brightness_widget;
+ GtkObject *brightness_red_widget;
+ GtkObject *brightness_green_widget;
+ GtkObject *brightness_blue_widget;
+ GtkObject *contrast_widget;
+ GtkObject *contrast_red_widget;
+ GtkObject *contrast_green_widget;
+ GtkObject *contrast_blue_widget;
+
+ SANE_Int xsane_color;
+ SANE_Bool show_preview;
+ SANE_Bool scanner_gamma_color;
+ SANE_Bool scanner_gamma_gray;
+ SANE_Bool enhancement_rgb_default;
+
+ SANE_Bool fax_fine_mode;
+
+ GtkWidget *outputfilename_entry;
+ GtkWidget *copy_number_entry;
+
+ SANE_Int *gamma_data, *gamma_data_red, *gamma_data_green, *gamma_data_blue;
+ SANE_Int *preview_gamma_data_red, *preview_gamma_data_green, *preview_gamma_data_blue;
+ SANE_Int *histogram_gamma_data_red, *histogram_gamma_data_green, *histogram_gamma_data_blue;
+
+ char *fax_filename;
+ char *fax_receiver;
+
+ int block_update_param;
+
+ int broken_pipe; /* for printercommand pipe */
+
+#ifdef HAVE_LIBGIMP_GIMP_H
+ /* for GIMP mode: */
+ gint32 image_ID;
+ GDrawable *drawable;
+ guchar *tile;
+ unsigned tile_offset;
+ GPixelRgn region;
+ int first_frame; /* used for RED/GREEN/BLUE frames */
+#endif
+} Xsane;
+
+extern struct Xsane xsane;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+typedef struct XsaneSetup
+{
+ GtkWidget *printer_name_entry;
+ GtkWidget *printer_command_entry;
+ GtkWidget *printer_copy_number_option_entry;
+ GtkWidget *printer_resolution_entry;
+ GtkWidget *printer_leftoffset_entry;
+ GtkWidget *printer_bottomoffset_entry;
+ GtkWidget *printer_gamma_entry;
+ GtkWidget *printer_gamma_red_entry;
+ GtkWidget *printer_gamma_green_entry;
+ GtkWidget *printer_gamma_blue_entry;
+ GtkWidget *printer_width_entry;
+ GtkWidget *printer_height_entry;
+
+ GtkWidget *jpeg_image_quality_scale;
+ GtkWidget *pnm_image_compression_scale;
+ GtkWidget *overwrite_warning_button;
+ GtkWidget *increase_filename_counter_button;
+ GtkWidget *skip_existing_numbers_button;
+
+ GtkWidget *main_window_fixed_button;
+
+ GtkWidget *preview_gamma_entry;
+ GtkWidget *preview_gamma_red_entry;
+ GtkWidget *preview_gamma_green_entry;
+ GtkWidget *preview_gamma_blue_entry;
+ GtkWidget *preview_preserve_button;
+ GtkWidget *preview_own_cmap_button;
+ GtkWidget *doc_viewer_entry;
+
+ GtkWidget *fax_command_entry;
+ GtkWidget *fax_receiver_option_entry;
+ GtkWidget *fax_postscript_option_entry;
+ GtkWidget *fax_normal_option_entry;
+ GtkWidget *fax_fine_option_entry;
+ GtkWidget *fax_viewer_entry;
+ GtkWidget *fax_width_entry;
+ GtkWidget *fax_leftoffset_entry;
+ GtkWidget *fax_bottomoffset_entry;
+ GtkWidget *fax_height_entry;
+
+ int tiff_compression_nr;
+ int tiff_compression_1_nr;
+
+ int image_permissions;
+ int directory_permissions;
+
+} XsaneSetup;
+
+extern struct XsaneSetup xsane_setup;
+
+/* ---------------------------------------------------------------------------------------------------------------------- */
+
+#endif
diff --git a/include/Makefile b/include/Makefile
new file mode 100644
index 0000000..214d47e
--- /dev/null
+++ b/include/Makefile
@@ -0,0 +1,8 @@
+# Generated automatically from Makefile.in by configure.
+# This is just a dummy to ensure that the include directory gets created
+# in a shadow-build.
+
+all:
+
+distclean:
+ rm -f Makefile
diff --git a/include/Makefile.in b/include/Makefile.in
new file mode 100644
index 0000000..c8de918
--- /dev/null
+++ b/include/Makefile.in
@@ -0,0 +1,7 @@
+# This is just a dummy to ensure that the include directory gets created
+# in a shadow-build.
+
+all:
+
+distclean:
+ rm -f Makefile
diff --git a/include/getopt.h b/include/getopt.h
new file mode 100644
index 0000000..aa7877f
--- /dev/null
+++ b/include/getopt.h
@@ -0,0 +1,129 @@
+/* Declarations for getopt.
+ Copyright (C) 1989, 90, 91, 92, 93, 94 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _GETOPT_H
+#define _GETOPT_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns EOF, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+ for unrecognized options. */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int optopt;
+
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of `struct option' terminated by an element containing a name which is
+ zero.
+
+ The field `has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field `flag' is not NULL, it points to a variable that is set
+ to the value given in the field `val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an `int' to
+ a compiled-in constant, such as set a value from `optarg', set the
+ option's `flag' field to zero and its `val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero `flag' field, `getopt'
+ returns the contents of the `val' field. */
+
+struct option
+{
+#if defined (__STDC__) && __STDC__
+ const char *name;
+#else
+ char *name;
+#endif
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'. */
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+#if defined (__STDC__) && __STDC__
+#ifdef __GNU_LIBRARY__
+/* Many other libraries have conflicting prototypes for getopt, with
+ differences in the consts, in stdlib.h. To avoid compilation
+ errors, only prototype getopt for the GNU C library. */
+extern int getopt (int argc, char *const *argv, const char *shortopts);
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+#endif /* __GNU_LIBRARY__ */
+extern int getopt_long (int argc, char *const *argv, const char *shortopts,
+ const struct option *longopts, int *longind);
+extern int getopt_long_only (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind);
+
+/* Internal only. Users should not call this directly. */
+extern int _getopt_internal (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind,
+ int long_only);
+#else /* not __STDC__ */
+extern int getopt ();
+extern int getopt_long ();
+extern int getopt_long_only ();
+
+extern int _getopt_internal ();
+#endif /* __STDC__ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GETOPT_H */
diff --git a/include/lalloca.h b/include/lalloca.h
new file mode 100644
index 0000000..0fd4fc1
--- /dev/null
+++ b/include/lalloca.h
@@ -0,0 +1,47 @@
+/* sane - Scanner Access Now Easy.
+ Copyright (C) 1997 The Free Software Foundation
+ This file is part of the SANE package.
+
+ SANE 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 2 of the License, or (at your
+ option) any later version.
+
+ SANE 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 sane; see the file COPYING. If not, write to the Free
+ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ This file implements a dynamic linking based SANE meta backend. It
+ allows managing an arbitrary number of SANE backends by using
+ dynamic linking to load backends on demand. */
+
+#ifndef lalloca_h
+#define lalloca_h
+
+/* AIX requires this to be the first thing in the file. */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+#pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+# if __STDC__
+void *alloca ();
+# else
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#endif /* lalloca_h */
diff --git a/include/sane/config.h.in b/include/sane/config.h.in
new file mode 100644
index 0000000..28fffdc
--- /dev/null
+++ b/include/sane/config.h.in
@@ -0,0 +1,342 @@
+#ifndef SANE_CONFIG_H
+#define SANE_CONFIG_H
+
+/* Define if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+#undef _ALL_SOURCE
+#endif
+
+/* Define if using alloca.c. */
+#undef C_ALLOCA
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c support on those systems. */
+#undef CRAY_STACKSEG_END
+
+/* Define if you have alloca, as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+#undef HAVE_ALLOCA_H
+
+/* Define if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define as __inline if that's what the C compiler calls it. */
+#undef inline
+
+/* Define if on MINIX. */
+#undef _MINIX
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef off_t
+
+/* Define if the system does not provide POSIX.1 features except
+ with this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
+/* Define to `unsigned char' if <sys/types.h> doesn't define. */
+#undef u_char
+
+/* Define to `unsigned int' if <sys/types.h> doesn't define. */
+#undef u_int
+
+/* Define to `unsigned long' if <sys/types.h> doesn't define. */
+#undef u_long
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef ssize_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef pid_t
+
+/* Define scsireq_t as `struct scsireq' if necessary. */
+#undef scsireq_t
+
+/* Define to the return type of signal handlers. */
+#undef RETSIGTYPE
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#undef STACK_DIRECTION
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if NLS is requested. */
+#undef ENABLE_NLS
+
+/* Define as 1 if you have catgets and don't want to use GNU gettext. */
+#undef HAVE_CATGETS
+
+/* Define as 1 if you have gettext and don't want to use GNU gettext. */
+#undef HAVE_GETTEXT
+
+/* Define if your locale.h file contains LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
+/* Define to 1 if you have the stpcpy function. */
+#undef HAVE_STPCPY
+
+/* Define to the name of the distribution. */
+#undef PACKAGE
+
+/* The concatenation of the strings PACKAGE, "-", and VERSION. */
+#undef PACKAGE_VERSION
+
+/* Define to the version of the distribution. */
+#undef VERSION
+
+/* Define if you have the __argz_count function. */
+#undef HAVE___ARGZ_COUNT
+
+/* Define if you have the __argz_next function. */
+#undef HAVE___ARGZ_NEXT
+
+/* Define if you have the __argz_stringify function. */
+#undef HAVE___ARGZ_STRINGIFY
+
+/* Define if you have the dcgettext function. */
+#undef HAVE_DCGETTEXT
+
+/* Define if you have the getcwd function. */
+#undef HAVE_GETCWD
+
+/* Define if you have the getpagesize function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define if you have the atexit function. */
+#undef HAVE_ATEXIT
+
+/* Define if you have the ioperm function. */
+#undef HAVE_IOPERM
+
+/* Define if you have the mkdir function. */
+#undef HAVE_MKDIR
+
+/* Define if you have the munmap function. */
+#undef HAVE_MUNMAP
+
+/* Define if you have the putenv function. */
+#undef HAVE_PUTENV
+
+/* Define if you have the scsireq_enter function. */
+#undef HAVE_SCSIREQ_ENTER
+
+/* Define if you have the sigprocmask function. */
+#undef HAVE_SIGPROCMASK
+
+/* Define if you have the setenv function. */
+#undef HAVE_SETENV
+
+/* Define if you have the setlocale function. */
+#undef HAVE_SETLOCALE
+
+/* Define if you have the stpcpy function. */
+#undef HAVE_STPCPY
+
+/* Define if you have the strcasecmp function. */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the strchr function. */
+#undef HAVE_STRCHR
+
+/* Define if you have the strdup function. */
+#undef HAVE_STRDUP
+
+/* Define if you have the strncasecmp function. */
+#undef HAVE_STRNCASECMP
+
+/* Define if you have the strndup function. */
+#undef HAVE_STRNDUP
+
+/* Define if you have the strftime function. */
+#undef HAVE_STRFTIME
+
+/* Define if you have the strstr function. */
+#undef HAVE_STRSTR
+
+/* Define if you have the strsep function. */
+#undef HAVE_STRSEP
+
+/* Define if you have the strtod function. */
+#undef HAVE_STRTOD
+
+/* Define if you have the valloc function. */
+#undef HAVE_VALLOC
+
+/* Define if you have the snprintf function. */
+#undef HAVE_SNPRINTF
+
+/* Ignore HAVE_USLEEP under Apollo Domain because the usleep()
+ implementation in the Sys5.3 environment is broken. */
+#ifndef apollo
+ /* Define if you have the usleep function. */
+# undef HAVE_USLEEP
+#endif
+
+/* Define if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
+
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
+
+/* Define if you have the <libc.h> header file. */
+#undef HAVE_LIBC_H
+
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
+
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define if you have the <sys/io.h> header file. */
+#undef HAVE_SYS_IO_H
+
+/* Define if you have the <asm/io.h> header file. */
+#undef HAVE_ASM_IO_H
+
+/* Define if you have the <scsi.h> header file. */
+#undef HAVE_SCSI_H
+
+/* Define if you have the <scsi/sg.h> header file. */
+#undef HAVE_SCSI_SG_H
+
+/* Define if you have the "/usr/src/linux/include/scsi/sg.h" header file. */
+#undef HAVE__USR_SRC_LINUX_INCLUDE_SCSI_SG_H
+
+/* Define if you have the <sys/dsreq.h> header file. */
+#undef HAVE_SYS_DSREQ_H
+
+/* Define if you have the <sys/scsi.h> header file. */
+#undef HAVE_SYS_SCSI_H
+
+/* Define if you have the <sys/scsi/targets/scgio.h> header file. */
+#undef HAVE_SYS_SCSI_TARGETS_SCGIO_H
+
+/* Define if you have the <sys/scsi/sgdefs.h> header file. */
+#undef HAVE_SYS_SCSI_SGDEFS_H
+
+/* Define if you have the <sys/scsicmd.h> header file. */
+#undef HAVE_SYS_SCSICMD_H
+
+/* Define if you have the <sys/scsiio.h> header file. */
+#undef HAVE_SYS_SCSIIO_H
+
+/* Define if you have the <sys/scanio.h> header file. */
+#undef HAVE_SYS_SCANIO_H
+
+/* Define if you have the <apollo/scsi.h> header file. */
+#undef HAVE_APOLLO_SCSI_H
+
+/* Define if you have the <bsd/dev/scsireg.h> header file. */
+#undef HAVE_BSD_DEV_SCSIREG_H
+
+/* Define if you have the <io/cam/cam.h> header file. */
+#undef HAVE_IO_CAM_CAM_H
+
+/* Define if you have the <camlib.h> header file. */
+#undef HAVE_CAMLIB_H
+
+/* Define if you have the <gscdds.h> header file. */
+#undef HAVE_GSCDDS_H
+
+/* Define if you have the <os2.h> header file. */
+#undef HAVE_OS2_H
+
+/* Define if you have EMX's sys/hw.h headers. */
+#undef HAVE_SYS_HW_H
+
+/* Define if you have sys/types.h. OS/2 wants them before select.h, etc. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the <values.h> header file. */
+#undef HAVE_VALUES_H
+
+/* Define if you have the i library (-li). */
+#undef HAVE_LIBI
+
+/* Define if you have the intl library (-lintl). */
+#undef HAVE_LIBINTL
+
+/* Define if you have the m library (-lm). */
+#undef HAVE_LIBM
+
+/* Define if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define if you have the dlopen function. */
+#undef HAVE_DLOPEN
+
+/* Define if you have the <dl.h> header file. */
+#undef HAVE_DL_H
+
+/* Define if you have the shl_load function. */
+#undef HAVE_SHL_LOAD
+
+/* Define if you have the GIMP header files and library. */
+#undef HAVE_LIBGIMP_GIMP_H
+
+/* Define if you have the GIMPfeatures header file. */
+#undef HAVE_LIBGIMP_GIMPFEATURES_H
+
+/* Define if you have libjpeg. */
+#undef HAVE_LIBJPEG
+
+/* Define if you have libz. */
+#undef HAVE_LIBZ
+
+/* Define if you have libpng. */
+#undef HAVE_LIBPNG
+
+/* Define if you have libtiff. */
+#undef HAVE_LIBTIFF
+
+#ifndef HAVE_STRNCASECMP
+ /* OS/2 needs this */
+# define strncasecmp(a, b, c) strnicmp(a, b, c)
+#endif
+
+#if defined (__sun) && defined (__GNUC__)
+# define _POSIX_SOURCE
+# define __EXTENSIONS__
+#endif
+
+#endif /* SANE_CONFIG_H */
diff --git a/include/sane/sanei_backend.h b/include/sane/sanei_backend.h
new file mode 100644
index 0000000..588e2d0
--- /dev/null
+++ b/include/sane/sanei_backend.h
@@ -0,0 +1,116 @@
+#include <sane/sanei_debug.h>
+
+#ifdef HAVE_SYS_HW_H
+ /* OS/2 i/o-port access compatibility macros: */
+# define inb(p) _inp8 (p)
+# define outb(v,p) _outp8 ((p),(v))
+# define ioperm(b,l,o) _portaccess ((b),(b)+(l)-1)
+# define HAVE_IOPERM 1
+#endif
+
+#ifndef O_NONBLOCK
+# ifdef O_NDELAY
+# define O_NONBLOCK O_NDELAY
+# else
+# define O_NONBLOCK FNDELAY /* last resort */
+# endif
+#endif
+
+#ifndef __GLIBC__
+# ifndef u_int8_t
+# define u_int8_t unsigned char
+# endif
+# ifndef u_int16_t
+# define u_int16_t unsigned short
+# endif
+# ifndef u_int32_t
+# define u_int32_t unsigned int
+# endif
+#endif
+
+#ifdef HAVE_SIGPROCMASK
+# define SIGACTION sigaction
+#else
+
+/* Just enough backwards compatibility that we get by in the backends
+ without making handstands. */
+# ifdef sigset_t
+# undef sigset_t
+# endif
+# ifdef sigemptyset
+# undef sigemptyset
+# endif
+# ifdef sigfillset
+# undef sigfillset
+# endif
+# ifdef sigaddset
+# undef sigaddset
+# endif
+# ifdef sigdelset
+# undef sigdelset
+# endif
+# ifdef sigprocmask
+# undef sigprocmask
+# endif
+# ifdef SIG_BLOCK
+# undef SIG_BLOCK
+# endif
+# ifdef SIG_UNBLOCK
+# undef SIG_UNBLOCK
+# endif
+# ifdef SIG_SETMASK
+# undef SIG_SETMASK
+# endif
+
+# define sigset_t int
+# define sigemptyset(set) do { *(set) = 0; } while (0)
+# define sigfillset(set) do { *(set) = ~0; } while (0)
+# define sigaddset(set,signal) do { *(set) |= sigmask (signal); } while (0)
+# define sigdelset(set,signal) do { *(set) &= ~sigmask (signal); } while (0)
+# define sigaction(sig,new,old) sigvec (sig,new,old)
+
+ /* Note: it's not safe to just declare our own "struct sigaction" since
+ some systems (e.g., some versions of OpenStep) declare that structure,
+ but do not implement sigprocmask(). Hard to believe, aint it? */
+# define SIGACTION sigvec
+# define SIG_BLOCK 1
+# define SIG_UNBLOCK 2
+# define SIG_SETMASK 3
+#endif /* !HAVE_SIGPROCMASK */
+
+/* Declare the entry points: */
+
+extern SANE_Status ENTRY(init) (SANE_Int *, SANE_Auth_Callback);
+extern SANE_Status ENTRY(get_devices) (const SANE_Device ***, SANE_Bool);
+extern SANE_Status ENTRY(open) (SANE_String_Const, SANE_Handle *);
+extern const SANE_Option_Descriptor *
+ ENTRY(get_option_descriptor) (SANE_Handle, SANE_Int);
+extern SANE_Status ENTRY(control_option) (SANE_Handle, SANE_Int, SANE_Action,
+ void *, SANE_Word *);
+extern SANE_Status ENTRY(get_parameters) (SANE_Handle, SANE_Parameters *);
+extern SANE_Status ENTRY(start) (SANE_Handle);
+extern SANE_Status ENTRY(read) (SANE_Handle, SANE_Byte *, SANE_Int,
+ SANE_Int *);
+extern SANE_Status ENTRY(set_io_mode) (SANE_Handle, SANE_Bool);
+extern SANE_Status ENTRY(get_select_fd) (SANE_Handle, SANE_Int *);
+extern void ENTRY(cancel) (SANE_Handle);
+extern void ENTRY(close) (SANE_Handle);
+extern void ENTRY(exit) (void);
+
+#ifndef STUBS
+/* Now redirect sane_* calls to backend's functions: */
+
+#define sane_init(a,b) ENTRY(init) (a,b)
+#define sane_get_devices(a,b) ENTRY(get_devices) (a,b)
+#define sane_open(a,b) ENTRY(open) (a,b)
+#define sane_get_option_descriptor(a,b) ENTRY(get_option_descriptor) (a,b)
+#define sane_control_option(a,b,c,d,e) ENTRY(control_option) (a,b,c,d,e)
+#define sane_get_parameters(a,b) ENTRY(get_parameters) (a,b)
+#define sane_start(a) ENTRY(start) (a)
+#define sane_read(a,b,c,d) ENTRY(read) (a,b,c,d)
+#define sane_set_io_mode(a,b) ENTRY(set_io_mode) (a,b)
+#define sane_get_select_fd(a,b) ENTRY(get_select_fd) (a,b)
+#define sane_cancel(a) ENTRY(cancel) (a)
+#define sane_close(a) ENTRY(close) (a)
+#define sane_exit(a) ENTRY(exit) (a)
+#endif /* STUBS */
diff --git a/include/sane/sanei_config.h b/include/sane/sanei_config.h
new file mode 100644
index 0000000..ac64007
--- /dev/null
+++ b/include/sane/sanei_config.h
@@ -0,0 +1,76 @@
+/* sane - Scanner Access Now Easy.
+ Copyright (C) 1997 Jeffrey S. Freedman
+ This file is part of the SANE package.
+
+ 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 2 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., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ As a special exception, the authors of SANE give permission for
+ additional uses of the libraries contained in this release of SANE.
+
+ The exception is that, if you link a SANE library with other files
+ to produce an executable, this does not by itself cause the
+ resulting executable to be covered by the GNU General Public
+ License. Your use of that executable is in no way restricted on
+ account of linking the SANE library code into it.
+
+ This exception does not, however, invalidate any other reasons why
+ the executable file might be covered by the GNU General Public
+ License.
+
+ If you submit changes to SANE to the maintainers to be included in
+ a subsequent release, you agree by submitting the changes that
+ those changes may be distributed with this exception intact.
+
+ If you write modifications of your own for SANE, it is your choice
+ whether to permit this exception to apply to your modifications.
+ If you do not wish that, delete this exception notice.
+
+ This file provides generic configuration support. */
+
+#ifndef sanei_config_h
+
+#include <stdio.h>
+
+extern FILE *sanei_config_open (const char *name);
+extern const char *sanei_config_skip_whitespace (const char *str);
+/* Scan a string constant from the string pointed to by STR and return
+ a malloced copy of it in *STRING_CONST (it's the responsibility of
+ the caller to free the returned string at an appropriate time).
+ Whitespace in front of the string constant is ignored. Whitespace
+ can be included in the string constant by enclosing it in
+ double-quotes. A return val of NULL indicates that no string
+ constant was found. */
+extern const char *sanei_config_get_string (const char *str,
+ char **string_const);
+
+/* A convenience function to support expanding device name patterns
+ into a list of devices. Apart from a normal device name
+ (such as /dev/sdb), this function currently supports SCSI
+ device specifications of the form:
+
+ scsi VENDOR MODEL TYPE BUS CHANNEL ID LUN
+
+ Where VENDOR is the desired vendor name. MODEL is the desired
+ MODEL name. TYPE is the desired device type. All of these can be
+ set to * to match anything. To include whitespace in these
+ strings, enclose them in double-quotes ("). BUS, ID, and LUN are
+ the desired SCSI bus, id, and logical-unit numbers. These can be
+ set to * or simply omitted to match anything. */
+extern void sanei_config_attach_matching_devices (const char *name,
+ SANE_Status (*attach)
+ (const char *dev));
+
+#endif /* sanei_config_h */
diff --git a/include/sane/sanei_signal.h b/include/sane/sanei_signal.h
new file mode 100644
index 0000000..0033c1c
--- /dev/null
+++ b/include/sane/sanei_signal.h
@@ -0,0 +1,50 @@
+#ifdef HAVE_SIGPROCMASK
+# define SIGACTION sigaction
+#else
+
+/* Just enough backwards compatibility that we get by in the backends
+ without making handstands. */
+# ifdef sigset_t
+# undef sigset_t
+# endif
+# ifdef sigemptyset
+# undef sigemptyset
+# endif
+# ifdef sigfillset
+# undef sigfillset
+# endif
+# ifdef sigaddset
+# undef sigaddset
+# endif
+# ifdef sigdelset
+# undef sigdelset
+# endif
+# ifdef sigprocmask
+# undef sigprocmask
+# endif
+# ifdef SIG_BLOCK
+# undef SIG_BLOCK
+# endif
+# ifdef SIG_UNBLOCK
+# undef SIG_UNBLOCK
+# endif
+# ifdef SIG_SETMASK
+# undef SIG_SETMASK
+# endif
+
+# define sigset_t int
+# define sigemptyset(set) do { *(set) = 0; } while (0)
+# define sigfillset(set) do { *(set) = ~0; } while (0)
+# define sigaddset(set,signal) do { *(set) |= sigmask (signal); } while (0)
+# define sigdelset(set,signal) do { *(set) &= ~sigmask (signal); } while (0)
+# define sigaction(sig,new,old) sigvec (sig,new,old)
+
+ /* Note: it's not safe to just declare our own "struct sigaction" since
+ some systems (e.g., some versions of OpenStep) declare that structure,
+ but do not implement sigprocmask(). Hard to believe, aint it? */
+# define SIGACTION sigvec
+# define SIG_BLOCK 1
+# define SIG_UNBLOCK 2
+# define SIG_SETMASK 3
+#endif /* !HAVE_SIGPROCMASK */
+
diff --git a/include/sane/stamp-h b/include/sane/stamp-h
new file mode 100644
index 0000000..9788f70
--- /dev/null
+++ b/include/sane/stamp-h
@@ -0,0 +1 @@
+timestamp
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..178cdac
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,250 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+#
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/intl/ChangeLog b/intl/ChangeLog
new file mode 100644
index 0000000..1989501
--- /dev/null
+++ b/intl/ChangeLog
@@ -0,0 +1,1086 @@
+1998-04-29 Ulrich Drepper <drepper@cygnus.com>
+
+ * intl/localealias.c (read_alias_file): Use unsigned char for
+ local variables. Remove unused variable tp.
+ * intl/l10nflist.c (_nl_normalize_codeset): Use unsigned char *
+ for type of codeset. For loosing Solaris systems.
+ * intl/loadinfo.h: Adapt prototype of _nl_normalize_codeset.
+ * intl/bindtextdom.c (BINDTEXTDOMAIN): Don't define local variable
+ len if not needed.
+ Patches by Jim Meyering.
+
+1998-04-28 Ulrich Drepper <drepper@cygnus.com>
+
+ * loadmsgcat.c (_nl_load_domain): Don't assign the element use_mmap if
+ mmap is not supported.
+
+ * hash-string.h: Don't include <values.h>.
+
+1998-04-27 Ulrich Drepper <drepper@cygnus.com>
+
+ * textdomain.c: Use strdup is available.
+
+ * localealias.c: Define HAVE_MEMPCPY so that we can use this
+ function. Define and use semapahores to protect modfication of
+ global objects when compiling for glibc. Add code to allow
+ freeing alias table.
+
+ * l10nflist.c: Don't assume stpcpy not being a macro.
+
+ * gettextP.h: Define internal_function macri if not already done.
+ Use glibc byte-swap macros instead of defining SWAP when compiled
+ for glibc.
+ (struct loaded_domain): Add elements to allow unloading.
+
+ * Makefile.in (distclean): Don't remove libintl.h here.
+
+ * bindtextdomain.c: Carry over changes from glibc. Use strdup if
+ available.
+
+ * dcgettext.c: Don't assume stpcpy not being a macro. Mark internal
+ functions. Add memory freeing code for glibc.
+
+ * dgettext.c: Update copyright.
+
+ * explodename.c: Include stdlib.h and string.h only if they exist.
+ Use strings.h eventually.
+
+ * finddomain.c: Mark internal functions. Use strdup if available.
+ Add memory freeing code for glibc.
+
+1997-10-10 20:00 Ulrich Drepper <drepper@cygnus.com>
+
+ * libgettext.h: Fix dummy textdomain and bindtextdomain macros.
+ They should return reasonable values.
+ Reported by Tom Tromey <tromey@cygnus.com>.
+
+1997-09-16 03:33 Ulrich Drepper <drepper@cygnus.com>
+
+ * libgettext.h: Define PARAMS also to `args' if __cplusplus is defined.
+ * intlh.inst.in: Likewise.
+ Reported by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>.
+
+ * libintl.glibc: Update from current glibc version.
+
+1997-09-06 02:10 Ulrich Drepper <drepper@cygnus.com>
+
+ * intlh.inst.in: Reformat copyright.
+
+1997-08-19 15:22 Ulrich Drepper <drepper@cygnus.com>
+
+ * dcgettext.c (DCGETTEXT): Remove wrong comment.
+
+1997-08-16 00:13 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (install-data): Don't change directory to install.
+
+1997-08-01 14:30 Ulrich Drepper <drepper@cygnus.com>
+
+ * cat-compat.c: Fix copyright.
+
+ * localealias.c: Don't define strchr unless !HAVE_STRCHR.
+
+ * loadmsgcat.c: Update copyright. Fix typos.
+
+ * l10nflist.c: Don't define strchr unless !HAVE_STRCHR.
+ (_nl_make_l10nflist): Handle sponsor and revision correctly.
+
+ * gettext.c: Update copyright.
+ * gettext.h: Likewise.
+ * hash-string.h: Likewise.
+
+ * finddomain.c: Remoave dead code. Define strchr only if
+ !HAVE_STRCHR.
+
+ * explodename.c: Include <sys/types.h>.
+
+ * explodename.c: Reformat copyright text.
+ (_nl_explode_name): Fix typo.
+
+ * dcgettext.c: Define and use __set_errno.
+ (guess_category_value): Don't use setlocale if HAVE_LC_MESSAGES is
+ not defined.
+
+ * bindtextdom.c: Pretty printing.
+
+1997-05-01 02:25 Ulrich Drepper <drepper@cygnus.com>
+
+ * dcgettext.c (guess_category_value): Don't depend on
+ HAVE_LC_MESSAGES. We don't need the macro here.
+ Patch by Bruno Haible <haible@ilog.fr>.
+
+ * cat-compat.c (textdomain): DoN't refer to HAVE_SETLOCALE_NULL
+ macro. Instead use HAVE_LOCALE_NULL and define it when using
+ glibc, as in dcgettext.c.
+ Patch by Bruno Haible <haible@ilog.fr>.
+
+ * Makefile.in (CPPFLAGS): New variable. Reported by Franc,ois
+ Pinard.
+
+Mon Mar 10 06:51:17 1997 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in: Implement handling of libtool.
+
+ * gettextP.h: Change data structures for use of generic lowlevel
+ i18n file handling.
+
+Wed Dec 4 20:21:18 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * textdomain.c: Put parentheses around arguments of memcpy macro
+ definition.
+ * localealias.c: Likewise.
+ * l10nflist.c: Likewise.
+ * finddomain.c: Likewise.
+ * bindtextdom.c: Likewise.
+ Reported by Thomas Esken.
+
+Mon Nov 25 22:57:51 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * textdomain.c: Move definition of `memcpy` macro to right
+ position.
+
+Fri Nov 22 04:01:58 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * finddomain.c [!HAVE_STRING_H && !_LIBC]: Define memcpy using
+ bcopy if not already defined. Reported by Thomas Esken.
+ * bindtextdom.c: Likewise.
+ * l10nflist.c: Likewise.
+ * localealias.c: Likewise.
+ * textdomain.c: Likewise.
+
+Tue Oct 29 11:10:27 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (libdir): Change to use exec_prefix instead of
+ prefix. Reported by Knut-HåvardAksnes <etokna@eto.ericsson.se>.
+
+Sat Aug 31 03:07:09 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * l10nflist.c (_nl_normalize_codeset): We convert to lower case,
+ so don't prepend uppercase `ISO' for only numeric arg.
+
+Fri Jul 19 00:15:46 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * l10nflist.c: Move inclusion of argz.h, ctype.h, stdlib.h after
+ definition of _GNU_SOURCE. Patch by Roland McGrath.
+
+ * Makefile.in (uninstall): Fix another bug with `for' loop and
+ empty arguments. Patch by Jim Meyering. Correct name os
+ uninstalled files: no intl- prefix anymore.
+
+ * Makefile.in (install-data): Again work around shells which
+ cannot handle mpty for list. Reported by Jim Meyering.
+
+Sat Jul 13 18:11:35 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (install): Split goal. Now depend on install-exec
+ and install-data.
+ (install-exec, install-data): New goals. Created from former
+ install goal.
+ Reported by Karl Berry.
+
+Sat Jun 22 04:58:14 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (MKINSTALLDIRS): New variable. Path to
+ mkinstalldirs script.
+ (install): use MKINSTALLDIRS variable or if the script is not present
+ try to find it in the $top_scrdir).
+
+Wed Jun 19 02:56:56 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * l10nflist.c: Linux libc *partly* includes the argz_* functions.
+ Grr. Work around by renaming the static version and use macros
+ for renaming.
+
+Tue Jun 18 20:11:17 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * l10nflist.c: Correct presence test macros of __argz_* functions.
+
+ * l10nflist.c: Include <argz.h> based on test of it instead when
+ __argz_* functions are available.
+ Reported by Andreas Schwab.
+
+Thu Jun 13 15:17:44 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * explodename.c, l10nflist.c: Define NULL for dumb systems.
+
+Tue Jun 11 17:05:13 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * intlh.inst.in, libgettext.h (dcgettext): Rename local variable
+ result to __result to prevent name clash.
+
+ * l10nflist.c, localealias.c, dcgettext.c: Define _GNU_SOURCE to
+ get prototype for stpcpy and strcasecmp.
+
+ * intlh.inst.in, libgettext.h: Move declaration of
+ `_nl_msg_cat_cntr' outside __extension__ block to prevent warning
+ from gcc's -Wnested-extern option.
+
+Fri Jun 7 01:58:00 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (install): Remove comment.
+
+Thu Jun 6 17:28:17 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (install): Work around for another Buglix stupidity.
+ Always use an `else' close for `if's. Reported by Nelson Beebe.
+
+ * Makefile.in (intlh.inst): Correct typo in phony rule.
+ Reported by Nelson Beebe.
+
+Thu Jun 6 01:49:52 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * dcgettext.c (read_alias_file): Rename variable alloca_list to
+ block_list as the macro calls assume.
+ Patch by Eric Backus.
+
+ * localealias.c [!HAVE_ALLOCA]: Define alloca as macro using
+ malloc.
+ (read_alias_file): Rename varriabe alloca_list to block_list as the
+ macro calls assume.
+ Patch by Eric Backus.
+
+ * l10nflist.c: Correct conditional for <argz.h> inclusion.
+ Reported by Roland McGrath.
+
+ * Makefile.in (all): Depend on all-@USE_INCLUDED_LIBINTL@, not
+ all-@USE_NLS@.
+
+ * Makefile.in (install): intlh.inst comes from local dir, not
+ $(srcdir).
+
+ * Makefile.in (intlh.inst): Special handling of this goal. If
+ used in gettext, this is really a rul to construct this file. If
+ used in any other package it is defined as a .PHONY rule with
+ empty body.
+
+ * finddomain.c: Extract locale file information handling into
+ l10nfile.c. Rename local stpcpy__ function to stpcpy.
+
+ * dcgettext.c (stpcpy): Add local definition.
+
+ * l10nflist.c: Solve some portability problems. Patches partly by
+ Thomas Esken. Add local definition of stpcpy.
+
+Tue Jun 4 02:47:49 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * intlh.inst.in: Don't depend including <locale.h> on
+ HAVE_LOCALE_H. Instead configure must rewrite this fiile
+ depending on the result of the configure run.
+
+ * Makefile.in (install): libintl.inst is now called intlh.inst.
+ Add rules for updating intlh.inst from intlh.inst.in.
+
+ * libintl.inst: Renamed to intlh.inst.in.
+
+ * localealias.c, dcgettext.c [__GNUC__]: Define HAVE_ALLOCA to 1
+ because gcc has __buitlin_alloca.
+ Reported by Roland McGrath.
+
+Mon Jun 3 00:32:16 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (installcheck): New goal to fulfill needs of
+ automake's distcheck.
+
+ * Makefile.in (install): Reorder commands so that VERSION is
+ found.
+
+ * Makefile.in (gettextsrcdir): Now use subdirectory intl/ in
+ @datadir@/gettext.
+ (COMSRCS): Add l10nfile.c.
+ (OBJECTS): Add l10nfile.o.
+ (DISTFILES): Rename to DISTFILE.normal. Remove $(DISTFILES.common).
+ (DISTFILE.gettext): Remove $(DISTFILES.common).
+ (all-gettext): Remove goal.
+ (install): If $(PACKAGE) = gettext install, otherwose do nothing. No
+ package but gettext itself should install libintl.h + headers.
+ (dist): Extend goal to work for gettext, too.
+ (dist-gettext): Remove goal.
+
+ * dcgettext.c [!HAVE_ALLOCA]: Define macro alloca by using malloc.
+
+Sun Jun 2 17:33:06 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * loadmsgcat.c (_nl_load_domain): Parameter is now comes from
+ find_l10nfile.
+
+Sat Jun 1 02:23:03 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * l10nflist.c (__argz_next): Add definition.
+
+ * dcgettext.c [!HAVE_ALLOCA]: Add code for handling missing alloca
+ code. Use new l10nfile handling.
+
+ * localealias.c [!HAVE_ALLOCA]: Add code for handling missing
+ alloca code.
+
+ * l10nflist.c: Initial revision.
+
+Tue Apr 2 18:51:18 1996 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (all-gettext): New goal. Same as all-yes.
+
+Thu Mar 28 23:01:22 1996 Karl Eichwalder <ke@ke.central.de>
+
+ * Makefile.in (gettextsrcdir): Define using @datadir@.
+
+Tue Mar 26 12:39:14 1996 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c: Include <ctype.h>. Reported by Roland McGrath.
+
+Sat Mar 23 02:00:35 1996 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (stpcpy): Rename to stpcpy__ to prevent clashing
+ with external declaration.
+
+Sat Mar 2 00:47:09 1996 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (all-no): Rename from all_no.
+
+Sat Feb 17 00:25:59 1996 Ulrich Drepper <drepper@myware>
+
+ * gettextP.h [loaded_domain]: Array `successor' must now contain up
+ to 63 elements (because of codeset name normalization).
+
+ * finddomain.c: Implement codeset name normalization.
+
+Thu Feb 15 04:39:09 1996 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (all): Define to `all-@USE_NLS@'.
+ (all-yes, all_no): New goals. `all-no' is noop, `all-yes'
+ is former all.
+
+Mon Jan 15 21:46:01 1996 Howard Gayle <howard@hal.com>
+
+ * localealias.c (alias_compare): Increment string pointers in loop
+ of strcasecmp replacement.
+
+Fri Dec 29 21:16:34 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (install-src): Who commented this goal out ? :-)
+
+Fri Dec 29 15:08:16 1995 Ulrich Drepper <drepper@myware>
+
+ * dcgettext.c (DCGETTEXT): Save `errno'. Failing system calls
+ should not effect it because a missing catalog is no error.
+ Reported by Harald K<o:>nig <koenig@tat.physik.uni-tuebingen.de>.
+
+Tue Dec 19 22:09:13 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (Makefile): Explicitly use $(SHELL) for running
+ shell scripts.
+
+Fri Dec 15 17:34:59 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * Makefile.in (install-src): Only install library and header when
+ we use the own implementation. Don't do it when using the
+ system's gettext or catgets functions.
+
+ * dcgettext.c (find_msg): Must not swap domain->hash_size here.
+
+Sat Dec 9 16:24:37 1995 Ulrich Drepper <drepper@myware>
+
+ * localealias.c, libintl.inst, libgettext.h, hash-string.h,
+ gettextP.h, finddomain.c, dcgettext.c, cat-compat.c:
+ Use PARAMS instead of __P. Suggested by Roland McGrath.
+
+Tue Dec 5 11:39:14 1995 Larry Schwimmer <rosebud@cyclone.stanford.edu>
+
+ * libgettext.h: Use `#if !defined (_LIBINTL_H)' instead of `#if
+ !_LIBINTL_H' because Solaris defines _LIBINTL_H as empty.
+
+Mon Dec 4 15:42:07 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (install-src):
+ Install libintl.inst instead of libintl.h.install.
+
+Sat Dec 2 22:51:38 1995 Marcus Daniels <marcus@sysc.pdx.edu>
+
+ * cat-compat.c (textdomain):
+ Reverse order in which files are tried you load. First
+ try local file, when this failed absolute path.
+
+Wed Nov 29 02:03:53 1995 Nelson H. F. Beebe <beebe@math.utah.edu>
+
+ * cat-compat.c (bindtextdomain): Add missing { }.
+
+Sun Nov 26 18:21:41 1995 Ulrich Drepper <drepper@myware>
+
+ * libintl.inst: Add missing __P definition. Reported by Nelson Beebe.
+
+ * Makefile.in:
+ Add dummy `all' and `dvi' goals. Reported by Tom Tromey.
+
+Sat Nov 25 16:12:01 1995 Franc,ois Pinard <pinard@iro.umontreal.ca>
+
+ * hash-string.h: Capitalize arguments of macros.
+
+Sat Nov 25 12:01:36 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (DISTFILES): Prevent files names longer than 13
+ characters. libintl.h.glibc->libintl.glibc,
+ libintl.h.install->libintl.inst. Reported by Joshua R. Poulson.
+
+Sat Nov 25 11:31:12 1995 Eric Backus <ericb@lsid.hp.com>
+
+ * dcgettext.c: Fix bug in preprocessor conditionals.
+
+Sat Nov 25 02:35:27 1995 Nelson H. F. Beebe <beebe@math.utah.edu>
+
+ * libgettext.h: Solaris cc does not understand
+ #if !SYMBOL1 && !SYMBOL2. Sad but true.
+
+Thu Nov 23 16:22:14 1995 Ulrich Drepper <drepper@myware>
+
+ * hash-string.h (hash_string):
+ Fix for machine with >32 bit `unsigned long's.
+
+ * dcgettext.c (DCGETTEXT):
+ Fix horrible bug in loop for alternative translation.
+
+Thu Nov 23 01:45:29 1995 Ulrich Drepper <drepper@myware>
+
+ * po2tbl.sed.in, linux-msg.sed, xopen-msg.sed:
+ Some further simplifications in message number generation.
+
+Mon Nov 20 21:08:43 1995 Ulrich Drepper <drepper@myware>
+
+ * libintl.h.glibc: Use __const instead of const in prototypes.
+
+ * Makefile.in (install-src):
+ Install libintl.h.install instead of libintl.h. This
+ is a stripped-down version. Suggested by Peter Miller.
+
+ * libintl.h.install, libintl.h.glibc: Initial revision.
+
+ * localealias.c (_nl_expand_alias, read_alias_file):
+ Protect prototypes in type casts by __P.
+
+Tue Nov 14 16:43:58 1995 Ulrich Drepper <drepper@myware>
+
+ * hash-string.h: Correct prototype for hash_string.
+
+Sun Nov 12 12:42:30 1995 Ulrich Drepper <drepper@myware>
+
+ * hash-string.h (hash_string): Add prototype.
+
+ * gettextP.h: Fix copyright.
+ (SWAP): Add prototype.
+
+Wed Nov 8 22:56:33 1995 Ulrich Drepper <drepper@myware>
+
+ * localealias.c (read_alias_file): Forgot sizeof.
+ Avoid calling *printf function. This introduces a big overhead.
+ Patch by Roland McGrath.
+
+Tue Nov 7 14:21:08 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c, cat-compat.c: Wrong indentation in #if for stpcpy.
+
+ * finddomain.c (stpcpy):
+ Define substitution function local. The macro was to flaky.
+
+ * cat-compat.c: Fix typo.
+
+ * xopen-msg.sed, linux-msg.sed:
+ While bringing message number to right place only accept digits.
+
+ * linux-msg.sed, xopen-msg.sed: Now that the counter does not have
+ leading 0s we don't need to remove them. Reported by Marcus
+ Daniels.
+
+ * Makefile.in (../po/cat-id-tbl.o): Use $(top_srdir) in
+ dependency. Reported by Marcus Daniels.
+
+ * cat-compat.c: (stpcpy) [!_LIBC && !HAVE_STPCPY]: Define replacement.
+ Generally cleanup using #if instead of #ifndef.
+
+ * Makefile.in: Correct typos in comment. By Franc,ois Pinard.
+
+Mon Nov 6 00:27:02 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (install-src): Don't install libintl.h and libintl.a
+ if we use an available gettext implementation.
+
+Sun Nov 5 22:02:08 1995 Ulrich Drepper <drepper@myware>
+
+ * libgettext.h: Fix typo: HAVE_CATGETTS -> HAVE_CATGETS. Reported
+ by Franc,ois Pinard.
+
+ * libgettext.h: Use #if instead of #ifdef/#ifndef.
+
+ * finddomain.c:
+ Comments describing what has to be done should start with FIXME.
+
+Sun Nov 5 19:38:01 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (DISTFILES): Split. Use DISTFILES with normal meaning.
+ DISTFILES.common names the files common to both dist goals.
+ DISTFILES.gettext are the files only distributed in GNU gettext.
+
+Sun Nov 5 17:32:54 1995 Ulrich Drepper <drepper@myware>
+
+ * dcgettext.c (DCGETTEXT): Correct searching in derived locales.
+ This was necessary since a change in _nl_find_msg several weeks
+ ago. I really don't know this is still not fixed.
+
+Sun Nov 5 12:43:12 1995 Ulrich Drepper <drepper@myware>
+
+ * loadmsgcat.c (_nl_load_domain): Test for FILENAME == NULL. This
+ might mark a special condition.
+
+ * finddomain.c (make_entry_rec): Don't make illegal entry as decided.
+
+ * Makefile.in (dist): Suppress error message when ln failed.
+ Get files from $(srcdir) explicitly.
+
+ * libgettext.h (gettext_const): Rename to gettext_noop.
+
+Fri Nov 3 07:36:50 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (make_entry_rec):
+ Protect against wrong locale names by testing mask.
+
+ * libgettext.h (gettext_const): Add macro definition.
+ Capitalize macro arguments.
+
+Thu Nov 2 23:15:51 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (_nl_find_domain):
+ Test for pointer != NULL before accessing value.
+ Reported by Tom Tromey.
+
+ * gettext.c (NULL):
+ Define as (void*)0 instad of 0. Reported by Franc,ois Pinard.
+
+Mon Oct 30 21:28:52 1995 Ulrich Drepper <drepper@myware>
+
+ * po2tbl.sed.in: Serious typo bug fixed by Jim Meyering.
+
+Sat Oct 28 23:20:47 1995 Ulrich Drepper <drepper@myware>
+
+ * libgettext.h: Disable dcgettext optimization for Solaris 2.3.
+
+ * localealias.c (alias_compare):
+ Peter Miller reported that tolower in some systems is
+ even dumber than I thought. Protect call by `isupper'.
+
+Fri Oct 27 22:22:51 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (libdir, includedir): New variables.
+ (install-src): Install libintl.a and libintl.h in correct dirs.
+
+Fri Oct 27 22:07:29 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (SOURCES): Fix typo: intrl.compat.c -> intl-compat.c.
+
+ * po2tbl.sed.in: Patch for buggy SEDs by Christian von Roques.
+
+ * localealias.c:
+ Fix typo and superflous test. Reported by Christian von Roques.
+
+Fri Oct 6 11:52:05 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (_nl_find_domain):
+ Correct some remainder from the pre-CEN syntax. Now
+ we don't have a constant number of successors anymore.
+
+Wed Sep 27 21:41:13 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (DISTFILES): Add libintl.h.glibc.
+
+ * Makefile.in (dist-libc): Add goal for packing sources for glibc.
+ (COMSRCS, COMHDRS): Splitted to separate sources shared with glibc.
+
+ * loadmsgcat.c: Forget to continue #if line.
+
+ * localealias.c:
+ [_LIBC]: Rename strcasecmp to __strcasecmp to keep ANSI C name
+ space clean.
+
+ * dcgettext.c, finddomain.c: Better comment to last change.
+
+ * loadmsgcat.c:
+ [_LIBC]: Rename fstat, open, close, read, mmap, and munmap to
+ __fstat, __open, __close, __read, __mmap, and __munmap resp
+ to keep ANSI C name space clean.
+
+ * finddomain.c:
+ [_LIBC]: Rename stpcpy to __stpcpy to keep ANSI C name space clean.
+
+ * dcgettext.c:
+ [_LIBC]: Rename getced and stpcpy to __getcwd and __stpcpy resp to
+ keep ANSI C name space clean.
+
+ * libgettext.h:
+ Include sys/types.h for those old SysV systems out there.
+ Reported by Francesco Potorti`.
+
+ * loadmsgcat.c (use_mmap): Define if compiled for glibc.
+
+ * bindtextdom.c: Include all those standard headers
+ unconditionally if _LIBC is defined.
+
+ * finddomain.c: Fix 2 times defiend -> defined.
+
+ * textdomain.c: Include libintl.h instead of libgettext.h when
+ compiling for glibc. Include all those standard headers
+ unconditionally if _LIBC is defined.
+
+ * localealias.c, loadmsgcat.c: Prepare to be compiled in glibc.
+
+ * gettext.c:
+ Include libintl.h instead of libgettext.h when compiling for glibc.
+ Get NULL from stddef.h if we compile for glibc.
+
+ * finddomain.c: Include libintl.h instead of libgettext.h when
+ compiling for glibc. Include all those standard headers
+ unconditionally if _LIBC is defined.
+
+ * dcgettext.c: Include all those standard headers unconditionally
+ if _LIBC is defined.
+
+ * dgettext.c: If compiled in glibc include libintl.h instead of
+ libgettext.h.
+ (locale.h): Don't rely on HAVE_LOCALE_H when compiling for glibc.
+
+ * dcgettext.c: If compiled in glibc include libintl.h instead of
+ libgettext.h.
+ (getcwd): Don't rely on HAVE_GETCWD when compiling for glibc.
+
+ * bindtextdom.c:
+ If compiled in glibc include libintl.h instead of libgettext.h.
+
+Mon Sep 25 22:23:06 1995 Ulrich Drepper <drepper@myware>
+
+ * localealias.c (_nl_expand_alias): Don't call bsearch if NMAP <= 0.
+ Reported by Marcus Daniels.
+
+ * cat-compat.c (bindtextdomain):
+ String used in putenv must not be recycled.
+ Reported by Marcus Daniels.
+
+ * libgettext.h (__USE_GNU_GETTEXT):
+ Additional symbol to signal that we use GNU gettext
+ library.
+
+ * cat-compat.c (bindtextdomain):
+ Fix bug with the strange stpcpy replacement.
+ Reported by Nelson Beebe.
+
+Sat Sep 23 08:23:51 1995 Ulrich Drepper <drepper@myware>
+
+ * cat-compat.c: Include <string.h> for stpcpy prototype.
+
+ * localealias.c (read_alias_file):
+ While expand strdup code temporary variable `cp' hided
+ higher level variable with same name. Rename to `tp'.
+
+ * textdomain.c (textdomain):
+ Avoid warning by using temporary variable in strdup code.
+
+ * finddomain.c (_nl_find_domain): Remove unused variable `application'.
+
+Thu Sep 21 15:51:44 1995 Ulrich Drepper <drepper@myware>
+
+ * localealias.c (alias_compare):
+ Use strcasecmp() only if available. Else use
+ implementation in place.
+
+ * intl-compat.c:
+ Wrapper functions now call *__ functions instead of __*.
+
+ * libgettext.h: Declare prototypes for *__ functions instead for __*.
+
+ * cat-compat.c, loadmsgcat.c:
+ Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+ of the standard libc and so prevent libintl.a from being used
+ standalone.
+
+ * bindtextdom.c:
+ Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+ of the standard libc and so prevent libintl.a from being used
+ standalone.
+ Rename to bindtextdomain__ if not used in GNU C Library.
+
+ * dgettext.c:
+ Rename function to dgettext__ if not used in GNU C Library.
+
+ * gettext.c:
+ Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+ of the standard libc and so prevent libintl.a from being used
+ standalone.
+ Functions now called gettext__ if not used in GNU C Library.
+
+ * dcgettext.c, localealias.c, textdomain.c, finddomain.c:
+ Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+ of the standard libc and so prevent libintl.a from being used
+ standalone.
+
+Sun Sep 17 23:14:49 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c: Correct some bugs in handling of CEN standard
+ locale definitions.
+
+Thu Sep 7 01:49:28 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c: Implement CEN syntax.
+
+ * gettextP.h (loaded_domain): Extend number of successors to 31.
+
+Sat Aug 19 19:25:29 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (aliaspath): Remove path to X11 locale dir.
+
+ * Makefile.in: Make install-src depend on install. This helps
+ gettext to install the sources and other packages can use the
+ install goal.
+
+Sat Aug 19 15:19:33 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (uninstall): Remove stuff installed by install-src.
+
+Tue Aug 15 13:13:53 1995 Ulrich Drepper <drepper@myware>
+
+ * VERSION.in: Initial revision.
+
+ * Makefile.in (DISTFILES):
+ Add VERSION file. This is not necessary for gettext, but
+ for other packages using this library.
+
+Tue Aug 15 06:16:44 1995 Ulrich Drepper <drepper@myware>
+
+ * gettextP.h (_nl_find_domain):
+ New prototype after changing search strategy.
+
+ * finddomain.c (_nl_find_domain):
+ We now try only to find a specified catalog. Fall back to other
+ catalogs listed in the locale list is now done in __dcgettext.
+
+ * dcgettext.c (__dcgettext):
+ Now we provide message fall back even to different languages.
+ I.e. if a message is not available in one language all the other
+ in the locale list a tried. Formerly fall back was only possible
+ within one language. Implemented by moving one loop from
+ _nl_find_domain to here.
+
+Mon Aug 14 23:45:50 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (gettextsrcdir):
+ Directory where source of GNU gettext library are made
+ available.
+ (INSTALL, INSTALL_DATA): Programs used for installing sources.
+ (gettext-src): New. Rule to install GNU gettext sources for use in
+ gettextize shell script.
+
+Sun Aug 13 14:40:48 1995 Ulrich Drepper <drepper@myware>
+
+ * loadmsgcat.c (_nl_load_domain):
+ Use mmap for loading only when munmap function is
+ also available.
+
+ * Makefile.in (install): Depend on `all' goal.
+
+Wed Aug 9 11:04:33 1995 Ulrich Drepper <drepper@myware>
+
+ * localealias.c (read_alias_file):
+ Do not overwrite '\n' when terminating alias value string.
+
+ * localealias.c (read_alias_file):
+ Handle long lines. Ignore the rest not fitting in
+ the buffer after the initial `fgets' call.
+
+Wed Aug 9 00:54:29 1995 Ulrich Drepper <drepper@myware>
+
+ * gettextP.h (_nl_load_domain):
+ Add prototype, replacing prototype for _nl_load_msg_cat.
+
+ * finddomain.c (_nl_find_domain):
+ Remove unneeded variable filename and filename_len.
+ (expand_alias): Remove prototype because functions does not
+ exist anymore.
+
+ * localealias.c (read_alias_file):
+ Change type of fname_len parameter to int.
+ (xmalloc): Add prototype.
+
+ * loadmsgcat.c: Better prototypes for xmalloc.
+
+Tue Aug 8 22:30:39 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (_nl_find_domain):
+ Allow alias name to be constructed from the four components.
+
+ * Makefile.in (aliaspath): New variable. Set to preliminary value.
+ (SOURCES): Add localealias.c.
+ (OBJECTS): Add localealias.o.
+
+ * gettextP.h: Add prototype for _nl_expand_alias.
+
+ * finddomain.c: Aliasing handled in intl/localealias.c.
+
+ * localealias.c: Aliasing for locale names.
+
+ * bindtextdom.c: Better prototypes for xmalloc and xstrdup.
+
+Mon Aug 7 23:47:42 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (DISTFILES): gettext.perl is now found in misc/.
+
+ * cat-compat.c (bindtextdomain):
+ Correct implementation. dirname parameter was not used.
+ Reported by Marcus Daniels.
+
+ * gettextP.h (loaded_domain):
+ New fields `successor' and `decided' for oo, lazy
+ message handling implementation.
+
+ * dcgettext.c:
+ Adopt for oo, lazy message handliing.
+ Now we can inherit translations from less specific locales.
+ (find_msg): New function.
+
+ * loadmsgcat.c, finddomain.c:
+ Complete rewrite. Implement oo, lazy message handling :-).
+ We now have an additional environment variable `LANGUAGE' with
+ a higher priority than LC_ALL for the LC_MESSAGE locale.
+ Here we can set a colon separated list of specifications each
+ of the form `language[_territory[.codeset]][@modifier]'.
+
+Sat Aug 5 09:55:42 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (unistd.h):
+ Include to get _PC_PATH_MAX defined on system having it.
+
+Fri Aug 4 22:42:00 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (stpcpy): Include prototype.
+
+ * Makefile.in (dist): Remove `copying instead' message.
+
+Wed Aug 2 18:52:03 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (ID, TAGS): Do not use $^.
+
+Tue Aug 1 20:07:11 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (TAGS, ID): Use $^ as command argument.
+ (TAGS): Give etags -o option t write to current directory,
+ not $(srcdir).
+ (ID): Use $(srcdir) instead os $(top_srcdir)/src.
+ (distclean): Remove ID.
+
+Sun Jul 30 11:51:46 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (gnulocaledir):
+ New variable, always using share/ for data directory.
+ (DEFS): Add GNULOCALEDIR, used in finddomain.c.
+
+ * finddomain.c (_nl_default_dirname):
+ Set to GNULOCALEDIR, because it always has to point
+ to the directory where GNU gettext Library writes it to.
+
+ * intl-compat.c (textdomain, bindtextdomain):
+ Undefine macros before function definition.
+
+Sat Jul 22 01:10:02 1995 Ulrich Drepper <drepper@myware>
+
+ * libgettext.h (_LIBINTL_H):
+ Protect definition in case where this file is included as
+ libgettext.h on Solaris machines. Add comment about this.
+
+Wed Jul 19 02:36:42 1995 Ulrich Drepper <drepper@myware>
+
+ * intl-compat.c (textdomain): Correct typo.
+
+Wed Jul 19 01:51:35 1995 Ulrich Drepper <drepper@myware>
+
+ * dcgettext.c (dcgettext): Function now called __dcgettext.
+
+ * dgettext.c (dgettext): Now called __dgettext and calls
+ __dcgettext.
+
+ * gettext.c (gettext):
+ Function now called __gettext and calls __dgettext.
+
+ * textdomain.c (textdomain): Function now called __textdomain.
+
+ * bindtextdom.c (bindtextdomain): Function now called
+ __bindtextdomain.
+
+ * intl-compat.c: Initial revision.
+
+ * Makefile.in (SOURCES): Add intl-compat.c.
+ (OBJECTS): We always compile the GNU gettext library functions.
+ OBJECTS contains all objects but cat-compat.o, ../po/cat-if-tbl.o,
+ and intl-compat.o.
+ (GETTOBJS): Contains now only intl-compat.o.
+
+ * libgettext.h:
+ Re-include protection matches dualistic character of libgettext.h.
+ For all functions in GNU gettext library define __ counter part.
+
+ * finddomain.c (strchr): Define as index if not found in C library.
+ (_nl_find_domain): For relative paths paste / in between.
+
+Tue Jul 18 16:37:45 1995 Ulrich Drepper <drepper@myware>
+
+ * loadmsgcat.c, finddomain.c: Add inclusion of sys/types.h.
+
+ * xopen-msg.sed: Fix bug with `msgstr ""' lines.
+ A little bit better comments.
+
+Tue Jul 18 01:18:27 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in:
+ po-mode.el, makelinks, combine-sh are now found in ../misc.
+
+ * po-mode.el, makelinks, combine-sh, elisp-comp:
+ Moved to ../misc/.
+
+ * libgettext.h, gettextP.h, gettext.h: Uniform test for __STDC__.
+
+Sun Jul 16 22:33:02 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (INSTALL, INSTALL_DATA): New variables.
+ (install-data, uninstall): Install/uninstall .elc file.
+
+ * po-mode.el (Installation comment):
+ Add .pox as possible extension of .po files.
+
+Sun Jul 16 13:23:27 1995 Ulrich Drepper <drepper@myware>
+
+ * elisp-comp: Complete new version by Franc,ois: This does not
+ fail when not compiling in the source directory.
+
+Sun Jul 16 00:12:17 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (../po/cat-id-tbl.o):
+ Use $(MAKE) instead of make for recursive make.
+
+ * Makefile.in (.el.elc): Use $(SHELL) instead of /bin/sh.
+ (install-exec): Add missing dummy goal.
+ (install-data, uninstall): @ in multi-line shell command at
+ beginning, not in front of echo. Reported by Eric Backus.
+
+Sat Jul 15 00:21:28 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (DISTFILES):
+ Rename libgettext.perl to gettext.perl to fit in 14 chars
+ file systems.
+
+ * gettext.perl:
+ Rename to gettext.perl to fit in 14 chars file systems.
+
+Thu Jul 13 23:17:20 1995 Ulrich Drepper <drepper@myware>
+
+ * cat-compat.c: If !STDC_HEADERS try to include malloc.h.
+
+Thu Jul 13 20:55:02 1995 Ulrich Drepper <drepper@myware>
+
+ * po2tbl.sed.in: Pretty printing.
+
+ * linux-msg.sed, xopen-msg.sed:
+ Correct bugs with handling substitute flags in branches.
+
+ * hash-string.h (hash_string):
+ Old K&R compilers don't under stand `unsigned char'.
+
+ * gettext.h (nls_uint32):
+ Some old K&R compilers (eg HP) don't understand `unsigned int'.
+
+ * cat-compat.c (msg_to_cat_id): De-ANSI-fy prototypes.
+
+Thu Jul 13 01:34:33 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (ELCFILES): New variable.
+ (DISTFILES): Add elisp-comp.
+ Add implicit rule for .el -> .elc compilation.
+ (install-data): install $ELCFILES
+ (clean): renamed po-to-tbl and po-to-msg to po2tbl and po2msg resp.
+
+ * elisp-comp: Initial revision
+
+Wed Jul 12 16:14:52 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in:
+ cat-id-tbl.c is now found in po/. This enables us to use an identical
+ intl/ directory in all packages.
+
+ * dcgettext.c (dcgettext): hashing does not work for table size <= 2.
+
+ * textdomain.c: fix typo (#if def -> #if defined)
+
+Tue Jul 11 18:44:43 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (stamp-cat-id): use top_srcdir to address source files
+ (DISTFILES,distclean): move tupdate.perl to src/
+
+ * po-to-tbl.sed.in:
+ add additional jump to clear change flag to recognize multiline strings
+
+Tue Jul 11 01:32:50 1995 Ulrich Drepper <drepper@myware>
+
+ * textdomain.c: Protect inclusion of stdlib.h and string.h.
+
+ * loadmsgcat.c: Protect inclusion of stdlib.h.
+
+ * libgettext.h: Protect inclusion of locale.h.
+ Allow use in C++ programs.
+ Define NULL is not happened already.
+
+ * Makefile.in (DISTFILES): ship po-to-tbl.sed.in instead of
+ po-to-tbl.sed.
+ (distclean): remove po-to-tbl.sed and tupdate.perl.
+
+ * tupdate.perl.in: Substitute Perl path even in exec line.
+ Don't include entries without translation from old .po file.
+
+Tue Jul 4 00:41:51 1995 Ulrich Drepper <drepper@myware>
+
+ * tupdate.perl.in: use "Updated: " in msgid "".
+
+ * cat-compat.c: Fix typo (LOCALDIR -> LOCALEDIR).
+ Define getenv if !__STDC__.
+
+ * bindtextdom.c: Protect stdlib.h and string.h inclusion.
+ Define free if !__STDC__.
+
+ * finddomain.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
+ Define free if !__STDC__.
+
+ * cat-compat.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
+
+Mon Jul 3 23:56:30 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in: Use LOCALEDIR instead of DEF_MSG_DOM_DIR.
+ Remove unneeded $(srcdir) from Makefile.in dependency.
+
+ * makelinks: Add copyright and short description.
+
+ * po-mode.el: Last version for 0.7.
+
+ * tupdate.perl.in: Fix die message.
+
+ * dcgettext.c: Protect include of string.h.
+
+ * gettext.c: Protect include of stdlib.h and further tries to get NULL.
+
+ * finddomain.c: Some corrections in includes.
+
+ * Makefile.in (INCLUDES): Prune list correct path to Makefile.in.
+
+ * po-to-tbl.sed: Adopt for new .po file format.
+
+ * linux-msg.sed, xopen-msg.sed: Adopt for new .po file format.
+
+Sun Jul 2 23:55:03 1995 Ulrich Drepper <drepper@myware>
+
+ * tupdate.perl.in: Complete rewrite for new .po file format.
+
+Sun Jul 2 02:06:50 1995 Ulrich Drepper <drepper@myware>
+
+ * First official release. This directory contains all the code
+ needed to internationalize own packages. It provides functions
+ which allow to use the X/Open catgets function with an interface
+ like the Uniforum gettext function. For system which does not
+ have neither of those a complete implementation is provided.
diff --git a/intl/Makefile.in b/intl/Makefile.in
new file mode 100644
index 0000000..35fb837
--- /dev/null
+++ b/intl/Makefile.in
@@ -0,0 +1,214 @@
+# Makefile for directory with message catalog handling in GNU NLS Utilities.
+# Copyright (C) 1995, 1996, 1997 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+transform = @program_transform_name@
+libdir = $(exec_prefix)/lib
+includedir = $(prefix)/include
+datadir = $(prefix)/@DATADIRNAME@
+localedir = $(datadir)/locale
+gnulocaledir = $(prefix)/share/locale
+gettextsrcdir = @datadir@/gettext/intl
+aliaspath = $(localedir):.
+subdir = intl
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+
+l = @l@
+
+AR = ar
+CC = @CC@
+LIBTOOL = @LIBTOOL@
+RANLIB = @RANLIB@
+
+DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \
+-DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@
+CPPFLAGS = @CPPFLAGS@
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+
+HEADERS = $(COMHDRS) libgettext.h loadinfo.h
+COMHDRS = gettext.h gettextP.h hash-string.h
+SOURCES = $(COMSRCS) intl-compat.c cat-compat.c
+COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
+finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
+explodename.c
+OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
+finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
+explodename.$lo
+CATOBJS = cat-compat.$lo ../po/cat-id-tbl.$lo
+GETTOBJS = intl-compat.$lo
+DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \
+xopen-msg.sed $(HEADERS) $(SOURCES)
+DISTFILES.normal = VERSION
+DISTFILES.gettext = libintl.glibc intlh.inst.in
+
+.SUFFIXES:
+.SUFFIXES: .c .o .lo
+.c.o:
+ $(COMPILE) $<
+.c.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) $<
+
+INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/lib -I$(top_srcdir)/include/sane
+
+all: all-@USE_INCLUDED_LIBINTL@
+
+all-yes: libintl.$la intlh.inst
+all-no:
+
+libintl.a: $(OBJECTS)
+ rm -f $@
+ $(AR) cru $@ $(OBJECTS)
+ $(RANLIB) $@
+
+libintl.la: $(OBJECTS)
+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) \
+ -version-info 1:0 -rpath $(libdir)
+
+../po/cat-id-tbl.$lo: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot
+ cd ../po && $(MAKE) cat-id-tbl.$lo
+
+check: all
+
+# This installation goal is only used in GNU gettext. Packages which
+# only use the library should use install instead.
+
+# We must not install the libintl.h/libintl.a files if we are on a
+# system which has the gettext() function in its C library or in a
+# separate library or use the catgets interface. A special case is
+# where configure found a previously installed GNU gettext library.
+# If you want to use the one which comes with this version of the
+# package, you have to use `configure --with-included-gettext'.
+install: install-exec install-data
+install-exec: all
+ if test "$(PACKAGE)" = "gettext" \
+ && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
+ if test -r $(MKINSTALLDIRS); then \
+ $(MKINSTALLDIRS) $(libdir) $(includedir); \
+ else \
+ $(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \
+ fi; \
+ $(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \
+ $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \
+ else \
+ : ; \
+ fi
+install-data: all
+ if test "$(PACKAGE)" = "gettext"; then \
+ if test -r $(MKINSTALLDIRS); then \
+ $(MKINSTALLDIRS) $(gettextsrcdir); \
+ else \
+ $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
+ fi; \
+ $(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \
+ dists="$(DISTFILES.common)"; \
+ for file in $$dists; do \
+ $(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall:
+ dists="$(DISTFILES.common)"; \
+ for file in $$dists; do \
+ rm -f $(gettextsrcdir)/$$file; \
+ done
+
+info dvi:
+
+$(OBJECTS): ../include/sane/config.h libgettext.h
+bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
+dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
+
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES)
+ here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
+
+id: ID
+
+ID: $(HEADERS) $(SOURCES)
+ here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
+
+
+mostlyclean:
+ rm -f *.a *.o *.lo core core.*
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile ID TAGS po2msg.sed po2tbl.sed
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+
+# GNU gettext needs not contain the file `VERSION' but contains some
+# other files which should not be distributed in other packages.
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: Makefile $(DISTFILES)
+ if test "$(PACKAGE)" = gettext; then \
+ additional="$(DISTFILES.gettext)"; \
+ else \
+ additional="$(DISTFILES.normal)"; \
+ fi; \
+ for file in $(DISTFILES.common) $$additional; do \
+ ln $(srcdir)/$$file $(distdir) 2> /dev/null \
+ || cp -p $(srcdir)/$$file $(distdir); \
+ done
+
+dist-libc:
+ tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc
+
+Makefile: Makefile.in ../config.status
+ cd .. \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+# The dependency for intlh.inst is different in gettext and all other
+# packages. Because we cannot you GNU make features we have to solve
+# the problem while rewriting Makefile.in.
+@GT_YES@intlh.inst: intlh.inst.in ../config.status
+@GT_YES@ cd .. \
+@GT_YES@ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
+@GT_YES@ $(SHELL) ./config.status
+@GT_NO@.PHONY: intlh.inst
+@GT_NO@intlh.inst:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/intl/VERSION b/intl/VERSION
new file mode 100644
index 0000000..ee66b06
--- /dev/null
+++ b/intl/VERSION
@@ -0,0 +1 @@
+GNU gettext library from gettext-0.10.35
diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c
new file mode 100644
index 0000000..d9c3f34
--- /dev/null
+++ b/intl/bindtextdom.c
@@ -0,0 +1,203 @@
+/* Implementation of the bindtextdomain(3) function
+ Copyright (C) 1995, 1996, 1997, 1998 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+#include "gettext.h"
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+/* Contains the default location of the message catalogs. */
+extern const char _nl_default_dirname[];
+
+/* List with bindings of specific domains. */
+extern struct binding *_nl_domain_bindings;
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define BINDTEXTDOMAIN __bindtextdomain
+# ifndef strdup
+# define strdup(str) __strdup (str)
+# endif
+#else
+# define BINDTEXTDOMAIN bindtextdomain__
+#endif
+
+/* Specify that the DOMAINNAME message catalog will be found
+ in DIRNAME rather than in the system locale data base. */
+char *
+BINDTEXTDOMAIN (domainname, dirname)
+ const char *domainname;
+ const char *dirname;
+{
+ struct binding *binding;
+
+ /* Some sanity checks. */
+ if (domainname == NULL || domainname[0] == '\0')
+ return NULL;
+
+ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+ {
+ int compare = strcmp (domainname, binding->domainname);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It is not in the list. */
+ binding = NULL;
+ break;
+ }
+ }
+
+ if (dirname == NULL)
+ /* The current binding has be to returned. */
+ return binding == NULL ? (char *) _nl_default_dirname : binding->dirname;
+
+ if (binding != NULL)
+ {
+ /* The domain is already bound. If the new value and the old
+ one are equal we simply do nothing. Otherwise replace the
+ old binding. */
+ if (strcmp (dirname, binding->dirname) != 0)
+ {
+ char *new_dirname;
+
+ if (strcmp (dirname, _nl_default_dirname) == 0)
+ new_dirname = (char *) _nl_default_dirname;
+ else
+ {
+#if defined _LIBC || defined HAVE_STRDUP
+ new_dirname = strdup (dirname);
+ if (new_dirname == NULL)
+ return NULL;
+#else
+ size_t len = strlen (dirname) + 1;
+ new_dirname = (char *) malloc (len);
+ if (new_dirname == NULL)
+ return NULL;
+
+ memcpy (new_dirname, dirname, len);
+#endif
+ }
+
+ if (binding->dirname != _nl_default_dirname)
+ free (binding->dirname);
+
+ binding->dirname = new_dirname;
+ }
+ }
+ else
+ {
+ /* We have to create a new binding. */
+#if !defined _LIBC && !defined HAVE_STRDUP
+ size_t len;
+#endif
+ struct binding *new_binding =
+ (struct binding *) malloc (sizeof (*new_binding));
+
+ if (new_binding == NULL)
+ return NULL;
+
+#if defined _LIBC || defined HAVE_STRDUP
+ new_binding->domainname = strdup (domainname);
+ if (new_binding->domainname == NULL)
+ return NULL;
+#else
+ len = strlen (domainname) + 1;
+ new_binding->domainname = (char *) malloc (len);
+ if (new_binding->domainname == NULL)
+ return NULL;
+ memcpy (new_binding->domainname, domainname, len);
+#endif
+
+ if (strcmp (dirname, _nl_default_dirname) == 0)
+ new_binding->dirname = (char *) _nl_default_dirname;
+ else
+ {
+#if defined _LIBC || defined HAVE_STRDUP
+ new_binding->dirname = strdup (dirname);
+ if (new_binding->dirname == NULL)
+ return NULL;
+#else
+ len = strlen (dirname) + 1;
+ new_binding->dirname = (char *) malloc (len);
+ if (new_binding->dirname == NULL)
+ return NULL;
+ memcpy (new_binding->dirname, dirname, len);
+#endif
+ }
+
+ /* Now enqueue it. */
+ if (_nl_domain_bindings == NULL
+ || strcmp (domainname, _nl_domain_bindings->domainname) < 0)
+ {
+ new_binding->next = _nl_domain_bindings;
+ _nl_domain_bindings = new_binding;
+ }
+ else
+ {
+ binding = _nl_domain_bindings;
+ while (binding->next != NULL
+ && strcmp (domainname, binding->next->domainname) > 0)
+ binding = binding->next;
+
+ new_binding->next = binding->next;
+ binding->next = new_binding;
+ }
+
+ binding = new_binding;
+ }
+
+ return binding->dirname;
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__bindtextdomain, bindtextdomain);
+#endif
diff --git a/intl/cat-compat.c b/intl/cat-compat.c
new file mode 100644
index 0000000..867d901
--- /dev/null
+++ b/intl/cat-compat.c
@@ -0,0 +1,262 @@
+/* Compatibility code for gettext-using-catgets interface.
+ Copyright (C) 1995, 1997 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <string.h>
+#else
+char *getenv ();
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# endif
+#endif
+
+#ifdef HAVE_NL_TYPES_H
+# include <nl_types.h>
+#endif
+
+#include "libgettext.h"
+
+/* @@ end of prolog @@ */
+
+/* XPG3 defines the result of `setlocale (category, NULL)' as:
+ ``Directs `setlocale()' to query `category' and return the current
+ setting of `local'.''
+ However it does not specify the exact format. And even worse: POSIX
+ defines this not at all. So we can use this feature only on selected
+ system (e.g. those using GNU C Library). */
+#ifdef _LIBC
+# define HAVE_LOCALE_NULL
+#endif
+
+/* The catalog descriptor. */
+static nl_catd catalog = (nl_catd) -1;
+
+/* Name of the default catalog. */
+static const char default_catalog_name[] = "messages";
+
+/* Name of currently used catalog. */
+static const char *catalog_name = default_catalog_name;
+
+/* Get ID for given string. If not found return -1. */
+static int msg_to_cat_id PARAMS ((const char *msg));
+
+/* Substitution for systems lacking this function in their C library. */
+#if !_LIBC && !HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+#endif
+
+
+/* Set currently used domain/catalog. */
+char *
+textdomain (domainname)
+ const char *domainname;
+{
+ nl_catd new_catalog;
+ char *new_name;
+ size_t new_name_len;
+ char *lang;
+
+#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES \
+ && defined HAVE_LOCALE_NULL
+ lang = setlocale (LC_MESSAGES, NULL);
+#else
+ lang = getenv ("LC_ALL");
+ if (lang == NULL || lang[0] == '\0')
+ {
+ lang = getenv ("LC_MESSAGES");
+ if (lang == NULL || lang[0] == '\0')
+ lang = getenv ("LANG");
+ }
+#endif
+ if (lang == NULL || lang[0] == '\0')
+ lang = "C";
+
+ /* See whether name of currently used domain is asked. */
+ if (domainname == NULL)
+ return (char *) catalog_name;
+
+ if (domainname[0] == '\0')
+ domainname = default_catalog_name;
+
+ /* Compute length of added path element. */
+ new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang)
+ + sizeof ("/LC_MESSAGES/") - 1 + sizeof (PACKAGE) - 1
+ + sizeof (".cat");
+
+ new_name = (char *) malloc (new_name_len);
+ if (new_name == NULL)
+ return NULL;
+
+ strcpy (new_name, PACKAGE);
+ new_catalog = catopen (new_name, 0);
+
+ if (new_catalog == (nl_catd) -1)
+ {
+ /* NLSPATH search didn't work, try absolute path */
+ sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang,
+ PACKAGE);
+ new_catalog = catopen (new_name, 0);
+
+ if (new_catalog == (nl_catd) -1)
+ {
+ free (new_name);
+ return (char *) catalog_name;
+ }
+ }
+
+ /* Close old catalog. */
+ if (catalog != (nl_catd) -1)
+ catclose (catalog);
+ if (catalog_name != default_catalog_name)
+ free ((char *) catalog_name);
+
+ catalog = new_catalog;
+ catalog_name = new_name;
+
+ return (char *) catalog_name;
+}
+
+char *
+bindtextdomain (domainname, dirname)
+ const char *domainname;
+ const char *dirname;
+{
+#if HAVE_SETENV || HAVE_PUTENV
+ char *old_val, *new_val, *cp;
+ size_t new_val_len;
+
+ /* This does not make much sense here but to be compatible do it. */
+ if (domainname == NULL)
+ return NULL;
+
+ /* Compute length of added path element. If we use setenv we don't need
+ the first byts for NLSPATH=, but why complicate the code for this
+ peanuts. */
+ new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname)
+ + sizeof ("/%L/LC_MESSAGES/%N.cat");
+
+ old_val = getenv ("NLSPATH");
+ if (old_val == NULL || old_val[0] == '\0')
+ {
+ old_val = NULL;
+ new_val_len += 1 + sizeof (LOCALEDIR) - 1
+ + sizeof ("/%L/LC_MESSAGES/%N.cat");
+ }
+ else
+ new_val_len += strlen (old_val);
+
+ new_val = (char *) malloc (new_val_len);
+ if (new_val == NULL)
+ return NULL;
+
+# if HAVE_SETENV
+ cp = new_val;
+# else
+ cp = stpcpy (new_val, "NLSPATH=");
+# endif
+
+ cp = stpcpy (cp, dirname);
+ cp = stpcpy (cp, "/%L/LC_MESSAGES/%N.cat:");
+
+ if (old_val == NULL)
+ {
+# if __STDC__
+ stpcpy (cp, LOCALEDIR "/%L/LC_MESSAGES/%N.cat");
+# else
+
+ cp = stpcpy (cp, LOCALEDIR);
+ stpcpy (cp, "/%L/LC_MESSAGES/%N.cat");
+# endif
+ }
+ else
+ stpcpy (cp, old_val);
+
+# if HAVE_SETENV
+ setenv ("NLSPATH", new_val, 1);
+ free (new_val);
+# else
+ putenv (new_val);
+ /* Do *not* free the environment entry we just entered. It is used
+ from now on. */
+# endif
+
+#endif
+
+ return (char *) domainname;
+}
+
+#undef gettext
+char *
+gettext (msg)
+ const char *msg;
+{
+ int msgid;
+
+ if (msg == NULL || catalog == (nl_catd) -1)
+ return (char *) msg;
+
+ /* Get the message from the catalog. We always use set number 1.
+ The message ID is computed by the function `msg_to_cat_id'
+ which works on the table generated by `po-to-tbl'. */
+ msgid = msg_to_cat_id (msg);
+ if (msgid == -1)
+ return (char *) msg;
+
+ return catgets (catalog, 1, msgid, (char *) msg);
+}
+
+/* Look through the table `_msg_tbl' which has `_msg_tbl_length' entries
+ for the one equal to msg. If it is found return the ID. In case when
+ the string is not found return -1. */
+static int
+msg_to_cat_id (msg)
+ const char *msg;
+{
+ int cnt;
+
+ for (cnt = 0; cnt < _msg_tbl_length; ++cnt)
+ if (strcmp (msg, _msg_tbl[cnt]._msg) == 0)
+ return _msg_tbl[cnt]._msg_number;
+
+ return -1;
+}
+
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library. So we
+ avoid the non-standard function stpcpy. In GNU C Library this
+ function is available, though. Also allow the symbol HAVE_STPCPY
+ to be defined. */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+ char *dest;
+ const char *src;
+{
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+ return dest - 1;
+}
+#endif
diff --git a/intl/dcgettext.c b/intl/dcgettext.c
new file mode 100644
index 0000000..c4c7a2c
--- /dev/null
+++ b/intl/dcgettext.c
@@ -0,0 +1,624 @@
+/* Implementation of the dcgettext(3) function.
+ Copyright (C) 1995, 1996, 1997, 1998 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/types.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+#endif
+
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+#ifndef __set_errno
+# define __set_errno(val) errno = (val)
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+char *getenv ();
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+# endif
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+#include "hash-string.h"
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define getcwd __getcwd
+# ifndef stpcpy
+# define stpcpy __stpcpy
+# endif
+#else
+# if !defined HAVE_GETCWD
+char *getwd ();
+# define getcwd(buf, max) getwd (buf)
+# else
+char *getcwd ();
+# endif
+# ifndef HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+# endif
+#endif
+
+/* Amount to increase buffer size by in each try. */
+#define PATH_INCR 32
+
+/* The following is from pathmax.h. */
+/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
+ PATH_MAX but might cause redefinition warnings when sys/param.h is
+ later included (as on MORE/BSD 4.3). */
+#if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__))
+# include <limits.h>
+#endif
+
+#ifndef _POSIX_PATH_MAX
+# define _POSIX_PATH_MAX 255
+#endif
+
+#if !defined(PATH_MAX) && defined(_PC_PATH_MAX)
+# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
+#endif
+
+/* Don't include sys/param.h if it already has been. */
+#if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN)
+# include <sys/param.h>
+#endif
+
+#if !defined(PATH_MAX) && defined(MAXPATHLEN)
+# define PATH_MAX MAXPATHLEN
+#endif
+
+#ifndef PATH_MAX
+# define PATH_MAX _POSIX_PATH_MAX
+#endif
+
+/* XPG3 defines the result of `setlocale (category, NULL)' as:
+ ``Directs `setlocale()' to query `category' and return the current
+ setting of `local'.''
+ However it does not specify the exact format. And even worse: POSIX
+ defines this not at all. So we can use this feature only on selected
+ system (e.g. those using GNU C Library). */
+#ifdef _LIBC
+# define HAVE_LOCALE_NULL
+#endif
+
+/* Name of the default domain used for gettext(3) prior any call to
+ textdomain(3). The default value for this is "messages". */
+const char _nl_default_default_domain[] = "messages";
+
+/* Value used as the default domain for gettext(3). */
+const char *_nl_current_default_domain = _nl_default_default_domain;
+
+/* Contains the default location of the message catalogs. */
+const char _nl_default_dirname[] = GNULOCALEDIR;
+
+/* List with bindings of specific domains created by bindtextdomain()
+ calls. */
+struct binding *_nl_domain_bindings;
+
+/* Prototypes for local functions. */
+static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file,
+ const char *msgid)) internal_function;
+static const char *category_to_name PARAMS ((int category)) internal_function;
+static const char *guess_category_value PARAMS ((int category,
+ const char *categoryname))
+ internal_function;
+
+
+/* For those loosing systems which don't have `alloca' we have to add
+ some additional code emulating it. */
+#ifdef HAVE_ALLOCA
+/* Nothing has to be done. */
+# define ADD_BLOCK(list, address) /* nothing */
+# define FREE_BLOCKS(list) /* nothing */
+#else
+struct block_list
+{
+ void *address;
+ struct block_list *next;
+};
+# define ADD_BLOCK(list, addr) \
+ do { \
+ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
+ /* If we cannot get a free block we cannot add the new element to \
+ the list. */ \
+ if (newp != NULL) { \
+ newp->address = (addr); \
+ newp->next = (list); \
+ (list) = newp; \
+ } \
+ } while (0)
+# define FREE_BLOCKS(list) \
+ do { \
+ while (list != NULL) { \
+ struct block_list *old = list; \
+ list = list->next; \
+ free (old); \
+ } \
+ } while (0)
+# undef alloca
+# define alloca(size) (malloc (size))
+#endif /* have alloca */
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DCGETTEXT __dcgettext
+#else
+# define DCGETTEXT dcgettext__
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+char *
+DCGETTEXT (domainname, msgid, category)
+ const char *domainname;
+ const char *msgid;
+ int category;
+{
+#ifndef HAVE_ALLOCA
+ struct block_list *block_list = NULL;
+#endif
+ struct loaded_l10nfile *domain;
+ struct binding *binding;
+ const char *categoryname;
+ const char *categoryvalue;
+ char *dirname, *xdomainname;
+ char *single_locale;
+ char *retval;
+ int saved_errno = errno;
+
+ /* If no real MSGID is given return NULL. */
+ if (msgid == NULL)
+ return NULL;
+
+ /* If DOMAINNAME is NULL, we are interested in the default domain. If
+ CATEGORY is not LC_MESSAGES this might not make much sense but the
+ defintion left this undefined. */
+ if (domainname == NULL)
+ domainname = _nl_current_default_domain;
+
+ /* First find matching binding. */
+ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+ {
+ int compare = strcmp (domainname, binding->domainname);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It is not in the list. */
+ binding = NULL;
+ break;
+ }
+ }
+
+ if (binding == NULL)
+ dirname = (char *) _nl_default_dirname;
+ else if (binding->dirname[0] == '/')
+ dirname = binding->dirname;
+ else
+ {
+ /* We have a relative path. Make it absolute now. */
+ size_t dirname_len = strlen (binding->dirname) + 1;
+ size_t path_max;
+ char *ret;
+
+ path_max = (unsigned) PATH_MAX;
+ path_max += 2; /* The getcwd docs say to do this. */
+
+ dirname = (char *) alloca (path_max + dirname_len);
+ ADD_BLOCK (block_list, dirname);
+
+ __set_errno (0);
+ while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE)
+ {
+ path_max += PATH_INCR;
+ dirname = (char *) alloca (path_max + dirname_len);
+ ADD_BLOCK (block_list, dirname);
+ __set_errno (0);
+ }
+
+ if (ret == NULL)
+ {
+ /* We cannot get the current working directory. Don't signal an
+ error but simply return the default string. */
+ FREE_BLOCKS (block_list);
+ __set_errno (saved_errno);
+ return (char *) msgid;
+ }
+
+ stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
+ }
+
+ /* Now determine the symbolic name of CATEGORY and its value. */
+ categoryname = category_to_name (category);
+ categoryvalue = guess_category_value (category, categoryname);
+
+ xdomainname = (char *) alloca (strlen (categoryname)
+ + strlen (domainname) + 5);
+ ADD_BLOCK (block_list, xdomainname);
+
+ stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
+ domainname),
+ ".mo");
+
+ /* Creating working area. */
+ single_locale = (char *) alloca (strlen (categoryvalue) + 1);
+ ADD_BLOCK (block_list, single_locale);
+
+
+ /* Search for the given string. This is a loop because we perhaps
+ got an ordered list of languages to consider for th translation. */
+ while (1)
+ {
+ /* Make CATEGORYVALUE point to the next element of the list. */
+ while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
+ ++categoryvalue;
+ if (categoryvalue[0] == '\0')
+ {
+ /* The whole contents of CATEGORYVALUE has been searched but
+ no valid entry has been found. We solve this situation
+ by implicitly appending a "C" entry, i.e. no translation
+ will take place. */
+ single_locale[0] = 'C';
+ single_locale[1] = '\0';
+ }
+ else
+ {
+ char *cp = single_locale;
+ while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
+ *cp++ = *categoryvalue++;
+ *cp = '\0';
+ }
+
+ /* If the current locale value is C (or POSIX) we don't load a
+ domain. Return the MSGID. */
+ if (strcmp (single_locale, "C") == 0
+ || strcmp (single_locale, "POSIX") == 0)
+ {
+ FREE_BLOCKS (block_list);
+ __set_errno (saved_errno);
+ return (char *) msgid;
+ }
+
+
+ /* Find structure describing the message catalog matching the
+ DOMAINNAME and CATEGORY. */
+ domain = _nl_find_domain (dirname, single_locale, xdomainname);
+
+ if (domain != NULL)
+ {
+ retval = find_msg (domain, msgid);
+
+ if (retval == NULL)
+ {
+ int cnt;
+
+ for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
+ {
+ retval = find_msg (domain->successor[cnt], msgid);
+
+ if (retval != NULL)
+ break;
+ }
+ }
+
+ if (retval != NULL)
+ {
+ FREE_BLOCKS (block_list);
+ __set_errno (saved_errno);
+ return retval;
+ }
+ }
+ }
+ /* NOTREACHED */
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dcgettext, dcgettext);
+#endif
+
+
+static char *
+internal_function
+find_msg (domain_file, msgid)
+ struct loaded_l10nfile *domain_file;
+ const char *msgid;
+{
+ size_t top, act, bottom;
+ struct loaded_domain *domain;
+
+ if (domain_file->decided == 0)
+ _nl_load_domain (domain_file);
+
+ if (domain_file->data == NULL)
+ return NULL;
+
+ domain = (struct loaded_domain *) domain_file->data;
+
+ /* Locate the MSGID and its translation. */
+ if (domain->hash_size > 2 && domain->hash_tab != NULL)
+ {
+ /* Use the hashing table. */
+ nls_uint32 len = strlen (msgid);
+ nls_uint32 hash_val = hash_string (msgid);
+ nls_uint32 idx = hash_val % domain->hash_size;
+ nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
+ nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]);
+
+ if (nstr == 0)
+ /* Hash table entry is empty. */
+ return NULL;
+
+ if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
+ && strcmp (msgid,
+ domain->data + W (domain->must_swap,
+ domain->orig_tab[nstr - 1].offset)) == 0)
+ return (char *) domain->data + W (domain->must_swap,
+ domain->trans_tab[nstr - 1].offset);
+
+ while (1)
+ {
+ if (idx >= domain->hash_size - incr)
+ idx -= domain->hash_size - incr;
+ else
+ idx += incr;
+
+ nstr = W (domain->must_swap, domain->hash_tab[idx]);
+ if (nstr == 0)
+ /* Hash table entry is empty. */
+ return NULL;
+
+ if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
+ && strcmp (msgid,
+ domain->data + W (domain->must_swap,
+ domain->orig_tab[nstr - 1].offset))
+ == 0)
+ return (char *) domain->data
+ + W (domain->must_swap, domain->trans_tab[nstr - 1].offset);
+ }
+ /* NOTREACHED */
+ }
+
+ /* Now we try the default method: binary search in the sorted
+ array of messages. */
+ bottom = 0;
+ top = domain->nstrings;
+ while (bottom < top)
+ {
+ int cmp_val;
+
+ act = (bottom + top) / 2;
+ cmp_val = strcmp (msgid, domain->data
+ + W (domain->must_swap,
+ domain->orig_tab[act].offset));
+ if (cmp_val < 0)
+ top = act;
+ else if (cmp_val > 0)
+ bottom = act + 1;
+ else
+ break;
+ }
+
+ /* If an translation is found return this. */
+ return bottom >= top ? NULL : (char *) domain->data
+ + W (domain->must_swap,
+ domain->trans_tab[act].offset);
+}
+
+
+/* Return string representation of locale CATEGORY. */
+static const char *
+internal_function
+category_to_name (category)
+ int category;
+{
+ const char *retval;
+
+ switch (category)
+ {
+#ifdef LC_COLLATE
+ case LC_COLLATE:
+ retval = "LC_COLLATE";
+ break;
+#endif
+#ifdef LC_CTYPE
+ case LC_CTYPE:
+ retval = "LC_CTYPE";
+ break;
+#endif
+#ifdef LC_MONETARY
+ case LC_MONETARY:
+ retval = "LC_MONETARY";
+ break;
+#endif
+#ifdef LC_NUMERIC
+ case LC_NUMERIC:
+ retval = "LC_NUMERIC";
+ break;
+#endif
+#ifdef LC_TIME
+ case LC_TIME:
+ retval = "LC_TIME";
+ break;
+#endif
+#ifdef LC_MESSAGES
+ case LC_MESSAGES:
+ retval = "LC_MESSAGES";
+ break;
+#endif
+#ifdef LC_RESPONSE
+ case LC_RESPONSE:
+ retval = "LC_RESPONSE";
+ break;
+#endif
+#ifdef LC_ALL
+ case LC_ALL:
+ /* This might not make sense but is perhaps better than any other
+ value. */
+ retval = "LC_ALL";
+ break;
+#endif
+ default:
+ /* If you have a better idea for a default value let me know. */
+ retval = "LC_XXX";
+ }
+
+ return retval;
+}
+
+/* Guess value of current locale from value of the environment variables. */
+static const char *
+internal_function
+guess_category_value (category, categoryname)
+ int category;
+ const char *categoryname;
+{
+ const char *retval;
+
+ /* The highest priority value is the `LANGUAGE' environment
+ variable. This is a GNU extension. */
+ retval = getenv ("LANGUAGE");
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+
+ /* `LANGUAGE' is not set. So we have to proceed with the POSIX
+ methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some
+ systems this can be done by the `setlocale' function itself. */
+#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
+ return setlocale (category, NULL);
+#else
+ /* Setting of LC_ALL overwrites all other. */
+ retval = getenv ("LC_ALL");
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+
+ /* Next comes the name of the desired category. */
+ retval = getenv (categoryname);
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+
+ /* Last possibility is the LANG environment variable. */
+ retval = getenv ("LANG");
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+
+ /* We use C as the default domain. POSIX says this is implementation
+ defined. */
+ return "C";
+#endif
+}
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library. So we
+ avoid the non-standard function stpcpy. In GNU C Library this
+ function is available, though. Also allow the symbol HAVE_STPCPY
+ to be defined. */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+ char *dest;
+ const char *src;
+{
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+ return dest - 1;
+}
+#endif
+
+
+#ifdef _LIBC
+/* If we want to free all resources we have to do some work at
+ program's end. */
+static void __attribute__ ((unused))
+free_mem (void)
+{
+ struct binding *runp;
+
+ for (runp = _nl_domain_bindings; runp != NULL; runp = runp->next)
+ {
+ free (runp->domainname);
+ if (runp->dirname != _nl_default_dirname)
+ /* Yes, this is a pointer comparison. */
+ free (runp->dirname);
+ }
+
+ if (_nl_current_default_domain != _nl_default_default_domain)
+ /* Yes, again a pointer comparison. */
+ free ((char *) _nl_current_default_domain);
+}
+
+text_set_element (__libc_subfreeres, free_mem);
+#endif
diff --git a/intl/dgettext.c b/intl/dgettext.c
new file mode 100644
index 0000000..0510c2b
--- /dev/null
+++ b/intl/dgettext.c
@@ -0,0 +1,59 @@
+/* Implementation of the dgettext(3) function
+ Copyright (C) 1995, 1996, 1997 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined HAVE_LOCALE_H || defined _LIBC
+# include <locale.h>
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DGETTEXT __dgettext
+# define DCGETTEXT __dcgettext
+#else
+# define DGETTEXT dgettext__
+# define DCGETTEXT dcgettext__
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog of the current
+ LC_MESSAGES locale. */
+char *
+DGETTEXT (domainname, msgid)
+ const char *domainname;
+ const char *msgid;
+{
+ return DCGETTEXT (domainname, msgid, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dgettext, dgettext);
+#endif
diff --git a/intl/explodename.c b/intl/explodename.c
new file mode 100644
index 0000000..8066dc2
--- /dev/null
+++ b/intl/explodename.c
@@ -0,0 +1,188 @@
+/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+#include <sys/types.h>
+
+#include "loadinfo.h"
+
+/* On some strange systems still no definition of NULL is found. Sigh! */
+#ifndef NULL
+# if defined __STDC__ && __STDC__
+# define NULL ((void *) 0)
+# else
+# define NULL 0
+# endif
+#endif
+
+/* @@ end of prolog @@ */
+
+int
+_nl_explode_name (name, language, modifier, territory, codeset,
+ normalized_codeset, special, sponsor, revision)
+ char *name;
+ const char **language;
+ const char **modifier;
+ const char **territory;
+ const char **codeset;
+ const char **normalized_codeset;
+ const char **special;
+ const char **sponsor;
+ const char **revision;
+{
+ enum { undecided, xpg, cen } syntax;
+ char *cp;
+ int mask;
+
+ *modifier = NULL;
+ *territory = NULL;
+ *codeset = NULL;
+ *normalized_codeset = NULL;
+ *special = NULL;
+ *sponsor = NULL;
+ *revision = NULL;
+
+ /* Now we determine the single parts of the locale name. First
+ look for the language. Termination symbols are `_' and `@' if
+ we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
+ mask = 0;
+ syntax = undecided;
+ *language = cp = name;
+ while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@'
+ && cp[0] != '+' && cp[0] != ',')
+ ++cp;
+
+ if (*language == cp)
+ /* This does not make sense: language has to be specified. Use
+ this entry as it is without exploding. Perhaps it is an alias. */
+ cp = strchr (*language, '\0');
+ else if (cp[0] == '_')
+ {
+ /* Next is the territory. */
+ cp[0] = '\0';
+ *territory = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@'
+ && cp[0] != '+' && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= TERRITORY;
+
+ if (cp[0] == '.')
+ {
+ /* Next is the codeset. */
+ syntax = xpg;
+ cp[0] = '\0';
+ *codeset = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '@')
+ ++cp;
+
+ mask |= XPG_CODESET;
+
+ if (*codeset != cp && (*codeset)[0] != '\0')
+ {
+ *normalized_codeset = _nl_normalize_codeset (*codeset,
+ cp - *codeset);
+ if (strcmp (*codeset, *normalized_codeset) == 0)
+ free ((char *) *normalized_codeset);
+ else
+ mask |= XPG_NORM_CODESET;
+ }
+ }
+ }
+
+ if (cp[0] == '@' || (syntax != xpg && cp[0] == '+'))
+ {
+ /* Next is the modifier. */
+ syntax = cp[0] == '@' ? xpg : cen;
+ cp[0] = '\0';
+ *modifier = ++cp;
+
+ while (syntax == cen && cp[0] != '\0' && cp[0] != '+'
+ && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= XPG_MODIFIER | CEN_AUDIENCE;
+ }
+
+ if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_'))
+ {
+ syntax = cen;
+
+ if (cp[0] == '+')
+ {
+ /* Next is special application (CEN syntax). */
+ cp[0] = '\0';
+ *special = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= CEN_SPECIAL;
+ }
+
+ if (cp[0] == ',')
+ {
+ /* Next is sponsor (CEN syntax). */
+ cp[0] = '\0';
+ *sponsor = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '_')
+ ++cp;
+
+ mask |= CEN_SPONSOR;
+ }
+
+ if (cp[0] == '_')
+ {
+ /* Next is revision (CEN syntax). */
+ cp[0] = '\0';
+ *revision = ++cp;
+
+ mask |= CEN_REVISION;
+ }
+ }
+
+ /* For CEN syntax values it might be important to have the
+ separator character in the file name, not for XPG syntax. */
+ if (syntax == xpg)
+ {
+ if (*territory != NULL && (*territory)[0] == '\0')
+ mask &= ~TERRITORY;
+
+ if (*codeset != NULL && (*codeset)[0] == '\0')
+ mask &= ~XPG_CODESET;
+
+ if (*modifier != NULL && (*modifier)[0] == '\0')
+ mask &= ~XPG_MODIFIER;
+ }
+
+ return mask;
+}
diff --git a/intl/finddomain.c b/intl/finddomain.c
new file mode 100644
index 0000000..81ea29b
--- /dev/null
+++ b/intl/finddomain.c
@@ -0,0 +1,216 @@
+/* Handle list of needed message catalogs
+ Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+/* List of already loaded domains. */
+static struct loaded_l10nfile *_nl_loaded_domains;
+
+
+/* Return a data structure describing the message catalog described by
+ the DOMAINNAME and CATEGORY parameters with respect to the currently
+ established bindings. */
+struct loaded_l10nfile *
+internal_function
+_nl_find_domain (dirname, locale, domainname)
+ const char *dirname;
+ char *locale;
+ const char *domainname;
+{
+ struct loaded_l10nfile *retval;
+ const char *language;
+ const char *modifier;
+ const char *territory;
+ const char *codeset;
+ const char *normalized_codeset;
+ const char *special;
+ const char *sponsor;
+ const char *revision;
+ const char *alias_value;
+ int mask;
+
+ /* LOCALE can consist of up to four recognized parts for the XPG syntax:
+
+ language[_territory[.codeset]][@modifier]
+
+ and six parts for the CEN syntax:
+
+ language[_territory][+audience][+special][,[sponsor][_revision]]
+
+ Beside the first part all of them are allowed to be missing. If
+ the full specified locale is not found, the less specific one are
+ looked for. The various parts will be stripped off according to
+ the following order:
+ (1) revision
+ (2) sponsor
+ (3) special
+ (4) codeset
+ (5) normalized codeset
+ (6) territory
+ (7) audience/modifier
+ */
+
+ /* If we have already tested for this locale entry there has to
+ be one data set in the list of loaded domains. */
+ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
+ strlen (dirname) + 1, 0, locale, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, domainname, 0);
+ if (retval != NULL)
+ {
+ /* We know something about this locale. */
+ int cnt;
+
+ if (retval->decided == 0)
+ _nl_load_domain (retval);
+
+ if (retval->data != NULL)
+ return retval;
+
+ for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ {
+ if (retval->successor[cnt]->decided == 0)
+ _nl_load_domain (retval->successor[cnt]);
+
+ if (retval->successor[cnt]->data != NULL)
+ break;
+ }
+ return cnt >= 0 ? retval : NULL;
+ /* NOTREACHED */
+ }
+
+ /* See whether the locale value is an alias. If yes its value
+ *overwrites* the alias name. No test for the original value is
+ done. */
+ alias_value = _nl_expand_alias (locale);
+ if (alias_value != NULL)
+ {
+#if defined _LIBC || defined HAVE_STRDUP
+ locale = strdup (alias_value);
+ if (locale == NULL)
+ return NULL;
+#else
+ size_t len = strlen (alias_value) + 1;
+ locale = (char *) malloc (len);
+ if (locale == NULL)
+ return NULL;
+
+ memcpy (locale, alias_value, len);
+#endif
+ }
+
+ /* Now we determine the single parts of the locale name. First
+ look for the language. Termination symbols are `_' and `@' if
+ we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
+ mask = _nl_explode_name (locale, &language, &modifier, &territory,
+ &codeset, &normalized_codeset, &special,
+ &sponsor, &revision);
+
+ /* Create all possible locale entries which might be interested in
+ generalization. */
+ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
+ strlen (dirname) + 1, mask, language, territory,
+ codeset, normalized_codeset, modifier, special,
+ sponsor, revision, domainname, 1);
+ if (retval == NULL)
+ /* This means we are out of core. */
+ return NULL;
+
+ if (retval->decided == 0)
+ _nl_load_domain (retval);
+ if (retval->data == NULL)
+ {
+ int cnt;
+ for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ {
+ if (retval->successor[cnt]->decided == 0)
+ _nl_load_domain (retval->successor[cnt]);
+ if (retval->successor[cnt]->data != NULL)
+ break;
+ }
+ }
+
+ /* The room for an alias was dynamically allocated. Free it now. */
+ if (alias_value != NULL)
+ free (locale);
+
+ return retval;
+}
+
+
+#ifdef _LIBC
+static void __attribute__ ((unused))
+free_mem (void)
+{
+ struct loaded_l10nfile *runp = _nl_loaded_domains;
+
+ while (runp != NULL)
+ {
+ struct loaded_l10nfile *here = runp;
+ if (runp->data != NULL)
+ _nl_unload_domain ((struct loaded_domain *) runp->data);
+ runp = runp->next;
+ free (here);
+ }
+}
+
+text_set_element (__libc_subfreeres, free_mem);
+#endif
diff --git a/intl/gettext.c b/intl/gettext.c
new file mode 100644
index 0000000..d929f98
--- /dev/null
+++ b/intl/gettext.c
@@ -0,0 +1,70 @@
+/* Implementation of gettext(3) function.
+ Copyright (C) 1995, 1997 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _LIBC
+# define __need_NULL
+# include <stddef.h>
+#else
+# ifdef STDC_HEADERS
+# include <stdlib.h> /* Just for NULL. */
+# else
+# ifdef HAVE_STRING_H
+# include <string.h>
+# else
+# define NULL ((void *) 0)
+# endif
+# endif
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define GETTEXT __gettext
+# define DGETTEXT __dgettext
+#else
+# define GETTEXT gettext__
+# define DGETTEXT dgettext__
+#endif
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+char *
+GETTEXT (msgid)
+ const char *msgid;
+{
+ return DGETTEXT (NULL, msgid);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__gettext, gettext);
+#endif
diff --git a/intl/gettext.h b/intl/gettext.h
new file mode 100644
index 0000000..3cd23d7
--- /dev/null
+++ b/intl/gettext.h
@@ -0,0 +1,105 @@
+/* Internal header for GNU gettext internationalization functions.
+ Copyright (C) 1995, 1997 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 2, 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 Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _GETTEXT_H
+#define _GETTEXT_H 1
+
+#include <stdio.h>
+
+#if HAVE_LIMITS_H || _LIBC
+# include <limits.h>
+#endif
+
+/* @@ end of prolog @@ */
+
+/* The magic number of the GNU message catalog format. */
+#define _MAGIC 0x950412de
+#define _MAGIC_SWAPPED 0xde120495
+
+/* Revision number of the currently used .mo (binary) file format. */
+#define MO_REVISION_NUMBER 0
+
+/* The following contortions are an attempt to use the C preprocessor
+ to determine an unsigned integral type that is 32 bits wide. An
+ alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
+ doing that would require that the configure script compile and *run*
+ the resulting executable. Locally running cross-compiled executables
+ is usually not possible. */
+
+#if __STDC__
+# define UINT_MAX_32_BITS 4294967295U
+#else
+# define UINT_MAX_32_BITS 0xFFFFFFFF
+#endif
+
+/* If UINT_MAX isn't defined, assume it's a 32-bit type.
+ This should be valid for all systems GNU cares about because
+ that doesn't include 16-bit systems, and only modern systems
+ (that certainly have <limits.h>) have 64+-bit integral types. */
+
+#ifndef UINT_MAX
+# define UINT_MAX UINT_MAX_32_BITS
+#endif
+
+#if UINT_MAX == UINT_MAX_32_BITS
+typedef unsigned nls_uint32;
+#else
+# if USHRT_MAX == UINT_MAX_32_BITS
+typedef unsigned short nls_uint32;
+# else
+# if ULONG_MAX == UINT_MAX_32_BITS
+typedef unsigned long nls_uint32;
+# else
+ /* The following line is intended to throw an error. Using #error is
+ not portable enough. */
+ "Cannot determine unsigned 32-bit data type."
+# endif
+# endif
+#endif
+
+
+/* Header for binary .mo file format. */
+struct mo_file_header
+{
+ /* The magic number. */
+ nls_uint32 magic;
+ /* The revision number of the file format. */
+ nls_uint32 revision;
+ /* The number of strings pairs. */
+ nls_uint32 nstrings;
+ /* Offset of table with start offsets of original strings. */
+ nls_uint32 orig_tab_offset;
+ /* Offset of table with start offsets of translation strings. */
+ nls_uint32 trans_tab_offset;
+ /* Size of hashing table. */
+ nls_uint32 hash_tab_size;
+ /* Offset of first hashing entry. */
+ nls_uint32 hash_tab_offset;
+};
+
+struct string_desc
+{
+ /* Length of addressed string. */
+ nls_uint32 length;
+ /* Offset of string in file. */
+ nls_uint32 offset;
+};
+
+/* @@ begin of epilog @@ */
+
+#endif /* gettext.h */
diff --git a/intl/gettextP.h b/intl/gettextP.h
new file mode 100644
index 0000000..00c5203
--- /dev/null
+++ b/intl/gettextP.h
@@ -0,0 +1,89 @@
+/* Header describing internals of gettext library
+ Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _GETTEXTP_H
+#define _GETTEXTP_H
+
+#include "loadinfo.h"
+
+/* @@ end of prolog @@ */
+
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif
+#endif
+
+#ifndef internal_function
+# define internal_function
+#endif
+
+#ifndef W
+# define W(flag, data) ((flag) ? SWAP (data) : (data))
+#endif
+
+
+#ifdef _LIBC
+# include <byteswap.h>
+# define SWAP(i) bswap_32 (i)
+#else
+static nls_uint32 SWAP PARAMS ((nls_uint32 i));
+
+static inline nls_uint32
+SWAP (i)
+ nls_uint32 i;
+{
+ return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
+}
+#endif
+
+
+struct loaded_domain
+{
+ const char *data;
+ int use_mmap;
+ size_t mmap_size;
+ int must_swap;
+ nls_uint32 nstrings;
+ struct string_desc *orig_tab;
+ struct string_desc *trans_tab;
+ nls_uint32 hash_size;
+ nls_uint32 *hash_tab;
+};
+
+struct binding
+{
+ struct binding *next;
+ char *domainname;
+ char *dirname;
+};
+
+struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
+ char *__locale,
+ const char *__domainname))
+ internal_function;
+void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain))
+ internal_function;
+void _nl_unload_domain PARAMS ((struct loaded_domain *__domain))
+ internal_function;
+
+/* @@ begin of epilog @@ */
+
+#endif /* gettextP.h */
diff --git a/intl/hash-string.h b/intl/hash-string.h
new file mode 100644
index 0000000..cacb38e
--- /dev/null
+++ b/intl/hash-string.h
@@ -0,0 +1,59 @@
+/* Implements a string hashing function.
+ Copyright (C) 1995, 1997 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 2, 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 Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* @@ end of prolog @@ */
+
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(Args) Args
+# else
+# define PARAMS(Args) ()
+# endif
+#endif
+
+/* We assume to have `unsigned long int' value with at least 32 bits. */
+#define HASHWORDBITS 32
+
+
+/* Defines the so called `hashpjw' function by P.J. Weinberger
+ [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
+ 1986, 1987 Bell Telephone Laboratories, Inc.] */
+static unsigned long hash_string PARAMS ((const char *__str_param));
+
+static inline unsigned long
+hash_string (str_param)
+ const char *str_param;
+{
+ unsigned long int hval, g;
+ const char *str = str_param;
+
+ /* Compute the hash value for the given string. */
+ hval = 0;
+ while (*str != '\0')
+ {
+ hval <<= 4;
+ hval += (unsigned long) *str++;
+ g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4));
+ if (g != 0)
+ {
+ hval ^= g >> (HASHWORDBITS - 8);
+ hval ^= g;
+ }
+ }
+ return hval;
+}
diff --git a/intl/intl-compat.c b/intl/intl-compat.c
new file mode 100644
index 0000000..503efa0
--- /dev/null
+++ b/intl/intl-compat.c
@@ -0,0 +1,76 @@
+/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
+ Library.
+ Copyright (C) 1995 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "libgettext.h"
+
+/* @@ end of prolog @@ */
+
+
+#undef gettext
+#undef dgettext
+#undef dcgettext
+#undef textdomain
+#undef bindtextdomain
+
+
+char *
+bindtextdomain (domainname, dirname)
+ const char *domainname;
+ const char *dirname;
+{
+ return bindtextdomain__ (domainname, dirname);
+}
+
+
+char *
+dcgettext (domainname, msgid, category)
+ const char *domainname;
+ const char *msgid;
+ int category;
+{
+ return dcgettext__ (domainname, msgid, category);
+}
+
+
+char *
+dgettext (domainname, msgid)
+ const char *domainname;
+ const char *msgid;
+{
+ return dgettext__ (domainname, msgid);
+}
+
+
+char *
+gettext (msgid)
+ const char *msgid;
+{
+ return gettext__ (msgid);
+}
+
+
+char *
+textdomain (domainname)
+ const char *domainname;
+{
+ return textdomain__ (domainname);
+}
diff --git a/intl/l10nflist.c b/intl/l10nflist.c
new file mode 100644
index 0000000..9c7dc18
--- /dev/null
+++ b/intl/l10nflist.c
@@ -0,0 +1,411 @@
+/* Handle list of needed message catalogs
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+
+#if defined HAVE_STRING_H || defined _LIBC
+# ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+# endif
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#if defined _LIBC || defined HAVE_ARGZ_H
+# include <argz.h>
+#endif
+#include <ctype.h>
+#include <sys/types.h>
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+#include "loadinfo.h"
+
+/* On some strange systems still no definition of NULL is found. Sigh! */
+#ifndef NULL
+# if defined __STDC__ && __STDC__
+# define NULL ((void *) 0)
+# else
+# define NULL 0
+# endif
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# ifndef stpcpy
+# define stpcpy(dest, src) __stpcpy(dest, src)
+# endif
+#else
+# ifndef HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+# endif
+#endif
+
+/* Define function which are usually not available. */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_COUNT
+/* Returns the number of strings in ARGZ. */
+static size_t argz_count__ PARAMS ((const char *argz, size_t len));
+
+static size_t
+argz_count__ (argz, len)
+ const char *argz;
+ size_t len;
+{
+ size_t count = 0;
+ while (len > 0)
+ {
+ size_t part_len = strlen (argz);
+ argz += part_len + 1;
+ len -= part_len + 1;
+ count++;
+ }
+ return count;
+}
+# undef __argz_count
+# define __argz_count(argz, len) argz_count__ (argz, len)
+#endif /* !_LIBC && !HAVE___ARGZ_COUNT */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
+/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
+ except the last into the character SEP. */
+static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
+
+static void
+argz_stringify__ (argz, len, sep)
+ char *argz;
+ size_t len;
+ int sep;
+{
+ while (len > 0)
+ {
+ size_t part_len = strlen (argz);
+ argz += part_len;
+ len -= part_len + 1;
+ if (len > 0)
+ *argz++ = sep;
+ }
+}
+# undef __argz_stringify
+# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
+#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_NEXT
+static char *argz_next__ PARAMS ((char *argz, size_t argz_len,
+ const char *entry));
+
+static char *
+argz_next__ (argz, argz_len, entry)
+ char *argz;
+ size_t argz_len;
+ const char *entry;
+{
+ if (entry)
+ {
+ if (entry < argz + argz_len)
+ entry = strchr (entry, '\0') + 1;
+
+ return entry >= argz + argz_len ? NULL : (char *) entry;
+ }
+ else
+ if (argz_len > 0)
+ return argz;
+ else
+ return 0;
+}
+# undef __argz_next
+# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry)
+#endif /* !_LIBC && !HAVE___ARGZ_NEXT */
+
+
+/* Return number of bits set in X. */
+static int pop PARAMS ((int x));
+
+static inline int
+pop (x)
+ int x;
+{
+ /* We assume that no more than 16 bits are used. */
+ x = ((x & ~0x5555) >> 1) + (x & 0x5555);
+ x = ((x & ~0x3333) >> 2) + (x & 0x3333);
+ x = ((x >> 4) + x) & 0x0f0f;
+ x = ((x >> 8) + x) & 0xff;
+
+ return x;
+}
+
+
+struct loaded_l10nfile *
+_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
+ territory, codeset, normalized_codeset, modifier, special,
+ sponsor, revision, filename, do_allocate)
+ struct loaded_l10nfile **l10nfile_list;
+ const char *dirlist;
+ size_t dirlist_len;
+ int mask;
+ const char *language;
+ const char *territory;
+ const char *codeset;
+ const char *normalized_codeset;
+ const char *modifier;
+ const char *special;
+ const char *sponsor;
+ const char *revision;
+ const char *filename;
+ int do_allocate;
+{
+ char *abs_filename;
+ struct loaded_l10nfile *last = NULL;
+ struct loaded_l10nfile *retval;
+ char *cp;
+ size_t entries;
+ int cnt;
+
+ /* Allocate room for the full file name. */
+ abs_filename = (char *) malloc (dirlist_len
+ + strlen (language)
+ + ((mask & TERRITORY) != 0
+ ? strlen (territory) + 1 : 0)
+ + ((mask & XPG_CODESET) != 0
+ ? strlen (codeset) + 1 : 0)
+ + ((mask & XPG_NORM_CODESET) != 0
+ ? strlen (normalized_codeset) + 1 : 0)
+ + (((mask & XPG_MODIFIER) != 0
+ || (mask & CEN_AUDIENCE) != 0)
+ ? strlen (modifier) + 1 : 0)
+ + ((mask & CEN_SPECIAL) != 0
+ ? strlen (special) + 1 : 0)
+ + (((mask & CEN_SPONSOR) != 0
+ || (mask & CEN_REVISION) != 0)
+ ? (1 + ((mask & CEN_SPONSOR) != 0
+ ? strlen (sponsor) + 1 : 0)
+ + ((mask & CEN_REVISION) != 0
+ ? strlen (revision) + 1 : 0)) : 0)
+ + 1 + strlen (filename) + 1);
+
+ if (abs_filename == NULL)
+ return NULL;
+
+ retval = NULL;
+ last = NULL;
+
+ /* Construct file name. */
+ memcpy (abs_filename, dirlist, dirlist_len);
+ __argz_stringify (abs_filename, dirlist_len, ':');
+ cp = abs_filename + (dirlist_len - 1);
+ *cp++ = '/';
+ cp = stpcpy (cp, language);
+
+ if ((mask & TERRITORY) != 0)
+ {
+ *cp++ = '_';
+ cp = stpcpy (cp, territory);
+ }
+ if ((mask & XPG_CODESET) != 0)
+ {
+ *cp++ = '.';
+ cp = stpcpy (cp, codeset);
+ }
+ if ((mask & XPG_NORM_CODESET) != 0)
+ {
+ *cp++ = '.';
+ cp = stpcpy (cp, normalized_codeset);
+ }
+ if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
+ {
+ /* This component can be part of both syntaces but has different
+ leading characters. For CEN we use `+', else `@'. */
+ *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
+ cp = stpcpy (cp, modifier);
+ }
+ if ((mask & CEN_SPECIAL) != 0)
+ {
+ *cp++ = '+';
+ cp = stpcpy (cp, special);
+ }
+ if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0)
+ {
+ *cp++ = ',';
+ if ((mask & CEN_SPONSOR) != 0)
+ cp = stpcpy (cp, sponsor);
+ if ((mask & CEN_REVISION) != 0)
+ {
+ *cp++ = '_';
+ cp = stpcpy (cp, revision);
+ }
+ }
+
+ *cp++ = '/';
+ stpcpy (cp, filename);
+
+ /* Look in list of already loaded domains whether it is already
+ available. */
+ last = NULL;
+ for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
+ if (retval->filename != NULL)
+ {
+ int compare = strcmp (retval->filename, abs_filename);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It's not in the list. */
+ retval = NULL;
+ break;
+ }
+
+ last = retval;
+ }
+
+ if (retval != NULL || do_allocate == 0)
+ {
+ free (abs_filename);
+ return retval;
+ }
+
+ retval = (struct loaded_l10nfile *)
+ malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
+ * (1 << pop (mask))
+ * sizeof (struct loaded_l10nfile *)));
+ if (retval == NULL)
+ return NULL;
+
+ retval->filename = abs_filename;
+ retval->decided = (__argz_count (dirlist, dirlist_len) != 1
+ || ((mask & XPG_CODESET) != 0
+ && (mask & XPG_NORM_CODESET) != 0));
+ retval->data = NULL;
+
+ if (last == NULL)
+ {
+ retval->next = *l10nfile_list;
+ *l10nfile_list = retval;
+ }
+ else
+ {
+ retval->next = last->next;
+ last->next = retval;
+ }
+
+ entries = 0;
+ /* If the DIRLIST is a real list the RETVAL entry corresponds not to
+ a real file. So we have to use the DIRLIST separation mechanism
+ of the inner loop. */
+ cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
+ for (; cnt >= 0; --cnt)
+ if ((cnt & ~mask) == 0
+ && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
+ && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
+ {
+ /* Iterate over all elements of the DIRLIST. */
+ char *dir = NULL;
+
+ while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
+ != NULL)
+ retval->successor[entries++]
+ = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
+ language, territory, codeset,
+ normalized_codeset, modifier, special,
+ sponsor, revision, filename, 1);
+ }
+ retval->successor[entries] = NULL;
+
+ return retval;
+}
+
+/* Normalize codeset name. There is no standard for the codeset
+ names. Normalization allows the user to use any of the common
+ names. */
+const char *
+_nl_normalize_codeset (codeset, name_len)
+ const unsigned char *codeset;
+ size_t name_len;
+{
+ int len = 0;
+ int only_digit = 1;
+ char *retval;
+ char *wp;
+ size_t cnt;
+
+ for (cnt = 0; cnt < name_len; ++cnt)
+ if (isalnum (codeset[cnt]))
+ {
+ ++len;
+
+ if (isalpha (codeset[cnt]))
+ only_digit = 0;
+ }
+
+ retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
+
+ if (retval != NULL)
+ {
+ if (only_digit)
+ wp = stpcpy (retval, "iso");
+ else
+ wp = retval;
+
+ for (cnt = 0; cnt < name_len; ++cnt)
+ if (isalpha (codeset[cnt]))
+ *wp++ = tolower (codeset[cnt]);
+ else if (isdigit (codeset[cnt]))
+ *wp++ = codeset[cnt];
+
+ *wp = '\0';
+ }
+
+ return (const char *) retval;
+}
+
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library. So we
+ avoid the non-standard function stpcpy. In GNU C Library this
+ function is available, though. Also allow the symbol HAVE_STPCPY
+ to be defined. */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+ char *dest;
+ const char *src;
+{
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+ return dest - 1;
+}
+#endif
diff --git a/intl/libgettext.h b/intl/libgettext.h
new file mode 100644
index 0000000..3a92960
--- /dev/null
+++ b/intl/libgettext.h
@@ -0,0 +1,182 @@
+/* Message catalogs for internationalization.
+ Copyright (C) 1995, 1996, 1997, 1998 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Because on some systems (e.g. Solaris) we sometimes have to include
+ the systems libintl.h as well as this file we have more complex
+ include protection above. But the systems header might perhaps also
+ define _LIBINTL_H and therefore we have to protect the definition here. */
+
+#if !defined _LIBINTL_H || !defined _LIBGETTEXT_H
+#ifndef _LIBINTL_H
+# define _LIBINTL_H 1
+#endif
+#define _LIBGETTEXT_H 1
+
+/* We define an additional symbol to signal that we use the GNU
+ implementation of gettext. */
+#define __USE_GNU_GETTEXT 1
+
+#include <sys/types.h>
+
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifndef PARAMS
+# if __STDC__ || defined __cplusplus
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif
+#endif
+
+#ifndef NULL
+# if !defined __cplusplus || defined __GNUC__
+# define NULL ((void *) 0)
+# else
+# define NULL (0)
+# endif
+#endif
+
+#if !HAVE_LC_MESSAGES
+/* This value determines the behaviour of the gettext() and dgettext()
+ function. But some system does not have this defined. Define it
+ to a default value. */
+# define LC_MESSAGES (-1)
+#endif
+
+
+/* Declarations for gettext-using-catgets interface. Derived from
+ Jim Meyering's libintl.h. */
+struct _msg_ent
+{
+ const char *_msg;
+ int _msg_number;
+};
+
+
+#if HAVE_CATGETS
+/* These two variables are defined in the automatically by po-to-tbl.sed
+ generated file `cat-id-tbl.c'. */
+extern const struct _msg_ent _msg_tbl[];
+extern int _msg_tbl_length;
+#endif
+
+
+/* For automatical extraction of messages sometimes no real
+ translation is needed. Instead the string itself is the result. */
+#define gettext_noop(Str) (Str)
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+extern char *gettext PARAMS ((const char *__msgid));
+extern char *gettext__ PARAMS ((const char *__msgid));
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current
+ LC_MESSAGES locale. */
+extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
+extern char *dgettext__ PARAMS ((const char *__domainname,
+ const char *__msgid));
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
+ int __category));
+extern char *dcgettext__ PARAMS ((const char *__domainname,
+ const char *__msgid, int __category));
+
+
+/* Set the current default message catalog to DOMAINNAME.
+ If DOMAINNAME is null, return the current default.
+ If DOMAINNAME is "", reset to the default of "messages". */
+extern char *textdomain PARAMS ((const char *__domainname));
+extern char *textdomain__ PARAMS ((const char *__domainname));
+
+/* Specify that the DOMAINNAME message catalog will be found
+ in DIRNAME rather than in the system locale data base. */
+extern char *bindtextdomain PARAMS ((const char *__domainname,
+ const char *__dirname));
+extern char *bindtextdomain__ PARAMS ((const char *__domainname,
+ const char *__dirname));
+
+#if ENABLE_NLS
+
+/* Solaris 2.3 has the gettext function but dcgettext is missing.
+ So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4
+ has dcgettext. */
+# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT)
+
+# define gettext(Msgid) \
+ dgettext (NULL, Msgid)
+
+# define dgettext(Domainname, Msgid) \
+ dcgettext (Domainname, Msgid, LC_MESSAGES)
+
+# if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7
+/* This global variable is defined in loadmsgcat.c. We need a sign,
+ whether a new catalog was loaded, which can be associated with all
+ translations. */
+extern int _nl_msg_cat_cntr;
+
+# define dcgettext(Domainname, Msgid, Category) \
+ (__extension__ \
+ ({ \
+ char *__result; \
+ if (__builtin_constant_p (Msgid)) \
+ { \
+ static char *__translation__; \
+ static int __catalog_counter__; \
+ if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \
+ { \
+ __translation__ = \
+ dcgettext__ (Domainname, Msgid, Category); \
+ __catalog_counter__ = _nl_msg_cat_cntr; \
+ } \
+ __result = __translation__; \
+ } \
+ else \
+ __result = dcgettext__ (Domainname, Msgid, Category); \
+ __result; \
+ }))
+# endif
+# endif
+
+#else
+
+# define gettext(Msgid) (Msgid)
+# define dgettext(Domainname, Msgid) (Msgid)
+# define dcgettext(Domainname, Msgid, Category) (Msgid)
+# define textdomain(Domainname) ((char *) Domainname)
+# define bindtextdomain(Domainname, Dirname) ((char *) Dirname)
+
+#endif
+
+/* @@ begin of epilog @@ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/intl/linux-msg.sed b/intl/linux-msg.sed
new file mode 100644
index 0000000..5918e72
--- /dev/null
+++ b/intl/linux-msg.sed
@@ -0,0 +1,100 @@
+# po2msg.sed - Convert Uniforum style .po file to Linux style .msg file
+# Copyright (C) 1995 Free Software Foundation, Inc.
+# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+#
+# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+#
+# The first directive in the .msg should be the definition of the
+# message set number. We use always set number 1.
+#
+1 {
+ i\
+$set 1 # Automatically created by po2msg.sed
+ h
+ s/.*/0/
+ x
+}
+#
+# Mitch's old catalog format does not allow comments.
+#
+# We copy the original message as a comment into the .msg file.
+#
+/^msgid/ {
+ s/msgid[ ]*"//
+#
+# This does not work now with the new format.
+# /"$/! {
+# s/\\$//
+# s/$/ ... (more lines following)"/
+# }
+ x
+# The following nice solution is by
+# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+ td
+# Increment a decimal number in pattern space.
+# First hide trailing `9' digits.
+ :d
+ s/9\(_*\)$/_\1/
+ td
+# Assure at least one digit is available.
+ s/^\(_*\)$/0\1/
+# Increment the last digit.
+ s/8\(_*\)$/9\1/
+ s/7\(_*\)$/8\1/
+ s/6\(_*\)$/7\1/
+ s/5\(_*\)$/6\1/
+ s/4\(_*\)$/5\1/
+ s/3\(_*\)$/4\1/
+ s/2\(_*\)$/3\1/
+ s/1\(_*\)$/2\1/
+ s/0\(_*\)$/1\1/
+# Convert the hidden `9' digits to `0's.
+ s/_/0/g
+ x
+ G
+ s/\(.*\)"\n\([0-9]*\)/$ #\2 Original Message:(\1)/p
+}
+#
+# The .msg file contains, other then the .po file, only the translations
+# but each given a unique ID. Starting from 1 and incrementing by 1 for
+# each message we assign them to the messages.
+# It is important that the .po file used to generate the cat-id-tbl.c file
+# (with po-to-tbl) is the same as the one used here. (At least the order
+# of declarations must not be changed.)
+#
+/^msgstr/ {
+ s/msgstr[ ]*"\(.*\)"/# \1/
+# Clear substitution flag.
+ tb
+# Append the next line.
+ :b
+ N
+# Look whether second part is continuation line.
+ s/\(.*\n\)"\(.*\)"/\1\2/
+# Yes, then branch.
+ ta
+ P
+ D
+# Note that D includes a jump to the start!!
+# We found a continuation line. But before printing insert '\'.
+ :a
+ s/\(.*\)\(\n.*\)/\1\\\2/
+ P
+# We cannot use D here.
+ s/.*\n\(.*\)/\1/
+ tb
+}
+d
diff --git a/intl/loadinfo.h b/intl/loadinfo.h
new file mode 100644
index 0000000..f4ebf6d
--- /dev/null
+++ b/intl/loadinfo.h
@@ -0,0 +1,76 @@
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+ 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif
+#endif
+
+/* Encoding of locale name parts. */
+#define CEN_REVISION 1
+#define CEN_SPONSOR 2
+#define CEN_SPECIAL 4
+#define XPG_NORM_CODESET 8
+#define XPG_CODESET 16
+#define TERRITORY 32
+#define CEN_AUDIENCE 64
+#define XPG_MODIFIER 128
+
+#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
+#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
+
+
+struct loaded_l10nfile
+{
+ const char *filename;
+ int decided;
+
+ const void *data;
+
+ struct loaded_l10nfile *next;
+ struct loaded_l10nfile *successor[1];
+};
+
+
+extern const char *_nl_normalize_codeset PARAMS ((const unsigned char *codeset,
+ size_t name_len));
+
+extern struct loaded_l10nfile *
+_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
+ const char *dirlist, size_t dirlist_len, int mask,
+ const char *language, const char *territory,
+ const char *codeset,
+ const char *normalized_codeset,
+ const char *modifier, const char *special,
+ const char *sponsor, const char *revision,
+ const char *filename, int do_allocate));
+
+
+extern const char *_nl_expand_alias PARAMS ((const char *name));
+
+extern int _nl_explode_name PARAMS ((char *name, const char **language,
+ const char **modifier,
+ const char **territory,
+ const char **codeset,
+ const char **normalized_codeset,
+ const char **special,
+ const char **sponsor,
+ const char **revision));
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
new file mode 100644
index 0000000..515892d
--- /dev/null
+++ b/intl/loadmsgcat.c
@@ -0,0 +1,222 @@
+/* Load needed message catalogs.
+ Copyright (C) 1995, 1996, 1997, 1998 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP) || defined _LIBC
+# include <sys/mman.h>
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ISO C functions. This is required by the standard
+ because some ISO C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define open __open
+# define close __close
+# define read __read
+# define mmap __mmap
+# define munmap __munmap
+#endif
+
+/* We need a sign, whether a new catalog was loaded, which can be associated
+ with all translations. This is important if the translations are
+ cached by one of GCC's features. */
+int _nl_msg_cat_cntr = 0;
+
+
+/* Load the message catalogs specified by FILENAME. If it is no valid
+ message catalog do nothing. */
+void
+internal_function
+_nl_load_domain (domain_file)
+ struct loaded_l10nfile *domain_file;
+{
+ int fd;
+ size_t size;
+ struct stat st;
+ struct mo_file_header *data = (struct mo_file_header *) -1;
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+ || defined _LIBC
+ int use_mmap = 0;
+#endif
+ struct loaded_domain *domain;
+
+ domain_file->decided = 1;
+ domain_file->data = NULL;
+
+ /* If the record does not represent a valid locale the FILENAME
+ might be NULL. This can happen when according to the given
+ specification the locale file name is different for XPG and CEN
+ syntax. */
+ if (domain_file->filename == NULL)
+ return;
+
+ /* Try to open the addressed file. */
+ fd = open (domain_file->filename, O_RDONLY);
+ if (fd == -1)
+ return;
+
+ /* We must know about the size of the file. */
+ if (fstat (fd, &st) != 0
+ || (size = (size_t) st.st_size) != st.st_size
+ || size < sizeof (struct mo_file_header))
+ {
+ /* Something went wrong. */
+ close (fd);
+ return;
+ }
+
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+ || defined _LIBC
+ /* Now we are ready to load the file. If mmap() is available we try
+ this first. If not available or it failed we try to load it. */
+ data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
+ MAP_PRIVATE, fd, 0);
+
+ if (data != (struct mo_file_header *) -1)
+ {
+ /* mmap() call was successful. */
+ close (fd);
+ use_mmap = 1;
+ }
+#endif
+
+ /* If the data is not yet available (i.e. mmap'ed) we try to load
+ it manually. */
+ if (data == (struct mo_file_header *) -1)
+ {
+ size_t to_read;
+ char *read_ptr;
+
+ data = (struct mo_file_header *) malloc (size);
+ if (data == NULL)
+ return;
+
+ to_read = size;
+ read_ptr = (char *) data;
+ do
+ {
+ long int nb = (long int) read (fd, read_ptr, to_read);
+ if (nb == -1)
+ {
+ close (fd);
+ return;
+ }
+
+ read_ptr += nb;
+ to_read -= nb;
+ }
+ while (to_read > 0);
+
+ close (fd);
+ }
+
+ /* Using the magic number we can test whether it really is a message
+ catalog file. */
+ if (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED)
+ {
+ /* The magic number is wrong: not a message catalog file. */
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+ || defined _LIBC
+ if (use_mmap)
+ munmap ((caddr_t) data, size);
+ else
+#endif
+ free (data);
+ return;
+ }
+
+ domain_file->data
+ = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
+ if (domain_file->data == NULL)
+ return;
+
+ domain = (struct loaded_domain *) domain_file->data;
+ domain->data = (char *) data;
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+ || defined _LIBC
+ domain->use_mmap = use_mmap;
+#endif
+ domain->mmap_size = size;
+ domain->must_swap = data->magic != _MAGIC;
+
+ /* Fill in the information about the available tables. */
+ switch (W (domain->must_swap, data->revision))
+ {
+ case 0:
+ domain->nstrings = W (domain->must_swap, data->nstrings);
+ domain->orig_tab = (struct string_desc *)
+ ((char *) data + W (domain->must_swap, data->orig_tab_offset));
+ domain->trans_tab = (struct string_desc *)
+ ((char *) data + W (domain->must_swap, data->trans_tab_offset));
+ domain->hash_size = W (domain->must_swap, data->hash_tab_size);
+ domain->hash_tab = (nls_uint32 *)
+ ((char *) data + W (domain->must_swap, data->hash_tab_offset));
+ break;
+ default:
+ /* This is an illegal revision. */
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+ || defined _LIBC
+ if (use_mmap)
+ munmap ((caddr_t) data, size);
+ else
+#endif
+ free (data);
+ free (domain);
+ domain_file->data = NULL;
+ return;
+ }
+
+ /* Show that one domain is changed. This might make some cached
+ translations invalid. */
+ ++_nl_msg_cat_cntr;
+}
+
+
+#ifdef _LIBC
+void
+internal_function
+_nl_unload_domain (domain)
+ struct loaded_domain *domain;
+{
+ if (domain->use_mmap)
+ munmap ((caddr_t) domain->data, domain->mmap_size);
+ else
+ free ((void *) domain->data);
+
+ free (domain);
+}
+#endif
diff --git a/intl/localealias.c b/intl/localealias.c
new file mode 100644
index 0000000..bca555a
--- /dev/null
+++ b/intl/localealias.c
@@ -0,0 +1,424 @@
+/* Handle aliases for locale names.
+ Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+char *getenv ();
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+# endif
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define strcasecmp __strcasecmp
+
+# define mempcpy __mempcpy
+# define HAVE_MEMPCPY 1
+
+/* We need locking here since we can be called from different places. */
+# include <bits/libc-lock.h>
+
+__libc_lock_define_initialized (static, lock);
+#endif
+
+
+/* For those loosing systems which don't have `alloca' we have to add
+ some additional code emulating it. */
+#ifdef HAVE_ALLOCA
+/* Nothing has to be done. */
+# define ADD_BLOCK(list, address) /* nothing */
+# define FREE_BLOCKS(list) /* nothing */
+#else
+struct block_list
+{
+ void *address;
+ struct block_list *next;
+};
+# define ADD_BLOCK(list, addr) \
+ do { \
+ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
+ /* If we cannot get a free block we cannot add the new element to \
+ the list. */ \
+ if (newp != NULL) { \
+ newp->address = (addr); \
+ newp->next = (list); \
+ (list) = newp; \
+ } \
+ } while (0)
+# define FREE_BLOCKS(list) \
+ do { \
+ while (list != NULL) { \
+ struct block_list *old = list; \
+ list = list->next; \
+ free (old); \
+ } \
+ } while (0)
+# undef alloca
+# define alloca(size) (malloc (size))
+#endif /* have alloca */
+
+
+struct alias_map
+{
+ const char *alias;
+ const char *value;
+};
+
+
+static char *string_space = NULL;
+static size_t string_space_act = 0;
+static size_t string_space_max = 0;
+static struct alias_map *map;
+static size_t nmap = 0;
+static size_t maxmap = 0;
+
+
+/* Prototypes for local functions. */
+static size_t read_alias_file PARAMS ((const char *fname, int fname_len))
+ internal_function;
+static void extend_alias_table PARAMS ((void));
+static int alias_compare PARAMS ((const struct alias_map *map1,
+ const struct alias_map *map2));
+
+
+const char *
+_nl_expand_alias (name)
+ const char *name;
+{
+ static const char *locale_alias_path = LOCALE_ALIAS_PATH;
+ struct alias_map *retval;
+ const char *result = NULL;
+ size_t added;
+
+#ifdef _LIBC
+ __libc_lock_lock (lock);
+#endif
+
+ do
+ {
+ struct alias_map item;
+
+ item.alias = name;
+
+ if (nmap > 0)
+ retval = (struct alias_map *) bsearch (&item, map, nmap,
+ sizeof (struct alias_map),
+ (int (*) PARAMS ((const void *,
+ const void *))
+ ) alias_compare);
+ else
+ retval = NULL;
+
+ /* We really found an alias. Return the value. */
+ if (retval != NULL)
+ {
+ result = retval->value;
+ break;
+ }
+
+ /* Perhaps we can find another alias file. */
+ added = 0;
+ while (added == 0 && locale_alias_path[0] != '\0')
+ {
+ const char *start;
+
+ while (locale_alias_path[0] == ':')
+ ++locale_alias_path;
+ start = locale_alias_path;
+
+ while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
+ ++locale_alias_path;
+
+ if (start < locale_alias_path)
+ added = read_alias_file (start, locale_alias_path - start);
+ }
+ }
+ while (added != 0);
+
+#ifdef _LIBC
+ __libc_lock_unlock (lock);
+#endif
+
+ return result;
+}
+
+
+static size_t
+internal_function
+read_alias_file (fname, fname_len)
+ const char *fname;
+ int fname_len;
+{
+#ifndef HAVE_ALLOCA
+ struct block_list *block_list = NULL;
+#endif
+ FILE *fp;
+ char *full_fname;
+ size_t added;
+ static const char aliasfile[] = "/locale.alias";
+
+ full_fname = (char *) alloca (fname_len + sizeof aliasfile);
+ ADD_BLOCK (block_list, full_fname);
+#ifdef HAVE_MEMPCPY
+ mempcpy (mempcpy (full_fname, fname, fname_len),
+ aliasfile, sizeof aliasfile);
+#else
+ memcpy (full_fname, fname, fname_len);
+ memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
+#endif
+
+ fp = fopen (full_fname, "r");
+ if (fp == NULL)
+ {
+ FREE_BLOCKS (block_list);
+ return 0;
+ }
+
+ added = 0;
+ while (!feof (fp))
+ {
+ /* It is a reasonable approach to use a fix buffer here because
+ a) we are only interested in the first two fields
+ b) these fields must be usable as file names and so must not
+ be that long
+ */
+ unsigned char buf[BUFSIZ];
+ unsigned char *alias;
+ unsigned char *value;
+ unsigned char *cp;
+
+ if (fgets (buf, sizeof buf, fp) == NULL)
+ /* EOF reached. */
+ break;
+
+ /* Possibly not the whole line fits into the buffer. Ignore
+ the rest of the line. */
+ if (strchr (buf, '\n') == NULL)
+ {
+ char altbuf[BUFSIZ];
+ do
+ if (fgets (altbuf, sizeof altbuf, fp) == NULL)
+ /* Make sure the inner loop will be left. The outer loop
+ will exit at the `feof' test. */
+ break;
+ while (strchr (altbuf, '\n') == NULL);
+ }
+
+ cp = buf;
+ /* Ignore leading white space. */
+ while (isspace (cp[0]))
+ ++cp;
+
+ /* A leading '#' signals a comment line. */
+ if (cp[0] != '\0' && cp[0] != '#')
+ {
+ alias = cp++;
+ while (cp[0] != '\0' && !isspace (cp[0]))
+ ++cp;
+ /* Terminate alias name. */
+ if (cp[0] != '\0')
+ *cp++ = '\0';
+
+ /* Now look for the beginning of the value. */
+ while (isspace (cp[0]))
+ ++cp;
+
+ if (cp[0] != '\0')
+ {
+ size_t alias_len;
+ size_t value_len;
+
+ value = cp++;
+ while (cp[0] != '\0' && !isspace (cp[0]))
+ ++cp;
+ /* Terminate value. */
+ if (cp[0] == '\n')
+ {
+ /* This has to be done to make the following test
+ for the end of line possible. We are looking for
+ the terminating '\n' which do not overwrite here. */
+ *cp++ = '\0';
+ *cp = '\n';
+ }
+ else if (cp[0] != '\0')
+ *cp++ = '\0';
+
+ if (nmap >= maxmap)
+ extend_alias_table ();
+
+ alias_len = strlen (alias) + 1;
+ value_len = strlen (value) + 1;
+
+ if (string_space_act + alias_len + value_len > string_space_max)
+ {
+ /* Increase size of memory pool. */
+ size_t new_size = (string_space_max
+ + (alias_len + value_len > 1024
+ ? alias_len + value_len : 1024));
+ char *new_pool = (char *) realloc (string_space, new_size);
+ if (new_pool == NULL)
+ {
+ FREE_BLOCKS (block_list);
+ return added;
+ }
+ string_space = new_pool;
+ string_space_max = new_size;
+ }
+
+ map[nmap].alias = memcpy (&string_space[string_space_act],
+ alias, alias_len);
+ string_space_act += alias_len;
+
+ map[nmap].value = memcpy (&string_space[string_space_act],
+ value, value_len);
+ string_space_act += value_len;
+
+ ++nmap;
+ ++added;
+ }
+ }
+ }
+
+ /* Should we test for ferror()? I think we have to silently ignore
+ errors. --drepper */
+ fclose (fp);
+
+ if (added > 0)
+ qsort (map, nmap, sizeof (struct alias_map),
+ (int (*) PARAMS ((const void *, const void *))) alias_compare);
+
+ FREE_BLOCKS (block_list);
+ return added;
+}
+
+
+static void
+extend_alias_table ()
+{
+ size_t new_size;
+ struct alias_map *new_map;
+
+ new_size = maxmap == 0 ? 100 : 2 * maxmap;
+ new_map = (struct alias_map *) realloc (map, (new_size
+ * sizeof (struct alias_map)));
+ if (new_map == NULL)
+ /* Simply don't extend: we don't have any more core. */
+ return;
+
+ map = new_map;
+ maxmap = new_size;
+}
+
+
+#ifdef _LIBC
+static void __attribute__ ((unused))
+free_mem (void)
+{
+ if (string_space != NULL)
+ free (string_space);
+ if (map != NULL)
+ free (map);
+}
+text_set_element (__libc_subfreeres, free_mem);
+#endif
+
+
+static int
+alias_compare (map1, map2)
+ const struct alias_map *map1;
+ const struct alias_map *map2;
+{
+#if defined _LIBC || defined HAVE_STRCASECMP
+ return strcasecmp (map1->alias, map2->alias);
+#else
+ const unsigned char *p1 = (const unsigned char *) map1->alias;
+ const unsigned char *p2 = (const unsigned char *) map2->alias;
+ unsigned char c1, c2;
+
+ if (p1 == p2)
+ return 0;
+
+ do
+ {
+ /* I know this seems to be odd but the tolower() function in
+ some systems libc cannot handle nonalpha characters. */
+ c1 = isupper (*p1) ? tolower (*p1) : *p1;
+ c2 = isupper (*p2) ? tolower (*p2) : *p2;
+ if (c1 == '\0')
+ break;
+ ++p1;
+ ++p2;
+ }
+ while (c1 == c2);
+
+ return c1 - c2;
+#endif
+}
diff --git a/intl/po2tbl.sed b/intl/po2tbl.sed
new file mode 100644
index 0000000..93c0435
--- /dev/null
+++ b/intl/po2tbl.sed
@@ -0,0 +1,60 @@
+1 {
+ i\
+/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\
+\
+#if HAVE_CONFIG_H\
+# include <config.h>\
+#endif\
+\
+#include "libgettext.h"\
+\
+const struct _msg_ent _msg_tbl[] = {
+ h
+ s/.*/0/
+ x
+}
+/^msgid/ {
+ s/msgid[ ]*\(".*"\)/ {\1/
+ tb
+ :b
+ N
+ s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
+ ta
+ s/\(.*\)\n.*/\1/
+ bc
+ :a
+ s/\(.*\)\(\n.*\)/\1\\\2/
+ P
+ s/.*\n\(.*\)/\1/
+ tb
+ :c
+ x
+ td
+ :d
+ s/9\(_*\)$/_\1/
+ td
+ s/^\(_*\)$/0\1/
+ s/8\(_*\)$/9\1/
+ s/7\(_*\)$/8\1/
+ s/6\(_*\)$/7\1/
+ s/5\(_*\)$/6\1/
+ s/4\(_*\)$/5\1/
+ s/3\(_*\)$/4\1/
+ s/2\(_*\)$/3\1/
+ s/1\(_*\)$/2\1/
+ s/0\(_*\)$/1\1/
+ s/_/0/g
+ x
+ G
+ s/\(.*\)\n\([0-9]*\)/\1, \2},/
+ s/\(.*\)"$/\1/
+ p
+}
+$ {
+ i\
+};\
+
+ g
+ s/0*\(.*\)/int _msg_tbl_length = \1;/p
+}
+d
diff --git a/intl/po2tbl.sed.in b/intl/po2tbl.sed.in
new file mode 100644
index 0000000..b3bcca4
--- /dev/null
+++ b/intl/po2tbl.sed.in
@@ -0,0 +1,102 @@
+# po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets
+# Copyright (C) 1995 Free Software Foundation, Inc.
+# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+#
+# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+1 {
+ i\
+/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\
+\
+#if HAVE_CONFIG_H\
+# include <config.h>\
+#endif\
+\
+#include "libgettext.h"\
+\
+const struct _msg_ent _msg_tbl[] = {
+ h
+ s/.*/0/
+ x
+}
+#
+# Write msgid entries in C array form.
+#
+/^msgid/ {
+ s/msgid[ ]*\(".*"\)/ {\1/
+ tb
+# Append the next line
+ :b
+ N
+# Look whether second part is continuation line.
+ s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
+# Yes, then branch.
+ ta
+# Because we assume that the input file correctly formed the line
+# just read cannot be again be a msgid line. So it's safe to ignore
+# it.
+ s/\(.*\)\n.*/\1/
+ bc
+# We found a continuation line. But before printing insert '\'.
+ :a
+ s/\(.*\)\(\n.*\)/\1\\\2/
+ P
+# We cannot use D here.
+ s/.*\n\(.*\)/\1/
+# Some buggy seds do not clear the `successful substitution since last ``t'''
+# flag on `N', so we do a `t' here to clear it.
+ tb
+# Not reached
+ :c
+ x
+# The following nice solution is by
+# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+ td
+# Increment a decimal number in pattern space.
+# First hide trailing `9' digits.
+ :d
+ s/9\(_*\)$/_\1/
+ td
+# Assure at least one digit is available.
+ s/^\(_*\)$/0\1/
+# Increment the last digit.
+ s/8\(_*\)$/9\1/
+ s/7\(_*\)$/8\1/
+ s/6\(_*\)$/7\1/
+ s/5\(_*\)$/6\1/
+ s/4\(_*\)$/5\1/
+ s/3\(_*\)$/4\1/
+ s/2\(_*\)$/3\1/
+ s/1\(_*\)$/2\1/
+ s/0\(_*\)$/1\1/
+# Convert the hidden `9' digits to `0's.
+ s/_/0/g
+ x
+ G
+ s/\(.*\)\n\([0-9]*\)/\1, \2},/
+ s/\(.*\)"$/\1/
+ p
+}
+#
+# Last line.
+#
+$ {
+ i\
+};\
+
+ g
+ s/0*\(.*\)/int _msg_tbl_length = \1;/p
+}
+d
diff --git a/intl/textdomain.c b/intl/textdomain.c
new file mode 100644
index 0000000..8855746
--- /dev/null
+++ b/intl/textdomain.c
@@ -0,0 +1,108 @@
+/* Implementation of the textdomain(3) function.
+ Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+#if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Name of the default text domain. */
+extern const char _nl_default_default_domain[];
+
+/* Default text domain in which entries for gettext(3) are to be found. */
+extern const char *_nl_current_default_domain;
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define TEXTDOMAIN __textdomain
+# ifndef strdup
+# define strdup(str) __strdup (str)
+# endif
+#else
+# define TEXTDOMAIN textdomain__
+#endif
+
+/* Set the current default message catalog to DOMAINNAME.
+ If DOMAINNAME is null, return the current default.
+ If DOMAINNAME is "", reset to the default of "messages". */
+char *
+TEXTDOMAIN (domainname)
+ const char *domainname;
+{
+ char *old;
+
+ /* A NULL pointer requests the current setting. */
+ if (domainname == NULL)
+ return (char *) _nl_current_default_domain;
+
+ old = (char *) _nl_current_default_domain;
+
+ /* If domain name is the null string set to default domain "messages". */
+ if (domainname[0] == '\0'
+ || strcmp (domainname, _nl_default_default_domain) == 0)
+ _nl_current_default_domain = _nl_default_default_domain;
+ else
+ {
+ /* If the following malloc fails `_nl_current_default_domain'
+ will be NULL. This value will be returned and so signals we
+ are out of core. */
+#if defined _LIBC || defined HAVE_STRDUP
+ _nl_current_default_domain = strdup (domainname);
+#else
+ size_t len = strlen (domainname) + 1;
+ char *cp = (char *) malloc (len);
+ if (cp != NULL)
+ memcpy (cp, domainname, len);
+ _nl_current_default_domain = cp;
+#endif
+ }
+
+ if (old != _nl_default_default_domain)
+ free (old);
+
+ return (char *) _nl_current_default_domain;
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__textdomain, textdomain);
+#endif
diff --git a/intl/xopen-msg.sed b/intl/xopen-msg.sed
new file mode 100644
index 0000000..b19c0bb
--- /dev/null
+++ b/intl/xopen-msg.sed
@@ -0,0 +1,104 @@
+# po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file
+# Copyright (C) 1995 Free Software Foundation, Inc.
+# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+#
+# 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 2, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+#
+# The first directive in the .msg should be the definition of the
+# message set number. We use always set number 1.
+#
+1 {
+ i\
+$set 1 # Automatically created by po2msg.sed
+ h
+ s/.*/0/
+ x
+}
+#
+# We copy all comments into the .msg file. Perhaps they can help.
+#
+/^#/ s/^#[ ]*/$ /p
+#
+# We copy the original message as a comment into the .msg file.
+#
+/^msgid/ {
+# Does not work now
+# /"$/! {
+# s/\\$//
+# s/$/ ... (more lines following)"/
+# }
+ s/^msgid[ ]*"\(.*\)"$/$ Original Message: \1/
+ p
+}
+#
+# The .msg file contains, other then the .po file, only the translations
+# but each given a unique ID. Starting from 1 and incrementing by 1 for
+# each message we assign them to the messages.
+# It is important that the .po file used to generate the cat-id-tbl.c file
+# (with po-to-tbl) is the same as the one used here. (At least the order
+# of declarations must not be changed.)
+#
+/^msgstr/ {
+ s/msgstr[ ]*"\(.*\)"/\1/
+ x
+# The following nice solution is by
+# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+ td
+# Increment a decimal number in pattern space.
+# First hide trailing `9' digits.
+ :d
+ s/9\(_*\)$/_\1/
+ td
+# Assure at least one digit is available.
+ s/^\(_*\)$/0\1/
+# Increment the last digit.
+ s/8\(_*\)$/9\1/
+ s/7\(_*\)$/8\1/
+ s/6\(_*\)$/7\1/
+ s/5\(_*\)$/6\1/
+ s/4\(_*\)$/5\1/
+ s/3\(_*\)$/4\1/
+ s/2\(_*\)$/3\1/
+ s/1\(_*\)$/2\1/
+ s/0\(_*\)$/1\1/
+# Convert the hidden `9' digits to `0's.
+ s/_/0/g
+ x
+# Bring the line in the format `<number> <message>'
+ G
+ s/^[^\n]*$/& /
+ s/\(.*\)\n\([0-9]*\)/\2 \1/
+# Clear flag from last substitution.
+ tb
+# Append the next line.
+ :b
+ N
+# Look whether second part is a continuation line.
+ s/\(.*\n\)"\(.*\)"/\1\2/
+# Yes, then branch.
+ ta
+ P
+ D
+# Note that `D' includes a jump to the start!!
+# We found a continuation line. But before printing insert '\'.
+ :a
+ s/\(.*\)\(\n.*\)/\1\\\2/
+ P
+# We cannot use the sed command `D' here
+ s/.*\n\(.*\)/\1/
+ tb
+}
+d
diff --git a/lib/Makefile.in b/lib/Makefile.in
new file mode 100644
index 0000000..a8ecbf6
--- /dev/null
+++ b/lib/Makefile.in
@@ -0,0 +1,75 @@
+SHELL = /bin/sh
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+configdir = ${sysconfdir}/sane.d
+sanedatadir = ${datadir}/sane
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+CC = @CC@
+INCLUDES = -I. -I$(srcdir) \
+ -I$(top_builddir)/include/sane -I$(top_srcdir)/include
+CPPFLAGS = @CPPFLAGS@
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+DEFS = @DEFS@
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+
+@SET_MAKE@
+
+LIBLIB_OBJS = alloca.o getopt.o getopt1.o sigprocmask.o strndup.o \
+ strdup.o strsep.o snprintf.o usleep.o
+LIBLIB_LTOBJS = alloca.lo getopt.lo getopt1.lo sigprocmask.lo strndup.lo \
+ strdup.lo strsep.lo snprintf.lo usleep.lo
+
+TARGETS = $(LIBLIB_OBJS)
+TARGETS = liblib.a
+
+.SUFFIXES:
+.SUFFIXES: .c .o
+.c.o:
+ $(COMPILE) $<
+ @test -f $@ || $(COMPILE) $<
+
+all: $(TARGETS)
+
+liblib.a: $(LIBLIB_OBJS)
+ ar r $@ $(LIBLIB_OBJS)
+
+install: all
+
+check:
+
+depend:
+ makedepend -I. -I../include *.c
+
+clean:
+ rm -f *.out *.o *.lo *~ *.a *.bak $(TESTPROGRAMS)
+ rm -rf .libs
+
+distclean: clean
+ rm -f Makefile
+
+.PHONY: all install check depend clean distclean
diff --git a/lib/alloca.c b/lib/alloca.c
new file mode 100644
index 0000000..16f7e86
--- /dev/null
+++ b/lib/alloca.c
@@ -0,0 +1,493 @@
+/* alloca.c -- allocate automatically reclaimed memory
+ (Mostly) portable public-domain implementation -- D A Gwyn
+
+ This implementation of the PWB library alloca function,
+ which is used to allocate space off the run-time stack so
+ that it is automatically reclaimed upon procedure exit,
+ was inspired by discussions with J. Q. Johnson of Cornell.
+ J.Otto Tennant <jot@cray.com> contributed the Cray support.
+
+ There are some preprocessor constants that can
+ be defined when compiling for your specific system, for
+ improved efficiency; however, the defaults should be okay.
+
+ The general concept of this implementation is to keep
+ track of all alloca-allocated blocks, and reclaim any
+ that are found to be deeper in the stack than the current
+ invocation. This heuristic does not reclaim storage as
+ soon as it becomes invalid, but it will do so eventually.
+
+ As a special case, alloca(0) reclaims storage without
+ allocating any. It is a good idea to use alloca(0) in
+ your main control loop, etc. to force garbage collection. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifndef HAVE_ALLOCA
+
+#ifdef emacs
+#include "blockinput.h"
+#endif
+
+/* If compiling with GCC 2, this file's not needed. */
+#if !defined (__GNUC__) || __GNUC__ < 2
+
+/* If someone has defined alloca as a macro,
+ there must be some other way alloca is supposed to work. */
+#ifndef alloca
+
+#ifdef emacs
+#ifdef static
+/* actually, only want this if static is defined as ""
+ -- this is for usg, in which emacs must undefine static
+ in order to make unexec workable
+ */
+#ifndef STACK_DIRECTION
+you
+lose
+-- must know STACK_DIRECTION at compile-time
+#endif /* STACK_DIRECTION undefined */
+#endif /* static */
+#endif /* emacs */
+
+/* If your stack is a linked list of frames, you have to
+ provide an "address metric" ADDRESS_FUNCTION macro. */
+
+#if defined (CRAY) && defined (CRAY_STACKSEG_END)
+long i00afunc ();
+#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
+#else
+#define ADDRESS_FUNCTION(arg) &(arg)
+#endif
+
+#if __STDC__
+typedef void *pointer;
+#else
+typedef char *pointer;
+#endif
+
+#define NULL 0
+
+/* Different portions of Emacs need to call different versions of
+ malloc. The Emacs executable needs alloca to call xmalloc, because
+ ordinary malloc isn't protected from input signals. On the other
+ hand, the utilities in lib-src need alloca to call malloc; some of
+ them are very simple, and don't have an xmalloc routine.
+
+ Non-Emacs programs expect this to call xmalloc.
+
+ Callers below should use malloc. */
+
+extern pointer malloc ();
+
+/* Define STACK_DIRECTION if you know the direction of stack
+ growth for your system; otherwise it will be automatically
+ deduced at run-time.
+
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+
+#ifndef STACK_DIRECTION
+#define STACK_DIRECTION 0 /* Direction unknown. */
+#endif
+
+#if STACK_DIRECTION != 0
+
+#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
+
+#else /* STACK_DIRECTION == 0; need run-time code. */
+
+static int stack_dir; /* 1 or -1 once known. */
+#define STACK_DIR stack_dir
+
+static void
+find_stack_direction ()
+{
+ static char *addr = NULL; /* Address of first `dummy', once known. */
+ auto char dummy; /* To get stack address. */
+
+ if (addr == NULL)
+ { /* Initial entry. */
+ addr = ADDRESS_FUNCTION (dummy);
+
+ find_stack_direction (); /* Recurse once. */
+ }
+ else
+ {
+ /* Second entry. */
+ if (ADDRESS_FUNCTION (dummy) > addr)
+ stack_dir = 1; /* Stack grew upward. */
+ else
+ stack_dir = -1; /* Stack grew downward. */
+ }
+}
+
+#endif /* STACK_DIRECTION == 0 */
+
+/* An "alloca header" is used to:
+ (a) chain together all alloca'ed blocks;
+ (b) keep track of stack depth.
+
+ It is very important that sizeof(header) agree with malloc
+ alignment chunk size. The following default should work okay. */
+
+#ifndef ALIGN_SIZE
+#define ALIGN_SIZE sizeof(double)
+#endif
+
+typedef union hdr
+{
+ char align[ALIGN_SIZE]; /* To force sizeof(header). */
+ struct
+ {
+ union hdr *next; /* For chaining headers. */
+ char *deep; /* For stack depth measure. */
+ } h;
+} header;
+
+static header *last_alloca_header = NULL; /* -> last alloca header. */
+
+/* Return a pointer to at least SIZE bytes of storage,
+ which will be automatically reclaimed upon exit from
+ the procedure that called alloca. Originally, this space
+ was supposed to be taken from the current stack frame of the
+ caller, but that method cannot be made to work for some
+ implementations of C, for example under Gould's UTX/32. */
+
+pointer
+alloca (size)
+ unsigned size;
+{
+ auto char probe; /* Probes stack depth: */
+ register char *depth = ADDRESS_FUNCTION (probe);
+
+#if STACK_DIRECTION == 0
+ if (STACK_DIR == 0) /* Unknown growth direction. */
+ find_stack_direction ();
+#endif
+
+ /* Reclaim garbage, defined as all alloca'd storage that
+ was allocated from deeper in the stack than currently. */
+
+ {
+ register header *hp; /* Traverses linked list. */
+
+#ifdef emacs
+ BLOCK_INPUT;
+#endif
+
+ for (hp = last_alloca_header; hp != NULL;)
+ if ((STACK_DIR > 0 && hp->h.deep > depth)
+ || (STACK_DIR < 0 && hp->h.deep < depth))
+ {
+ register header *np = hp->h.next;
+
+ free ((pointer) hp); /* Collect garbage. */
+
+ hp = np; /* -> next header. */
+ }
+ else
+ break; /* Rest are not deeper. */
+
+ last_alloca_header = hp; /* -> last valid storage. */
+
+#ifdef emacs
+ UNBLOCK_INPUT;
+#endif
+ }
+
+ if (size == 0)
+ return NULL; /* No allocation required. */
+
+ /* Allocate combined header + user data storage. */
+
+ {
+ register pointer new = malloc (sizeof (header) + size);
+ /* Address of header. */
+
+ ((header *) new)->h.next = last_alloca_header;
+ ((header *) new)->h.deep = depth;
+
+ last_alloca_header = (header *) new;
+
+ /* User storage begins just after header. */
+
+ return (pointer) ((char *) new + sizeof (header));
+ }
+}
+
+#if defined (CRAY) && defined (CRAY_STACKSEG_END)
+
+#ifdef DEBUG_I00AFUNC
+#include <stdio.h>
+#endif
+
+#ifndef CRAY_STACK
+#define CRAY_STACK
+#ifndef CRAY2
+/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
+struct stack_control_header
+ {
+ long shgrow:32; /* Number of times stack has grown. */
+ long shaseg:32; /* Size of increments to stack. */
+ long shhwm:32; /* High water mark of stack. */
+ long shsize:32; /* Current size of stack (all segments). */
+ };
+
+/* The stack segment linkage control information occurs at
+ the high-address end of a stack segment. (The stack
+ grows from low addresses to high addresses.) The initial
+ part of the stack segment linkage control information is
+ 0200 (octal) words. This provides for register storage
+ for the routine which overflows the stack. */
+
+struct stack_segment_linkage
+ {
+ long ss[0200]; /* 0200 overflow words. */
+ long sssize:32; /* Number of words in this segment. */
+ long ssbase:32; /* Offset to stack base. */
+ long:32;
+ long sspseg:32; /* Offset to linkage control of previous
+ segment of stack. */
+ long:32;
+ long sstcpt:32; /* Pointer to task common address block. */
+ long sscsnm; /* Private control structure number for
+ microtasking. */
+ long ssusr1; /* Reserved for user. */
+ long ssusr2; /* Reserved for user. */
+ long sstpid; /* Process ID for pid based multi-tasking. */
+ long ssgvup; /* Pointer to multitasking thread giveup. */
+ long sscray[7]; /* Reserved for Cray Research. */
+ long ssa0;
+ long ssa1;
+ long ssa2;
+ long ssa3;
+ long ssa4;
+ long ssa5;
+ long ssa6;
+ long ssa7;
+ long sss0;
+ long sss1;
+ long sss2;
+ long sss3;
+ long sss4;
+ long sss5;
+ long sss6;
+ long sss7;
+ };
+
+#else /* CRAY2 */
+/* The following structure defines the vector of words
+ returned by the STKSTAT library routine. */
+struct stk_stat
+ {
+ long now; /* Current total stack size. */
+ long maxc; /* Amount of contiguous space which would
+ be required to satisfy the maximum
+ stack demand to date. */
+ long high_water; /* Stack high-water mark. */
+ long overflows; /* Number of stack overflow ($STKOFEN) calls. */
+ long hits; /* Number of internal buffer hits. */
+ long extends; /* Number of block extensions. */
+ long stko_mallocs; /* Block allocations by $STKOFEN. */
+ long underflows; /* Number of stack underflow calls ($STKRETN). */
+ long stko_free; /* Number of deallocations by $STKRETN. */
+ long stkm_free; /* Number of deallocations by $STKMRET. */
+ long segments; /* Current number of stack segments. */
+ long maxs; /* Maximum number of stack segments so far. */
+ long pad_size; /* Stack pad size. */
+ long current_address; /* Current stack segment address. */
+ long current_size; /* Current stack segment size. This
+ number is actually corrupted by STKSTAT to
+ include the fifteen word trailer area. */
+ long initial_address; /* Address of initial segment. */
+ long initial_size; /* Size of initial segment. */
+ };
+
+/* The following structure describes the data structure which trails
+ any stack segment. I think that the description in 'asdef' is
+ out of date. I only describe the parts that I am sure about. */
+
+struct stk_trailer
+ {
+ long this_address; /* Address of this block. */
+ long this_size; /* Size of this block (does not include
+ this trailer). */
+ long unknown2;
+ long unknown3;
+ long link; /* Address of trailer block of previous
+ segment. */
+ long unknown5;
+ long unknown6;
+ long unknown7;
+ long unknown8;
+ long unknown9;
+ long unknown10;
+ long unknown11;
+ long unknown12;
+ long unknown13;
+ long unknown14;
+ };
+
+#endif /* CRAY2 */
+#endif /* not CRAY_STACK */
+
+#ifdef CRAY2
+/* Determine a "stack measure" for an arbitrary ADDRESS.
+ I doubt that "lint" will like this much. */
+
+static long
+i00afunc (long *address)
+{
+ struct stk_stat status;
+ struct stk_trailer *trailer;
+ long *block, size;
+ long result = 0;
+
+ /* We want to iterate through all of the segments. The first
+ step is to get the stack status structure. We could do this
+ more quickly and more directly, perhaps, by referencing the
+ $LM00 common block, but I know that this works. */
+
+ STKSTAT (&status);
+
+ /* Set up the iteration. */
+
+ trailer = (struct stk_trailer *) (status.current_address
+ + status.current_size
+ - 15);
+
+ /* There must be at least one stack segment. Therefore it is
+ a fatal error if "trailer" is null. */
+
+ if (trailer == 0)
+ abort ();
+
+ /* Discard segments that do not contain our argument address. */
+
+ while (trailer != 0)
+ {
+ block = (long *) trailer->this_address;
+ size = trailer->this_size;
+ if (block == 0 || size == 0)
+ abort ();
+ trailer = (struct stk_trailer *) trailer->link;
+ if ((block <= address) && (address < (block + size)))
+ break;
+ }
+
+ /* Set the result to the offset in this segment and add the sizes
+ of all predecessor segments. */
+
+ result = address - block;
+
+ if (trailer == 0)
+ {
+ return result;
+ }
+
+ do
+ {
+ if (trailer->this_size <= 0)
+ abort ();
+ result += trailer->this_size;
+ trailer = (struct stk_trailer *) trailer->link;
+ }
+ while (trailer != 0);
+
+ /* We are done. Note that if you present a bogus address (one
+ not in any segment), you will get a different number back, formed
+ from subtracting the address of the first block. This is probably
+ not what you want. */
+
+ return (result);
+}
+
+#else /* not CRAY2 */
+/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
+ Determine the number of the cell within the stack,
+ given the address of the cell. The purpose of this
+ routine is to linearize, in some sense, stack addresses
+ for alloca. */
+
+static long
+i00afunc (long address)
+{
+ long stkl = 0;
+
+ long size, pseg, this_segment, stack;
+ long result = 0;
+
+ struct stack_segment_linkage *ssptr;
+
+ /* Register B67 contains the address of the end of the
+ current stack segment. If you (as a subprogram) store
+ your registers on the stack and find that you are past
+ the contents of B67, you have overflowed the segment.
+
+ B67 also points to the stack segment linkage control
+ area, which is what we are really interested in. */
+
+ stkl = CRAY_STACKSEG_END ();
+ ssptr = (struct stack_segment_linkage *) stkl;
+
+ /* If one subtracts 'size' from the end of the segment,
+ one has the address of the first word of the segment.
+
+ If this is not the first segment, 'pseg' will be
+ nonzero. */
+
+ pseg = ssptr->sspseg;
+ size = ssptr->sssize;
+
+ this_segment = stkl - size;
+
+ /* It is possible that calling this routine itself caused
+ a stack overflow. Discard stack segments which do not
+ contain the target address. */
+
+ while (!(this_segment <= address && address <= stkl))
+ {
+#ifdef DEBUG_I00AFUNC
+ fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
+#endif
+ if (pseg == 0)
+ break;
+ stkl = stkl - pseg;
+ ssptr = (struct stack_segment_linkage *) stkl;
+ size = ssptr->sssize;
+ pseg = ssptr->sspseg;
+ this_segment = stkl - size;
+ }
+
+ result = address - this_segment;
+
+ /* If you subtract pseg from the current end of the stack,
+ you get the address of the previous stack segment's end.
+ This seems a little convoluted to me, but I'll bet you save
+ a cycle somewhere. */
+
+ while (pseg != 0)
+ {
+#ifdef DEBUG_I00AFUNC
+ fprintf (stderr, "%011o %011o\n", pseg, size);
+#endif
+ stkl = stkl - pseg;
+ ssptr = (struct stack_segment_linkage *) stkl;
+ size = ssptr->sssize;
+ pseg = ssptr->sspseg;
+ result += size;
+ }
+ return (result);
+}
+
+#endif /* not CRAY2 */
+#endif /* CRAY */
+
+#endif /* no alloca */
+#endif /* not GCC version 2 */
+
+#endif /* !HAVE_ALLOCA */
diff --git a/lib/getopt.c b/lib/getopt.c
new file mode 100644
index 0000000..91f00b5
--- /dev/null
+++ b/lib/getopt.c
@@ -0,0 +1,831 @@
+/* Getopt for GNU.
+ NOTE: getopt is now part of the C library, so if you don't know what
+ "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
+ before changing it!
+
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996
+ 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 2, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
+ Ditto for AIX 3.2 and <stdlib.h>. */
+#ifndef _NO_PROTO
+#define _NO_PROTO
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#if !defined (__STDC__) || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+/* Don't include stdlib.h for non-GNU C libraries because some of them
+ contain conflicting prototypes for getopt. */
+#include <stdlib.h>
+#if defined (_LIBC) || defined (HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#endif /* GNU C library. */
+
+#ifdef VMS
+#include <unixlib.h>
+#if HAVE_STRING_H - 0
+#include <string.h>
+#endif
+#endif
+
+#ifdef WIN32
+/* It's not Unix, really. See? Capital letters. */
+#include <windows.h>
+#define getpid() GetCurrentProcessId()
+#endif
+
+#ifndef _
+/* This is for other GNU distributions with internationalized messages.
+ When compiling libc, the _ macro is predefined. */
+#ifdef HAVE_LIBINTL_H
+# include <libintl.h>
+# define _(msgid) gettext (msgid)
+#else
+# define _(msgid) (msgid)
+#endif
+#endif
+
+/* This version of `getopt' appears to the caller like standard Unix `getopt'
+ but it behaves differently for the user, since it allows the user
+ to intersperse the options with the other arguments.
+
+ As `getopt' works, it permutes the elements of ARGV so that,
+ when it is done, all the options precede everything else. Thus
+ all application programs are extended to handle flexible argument order.
+
+ Setting the environment variable POSIXLY_CORRECT disables permutation.
+ Then the behavior is completely standard.
+
+ GNU application programs can use a third alternative mode in which
+ they can distinguish the relative order of options and other arguments. */
+
+#include "getopt.h"
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+char *optarg = NULL;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns EOF, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+/* XXX 1003.2 says this must be 1 before any call. */
+int optind = 0;
+
+/* The next char to be scanned in the option-element
+ in which the last option character we returned was found.
+ This allows us to pick up the scan where we left off.
+
+ If this is zero, or a null string, it means resume the scan
+ by advancing to the next ARGV-element. */
+
+static char *nextchar;
+
+/* Callers store zero here to inhibit the error message
+ for unrecognized options. */
+
+int opterr = 1;
+
+/* Set to an option character which was unrecognized.
+ This must be initialized on some systems to avoid linking in the
+ system's own getopt implementation. */
+
+int optopt = '?';
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+ If the caller did not specify anything,
+ the default is REQUIRE_ORDER if the environment variable
+ POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+ REQUIRE_ORDER means don't recognize them as options;
+ stop option processing when the first non-option is seen.
+ This is what Unix does.
+ This mode of operation is selected by either setting the environment
+ variable POSIXLY_CORRECT, or using `+' as the first character
+ of the list of option characters.
+
+ PERMUTE is the default. We permute the contents of ARGV as we scan,
+ so that eventually all the non-options are at the end. This allows options
+ to be given in any order, even with programs that were not written to
+ expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were written
+ to expect options and other ARGV-elements in any order and that care about
+ the ordering of the two. We describe each non-option ARGV-element
+ as if it were the argument of an option with character code 1.
+ Using `-' as the first character of the list of option characters
+ selects this mode of operation.
+
+ The special argument `--' forces an end of option-scanning regardless
+ of the value of `ordering'. In the case of RETURN_IN_ORDER, only
+ `--' can cause `getopt' to return EOF with `optind' != ARGC. */
+
+static enum
+{
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+} ordering;
+
+/* Value of POSIXLY_CORRECT environment variable. */
+static char *posixly_correct;
+
+#ifdef __GNU_LIBRARY__
+/* We want to avoid inclusion of string.h with non-GNU libraries
+ because there are many ways it can cause trouble.
+ On some systems, it contains special magic macros that don't work
+ in GCC. */
+#include <string.h>
+#define my_index strchr
+#else
+
+/* Avoid depending on library functions or files
+ whose names are inconsistent. */
+
+char *getenv ();
+
+static char *
+my_index (str, chr)
+ const char *str;
+ int chr;
+{
+ while (*str)
+ {
+ if (*str == chr)
+ return (char *) str;
+ str++;
+ }
+ return 0;
+}
+
+/* If using GCC, we can safely declare strlen this way.
+ If not using GCC, it is ok not to declare it. */
+#ifdef __GNUC__
+/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
+ That was relevant to code that was here before. */
+#if !defined (__STDC__) || !__STDC__
+/* gcc with -traditional declares the built-in strlen to return int,
+ and has done so at least since version 2.4.5. -- rms. */
+extern int strlen (const char *);
+#endif /* not __STDC__ */
+#endif /* __GNUC__ */
+
+#endif /* not __GNU_LIBRARY__ */
+
+/* Handle permutation of arguments. */
+
+/* Describe the part of ARGV that contains non-options that have
+ been skipped. `first_nonopt' is the index in ARGV of the first of them;
+ `last_nonopt' is the index after the last of them. */
+
+static int first_nonopt;
+static int last_nonopt;
+
+/* Bash 2.0 gives us an environment variable containing flags
+ indicating ARGV elements that should not be considered arguments. */
+
+static const char *nonoption_flags;
+static int nonoption_flags_len;
+
+/* Exchange two adjacent subsequences of ARGV.
+ One subsequence is elements [first_nonopt,last_nonopt)
+ which contains all the non-options that have been skipped so far.
+ The other is elements [last_nonopt,optind), which contains all
+ the options processed since those non-options were skipped.
+
+ `first_nonopt' and `last_nonopt' are relocated so that they describe
+ the new indices of the non-options in ARGV after they are moved. */
+
+#if defined (__STDC__) && __STDC__
+static void exchange (char **);
+#endif
+
+static void
+exchange (argv)
+ char **argv;
+{
+ int bottom = first_nonopt;
+ int middle = last_nonopt;
+ int top = optind;
+ char *tem;
+
+ /* Exchange the shorter segment with the far end of the longer segment.
+ That puts the shorter segment into the right place.
+ It leaves the longer segment in the right place overall,
+ but it consists of two parts that need to be swapped next. */
+
+ while (top > middle && middle > bottom)
+ {
+ if (top - middle > middle - bottom)
+ {
+ /* Bottom segment is the short one. */
+ int len = middle - bottom;
+ register int i;
+
+ /* Swap it with the top part of the top segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[top - (middle - bottom) + i];
+ argv[top - (middle - bottom) + i] = tem;
+ }
+ /* Exclude the moved bottom segment from further swapping. */
+ top -= len;
+ }
+ else
+ {
+ /* Top segment is the short one. */
+ int len = top - middle;
+ register int i;
+
+ /* Swap it with the bottom part of the bottom segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[middle + i];
+ argv[middle + i] = tem;
+ }
+ /* Exclude the moved top segment from further swapping. */
+ bottom += len;
+ }
+ }
+
+ /* Update records for the slots the non-options now occupy. */
+
+ first_nonopt += (optind - last_nonopt);
+ last_nonopt = optind;
+}
+
+/* Initialize the internal data when the first call is made. */
+
+#if defined (__STDC__) && __STDC__
+static const char *_getopt_initialize (const char *);
+#endif
+static const char *
+_getopt_initialize (optstring)
+ const char *optstring;
+{
+ /* Start processing options with ARGV-element 1 (since ARGV-element 0
+ is the program name); the sequence of previously skipped
+ non-option ARGV-elements is empty. */
+
+ first_nonopt = last_nonopt = optind = 1;
+
+ nextchar = NULL;
+
+ posixly_correct = getenv ("POSIXLY_CORRECT");
+
+ /* Determine how to handle the ordering of options and nonoptions. */
+
+ if (optstring[0] == '-')
+ {
+ ordering = RETURN_IN_ORDER;
+ ++optstring;
+ }
+ else if (optstring[0] == '+')
+ {
+ ordering = REQUIRE_ORDER;
+ ++optstring;
+ }
+ else if (posixly_correct != NULL)
+ ordering = REQUIRE_ORDER;
+ else
+ ordering = PERMUTE;
+
+ if (posixly_correct == NULL)
+ {
+ /* Bash 2.0 puts a special variable in the environment for each
+ command it runs, specifying which ARGV elements are the results of
+ file name wildcard expansion and therefore should not be
+ considered as options. */
+ char var[100];
+ sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ());
+ nonoption_flags = getenv (var);
+ if (nonoption_flags == NULL)
+ nonoption_flags_len = 0;
+ else
+ nonoption_flags_len = strlen (nonoption_flags);
+ }
+
+ return optstring;
+}
+
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+ given in OPTSTRING.
+
+ If an element of ARGV starts with '-', and is not exactly "-" or "--",
+ then it is an option element. The characters of this element
+ (aside from the initial '-') are option characters. If `getopt'
+ is called repeatedly, it returns successively each of the option characters
+ from each of the option elements.
+
+ If `getopt' finds another option character, it returns that character,
+ updating `optind' and `nextchar' so that the next call to `getopt' can
+ resume the scan with the following option character or ARGV-element.
+
+ If there are no more option characters, `getopt' returns `EOF'.
+ Then `optind' is the index in ARGV of the first ARGV-element
+ that is not an option. (The ARGV-elements have been permuted
+ so that those that are not options now come last.)
+
+ OPTSTRING is a string containing the legitimate option characters.
+ If an option character is seen that is not listed in OPTSTRING,
+ return '?' after printing an error message. If you set `opterr' to
+ zero, the error message is suppressed but we still return '?'.
+
+ If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+ so the following text in the same ARGV-element, or the text of the following
+ ARGV-element, is returned in `optarg'. Two colons mean an option that
+ wants an optional arg; if there is text in the current ARGV-element,
+ it is returned in `optarg', otherwise `optarg' is set to zero.
+
+ If OPTSTRING starts with `-' or `+', it requests different methods of
+ handling the non-option ARGV-elements.
+ See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+ Long-named options begin with `--' instead of `-'.
+ Their names may be abbreviated as long as the abbreviation is unique
+ or is an exact match for some defined option. If they have an
+ argument, it follows the option name in the same ARGV-element, separated
+ from the option name by a `=', or else the in next ARGV-element.
+ When `getopt' finds a long-named option, it returns 0 if that option's
+ `flag' field is nonzero, the value of the option's `val' field
+ if the `flag' field is zero.
+
+ The elements of ARGV aren't really const, because we permute them.
+ But we pretend they're const in the prototype to be compatible
+ with other systems.
+
+ LONGOPTS is a vector of `struct option' terminated by an
+ element containing a name which is zero.
+
+ LONGIND returns the index in LONGOPT of the long-named option found.
+ It is only valid when a long-named option has been found by the most
+ recent call.
+
+ If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+ long-named options. */
+
+int
+_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+ const struct option *longopts;
+ int *longind;
+ int long_only;
+{
+ optarg = NULL;
+
+ if (optind == 0)
+ {
+ optstring = _getopt_initialize (optstring);
+ optind = 1; /* Don't scan ARGV[0], the program name. */
+ }
+
+ /* Test whether ARGV[optind] points to a non-option argument.
+ Either it does not have option syntax, or there is an environment flag
+ from the shell indicating it is not an option. */
+#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
+ || (optind < nonoption_flags_len \
+ && nonoption_flags[optind] == '1'))
+
+ if (nextchar == NULL || *nextchar == '\0')
+ {
+ /* Advance to the next ARGV-element. */
+
+ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
+ moved back by the user (who may also have changed the arguments). */
+ if (last_nonopt > optind)
+ last_nonopt = optind;
+ if (first_nonopt > optind)
+ first_nonopt = optind;
+
+ if (ordering == PERMUTE)
+ {
+ /* If we have just processed some options following some non-options,
+ exchange them so that the options come first. */
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange ((char **) argv);
+ else if (last_nonopt != optind)
+ first_nonopt = optind;
+
+ /* Skip any additional non-options
+ and extend the range of non-options previously skipped. */
+
+ while (optind < argc && NONOPTION_P)
+ optind++;
+ last_nonopt = optind;
+ }
+
+ /* The special ARGV-element `--' means premature end of options.
+ Skip it like a null option,
+ then exchange with previous non-options as if it were an option,
+ then skip everything else like a non-option. */
+
+ if (optind != argc && !strcmp (argv[optind], "--"))
+ {
+ optind++;
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange ((char **) argv);
+ else if (first_nonopt == last_nonopt)
+ first_nonopt = optind;
+ last_nonopt = argc;
+
+ optind = argc;
+ }
+
+ /* If we have done all the ARGV-elements, stop the scan
+ and back over any non-options that we skipped and permuted. */
+
+ if (optind == argc)
+ {
+ /* Set the next-arg-index to point at the non-options
+ that we previously skipped, so the caller will digest them. */
+ if (first_nonopt != last_nonopt)
+ optind = first_nonopt;
+ return EOF;
+ }
+
+ /* If we have come to a non-option and did not permute it,
+ either stop the scan or describe it to the caller and pass it by. */
+
+ if (NONOPTION_P)
+ {
+ if (ordering == REQUIRE_ORDER)
+ return EOF;
+ optarg = argv[optind++];
+ return 1;
+ }
+
+ /* We have found another option-ARGV-element.
+ Skip the initial punctuation. */
+
+ nextchar = (argv[optind] + 1
+ + (longopts != NULL && argv[optind][1] == '-'));
+ }
+
+ /* Decode the current option-ARGV-element. */
+
+ /* Check whether the ARGV-element is a long option.
+
+ If long_only and the ARGV-element has the form "-f", where f is
+ a valid short option, don't consider it an abbreviated form of
+ a long option that starts with f. Otherwise there would be no
+ way to give the -f short option.
+
+ On the other hand, if there's a long option "fubar" and
+ the ARGV-element is "-fu", do consider that an abbreviation of
+ the long option, just like "--fu", and not "-f" with arg "u".
+
+ This distinction seems to be the most useful approach. */
+
+ if (longopts != NULL
+ && (argv[optind][1] == '-'
+ || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
+ {
+ char *nameend;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ int exact = 0;
+ int ambig = 0;
+ int indfound;
+ int option_index;
+
+ for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
+ /* Do nothing. */ ;
+
+#ifdef lint /* Suppress `used before initialized' warning. */
+ indfound = 0;
+#endif
+
+ /* Test all long options for either exact match
+ or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, nextchar, nameend - nextchar))
+ {
+ if (nameend - nextchar == strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else
+ /* Second or later nonexact match found. */
+ ambig = 1;
+ }
+
+ if (ambig && !exact)
+ {
+ if (opterr)
+ fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
+ argv[0], argv[optind]);
+ nextchar += strlen (nextchar);
+ optind++;
+ optopt = 0;
+ return '?';
+ }
+
+ if (pfound != NULL)
+ {
+ option_index = indfound;
+ optind++;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ optarg = nameend + 1;
+ else
+ {
+ if (opterr)
+ if (argv[optind - 1][1] == '-')
+ /* --option */
+ fprintf (stderr,
+ _("%s: option `--%s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+ else
+ /* +option or -option */
+ fprintf (stderr,
+ _("%s: option `%c%s' doesn't allow an argument\n"),
+ argv[0], argv[optind - 1][0], pfound->name);
+
+ nextchar += strlen (nextchar);
+
+ optopt = pfound->val;
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (optind < argc)
+ optarg = argv[optind++];
+ else
+ {
+ if (opterr)
+ fprintf (stderr,
+ _("%s: option `%s' requires an argument\n"),
+ argv[0], argv[optind - 1]);
+ nextchar += strlen (nextchar);
+ optopt = pfound->val;
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+ nextchar += strlen (nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+
+ /* Can't find it as a long option. If this is not getopt_long_only,
+ or the option starts with '--' or is not a valid short
+ option, then it's an error.
+ Otherwise interpret it as a short option. */
+ if (!long_only || argv[optind][1] == '-'
+ || my_index (optstring, *nextchar) == NULL)
+ {
+ if (opterr)
+ {
+ if (argv[optind][1] == '-')
+ /* --option */
+ fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
+ argv[0], nextchar);
+ else
+ /* +option or -option */
+ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
+ argv[0], argv[optind][0], nextchar);
+ }
+ nextchar = (char *) "";
+ optind++;
+ optopt = 0;
+ return '?';
+ }
+ }
+
+ /* Look at and handle the next short option-character. */
+
+ {
+ char c = *nextchar++;
+ char *temp = my_index (optstring, c);
+
+ /* Increment `optind' when we start to process its last character. */
+ if (*nextchar == '\0')
+ ++optind;
+
+ if (temp == NULL || c == ':')
+ {
+ if (opterr)
+ {
+ if (posixly_correct)
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, _("%s: illegal option -- %c\n"),
+ argv[0], c);
+ else
+ fprintf (stderr, _("%s: invalid option -- %c\n"),
+ argv[0], c);
+ }
+ optopt = c;
+ return '?';
+ }
+ if (temp[1] == ':')
+ {
+ if (temp[2] == ':')
+ {
+ /* This is an option that accepts an argument optionally. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ optind++;
+ }
+ else
+ optarg = NULL;
+ nextchar = NULL;
+ }
+ else
+ {
+ /* This is an option that requires an argument. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ optind++;
+ }
+ else if (optind == argc)
+ {
+ if (opterr)
+ {
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr,
+ _("%s: option requires an argument -- %c\n"),
+ argv[0], c);
+ }
+ optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ }
+ else
+ /* We already incremented `optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ optarg = argv[optind++];
+ nextchar = NULL;
+ }
+ }
+ return c;
+ }
+}
+
+int
+getopt (argc, argv, optstring)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+{
+ return _getopt_internal (argc, argv, optstring,
+ (const struct option *) 0,
+ (int *) 0,
+ 0);
+}
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
+
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+ the above definition of `getopt'. */
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+
+ c = getopt (argc, argv, "abc:d:0123456789");
+ if (c == EOF)
+ break;
+
+ switch (c)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/lib/getopt1.c b/lib/getopt1.c
new file mode 100644
index 0000000..7cf0bfb
--- /dev/null
+++ b/lib/getopt1.c
@@ -0,0 +1,180 @@
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994
+ 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 2, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "getopt.h"
+
+#if !defined (__STDC__) || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+#include <stdlib.h>
+#else
+char *getenv ();
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+int
+getopt_long (argc, argv, options, long_options, opt_index)
+ int argc;
+ char *const *argv;
+ const char *options;
+ const struct option *long_options;
+ int *opt_index;
+{
+ return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+ If an option that starts with '-' (not '--') doesn't match a long option,
+ but does match a short option, it is parsed as a short option
+ instead. */
+
+int
+getopt_long_only (argc, argv, options, long_options, opt_index)
+ int argc;
+ char *const *argv;
+ const char *options;
+ const struct option *long_options;
+ int *opt_index;
+{
+ return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
+}
+
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
+
+#ifdef TEST
+
+#include <stdio.h>
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+ int option_index = 0;
+ static struct option long_options[] =
+ {
+ {"add", 1, 0, 0},
+ {"append", 0, 0, 0},
+ {"delete", 1, 0, 0},
+ {"verbose", 0, 0, 0},
+ {"create", 0, 0, 0},
+ {"file", 1, 0, 0},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "abc:d:0123456789",
+ long_options, &option_index);
+ if (c == EOF)
+ break;
+
+ switch (c)
+ {
+ case 0:
+ printf ("option %s", long_options[option_index].name);
+ if (optarg)
+ printf (" with arg %s", optarg);
+ printf ("\n");
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", optarg);
+ break;
+
+ case 'd':
+ printf ("option d with value `%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/lib/sigprocmask.c b/lib/sigprocmask.c
new file mode 100644
index 0000000..263c281
--- /dev/null
+++ b/lib/sigprocmask.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include <config.h>
+
+#include <errno.h>
+
+#ifndef HAVE_SIGPROCMASK
+
+#define sigprocmask SOMETHINGELSE
+#include <signal.h>
+#undef sigprocmask
+
+int
+sigprocmask (int how, int *new, int *old)
+{
+ int o, n = *new;
+
+ switch (how)
+ {
+ case 1: o = sigblock (n); break;
+ case 2: o = sigsetmask (sigblock (0) & ~n); break;
+ case 3: o = sigsetmask (n); break;
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+ if (old)
+ *old = o;
+ return 0;
+}
+
+#endif /* !HAVE_SIGPROCMASK */
diff --git a/lib/snprintf.c b/lib/snprintf.c
new file mode 100644
index 0000000..0683b08
--- /dev/null
+++ b/lib/snprintf.c
@@ -0,0 +1,532 @@
+#include <config.h>
+
+#ifndef HAVE_SNPRINTF
+
+/***************************************************************************
+ * LPRng - An Extended Print Spooler System
+ *
+ * Copyright 1988-1997, Patrick Powell, San Diego, CA
+ * papowell@sdsu.edu
+ * See below for conditions of use.
+ *
+ ***************************************************************************
+ * MODULE: snprintf.c
+ * PURPOSE: LPRng version of printf - absolutely bombproof (hopefully!)
+ **************************************************************************/
+#if 0
+
+ The "Artistic License"
+
+ Preamble
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to make
+reasonable modifications.
+
+Definitions:
+
+ "Package" refers to the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection of files
+ created through textual modification.
+
+ "Standard Version" refers to such a Package if it has not been
+ modified, or has been modified in accordance with the wishes
+ of the Copyright Holder as specified below.
+
+ "Copyright Holder" is whoever is named in the copyright or
+ copyrights for the package.
+
+ "You" is you, if you are thinking about copying or distributing
+ this Package.
+
+ "Reasonable copying fee" is whatever you can justify on the
+ basis of media cost, duplication charges, time of people involved,
+ and so on. (You will not be required to justify it to the
+ Copyright Holder, but only to the computing community at large
+ as a market that must bear the fee.)
+
+ "Freely Available" means that no fee is charged for the item
+ itself, though there may be fees involved in handling the item.
+ It also means that recipients of the item may redistribute it
+ under the same conditions they received it.
+
+1. You may make and give away verbatim copies of the source form of the
+Standard Version of this Package without restriction, provided that you
+duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications
+derived from the Public Domain or from the Copyright Holder. A Package
+modified in such a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided
+that you insert a prominent notice in each changed file stating how and
+when you changed that file, and provided that you do at least ONE of the
+following:
+
+ a) place your modifications in the Public Domain or otherwise make them
+ Freely Available, such as by posting said modifications to Usenet or
+ an equivalent medium, or placing the modifications on a major archive
+ site such as uunet.uu.net, or by allowing the Copyright Holder to include
+ your modifications in the Standard Version of the Package.
+
+ b) use the modified Package only within your corporation or organization.
+
+ c) rename any non-standard executables so the names do not conflict
+ with standard executables, which must also be provided, and provide
+ a separate manual page for each non-standard executable that clearly
+ documents how it differs from the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
+
+ a) distribute a Standard Version of the executables and library files,
+ together with instructions (in the manual page or equivalent) on where
+ to get the Standard Version.
+
+ b) accompany the distribution with the machine-readable source of
+ the Package with your modifications.
+
+ c) give non-standard executables non-standard names, and clearly
+ document the differences in manual pages (or equivalent), together
+ with instructions on where to get the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this
+Package. You may charge any fee you choose for support of this
+Package. You may not charge a fee for this Package itself. However,
+you may distribute this Package in aggregate with other (possibly
+commercial) programs as part of a larger (possibly commercial) software
+distribution provided that you do not advertise this Package as a
+product of your own.
+
+6. The name of the Copyright Holder may not be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+7. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+ The End
+#include "lp.h"
+#endif
+
+#include <stdarg.h>
+#include <errno.h>
+#include <sys/types.h>
+#define HAVE_STDARGS /* let's hope that works everywhere (mj) */
+#define VA_LOCAL_DECL va_list ap;
+#define VA_START(f) va_start(ap, f)
+#define VA_SHIFT(v,t) ; /* no-op for ANSI */
+#define VA_END va_end(ap)
+
+/**** ENDINCLUDE ****/
+
+static char *const _id = "$Id: snprintf.c,v 3.2 1997/01/19 14:34:56 papowell Exp $";
+
+/*
+ * dopr(): poor man's version of doprintf
+ */
+
+static char * plp_Errormsg ( int err );
+static void dopr( char *buffer, const char *format, va_list args );
+static void fmtstr( char *value, int ljust, int len, int zpad, int precision );
+static void fmtnum( long value, int base, int dosign,
+ int ljust, int len, int zpad, int precision );
+static void fmtdouble( int fmt, double value,
+ int ljust, int len, int zpad, int precision );
+static void dostr( char * );
+static char *output;
+static void dopr_outch( int c );
+static char *end;
+int visible_control = 1;
+
+/**************************************************************
+ * Original:
+ * Patrick Powell Tue Apr 11 09:48:21 PDT 1995
+ * A bombproof version of doprnt (dopr) included.
+ * Sigh. This sort of thing is always nasty do deal with. Note that
+ * the version here does not include floating point...
+ *
+ * plp_snprintf() is used instead of sprintf() as it does limit checks
+ * for string length. This covers a nasty loophole.
+ *
+ * The other functions are there to prevent NULL pointers from
+ * causing nast effects.
+ **************************************************************/
+
+int vsnprintf(char *str, size_t count, const char *fmt, va_list args)
+{
+ str[0] = 0;
+ end = str+count-1;
+ dopr( str, fmt, args );
+ if( count>0 ){
+ end[0] = 0;
+ }
+ return(strlen(str));
+}
+
+/* VARARGS3 */
+#ifdef HAVE_STDARGS
+int snprintf (char *str,size_t count,const char *fmt,...)
+#else
+int snprintf (va_alist) va_dcl
+#endif
+{
+#ifndef HAVE_STDARGS
+ char *str;
+ size_t count;
+ char *fmt;
+#endif
+ VA_LOCAL_DECL
+
+ VA_START (fmt);
+ VA_SHIFT (str, char *);
+ VA_SHIFT (count, size_t );
+ VA_SHIFT (fmt, char *);
+ (void) vsnprintf ( str, count, fmt, ap);
+ VA_END;
+ return( strlen( str ) );
+}
+
+static void dopr( char *buffer, const char *format, va_list args )
+{
+ int ch;
+ long value;
+ int longflag = 0;
+ char *strvalue;
+ int ljust;
+ int len;
+ int zpad;
+ int precision;
+ int set_precision;
+ double dval;
+ int err = errno;
+
+ output = buffer;
+ while( (ch = *format++) ){
+ switch( ch ){
+ case '%':
+ ljust = len = zpad = 0;
+ precision = -1; set_precision = 0;
+ nextch:
+ ch = *format++;
+ switch( ch ){
+ case 0:
+ dostr( "**end of format**" );
+ return;
+ case '-': ljust = 1; goto nextch;
+ case '.': set_precision = 1; precision = 0; goto nextch;
+ case '*': len = va_arg( args, int ); goto nextch;
+ case '0': /* set zero padding if len not set */
+ if(len==0 && set_precision == 0 ) zpad = '0';
+ case '1': case '2': case '3':
+ case '4': case '5': case '6':
+ case '7': case '8': case '9':
+ if( set_precision ){
+ precision = precision*10 + ch - '0';
+ } else {
+ len = len*10 + ch - '0';
+ }
+ goto nextch;
+ case 'l': longflag = 1; goto nextch;
+ case 'u': case 'U':
+ /*fmtnum(value,base,dosign,ljust,len, zpad, precision) */
+ if( longflag ){
+ value = va_arg( args, long );
+ } else {
+ value = va_arg( args, int );
+ }
+ fmtnum( value, 10,0, ljust, len, zpad, precision ); break;
+ case 'o': case 'O':
+ /*fmtnum(value,base,dosign,ljust,len, zpad, precision) */
+ if( longflag ){
+ value = va_arg( args, long );
+ } else {
+ value = va_arg( args, int );
+ }
+ fmtnum( value, 8,0, ljust, len, zpad, precision ); break;
+ case 'd': case 'D':
+ if( longflag ){
+ value = va_arg( args, long );
+ } else {
+ value = va_arg( args, int );
+ }
+ fmtnum( value, 10,1, ljust, len, zpad, precision ); break;
+ case 'x':
+ if( longflag ){
+ value = va_arg( args, long );
+ } else {
+ value = va_arg( args, int );
+ }
+ fmtnum( value, 16,0, ljust, len, zpad, precision ); break;
+ case 'X':
+ if( longflag ){
+ value = va_arg( args, long );
+ } else {
+ value = va_arg( args, int );
+ }
+ fmtnum( value,-16,0, ljust, len, zpad, precision ); break;
+ case 's':
+ strvalue = va_arg( args, char *);
+ fmtstr( strvalue,ljust,len, zpad, precision );
+ break;
+ case 'c':
+ ch = va_arg( args, int );
+ { char b[2];
+ int vsb = visible_control;
+ b[0] = ch;
+ b[1] = 0;
+ visible_control = 0;
+ fmtstr( b,ljust,len, zpad, precision );
+ visible_control = vsb;
+ }
+ break;
+ case 'f': case 'g':
+ dval = va_arg( args, double );
+ fmtdouble( ch, dval,ljust,len, zpad, precision ); break;
+ case 'm':
+ fmtstr( plp_Errormsg(err),ljust,len, zpad, precision ); break;
+ case '%': dopr_outch( ch ); continue;
+ default:
+ dostr( "???????" );
+ }
+ longflag = 0;
+ break;
+ default:
+ dopr_outch( ch );
+ break;
+ }
+ }
+ *output = 0;
+}
+
+/*
+ * Format '%[-]len[.precision]s'
+ * - = left justify (ljust)
+ * len = minimum length
+ * precision = numbers of chars in string to use
+ */
+static void
+fmtstr( char *value, int ljust, int len, int zpad, int precision )
+{
+ int padlen, strlen, i, c; /* amount to pad */
+
+ if( value == 0 ){
+ value = "<NULL>";
+ }
+ if( precision > 0 ){
+ strlen = precision;
+ } else {
+ /* cheap strlen so you do not have library call */
+ for( strlen = 0; (c=value[strlen]); ++ strlen ){
+ if( visible_control && iscntrl( c ) && !isspace( c ) ){
+ ++strlen;
+ }
+ }
+ }
+ padlen = len - strlen;
+ if( padlen < 0 ) padlen = 0;
+ if( ljust ) padlen = -padlen;
+ while( padlen > 0 ) {
+ dopr_outch( ' ' );
+ --padlen;
+ }
+ /* output characters */
+ for( i = 0; (c = value[i]); ++i ){
+ if( visible_control && iscntrl( c ) && !isspace( c ) ){
+ dopr_outch('^');
+ c = ('@' | (c & 0x1F));
+ }
+ dopr_outch(c);
+ }
+ while( padlen < 0 ) {
+ dopr_outch( ' ' );
+ ++padlen;
+ }
+}
+
+static void
+fmtnum( long value, int base, int dosign, int ljust,
+ int len, int zpad, int precision )
+{
+ int signvalue = 0;
+ unsigned long uvalue;
+ char convert[20];
+ int place = 0;
+ int padlen = 0; /* amount to pad */
+ int caps = 0;
+
+ /* DEBUGP(("value 0x%x, base %d, dosign %d, ljust %d, len %d, zpad %d\n",
+ value, base, dosign, ljust, len, zpad )); */
+ uvalue = value;
+ if( dosign ){
+ if( value < 0 ) {
+ signvalue = '-';
+ uvalue = -value;
+ }
+ }
+ if( base < 0 ){
+ caps = 1;
+ base = -base;
+ }
+ do{
+ convert[place++] =
+ (caps? "0123456789ABCDEF":"0123456789abcdef")
+ [uvalue % (unsigned)base ];
+ uvalue = (uvalue / (unsigned)base );
+ }while(uvalue);
+ convert[place] = 0;
+ padlen = len - place;
+ if( padlen < 0 ) padlen = 0;
+ if( ljust ) padlen = -padlen;
+ /* DEBUGP(( "str '%s', place %d, sign %c, padlen %d\n",
+ convert,place,signvalue,padlen)); */
+ if( zpad && padlen > 0 ){
+ if( signvalue ){
+ dopr_outch( signvalue );
+ --padlen;
+ signvalue = 0;
+ }
+ while( padlen > 0 ){
+ dopr_outch( zpad );
+ --padlen;
+ }
+ }
+ while( padlen > 0 ) {
+ dopr_outch( ' ' );
+ --padlen;
+ }
+ if( signvalue ) dopr_outch( signvalue );
+ while( place > 0 ) dopr_outch( convert[--place] );
+ while( padlen < 0 ){
+ dopr_outch( ' ' );
+ ++padlen;
+ }
+}
+
+static void
+fmtdouble( int fmt, double value, int ljust, int len, int zpad, int precision )
+{
+ char convert[128];
+ char fmtstr[128];
+ int l;
+
+ if( len == 0 ) len = 10;
+ if( len > sizeof(convert) - 10 ){
+ len = sizeof(convert) - 10;
+ }
+ if( precision > sizeof(convert) - 10 ){
+ precision = sizeof(convert) - 10;
+ }
+ if( precision > len ) precision = len;
+ strcpy( fmtstr, "%" );
+ if( ljust ) strcat(fmtstr, "-" );
+ if( len ){
+ sprintf( fmtstr+strlen(fmtstr), "%d", len );
+ }
+ if( precision > 0 ){
+ sprintf( fmtstr+strlen(fmtstr), ".%d", precision );
+ }
+ l = strlen( fmtstr );
+ fmtstr[l] = fmt;
+ fmtstr[l+1] = 0;
+ sprintf( convert, fmtstr, value );
+ dostr( convert );
+}
+
+static void dostr( char *str )
+{
+ while(*str) dopr_outch(*str++);
+}
+
+static void dopr_outch( int c )
+{
+ if( end == 0 || output < end ){
+ *output++ = c;
+ }
+}
+
+
+/****************************************************************************
+ * static char *plp_errormsg( int err )
+ * returns a printable form of the
+ * errormessage corresponding to the valie of err.
+ * This is the poor man's version of sperror(), not available on all systems
+ * Patrick Powell Tue Apr 11 08:05:05 PDT 1995
+ ****************************************************************************/
+/****************************************************************************/
+#if !defined(HAVE_STRERROR)
+
+# if defined(HAVE_SYS_NERR)
+# if !defined(HAVE_SYS_NERR_DEF)
+ extern int sys_nerr;
+# endif
+# define num_errors (sys_nerr)
+# else
+# define num_errors (-1) /* always use "errno=%d" */
+# endif
+
+# if defined(HAVE_SYS_ERRLIST)
+# if !defined(HAVE_SYS_ERRLIST_DEF)
+ extern const char *const sys_errlist[];
+# endif
+# else
+# undef num_errors
+# define num_errors (-1) /* always use "errno=%d" */
+# endif
+
+#endif
+
+static char * plp_Errormsg ( int err )
+{
+ char *cp;
+
+#if defined(HAVE_STRERROR)
+ cp = (void *)strerror(err);
+#else
+# if defined(HAVE_SYS_ERRLIST)
+ if (err >= 0 && err < num_errors) {
+ cp = (void *)sys_errlist[err];
+ } else
+# endif
+ {
+ static char msgbuf[32]; /* holds "errno=%d". */
+ /* SAFE use of sprintf */
+ (void) sprintf (msgbuf, "errno=%d", err);
+ cp = msgbuf;
+ }
+#endif
+ return (cp);
+}
+
+#if defined(TEST)
+#include <stdio.h>
+int main( void )
+{
+ char buffer[128];
+ char *t;
+ char *test1 = "01234";
+ errno = 1;
+ plp_snprintf( buffer, sizeof(buffer), (t="errno '%m'")); printf( "%s = '%s'\n", t, buffer );
+ plp_snprintf( buffer, sizeof(buffer), (t = "%s"), test1 ); printf( "%s = '%s'\n", t, buffer );
+ plp_snprintf( buffer, sizeof(buffer), (t = "%12s"), test1 ); printf( "%s = '%s'\n", t, buffer );
+ plp_snprintf( buffer, sizeof(buffer), (t = "%-12s"), test1 ); printf( "%s = '%s'\n", t, buffer );
+ plp_snprintf( buffer, sizeof(buffer), (t = "%12.2s"), test1 ); printf( "%s = '%s'\n", t, buffer );
+ plp_snprintf( buffer, sizeof(buffer), (t = "%-12.2s"), test1 ); printf( "%s = '%s'\n", t, buffer );
+ plp_snprintf( buffer, sizeof(buffer), (t = "%g"), 1.25 ); printf( "%s = '%s'\n", t, buffer );
+ plp_snprintf( buffer, sizeof(buffer), (t = "%g"), 1.2345 ); printf( "%s = '%s'\n", t, buffer );
+ plp_snprintf( buffer, sizeof(buffer), (t = "%12g"), 1.25 ); printf( "%s = '%s'\n", t, buffer );
+ plp_snprintf( buffer, sizeof(buffer), (t = "%12.2g"), 1.25 ); printf( "%s = '%s'\n", t, buffer );
+ plp_snprintf( buffer, sizeof(buffer), (t = "%0*d"), 6, 1 ); printf( "%s = '%s'\n", t, buffer );
+ return(0);
+}
+#endif
+
+
+#endif /* HAVE_SNPRINTF */
diff --git a/lib/strdup.c b/lib/strdup.c
new file mode 100644
index 0000000..62f2976
--- /dev/null
+++ b/lib/strdup.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef HAVE_STRDUP
+
+char *
+strdup (const char * s)
+{
+ char *clone;
+ size_t size;
+
+ size = strlen (s) + 1;
+ clone = malloc (size);
+ memcpy (clone, s, size);
+ return clone;
+}
+
+#endif /* !HAVE_STRDUP */
diff --git a/lib/strndup.c b/lib/strndup.c
new file mode 100644
index 0000000..b02355e
--- /dev/null
+++ b/lib/strndup.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include <config.h>
+
+#ifndef HAVE_STRNDUP
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <sys/types.h>
+
+char *
+strndup (const char * s, size_t n)
+{
+ char *clone;
+
+ clone = malloc (n + 1);
+ strncpy (clone, s, n);
+ clone[n] = '\0';
+ return clone;
+}
+
+#endif /* !HAVE_STRNDUP */
diff --git a/lib/strsep.c b/lib/strsep.c
new file mode 100644
index 0000000..c3e05e3
--- /dev/null
+++ b/lib/strsep.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 1992, 1993, 1996 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include <config.h>
+
+#include <string.h>
+
+#ifndef HAVE_STRSEP
+
+char *
+strsep (char **stringp, const char *delim)
+{
+ char *begin, *end;
+
+ begin = *stringp;
+ if (! begin || *begin == '\0')
+ return NULL;
+
+ /* Find the end of the token. */
+ end = strpbrk (begin, delim);
+ if (end)
+ {
+ /* Terminate the token and set *STRINGP past NUL character. */
+ *end++ = '\0';
+ *stringp = end;
+ }
+ else
+ /* No more delimiters; this is the last token. */
+ *stringp = NULL;
+
+ return begin;
+}
+
+#endif /* !HAVE_STRSEP */
diff --git a/lib/usleep.c b/lib/usleep.c
new file mode 100644
index 0000000..4f63df4
--- /dev/null
+++ b/lib/usleep.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 1992 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+#include <config.h>
+
+#ifndef HAVE_USLEEP
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+
+#ifdef apollo
+# include <apollo/base.h>
+# include <apollo/time.h>
+ static time_$clock_t DomainTime100mS =
+ {
+ 0, 100000/4
+ };
+ static status_$t DomainStatus;
+#endif
+
+/* Sleep USECONDS microseconds, or until a previously set timer goes off. */
+unsigned int
+usleep (unsigned int useconds)
+{
+#ifdef apollo
+ /* The usleep function does not work under the SYS5.3 environment.
+ Use the Domain/OS time_$wait call instead. */
+ time_$wait (time_$relative, DomainTime100mS, &DomainStatus);
+#else
+ struct timeval delay;
+
+ delay.tv_sec = 0;
+ delay.tv_usec = useconds;
+ select (0, 0, 0, 0, &delay);
+ return 0;
+#endif
+}
+
+#endif /* !HAVE_USLEEP */
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 0000000..cc8783e
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,36 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Last modified: 1994-03-25
+# Public domain
+
+errstatus=0
+
+for file in ${1+"$@"} ; do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d in ${1+"$@"} ; do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp" 1>&2
+ mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+ fi
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
diff --git a/po/Makefile.in b/po/Makefile.in
new file mode 100644
index 0000000..726140e
--- /dev/null
+++ b/po/Makefile.in
@@ -0,0 +1,92 @@
+PACKAGE = xsane
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+
+prefix = @prefix@
+datadir = @datadir@
+
+localedir = $(datadir)/locale
+gnulocaledir = $(prefix)/share/locale
+gettextsrcdir = $(prefix)/share/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+INSTOBJEXT = @INSTOBJEXT@
+
+.SUFFIXES: .po .gmo .mo
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+.po.gmo:
+ file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
+ && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+all: $(CATALOGS)
+
+install: all
+ $(MKINSTALLDIRS) $(datadir);
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ case "$$cat" in \
+ *.gmo) destdir=$(gnulocaledir);; \
+ *) destdir=$(localedir);; \
+ esac; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ dir=$$destdir/$$lang/LC_MESSAGES; \
+ $(MKINSTALLDIRS) $$dir; \
+ if test -r $$cat; then \
+ $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
+ echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+ else \
+ $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
+ echo "installing $(srcdir)/$$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+ fi; \
+ if test -r $$cat.m; then \
+ $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ if test -r $(srcdir)/$$cat.m ; then \
+ $(INSTALL_DATA) $(srcdir)/$$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $(srcdir)/$$cat as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ true; \
+ fi; \
+ fi; \
+ done
+
+uninstall:
+ catalogs='$(CATALOGS)';
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ done
+ rm -f $(gettextsrcdir)/po-Makefile.in
+
+clean:
+ rm -f core core.*
+
+distclean: clean
+ rm -f Makefile
+
+maintainer-clean: clean
+ rm -f *.mo *.gmo
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/Makefile.in.bak b/po/Makefile.in.bak
new file mode 100644
index 0000000..272b056
--- /dev/null
+++ b/po/Makefile.in.bak
@@ -0,0 +1,92 @@
+PACKAGE = xsane
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+
+prefix = @prefix@
+datadir = @datadir@
+
+localedir = $(datadir)/locale
+gnulocaledir = $(prefix)/share/locale
+gettextsrcdir = $(prefix)/share/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+INSTOBJEXT = @INSTOBJEXT@
+
+.SUFFIXES: .po .gmo .mo
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+.po.gmo:
+ file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
+ && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+all: $(CATALOGS)
+
+install: all
+ $(MKINSTALLDIRS) $(datadir);
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ case "$$cat" in \
+ *.gmo) destdir=$(gnulocaledir);; \
+ *) destdir=$(localedir);; \
+ esac; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ dir=$$destdir/$$lang/LC_MESSAGES; \
+ $(MKINSTALLDIRS) $$dir; \
+ if test -r $$cat; then \
+ $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
+ echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+ else \
+ $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
+ echo "installing $(srcdir)/$$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+ fi; \
+ if test -r $$cat.m; then \
+ $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ if test -r $(srcdir)/$$cat.m ; then \
+ $(INSTALL_DATA) $(srcdir)/$$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $(srcdir)/$$cat as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ true; \
+ fi; \
+ fi; \
+ done
+
+uninstall:
+ catalogs='$(CATALOGS)';
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ done
+ rm -f $(gettextsrcdir)/po-Makefile.in
+
+clean:
+ rm -f core core.*
+
+distclean: clean
+ rm -f Makefile
+
+maintainer-clean: distclean
+ rm -f *.mo *.gmo
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/README.ADD_NEW_LANGUAGE b/po/README.ADD_NEW_LANGUAGE
new file mode 100644
index 0000000..da658fa
--- /dev/null
+++ b/po/README.ADD_NEW_LANGUAGE
@@ -0,0 +1,69 @@
+
+How to add a new language to xsane:
+-----------------------------------
+
+SHORT DESCRIPTION:
+------------------
+
+XSane uses gettext for supporting translation into different languages.
+*** BUT ***:
+I don`t use the standard routines to create the empty translation(*.po) file.
+My way is more flexible when changes in the original textes are made:
+
+All texts that are printed from xsane are #DEFINEd in xsane-text.h.
+Every text that is added to xsane will be added in frontend/xsane-text.h
+AND in po/newlanguage.in.in.
+
+******* Please don`t edit or create a *.po file by hand! ********
+
+The files *.po are created form the files *.po.in . In xsane and in the
+*.po.in files we use the #defined labels of the text instead of the text.
+This way the original text can be changed without all language files
+have to be changed!
+
+po.in2po uses the gcc preprocessor to replace the #defined labels by the
+original (up to date) text and creates the *.po files.
+
+make_newlanguage.po.in creates the file newlanguage.po.in, the gcc preprocessor
+is used to add the recent original texts as comments.
+
+
+
+WHAT DO YOU HAVE TO DO TO CREATE ADD A NEW LANGUAGE?
+----------------------------------------------------
+
+Take the file newlanguage.po.in and copy it to "language".po.in
+where "language" is the abbrevation that represents you language
+(eg. fr.po.in for french, de.po.in for german,...).
+
+Edit the file "language".po.in and type in the translation
+in the lines:
+msgstr "text"
+
+If that is done:
+ - if you have gcc installed, call po.in2po "language"
+ - if you don`t have gcc see if you have a C preprocessor you can use
+ if not, I will transform it for you
+
+now change to the xsane directory and do
+edit configure.in and add "language" to ALL_LINGUAS, then do
+ make distclean
+ ./configure
+ make
+and as root
+ make install
+
+(You have to install xsane, otherwise the language files will not be found!)
+
+set environment variable LANG to your language
+(eg. export LANG=de) and call xsane
+
+If you want to make your translation public
+please send your "language".po.in file to:
+Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+If you have any problems please also contact
+me on the email-address above!
+
+Bye
+Oliver Rauch
+
diff --git a/po/README.UPDATE_LANGUAGE b/po/README.UPDATE_LANGUAGE
new file mode 100644
index 0000000..1a18a6b
--- /dev/null
+++ b/po/README.UPDATE_LANGUAGE
@@ -0,0 +1,8 @@
+To update the lines
+#original text: "*"
+in file.po.in call remake_language.po.in file[.po.in]
+
+To update file.po call
+po.in2po file
+
+
diff --git a/po/add-0.37.po.in b/po/add-0.37.po.in
new file mode 100644
index 0000000..943dcfa
--- /dev/null
+++ b/po/add-0.37.po.in
@@ -0,0 +1,56 @@
+#original text: "Saving image"
+msgid PROGRESS_SAVING
+msgstr ""
+
+#original text: "Saving fax image"
+msgid PROGRESS_SAVING_FAX
+msgstr ""
+
+#original text: "Converting data...."
+msgid PROGRESS_CONVERTING_DATA
+msgstr ""
+
+#original text: "Converting to postscript"
+msgid PROGRESS_CONVERTING_PS
+msgstr ""
+
+#original text: "Scanning"
+msgid PROGRESS_SCANNING
+msgstr ""
+
+#original text: "Receiving %s data for `%s'..."
+msgid PROGRESS_RECEIVING_SCAN
+msgstr ""
+
+#original text: "Receiving %s data for photocopy ..."
+msgid PROGRESS_RECEIVING_COPY
+msgstr ""
+
+#original text: "Receiving %s data for fax ..."
+msgid PROGRESS_RECEIVING_FAX
+msgstr ""
+
+#original text: "Receiving %s data for GIMP..."
+msgid PROGRESS_RECEIVING_GIMP
+msgstr ""
+
+
+
+msgid "flatbed scanner"
+msgstr ""
+
+msgid "frame grabber"
+msgstr ""
+
+msgid "handheld scanner"
+msgstr ""
+
+msgid "still camera"
+msgstr ""
+
+msgid "video camera"
+msgstr ""
+
+msgid "virtual device"
+msgstr ""
+
diff --git a/po/add-0.38.po.in b/po/add-0.38.po.in
new file mode 100644
index 0000000..6f95e72
--- /dev/null
+++ b/po/add-0.38.po.in
@@ -0,0 +1,48 @@
+#original text: "View"
+msgid MENU_VIEW
+msgstr ""
+
+#original text: "Email:"
+msgid TEXT_EMAIL
+msgstr ""
+
+#original text: "with GIMP support, compiled with GIMP-"
+msgid TEXT_WITH_GIMP_SUPPORT
+msgstr ""
+
+#original text: "without GIMP support"
+msgid TEXT_WITHOUT_GIMP_SUPPORT
+msgstr ""
+
+#original text: "compiled with GIMP-"
+msgid TEXT_GIMP_VERSION
+msgstr ""
+
+#original text: "GIMP can't handle depth"
+msgid ERR_GIMP_BAD_DEPTH
+msgstr ""
+
+#original text: "Front-end to the SANE interface"
+msgid XSANE_GIMP_INSTALL_BLURB
+msgstr ""
+
+#original text: "This function provides access to scanners and other image acquisition devices through the SANE (Scanner Access Now Easy) interface."
+msgid XSANE_GIMP_INSTALL_HELP
+msgstr ""
+
+#original text: "<Toolbox>/File/Acquire/XSane: "
+msgid XSANE_GIMP_MENU
+msgstr ""
+
+#original text: "<Toolbox>/Xtns/XSane/"
+msgid XSANE_GIMP_MENU_OLD
+msgstr ""
+
+#original text: "<Toolbox>/File/Acquire/XSane: Device dialog..."
+msgid XSANE_GIMP_MENU_DIALOG
+msgstr ""
+
+#original text: "<Toolbox>/Xtns/XSane/Device dialog..."
+msgid XSANE_GIMP_MENU_DIALOG_OLD
+msgstr ""
+
diff --git a/po/add-0.40.po.in b/po/add-0.40.po.in
new file mode 100644
index 0000000..3b443fe
--- /dev/null
+++ b/po/add-0.40.po.in
@@ -0,0 +1,40 @@
+#original text: "Overwrite"
+msgid BUTTON_OVERWRITE
+msgstr ""
+
+#original text: "File:"
+msgid TEXT_FILE
+msgstr ""
+
+#original text: "Failed to create file:"
+msgid ERR_FAILED_CREATE_FILE
+msgstr ""
+
+#original text: "Error while loading device settings:"
+msgid ERR_LOAD_DEVICE_SETTINGS
+msgstr ""
+
+#original text: "is not a device-rc-file !!!"
+msgid ERR_NO_DRC_FILE
+msgstr ""
+
+#original text: "Failed to execute netscape!"
+msgid ERR_NETSCAPE_EXECUTE_FAIL
+msgstr ""
+
+#original text: "Send fax: no receiver defined"
+msgid ERR_SENDFAX_RECEIVER_MISSING
+msgstr ""
+
+#original text: "has been created for device"
+msgid ERR_CREATED_FOR_DEVICE
+msgstr ""
+
+#original text: "you want to use it for device"
+msgid ERR_USED_FOR_DEVICE
+msgstr ""
+
+#original text: "this may cause problems!"
+msgid ERR_MAY_CAUSE_PROBLEMS
+msgstr ""
+
diff --git a/po/add-0.44.po.in b/po/add-0.44.po.in
new file mode 100644
index 0000000..2553218
--- /dev/null
+++ b/po/add-0.44.po.in
@@ -0,0 +1,9 @@
+
+#original text: "Copy options"
+msgid NOTEBOOK_COPY_OPTIONS
+msgstr ""
+
+#original text: "Problems?"
+msgid MENU_ITEM_PROBLEMS
+msgstr ""
+
diff --git a/po/add-0.47.po.in b/po/add-0.47.po.in
new file mode 100644
index 0000000..77c197a
--- /dev/null
+++ b/po/add-0.47.po.in
@@ -0,0 +1,5 @@
+
+#original text: "Create project"
+msgid BUTTON_CREATE_PROJECT
+msgstr ""
+
diff --git a/po/cs.gmo b/po/cs.gmo
new file mode 100644
index 0000000..b29f57f
--- /dev/null
+++ b/po/cs.gmo
Binary files differ
diff --git a/po/cs.po b/po/cs.po
new file mode 100644
index 0000000..faa03d0
--- /dev/null
+++ b/po/cs.po
@@ -0,0 +1,1594 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#nls translation file for xsane
+#language: czech (cs)
+
+#original text: "About"
+msgid "About"
+msgstr "O programu"
+
+#original text: "authorization"
+msgid "authorization"
+msgstr "autorizace"
+
+#original text: "info"
+msgid "info"
+msgstr "informace"
+
+#original text: "batch scan"
+msgid "batch scan"
+msgstr "dávkové skenování"
+
+#original text: "fax project"
+msgid "fax project"
+msgstr "faxový projekt"
+
+#original text: "rename fax page"
+msgid "rename fax page"
+msgstr "pøejmenovat faxovou stránku"
+
+#original text: "setup"
+msgid "setup"
+msgstr "nastavení"
+
+#original text: "Histogram"
+msgid "Histogram"
+msgstr "Histogram"
+
+#original text: "Standard options"
+msgid "Standard options"
+msgstr "Standardní volby"
+
+#original text: "Advanced options"
+msgid "Advanced options"
+msgstr "Roz¹íøené volby"
+
+#original text: "device selection"
+msgid "device selection"
+msgstr "výbìr zaøízení"
+
+#original text: "Preview"
+msgid "Preview"
+msgstr "Náhled"
+
+#original text: "output filename"
+msgid "output filename"
+msgstr "jméno výstupního souboru"
+
+#original text: "save device settings"
+msgid "save device settings"
+msgstr "zapsat nastavení zaøízení"
+
+#original text: "load device settings"
+msgid "load device settings"
+msgstr "naèíst nastavení zaøízení"
+
+#original text: "File"
+msgid "File"
+msgstr "Soubor"
+
+#original text: "Preferences"
+msgid "Preferences"
+msgstr "Nastavení"
+
+#original text: "View"
+msgid "View"
+msgstr "Pohled"
+
+#original text: "Help"
+msgid "Help"
+msgstr "Nápovìda"
+
+#original text: "About"
+msgid "About"
+msgstr "O programu"
+
+#original text: "Info"
+msgid "Info"
+msgstr "Informace"
+
+#original text: "Exit"
+msgid "Exit"
+msgstr "Konec"
+
+#original text: "Raw image"
+msgid "Raw image"
+msgstr "Pùvodní obrázek"
+
+#original text: "Enhanced image"
+msgid "Enhanced image"
+msgstr "Zpracovaný obrázek"
+
+#original text: "Start"
+msgid "Start"
+msgstr "Start"
+
+#original text: "Ok"
+msgid "Ok"
+msgstr "OK"
+
+#original text: "Apply"
+msgid "Apply"
+msgstr "Pou¾ít"
+
+#original text: "Cancel"
+msgid "Cancel"
+msgstr "Zru¹it"
+
+#original text: "Close"
+msgid "Close"
+msgstr "Zavøít"
+
+#original text: "Overwrite"
+msgid "Overwrite"
+msgstr "Pøepsat"
+
+#original text: "Add area"
+msgid "Add area"
+msgstr "Pøidat oblast"
+
+#original text: "Delete"
+msgid "Delete"
+msgstr "Smazat"
+
+#original text: "Show"
+msgid "Show"
+msgstr "Ukázat"
+
+#original text: "Rename"
+msgid "Rename"
+msgstr "Pøejmenovat"
+
+#original text: "Send project"
+msgid "Send project"
+msgstr "Odeslat projekt"
+
+#original text: "Delete project"
+msgid "Delete project"
+msgstr "Smazat projekt"
+
+#original text: "Add printer"
+msgid "Add printer"
+msgstr "Pøidat tiskárnu"
+
+#original text: "Delete printer"
+msgid "Delete printer"
+msgstr "Odebrat tiskárnu"
+
+#original text: "Acquire Preview"
+msgid "Acquire Preview"
+msgstr "Sejmout náhled"
+
+#original text: "Cancel Preview"
+msgid "Cancel Preview"
+msgstr "Zru¹it náhled"
+
+#original text: "Fine mode"
+msgid "Fine mode"
+msgstr "Nalézt re¾im"
+
+#original text: "Overwrite warning"
+msgid "Overwrite warning"
+msgstr "Varování o pøepsání"
+
+#original text: "Increase filename counter"
+msgid "Increase filename counter"
+msgstr "Zvý¹it èítaè jména souboru"
+
+#original text: "Skip existing numbers"
+msgid "Skip existing numbers"
+msgstr "Pøeskoèit existující èísla"
+
+#original text: "Main window size fixed"
+msgid "Main window size fixed"
+msgstr "Pevná velikost hlavního okna"
+
+#original text: "Preserve preview image"
+msgid "Preserve preview image"
+msgstr "Zachovat náhledový obrázek"
+
+#original text: "Use private colormap"
+msgid "Use private colormap"
+msgstr "Pou¾ít vlastní barevnou mapu"
+
+#original text: "Available devices:"
+msgid "Available devices:"
+msgstr "Dostupná zaøízení:"
+
+#original text: "XSane options"
+msgid "XSane options"
+msgstr "Pøedvolby XSane"
+
+#original text: "XSane mode"
+msgid "XSane mode"
+msgstr "Re¾im XSane"
+
+#original text: "Scanner and backend:"
+msgid "Scanner and backend:"
+msgstr "Skener a ovladaè:"
+
+#original text: "Vendor:"
+msgid "Vendor:"
+msgstr "Výrobce:"
+
+#original text: "Model:"
+msgid "Model:"
+msgstr "Model:"
+
+#original text: "Type:"
+msgid "Type:"
+msgstr "Typ:"
+
+#original text: "Device:"
+msgid "Device:"
+msgstr "Zaøízení:"
+
+#original text: "Loaded backend:"
+msgid "Loaded backend:"
+msgstr "Zavedený ovladaè:"
+
+#original text: "Sane version:"
+msgid "Sane version:"
+msgstr "Verze Sane:"
+
+#original text: "Recent values:"
+msgid "Recent values:"
+msgstr "Souèasné hodnoty:"
+
+#original text: "Gamma correction by:"
+msgid "Gamma correction by:"
+msgstr "Gama korekce provádí:"
+
+#original text: "scanner"
+msgid "scanner"
+msgstr "skener"
+
+#original text: "software (xsane)"
+msgid "software (xsane)"
+msgstr "software (xsane)"
+
+#original text: "none"
+msgid "none"
+msgstr "nikdo"
+
+#original text: "Gamma input depth:"
+msgid "Gamma input depth:"
+msgstr "Vstupní hloubka gama:"
+
+#original text: "Gamma output depth:"
+msgid "Gamma output depth:"
+msgstr "Výstupní hloubka gama:"
+
+#original text: "Scanner output depth:"
+msgid "Scanner output depth:"
+msgstr "Výstupní hloubka skeneru:"
+
+#original text: "XSane output formats:"
+msgid "XSane output formats:"
+msgstr "Výstupní formáty xsane:"
+
+#original text: "8 bit output formats:"
+msgid "8 bit output formats:"
+msgstr "8bitové výstupní formáty:"
+
+#original text: "16 bit output formats:"
+msgid "16 bit output formats:"
+msgstr "16bitové výstupní formáty:"
+
+#original text: "Authorization required for"
+msgid "Authorization required for"
+msgstr "Je vy¾adovaná autorizace"
+
+#original text: "Username :"
+msgid "Username :"
+msgstr "U¾ivatel: "
+
+#original text: "Password :"
+msgid "Password :"
+msgstr "Heslo: "
+
+#original text: "Invalid parameters."
+msgid "Invalid parameters."
+msgstr "Neplatné parametry."
+
+#original text: "version:"
+msgid "version:"
+msgstr "verze:"
+
+#original text: "package"
+msgid "package"
+msgstr "balík"
+
+#original text: "with GIMP support"
+msgid "with GIMP support"
+msgstr "s podporou programu GIMP"
+
+#original text: "without GIMP support"
+msgid "without GIMP support"
+msgstr "bez podpory programu GIMP"
+
+#original text: "compiled with GIMP-"
+msgid "compiled with GIMP-"
+msgstr "kompilováno s programem GIMP-"
+
+#original text: "unknown"
+msgid "unknown"
+msgstr "neznámý"
+
+#original text: "Email:"
+msgid "Email:"
+msgstr "E-mail:"
+
+#original text: "File:"
+msgid "File:"
+msgstr "Soubor:"
+
+#original text: "0x0: 0KB"
+msgid "0x0: 0KB"
+msgstr "0 × 0: 0 KB"
+
+#original text: "Printer selection:"
+msgid "Printer selection:"
+msgstr "Výbìr tiskárny:"
+
+#original text: "Name:"
+msgid "Name:"
+msgstr "Jméno:"
+
+#original text: "Command:"
+msgid "Command:"
+msgstr "Pøíkaz:"
+
+#original text: "Copy number option:"
+msgid "Copy number option:"
+msgstr "Volba poètu kopií:"
+
+#original text: "Resolution (dpi):"
+msgid "Resolution (dpi):"
+msgstr "Rozli¹ení (dpi):"
+
+#original text: "Width (1/72 inch):"
+msgid "Width (1/72 inch):"
+msgstr "©íøka (1/72 palce):"
+
+#original text: "Height (1/72 inch):"
+msgid "Height (1/72 inch):"
+msgstr "Vý¹ka (1/72 palce):"
+
+#original text: "Left offset (1/72 inch):"
+msgid "Left offset (1/72 inch):"
+msgstr "Levý posun (1/72 palce):"
+
+#original text: "Bottom offset (1/72 inch):"
+msgid "Bottom offset (1/72 inch):"
+msgstr "Spodní posun (1/72 palce):"
+
+#original text: "Printer gamma value:"
+msgid "Printer gamma value:"
+msgstr "Gama hodnota tiskárny:"
+
+#original text: "Printer gamma red:"
+msgid "Printer gamma red:"
+msgstr "Èervená gama tiskárny:"
+
+#original text: "Printer gamma green:"
+msgid "Printer gamma green:"
+msgstr "Zelená gama tiskárny:"
+
+#original text: "Printer gamma blue:"
+msgid "Printer gamma blue:"
+msgstr "Modrá gama tiskárny:"
+
+#original text: "JPEG image quality"
+msgid "JPEG image quality"
+msgstr "Kvalita JPEG obrázku"
+
+#original text: "PNG image compression"
+msgid "PNG image compression"
+msgstr "Komprese PNG obrázku"
+
+#original text: "TIFF multi bit image compression"
+msgid "TIFF multi bit image compression"
+msgstr "Komprese vícebitových TIFF obrázkù"
+
+#original text: "TIFF lineart image compression"
+msgid "TIFF lineart image compression"
+msgstr "Komprese jednobarevných TIFF obrázkù"
+
+#original text: "Preview gamma:"
+msgid "Preview gamma:"
+msgstr "Gama náhledu:"
+
+#original text: "Preview gamma red:"
+msgid "Preview gamma red:"
+msgstr "Èervená gama náhledu:"
+
+#original text: "Preview gamma green:"
+msgid "Preview gamma green:"
+msgstr "Zelená gama náhledu:"
+
+#original text: "Preview gamma blue:"
+msgid "Preview gamma blue:"
+msgstr "Modrá gama náhledu:"
+
+#original text: "Helpfile viewer (HTML):"
+msgid "Helpfile viewer (HTML):"
+msgstr "Prohlí¾eè souboru nápovìdy (HTML):"
+
+#original text: "Command:"
+msgid "Command:"
+msgstr "Pøíkaz:"
+
+#original text: "Receiver option:"
+msgid "Receiver option:"
+msgstr "Volba pøíjemce:"
+
+#original text: "Postscriptfile option:"
+msgid "Postscriptfile option:"
+msgstr "Volby postscriptového souboru:"
+
+#original text: "Normal mode option:"
+msgid "Normal mode option:"
+msgstr "Volby normálního re¾imu:"
+
+#original text: "Fine mode option:"
+msgid "Fine mode option:"
+msgstr "Volby re¾imu vysokého rozli¹ení:"
+
+#original text: "Viewer (Postscript):"
+msgid "Viewer (Postscript):"
+msgstr "Prohlí¾eè (Postscript):"
+
+#original text: "Saving options"
+msgid "Saving options"
+msgstr "Volby zápisu"
+
+#original text: "Display options"
+msgid "Display options"
+msgstr "Volby zobrazování"
+
+#original text: "Fax options"
+msgid "Fax options"
+msgstr "Volby faxu"
+
+#original text: "Scan"
+msgid "Scan"
+msgstr "Skenování"
+
+#original text: "Copy"
+msgid "Copy"
+msgstr "Kopírování"
+
+#original text: "Fax"
+msgid "Fax"
+msgstr "Faxování"
+
+#original text: "Setup"
+msgid "Setup"
+msgstr "Nastavení"
+
+#original text: "Show tooltips"
+msgid "Show tooltips"
+msgstr "Ukazovat tipy"
+
+#original text: "Show preview"
+msgid "Show preview"
+msgstr "Ukazovat náhled"
+
+#original text: "Show histogram"
+msgid "Show histogram"
+msgstr "Ukazovat histogram"
+
+#original text: "Show standard options"
+msgid "Show standard options"
+msgstr "Ukazovat standardní volby"
+
+#original text: "Show advanced options"
+msgid "Show advanced options"
+msgstr "Ukazovat roz¹íøené volby"
+
+
+#original text: "Show resolution list"
+msgid "Show resolution list"
+msgstr "Ukazovat seznam rozli¹ení"
+
+#original text: "Length unit"
+msgid "Length unit"
+msgstr "Délková jednotka"
+
+#original text: "millimeters"
+msgid "millimeters"
+msgstr "milimetry"
+
+#original text: "centimeters"
+msgid "centimeters"
+msgstr "centimetry"
+
+#original text: "inches"
+msgid "inches"
+msgstr "palce"
+
+#original text: "Save device settings"
+msgid "Save device settings"
+msgstr "Zapsat nastavení zaøízení"
+
+#original text: "Load device settings"
+msgid "Load device settings"
+msgstr "Naèíst nastavení zaøízení"
+
+#original text: "Xsane doc"
+msgid "Xsane doc"
+msgstr "Dokumentace Xsane"
+
+#original text: "Backend doc"
+msgid "Backend doc"
+msgstr "Dokumentace rozhraní zaøízení"
+
+#original text: "Available backends"
+msgid "Available backends"
+msgstr "Dospupná rozhraní zaøízení"
+
+#original text: "Scantips"
+msgid "Scantips"
+msgstr "Skenovací tipy"
+
+#original text: "no compression"
+msgid "no compression"
+msgstr "¾ádná komprese"
+
+#original text: "CCITT 1D Huffman compression"
+msgid "CCITT 1D Huffman compression"
+msgstr "Huffmanova komprese CCITT 1D"
+
+#original text: "CCITT Group 3 Fax compression"
+msgid "CCITT Group 3 Fax compression"
+msgstr "Komprese CCITT Group 3 Fax"
+
+#original text: "CCITT Group 4 Fax compression"
+msgid "CCITT Group 4 Fax compression"
+msgstr "Komprese CCITT Group 4 Fax"
+
+#original text: "JPEG DCT compression"
+msgid "JPEG DCT compression"
+msgstr "Komprese JPEG DCT"
+
+#original text: "pack bits"
+msgid "pack bits"
+msgstr "bitové pakování"
+
+#original text: "by ext"
+msgid "by ext"
+msgstr "podle pøípony"
+
+#original text: "Saving image"
+msgid "Saving image"
+msgstr "Zapisuje se obrázek"
+
+#original text: "Saving fax image"
+msgid "Saving fax image"
+msgstr "Zapisuje se faxový obrázek"
+
+#original text: "Converting data...."
+msgid "Converting data...."
+msgstr "Konvertují se data..."
+
+#original text: "Converting to postscript"
+msgid "Converting to postscript"
+msgstr "Konvertuje se do Postscriptu"
+
+#original text: "Scanning"
+msgid "Scanning"
+msgstr "Skenuje se"
+
+#original text: "Receiving %s data for `%s'..."
+msgid "Receiving %s data for `%s'..."
+msgstr "Snímají se data typu %s pro `%s'..."
+
+#original text: "Receiving %s data for photocopy ..."
+msgid "Receiving %s data for photocopy ..."
+msgstr "Snímají se data typu %s pro fotokopii..."
+
+#original text: "Receiving %s data for fax ..."
+msgid "Receiving %s data for fax ..."
+msgstr "Snímají se data typu %s pro fax..."
+
+#original text: "Receiving %s data for GIMP..."
+msgid "Receiving %s data for GIMP..."
+msgstr "Snímají se data typu %s pro GIMP..."
+
+
+#original text: "Use XSane for SCANning, photoCOPYing, FAXing..."
+msgid "Use XSane for SCANning, photoCOPYing, FAXing..."
+msgstr "XSane slou¾í pro skenování, kopírování, faxování..."
+
+#original text: "Browse for image filename"
+msgid "Browse for image filename"
+msgstr "Hledání jména souboru"
+
+#original text: "Filename for scanned image"
+msgid "Filename for scanned image"
+msgstr "Jméno souboru pro skenovaný obrázek"
+
+#original text: "Filename extension and type of image format"
+msgid "Filename extension and type of image format"
+msgstr "Pøípona jména souboru a typ obrázkového formátu"
+
+#original text: "Enter name of fax project"
+msgid "Enter name of fax project"
+msgstr "Zadání jméno faxového projektu"
+
+#original text: "Enter new name for faxpage"
+msgid "Enter new name for faxpage"
+msgstr "Zadání jména faxové strany"
+
+#original text: "Enter receiver phone number or address"
+msgid "Enter receiver phone number or address"
+msgstr "Zadání telefonního èísla nebo adresy pøíjemce"
+
+#original text: "Select printer definition"
+msgid "Select printer definition"
+msgstr "Volba definice tiskárny"
+
+#original text: "Set scan resolution"
+msgid "Set scan resolution"
+msgstr "Nastavení rozli¹ení skenování"
+
+#original text: "Set zoomfactor"
+msgid "Set zoomfactor"
+msgstr "Nastavení faktoru zmìny velikosti"
+
+#original text: "Set number of copies"
+msgid "Set number of copies"
+msgstr "Nastavení poètu kopií"
+
+#original text: "Negative: Invert colors for scanning negatives\n" "e.g. swap black and white"
+msgid "Negative: Invert colors for scanning negatives\n" "e.g. swap black and white"
+msgstr "Negativ: Invertuje barvy pro skenování negativù\n" "napø. pøehodá èernou a bílou"
+
+#original text: "Set gamma value"
+msgid "Set gamma value"
+msgstr "Nastavení gama hodnoty"
+
+#original text: "Set gamma value for red component"
+msgid "Set gamma value for red component"
+msgstr "Nastavení gama hodnoty èervené komponenty"
+
+#original text: "Set gamma value for green component"
+msgid "Set gamma value for green component"
+msgstr "Nastavení gama hodnoty zelené komponenty"
+
+#original text: "Set gamma value for blue component"
+msgid "Set gamma value for blue component"
+msgstr "Nastavení gama hodnoty modré komponenty"
+
+#original text: "Set brightness"
+msgid "Set brightness"
+msgstr "Nastavení jasu"
+
+#original text: "Set brightness for red component"
+msgid "Set brightness for red component"
+msgstr "Nastavení jasu èervené komponenty"
+
+#original text: "Set brightness for green component"
+msgid "Set brightness for green component"
+msgstr "Nastavení jasu zelené komponenty"
+
+#original text: "Set brightness for blue component"
+msgid "Set brightness for blue component"
+msgstr "Nastavení jasu modré komponenty"
+
+#original text: "Set contrast"
+msgid "Set contrast"
+msgstr "Nastavení kontrastu"
+
+#original text: "Set contrast for red component"
+msgid "Set contrast for red component"
+msgstr "Nastavení kontrastu èervené komponenty"
+
+#original text: "Set contrast for green component"
+msgid "Set contrast for green component"
+msgstr "Nastavení kontrastu zelené komponenty"
+
+#original text: "Set contrast for blue component"
+msgid "Set contrast for blue component"
+msgstr "Nastavení kontrastu modré komponenty"
+
+#original text: "RGB default: Set enhancement values for red, green and blue to default values:\n" " gamma = 1.0\n" " brightness = 0\n" " contrast = 0"
+msgid "RGB default: Set enhancement values for red, green and blue to default values:\n" " gamma = 1.0\n" " brightness = 0\n" " contrast = 0"
+msgstr "Implicitní RGB: Nastavení hodnot pro zpracování èervené, zelené a modré:\n" " gama = 1.0\n" " jas = 0\n" " kontrast = 0"
+
+#original text: "Autoadjust gamma, brightness and contrast in dependance of selected area"
+msgid "Autoadjust gamma, brightness and contrast in dependance of selected area"
+msgstr "Automatické nastavení gamy, jasu a kontrastu v závislosti na vybrané oblasti"
+
+#original text: "Set default enhancement values:\n" "gamma = 1.0\n" "brightness = 0\n" "contrast = 0"
+msgid "Set default enhancement values:\n" "gamma = 1.0\n" "brightness = 0\n" "contrast = 0"
+msgstr "Nastavení implicitních hodnot zpracování:\n" "gama = 1.0\n" "jas = 0\n" "kontrast = 0"
+
+#original text: "Restore enhancement values from preferences"
+msgid "Restore enhancement values from preferences"
+msgstr "Obnovit hodnoty zpracování z pøedvoleb"
+
+#original text: "Store active enhancement values to preferences"
+msgid "Store active enhancement values to preferences"
+msgstr "Ulo¾it hodnoty zpracování z pøedvoleb"
+
+#original text: "Show histogram of intensity/gray"
+msgid "Show histogram of intensity/gray"
+msgstr "Zobrazit histogram intenzity / ¹edi"
+
+#original text: "Show histogram of red component"
+msgid "Show histogram of red component"
+msgstr "Zobrazit histogram èervené komponenty"
+
+#original text: "Show histogram of green component"
+msgid "Show histogram of green component"
+msgstr "Zobrazit histogram zelené komponenty"
+
+#original text: "Show histogram of blue component"
+msgid "Show histogram of blue component"
+msgstr "Zobrazit histogram modré komponenty"
+
+#original text: "Display histogram with lines instead of pixels"
+msgid "Display histogram with lines instead of pixels"
+msgstr "Zoprazit èárový histogram místo plo¹ného"
+
+#original text: "Show logarithm of pixelcount"
+msgid "Show logarithm of pixelcount"
+msgstr "Zobrazit logaritmy poètù pixelù"
+
+#original text: "Select definition to change"
+msgid "Select definition to change"
+msgstr "Volba definice ke zmìnì"
+
+#original text: "Define a name for the selection of this definition"
+msgid "Define a name for the selection of this definition"
+msgstr "Zadání jména pro výbìr této definice"
+
+#original text: "Enter command to be executed in copy mode (e.g. \"lpr -\")"
+msgid "Enter command to be executed in copy mode (e.g. \"lpr -\")"
+msgstr "Zadání pøíkazu, který má být vyvolán v re¾imu kopírování (napø. \"lpr -\")"
+
+#original text: "Enter option for copy numbers"
+msgid "Enter option for copy numbers"
+msgstr "Zadání volby poètu kopií"
+
+#original text: "Resolution with which images are printed and saved in postscript"
+msgid "Resolution with which images are printed and saved in postscript"
+msgstr "Rozli¹ení, ve kterém budou obrázky tisknuty a zapisovány do postscriptu"
+
+#original text: "Width of printable area in 1/72 inch"
+msgid "Width of printable area in 1/72 inch"
+msgstr "©íøka tisknutelné plochy v dvaasedmdesátinách palce"
+
+#original text: "Height of printable area in 1/72 inch"
+msgid "Height of printable area in 1/72 inch"
+msgstr "Vý¹ka tisknutelné plochy v dvaasedmdesátinách palce"
+
+#original text: "Left offset from the edge of the paper to the printable area in 1/72 inch"
+msgid "Left offset from the edge of the paper to the printable area in 1/72 inch"
+msgstr "Posun od levého okraje papíru do tisknutelné plochy v dvaasedmdesátinách palce"
+
+#original text: "Bottom offset from the edge of the paper to the printable area in 1/72 inch"
+msgid "Bottom offset from the edge of the paper to the printable area in 1/72 inch"
+msgstr "Posun od spodního okraje papíru do tisknutelné plochy v dvaasedmdesátinách palce"
+
+#original text: "Additional gamma value for photocopy"
+msgid "Additional gamma value for photocopy"
+msgstr "Dodateèná gama hodnota pro fotokopii"
+
+#original text: "Additional gamma value for red component for photocopy"
+msgid "Additional gamma value for red component for photocopy"
+msgstr "Dodateèná gama hodnota pro èervenou komponentu pro fotokopii"
+
+#original text: "Additional gamma value for green component for photocopy"
+msgid "Additional gamma value for green component for photocopy"
+msgstr "Dodateèná gama hodnota pro zelenou komponentu pro fotokopii"
+
+#original text: "Additional gamma value for blue component for photocopy"
+msgid "Additional gamma value for blue component for photocopy"
+msgstr "Dodateèná gama hodnota pro modrou komponentu pro fotokopii"
+
+#original text: "Quality in percent if image is saved as jpeg or tiff with jpeg compression"
+msgid "Quality in percent if image is saved as jpeg or tiff with jpeg compression"
+msgstr "Kvalita v procentech, je-li obrázek zapisován jako jpeg nebo tiff s jpeg kompresí"
+
+#original text: "Compression if image is saved as png"
+msgid "Compression if image is saved as png"
+msgstr "Typ komprese, je-li obrázek zapisován jako png"
+
+#original text: "Compression type if multi bit image is saved as tiff"
+msgid "Compression type if multi bit image is saved as tiff"
+msgstr "Typ komprese, je-li obrázek zapisován jako vícebitový TIFF"
+
+#original text: "Compression type if lineart image is saved as tiff"
+msgid "Compression type if lineart image is saved as tiff"
+msgstr "Typ komprese, je-li obrázek zapisován jako jednobarevný TIFF"
+
+#original text: "Warn before overwriting an existing file"
+msgid "Warn before overwriting an existing file"
+msgstr "Varování pøed pøepsáním existujícího souboru"
+
+#original text: "If the filename is of the form \"name-001.ext\" " "(where the number of digits is free) " "the number is increased after a scan is finished"
+msgid "If the filename is of the form \"name-001.ext\" " "(where the number of digits is free) " "the number is increased after a scan is finished"
+msgstr "Je-li jméno souboru ve tvaru \"jméno-001.pøíp\" (poèet èíslic je libovolný), èíslo je o skenování zvìt¹eno"
+
+#original text: "If filename counter is automatically increased, used numbers are skipped"
+msgid "If filename counter is automatically increased, used numbers are skipped"
+msgstr "Je-li èítaè souborù automaticky zvìt¹ován, pou¾itá èísla jsou pøeskoèena"
+
+#original text: "Use fixed main window size or scrolled, resizable main window"
+msgid "Use fixed main window size or scrolled, resizable main window"
+msgstr "U¾ití pevné velikosti hlavního okna nebo okna s posuvníky a promìnnou velikostí"
+
+#original text: "Preserve preview image for next program start"
+msgid "Preserve preview image for next program start"
+msgstr "Zachování náhledu pro pøí¹tí spu¹tìní programu"
+
+#original text: "Use an own colormap for preview if display depth is 8 bpp"
+msgid "Use an own colormap for preview if display depth is 8 bpp"
+msgstr "Pou¾ití vlastní barevné mapy náhledu, je-li obrazová hloubka 8"
+
+#original text: "Set gamma correction value for preview image"
+msgid "Set gamma correction value for preview image"
+msgstr "Nastavení gama korekce pro náhledová obrázek"
+
+#original text: "Set gamma correction value for red component of preview image"
+msgid "Set gamma correction value for red component of preview image"
+msgstr "Nastavení gama korekce pro èervenou komponentu náhledového obrázku"
+
+#original text: "Set gamma correction value for green component of preview image"
+msgid "Set gamma correction value for green component of preview image"
+msgstr "Nastavení gama korekce pro zelenou komponentu náhledového obrázku"
+
+#original text: "Set gamma correction value for blue component of preview image"
+msgid "Set gamma correction value for blue component of preview image"
+msgstr "Nastavení gama korekce pro modrou komponentu náhledového obrázku"
+
+#original text: "Enter command to be executed to display helpfiles, must be a html-viewer!"
+msgid "Enter command to be executed to display helpfiles, must be a html-viewer!"
+msgstr "Nastevení pøíkazu k zobrazení souborù nápovìdy, musí být html prohlí¾eè!"
+
+#original text: "Enter command to be executed in fax mode"
+msgid "Enter command to be executed in fax mode"
+msgstr "Nastevení pøíkazu provádìného ve faxovém re¾imu"
+
+#original text: "Enter option to specify receiver"
+msgid "Enter option to specify receiver"
+msgstr "Nastevení volby urèující pøíjemce"
+
+#original text: "Enter option to specify postscript files following"
+msgid "Enter option to specify postscript files following"
+msgstr "Nastevení volby k zadání postscriptových souborù"
+
+#original text: "Enter option to specify normal mode (low resolution)"
+msgid "Enter option to specify normal mode (low resolution)"
+msgstr "Nastavení volby k urèení normálního re¾imu (nízké rozli¹ení)"
+
+#original text: "Enter option to specify fine mode (high resolution)"
+msgid "Enter option to specify fine mode (high resolution)"
+msgstr "Nastavení volby k urèení kvalitního re¾imu (velké rozli¹ení)"
+
+#original text: "Enter command to be executed to view a fax"
+msgid "Enter command to be executed to view a fax"
+msgstr "Nastavení pøíkazu k zobrazení faxu"
+
+#original text: "Use high vertical resolution (196 lpi instead of 98 lpi)"
+msgid "Use high vertical resolution (196 lpi instead of 98 lpi)"
+msgstr "U¾ití vysokého svislého rozli¹ení (196 dpi namísto 98 dpi)"
+
+#original text: "Pick white point"
+msgid "Pick white point"
+msgstr "Nasátí bílého bodu"
+
+#original text: "Pick gray point"
+msgid "Pick gray point"
+msgstr "Nasátí ¹edého bodu"
+
+#original text: "Pick black point"
+msgid "Pick black point"
+msgstr "Nasátí èerného bodu"
+
+#original text: "Use full scanarea"
+msgid "Use full scanarea"
+msgstr "U¾ití plné skenovací plochy"
+
+#original text: "Zoom 20% out"
+msgid "Zoom 20% out"
+msgstr "Vzdálení o 20 %"
+
+#original text: "Zoom into selected area"
+msgid "Zoom into selected area"
+msgstr "Pøiblí¾ení zvolenou oblast"
+
+#original text: "Undo last zoom"
+msgid "Undo last zoom"
+msgstr "Vrácení posledního pøiblí¾ení"
+
+#original text: "Select visible area"
+msgid "Select visible area"
+msgstr "Volba viditelné oblasti"
+
+#original text: "Failed to determine home directory:"
+msgid "Failed to determine home directory:"
+msgstr "Selhalo urèení domovského adresáøe:"
+
+#original text: "Filename too long"
+msgid "Filename too long"
+msgstr "Jméno souboru je pøíli¹ dlouhé"
+
+#original text: "Failed to set value of option"
+msgid "Failed to set value of option"
+msgstr "Selhalo nastavení hodnoty volby"
+
+#original text: "Failed to obtain value of option"
+msgid "Failed to obtain value of option"
+msgstr "Selhalo získání hodnoty volby"
+
+#original text: "Error obtaining option count"
+msgid "Error obtaining option count"
+msgstr "Selhalo získání poètu voleb"
+
+#original text: "Failed to open device"
+msgid "Failed to open device"
+msgstr "Otevøení zaøízení selhalo"
+
+#original text: "no devices available"
+msgid "no devices available"
+msgstr "nejsou k dispozici ¾ádná zaøízení"
+
+#original text: "Error during read:"
+msgid "Error during read:"
+msgstr "Chyba bìhem ètení:"
+
+#original text: "Error during save:"
+msgid "Error during save:"
+msgstr "Chyba bìhem zápisu:"
+
+#original text: "Can't handle depth"
+msgid "Can't handle depth"
+msgstr "Nelze zpracovat hloubku"
+
+#original text: "GIMP can't handle depth"
+msgid "GIMP can't handle depth"
+msgstr "GIMP neumí zpracovat hloubku"
+
+#original text: "Unknown file format for saving"
+msgid "Unknown file format for saving"
+msgstr "Neznámý formát souboru pro zápis"
+
+#original text: "Failed to open"
+msgid "Failed to open"
+msgstr "Otevøení selhalo"
+
+#original text: "Failed to open pipe for executing printercommand"
+msgid "Failed to open pipe for executing printercommand"
+msgstr "Otevøení roury ke spu¹tìní pøíkazu tiskárny selhalo"
+
+#original text: "Failed to execute printercommand:"
+msgid "Failed to execute printercommand:"
+msgstr "Spu¹tìní pøíkazu tiskárny selhalo"
+
+#original text: "Failed to start scanner:"
+msgid "Failed to start scanner:"
+msgstr "Spu¹tìní skeneru selhalo"
+
+#original text: "Failed to get parameters:"
+msgid "Failed to get parameters:"
+msgstr "Získání parametrù selhalo:"
+
+#original text: "No output format given"
+msgid "No output format given"
+msgstr "Nebyl zadán výstupní formát"
+
+#original text: "out of memory"
+msgid "out of memory"
+msgstr "nedostatek pamìti"
+
+#original text: "LIBTIFF reports error"
+msgid "LIBTIFF reports error"
+msgstr "LIBTIFF hlásí chybu"
+
+#original text: "LIBPNG reports error"
+msgid "LIBPNG reports error"
+msgstr "LIBPNG hlásí chybu"
+
+#original text: "unknown type"
+msgid "unknown type"
+msgstr "neznámý typ"
+
+#original text: "unknown constraint type"
+msgid "unknown constraint type"
+msgstr "neznámý po¾adovaný typ"
+
+#original text: "Failed to execute documentation viewer:"
+msgid "Failed to execute documentation viewer:"
+msgstr "Spu¹tìní prohlí¾eèe dokumentace selhalo"
+
+#original text: "Failed to execute fax viewer:"
+msgid "Failed to execute fax viewer:"
+msgstr "Spu¹tìní faxového prohlí¾eèe selhalo"
+
+#original text: "Failed to execute faxcommand:"
+msgid "Failed to execute faxcommand:"
+msgstr "Spu¹tìní faxového pøíkazu selhalo:"
+
+#original text: "bad frame format"
+msgid "bad frame format"
+msgstr "¹patný formát rámce"
+
+#original text: "unable to set resolution"
+msgid "unable to set resolution"
+msgstr "nepodaøilo se nastavit rozli¹ení"
+
+#original text: "error"
+msgid "error"
+msgstr "chyba"
+
+#original text: "Sane major version number mismatch!"
+msgid "Sane major version number mismatch!"
+msgstr "Hlavní èíslo verze Sane nesouhlasí!"
+
+#original text: "xsane major version ="
+msgid "xsane major version ="
+msgstr "hlavní èíslo verze xsane ="
+
+#original text: "backend major version ="
+msgid "backend major version ="
+msgstr "hlavní èíslo verze ovladaèe ="
+
+#original text: "*** PROGRAM ABORTED ***"
+msgid "*** PROGRAM ABORTED ***"
+msgstr "*** PROGRAM ZRU©EN ***"
+
+#original text: "Failed to allocate image memory:"
+msgid "Failed to allocate image memory:"
+msgstr "Selhalo získání pamìti pro obrázek:"
+
+#original text: "Preview cannot handle bit depth"
+msgid "Preview cannot handle bit depth"
+msgstr "Náhled neumí obslou¾it bitovou hloubku"
+
+#original text: "GIMP support missing"
+msgid "GIMP support missing"
+msgstr "Chybí podpora programu GIMP"
+
+#original text: "Filename counter overflow"
+msgid "Filename counter overflow"
+msgstr "Pøeteèení èítaèe jména souboru"
+
+#original text: "warning: option has no value constraint"
+msgid "warning: option has no value constraint"
+msgstr "varování: volba nezískala ¾ádnou hodnotu"
+
+#original text: "Ok"
+msgid "Ok"
+msgstr "OK"
+
+#original text: "Error"
+msgid "Error"
+msgstr "Chyba"
+
+#original text: "Warning"
+msgid "Warning"
+msgstr "Varování"
+
+#original text: "Failed to create file:"
+msgid "Failed to create file:"
+msgstr "Vytvoøení souboru selhalo"
+
+#original text: "Error while loading device settings:"
+msgid "Error while loading device settings:"
+msgstr "Chyba bìhem ètení nastavení zaøízení:"
+
+#original text: "is not a device-rc-file !!!"
+msgid "is not a device-rc-file !!!"
+msgstr "není soubor-záznamu-zaøízení!!!"
+
+#original text: "Failed to execute netscape!"
+msgid "Failed to execute netscape!"
+msgstr "Spu¹tìní Netscape selhalo!"
+
+#original text: "Send fax: no receiver defined"
+msgid "Send fax: no receiver defined"
+msgstr "Odeslání faxu: není definován pøíjemce"
+
+#original text: "has been created for device"
+msgid "has been created for device"
+msgstr "byl vytvoøen pro zaøízení"
+
+#original text: "you want to use it for device"
+msgid "you want to use it for device"
+msgstr "má být pou¾it pro zaøízení"
+
+#original text: "this may cause problems!"
+msgid "this may cause problems!"
+msgstr "to mù¾e zpùsobit problémy!"
+
+#original text: "Usage:"
+msgid "Usage:"
+msgstr "U¾ití:"
+
+#original text: "[OPTION]... [DEVICE]"
+msgid "[OPTION]... [DEVICE]"
+msgstr "[VOLBA]... [ZAØÍZENÍ]"
+
+#original text: "Start up graphical user interface to access SANE (Scanner Access Now Easy) devices.\n\n-h, --help display this help message and exit\n-v, --version print version information\n\n-d, --device-settings file load device settings from file (without \".drc\")\n\n-s, --scan start with scan-mode active\n-c, --copy start with copy-mode active\n-f, --fax start with fax-mode active\n-n, --no-mode-selection disable menu for xsane mode selection\n\n-F, --Fixed fixed main window size (overwrite preferences value)\n-R, --Resizeable resizable, scrolled main window (overwrite preferences value)\n\n--display X11-display redirect output to X11-display\n--no-xshm do not use shared memory images\n--sync request a synchronous connection with the X11 server"
+msgid "Start up graphical user interface to access SANE (Scanner Access Now Easy) devices.\n\n-h, --help display this help message and exit\n-v, --version print version information\n\n-d, --device-settings file load device settings from file (without \".drc\")\n\n-s, --scan start with scan-mode active\n-c, --copy start with copy-mode active\n-f, --fax start with fax-mode active\n-n, --no-mode-selection disable menu for xsane mode selection\n\n-F, --Fixed fixed main window size (overwrite preferences value)\n-R, --Resizeable resizable, scrolled main window (overwrite preferences value)\n\n--display X11-display redirect output to X11-display\n--no-xshm do not use shared memory images\n--sync request a synchronous connection with the X11 server"
+msgstr ""
+"Spu¹tìní grafického rozhraní pro pøístup k SANE zarízením.\n"
+"(SANE = Scanner Access Now Easy - pøístup ke skeneru je nyní snadný)\n"
+"\n"
+"-h, --help vypí¹e tuto nápovìdu a skonèí\n"
+"-v, --version vypí¹e oznaèení verze\n"
+"\n"
+"-d, --device-settings soubor naète nastavení zaøízení ze souboru (bez \".drc\")\n"
+"\n"
+"-s, --scan spustí se s aktivním re¾imem skenování\n"
+"-c, --copy spustí se s aktivním re¾imem kopírování\n"
+"-f, --fax spustí se s aktivním re¾imem faxování\n"
+"-n, --no-mode-selection zaká¾e menu volby xsane re¾imu\n"
+"\n"
+"-F, --Fixed pou¾ije pevnou velikost hlavního okna\n"
+" (pøepí¹e hodnotu pøedvolby)\n"
+"-R, --Resizeable pou¾ije hlavní okno s posuvníky a promìnnou velikostí\n"
+" (pøepí¹e hodnotu pøedvolby)\n"
+"\n"
+"--display X11-displej pøesmìruje výstup na X11-displej\n"
+"--no-xshm nepou¾ije sdílené pamì»ové obrazy\n"
+"--sync vy¾ádá synchronní spojení s X11 serverem"
+
+#original text: "Front-end to the SANE interface"
+msgid "Front-end to the SANE interface"
+msgstr "U¾ivatelský program k rozhraní SANE"
+
+#original text: "This function provides access to scanners and other image acquisition devices through the SANE (Scanner Access Now Easy) interface."
+msgid "This function provides access to scanners and other image acquisition devices through the SANE (Scanner Access Now Easy) interface."
+msgstr "Tato funkce nabízí pøes rozhrani SANE (Scanner Access Now Easy - pøístup ke skeneru je nyní snadný) pøístup ke skenerùm a jiným zaøízením ke snímání obrázkù"
+
+#original text: "<Toolbox>/File/Acquire/XSane: "
+msgid "<Toolbox>/File/Acquire/XSane: "
+msgstr "<Toolbox>/Soubor/Získat/XSane: "
+
+#original text: "<Toolbox>/Xtns/XSane/"
+msgid "<Toolbox>/Xtns/XSane/"
+msgstr "<Toolbox>/Roz¹./XSane/"
+
+#original text: "<Toolbox>/File/Acquire/XSane: Device dialog..."
+msgid "<Toolbox>/File/Acquire/XSane: Device dialog..."
+msgstr "<Toolbox>/Soubor/Získat/XSane: Dialog zaøízení..."
+
+#original text: "<Toolbox>/Xtns/XSane/Device dialog..."
+msgid "<Toolbox>/Xtns/XSane/Device dialog..."
+msgstr "<Toolbox>/Roz¹./XSane/Dialog zaøízení..."
+
+#original text: "flatbed scanner"
+msgid "flatbed scanner"
+msgstr "plo¹ný skener"
+
+#original text: "frame grabber"
+msgid "frame grabber"
+msgstr "snímaè políèek"
+
+#original text: "handheld scanner"
+msgid "handheld scanner"
+msgstr "ruèní ckener"
+
+#original text: "still camera"
+msgid "still camera"
+msgstr "digitální fotoaparát"
+
+#original text: "video camera"
+msgid "video camera"
+msgstr "videokamera"
+
+#original text: "virtual device"
+msgid "virtual device"
+msgstr "virtuální zaøízení"
+
+
+#original text: "Success"
+msgid "Success"
+msgstr "Úspìch"
+
+#original text: "Operation not supported"
+msgid "Operation not supported"
+msgstr "Operace není podporovaná"
+
+#original text: "Operation was cancelled"
+msgid "Operation was cancelled"
+msgstr "Operace byla zru¹ena"
+
+#original text: "Device busy"
+msgid "Device busy"
+msgstr "Zaøízení je v pou¾ívání"
+
+#original text: "Invalid argument"
+msgid "Invalid argument"
+msgstr "Neplatný argument"
+
+#original text: "End of file reached"
+msgid "End of file reached"
+msgstr "Dosa¾en konec souboru"
+
+#original text: "Document feeder jammed"
+msgid "Document feeder jammed"
+msgstr "Zmaèkaný papír v podavaèi"
+
+#original text: "Document feeder out of documents"
+msgid "Document feeder out of documents"
+msgstr "V podavaèi do¹ly dokumenty"
+
+#original text: "Scanner cover is open"
+msgid "Scanner cover is open"
+msgstr "Víko skeneru je otevøeno"
+
+#original text: "Error during device I/O"
+msgid "Error during device I/O"
+msgstr "Chyba bìhem V/V zaøízení"
+
+#original text: "Out of memory"
+msgid "Out of memory"
+msgstr "Nedostatek pamìti"
+
+#original text: "Access to resource has been denied"
+msgid "Access to resource has been denied"
+msgstr "Pøístup ke zdroji byl odmítnut"
+
diff --git a/po/cs.po.in b/po/cs.po.in
new file mode 100644
index 0000000..46d8dbd
--- /dev/null
+++ b/po/cs.po.in
@@ -0,0 +1,1239 @@
+#include "../frontend/xsane-text.h"
+#define _(x) x
+
+#nls translation file for xsane
+#language: czech (cs)
+#by Stanislav Brabec <utx@k332.feld.cvut.cz>
+
+#original text: "About"
+msgid WINDOW_ABOUT
+msgstr "O programu"
+
+#original text: "authorization"
+msgid WINDOW_AUTHORIZE
+msgstr "autorizace"
+
+#original text: "info"
+msgid WINDOW_INFO
+msgstr "informace"
+
+#original text: "batch scan"
+msgid WINDOW_BATCH_SCAN
+msgstr "dávkové skenování"
+
+#original text: "fax project"
+msgid WINDOW_FAX_PROJECT
+msgstr "faxový projekt"
+
+#original text: "rename fax page"
+msgid WINDOW_FAX_RENAME
+msgstr "pøejmenovat faxovou stránku"
+
+#original text: "setup"
+msgid WINDOW_SETUP
+msgstr "nastavení"
+
+#original text: "Histogram"
+msgid WINDOW_HISTOGRAM
+msgstr "Histogram"
+
+#original text: "Standard options"
+msgid WINDOW_STANDARD_OPTIONS
+msgstr "Standardní volby"
+
+#original text: "Advanced options"
+msgid WINDOW_ADVANCED_OPTIONS
+msgstr "Roz¹íøené volby"
+
+#original text: "device selection"
+msgid WINDOW_DEVICE_SELECTION
+msgstr "výbìr zaøízení"
+
+#original text: "Preview"
+msgid WINDOW_PREVIEW
+msgstr "Náhled"
+
+#original text: "output filename"
+msgid WINDOW_OUTPUT_FILENAME
+msgstr "jméno výstupního souboru"
+
+#original text: "save device settings"
+msgid WINDOW_SAVE_SETTINGS
+msgstr "zapsat nastavení zaøízení"
+
+#original text: "load device settings"
+msgid WINDOW_LOAD_SETTINGS
+msgstr "naèíst nastavení zaøízení"
+
+#original text: "File"
+msgid MENU_FILE
+msgstr "Soubor"
+
+#original text: "Preferences"
+msgid MENU_PREFERENCES
+msgstr "Nastavení"
+
+#original text: "View"
+msgid MENU_VIEW
+msgstr "Pohled"
+
+#original text: "Help"
+msgid MENU_HELP
+msgstr "Nápovìda"
+
+#original text: "About"
+msgid MENU_ITEM_ABOUT
+msgstr "O programu"
+
+#original text: "Info"
+msgid MENU_ITEM_INFO
+msgstr "Informace"
+
+#original text: "Exit"
+msgid MENU_ITEM_EXIT
+msgstr "Konec"
+
+#original text: "Raw image"
+msgid FRAME_RAW_IMAGE
+msgstr "Pùvodní obrázek"
+
+#original text: "Enhanced image"
+msgid FRAME_ENHANCED_IMAGE
+msgstr "Zpracovaný obrázek"
+
+#original text: "Start"
+msgid BUTTON_START
+msgstr "Start"
+
+#original text: "Ok"
+msgid BUTTON_OK
+msgstr "OK"
+
+#original text: "Apply"
+msgid BUTTON_APPLY
+msgstr "Pou¾ít"
+
+#original text: "Cancel"
+msgid BUTTON_CANCEL
+msgstr "Zru¹it"
+
+#original text: "Close"
+msgid BUTTON_CLOSE
+msgstr "Zavøít"
+
+#original text: "Overwrite"
+msgid BUTTON_OVERWRITE
+msgstr "Pøepsat"
+
+#original text: "Add area"
+msgid BUTTON_ADD_AREA
+msgstr "Pøidat oblast"
+
+#original text: "Delete"
+msgid BUTTON_DELETE
+msgstr "Smazat"
+
+#original text: "Show"
+msgid BUTTON_SHOW
+msgstr "Ukázat"
+
+#original text: "Rename"
+msgid BUTTON_RENAME
+msgstr "Pøejmenovat"
+
+#original text: "Send project"
+msgid BUTTON_SEND_PROJECT
+msgstr "Odeslat projekt"
+
+#original text: "Delete project"
+msgid BUTTON_DELETE_PROJECT
+msgstr "Smazat projekt"
+
+#original text: "Add printer"
+msgid BUTTON_ADD_PRINTER
+msgstr "Pøidat tiskárnu"
+
+#original text: "Delete printer"
+msgid BUTTON_DELETE_PRINTER
+msgstr "Odebrat tiskárnu"
+
+#original text: "Acquire Preview"
+msgid BUTTON_PREVIEW_ACQUIRE
+msgstr "Sejmout náhled"
+
+#original text: "Cancel Preview"
+msgid BUTTON_PREVIEW_CANCEL
+msgstr "Zru¹it náhled"
+
+#original text: "Fine mode"
+msgid RADIO_BUTTON_FINE_MODE
+msgstr "Nalézt re¾im"
+
+#original text: "Overwrite warning"
+msgid RADIO_BUTTON_OVERWRITE_WARNING
+msgstr "Varování o pøepsání"
+
+#original text: "Increase filename counter"
+msgid RADIO_BUTTON_INCREASE_COUNTER
+msgstr "Zvý¹it èítaè jména souboru"
+
+#original text: "Skip existing numbers"
+msgid RADIO_BUTTON_SKIP_EXISTING_NRS
+msgstr "Pøeskoèit existující èísla"
+
+#original text: "Main window size fixed"
+msgid RADIO_BUTTON_WINDOW_FIXED
+msgstr "Pevná velikost hlavního okna"
+
+#original text: "Preserve preview image"
+msgid RADIO_BUTTON_PRESERVE_PRVIEW
+msgstr "Zachovat náhledový obrázek"
+
+#original text: "Use private colormap"
+msgid RADIO_BUTTON_PRIVATE_COLORMAP
+msgstr "Pou¾ít vlastní barevnou mapu"
+
+#original text: "Available devices:"
+msgid TEXT_AVAILABLE_DEVICES
+msgstr "Dostupná zaøízení:"
+
+#original text: "XSane options"
+msgid TEXT_XSANE_OPTIONS
+msgstr "Pøedvolby XSane"
+
+#original text: "XSane mode"
+msgid TEXT_XSANE_MODE
+msgstr "Re¾im XSane"
+
+#original text: "Scanner and backend:"
+msgid TEXT_SCANNER_BACKEND
+msgstr "Skener a ovladaè:"
+
+#original text: "Vendor:"
+msgid TEXT_VENDOR
+msgstr "Výrobce:"
+
+#original text: "Model:"
+msgid TEXT_MODEL
+msgstr "Model:"
+
+#original text: "Type:"
+msgid TEXT_TYPE
+msgstr "Typ:"
+
+#original text: "Device:"
+msgid TEXT_DEVICE
+msgstr "Zaøízení:"
+
+#original text: "Loaded backend:"
+msgid TEXT_LOADED_BACKEND
+msgstr "Zavedený ovladaè:"
+
+#original text: "Sane version:"
+msgid TEXT_SANE_VERSION
+msgstr "Verze Sane:"
+
+#original text: "Recent values:"
+msgid TEXT_RECENT_VALUES
+msgstr "Souèasné hodnoty:"
+
+#original text: "Gamma correction by:"
+msgid TEXT_GAMMA_CORR_BY
+msgstr "Gama korekce provádí:"
+
+#original text: "scanner"
+msgid TEXT_SCANNER
+msgstr "skener"
+
+#original text: "software (xsane)"
+msgid TEXT_SOFTWARE_XSANE
+msgstr "software (xsane)"
+
+#original text: "none"
+msgid TEXT_NONE
+msgstr "nikdo"
+
+#original text: "Gamma input depth:"
+msgid TEXT_GAMMA_INPUT_DEPTH
+msgstr "Vstupní hloubka gama:"
+
+#original text: "Gamma output depth:"
+msgid TEXT_GAMMA_OUTPUT_DEPTH
+msgstr "Výstupní hloubka gama:"
+
+#original text: "Scanner output depth:"
+msgid TEXT_SCANNER_OUTPUT_DEPTH
+msgstr "Výstupní hloubka skeneru:"
+
+#original text: "XSane output formats:"
+msgid TEXT_OUTPUT_FORMATS
+msgstr "Výstupní formáty xsane:"
+
+#original text: "8 bit output formats:"
+msgid TEXT_8BIT_FORMATS
+msgstr "8bitové výstupní formáty:"
+
+#original text: "16 bit output formats:"
+msgid TEXT_16BIT_FORMATS
+msgstr "16bitové výstupní formáty:"
+
+#original text: "Authorization required for"
+msgid TEXT_AUTHORIZATION_REQ
+msgstr "Je vy¾adovaná autorizace"
+
+#original text: "Username :"
+msgid TEXT_USERNAME
+msgstr "U¾ivatel: "
+
+#original text: "Password :"
+msgid TEXT_PASSWORD
+msgstr "Heslo: "
+
+#original text: "Invalid parameters."
+msgid TEXT_INVALID_PARAMS
+msgstr "Neplatné parametry."
+
+#original text: "version:"
+msgid TEXT_VERSION
+msgstr "verze:"
+
+#original text: "package"
+msgid TEXT_PACKAGE
+msgstr "balík"
+
+#original text: "with GIMP support"
+msgid TEXT_WITH_GIMP_SUPPORT
+msgstr "s podporou programu GIMP"
+
+#original text: "without GIMP support"
+msgid TEXT_WITHOUT_GIMP_SUPPORT
+msgstr "bez podpory programu GIMP"
+
+#original text: "compiled with GIMP-"
+msgid TEXT_GIMP_VERSION
+msgstr "kompilováno s programem GIMP-"
+
+#original text: "unknown"
+msgid TEXT_UNKNOWN
+msgstr "neznámý"
+
+#original text: "Email:"
+msgid TEXT_EMAIL
+msgstr "E-mail:"
+
+#original text: "File:"
+msgid TEXT_FILE
+msgstr "Soubor:"
+
+#original text: "0x0: 0KB"
+msgid TEXT_INFO_BOX
+msgstr "0 × 0: 0 KB"
+
+#original text: "Printer selection:"
+msgid TEXT_SETUP_PRINTER_SEL
+msgstr "Výbìr tiskárny:"
+
+#original text: "Name:"
+msgid TEXT_SETUP_PRINTER_NAME
+msgstr "Jméno:"
+
+#original text: "Command:"
+msgid TEXT_SETUP_PRINTER_CMD
+msgstr "Pøíkaz:"
+
+#original text: "Copy number option:"
+msgid TEXT_SETUP_COPY_NR_OPT
+msgstr "Volba poètu kopií:"
+
+#original text: "Resolution (dpi):"
+msgid TEXT_SETUP_PRINTER_RES
+msgstr "Rozli¹ení (dpi):"
+
+#original text: "Width (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_WIDTH
+msgstr "©íøka (1/72 palce):"
+
+#original text: "Height (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_HEIGHT
+msgstr "Vý¹ka (1/72 palce):"
+
+#original text: "Left offset (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_LEFT
+msgstr "Levý posun (1/72 palce):"
+
+#original text: "Bottom offset (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_BOTTOM
+msgstr "Spodní posun (1/72 palce):"
+
+#original text: "Printer gamma value:"
+msgid TEXT_SETUP_PRINTER_GAMMA
+msgstr "Gama hodnota tiskárny:"
+
+#original text: "Printer gamma red:"
+msgid TEXT_SETUP_PRINTER_GAMMA_RED
+msgstr "Èervená gama tiskárny:"
+
+#original text: "Printer gamma green:"
+msgid TEXT_SETUP_PRINTER_GAMMA_GREEN
+msgstr "Zelená gama tiskárny:"
+
+#original text: "Printer gamma blue:"
+msgid TEXT_SETUP_PRINTER_GAMMA_BLUE
+msgstr "Modrá gama tiskárny:"
+
+#original text: "JPEG image quality"
+msgid TEXT_SETUP_JPEG_QUALITY
+msgstr "Kvalita JPEG obrázku"
+
+#original text: "PNG image compression"
+msgid TEXT_SETUP_PNG_COMPRESSION
+msgstr "Komprese PNG obrázku"
+
+#original text: "TIFF multi bit image compression"
+msgid TEXT_SETUP_TIFF_COMPRESSION
+msgstr "Komprese vícebitových TIFF obrázkù"
+
+#original text: "TIFF lineart image compression"
+msgid TEXT_SETUP_TIFF_COMPRESSION_1
+msgstr "Komprese jednobarevných TIFF obrázkù"
+
+#original text: "Preview gamma:"
+msgid TEXT_SETUP_PREVIEW_GAMMA
+msgstr "Gama náhledu:"
+
+#original text: "Preview gamma red:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_RED
+msgstr "Èervená gama náhledu:"
+
+#original text: "Preview gamma green:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_GREEN
+msgstr "Zelená gama náhledu:"
+
+#original text: "Preview gamma blue:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_BLUE
+msgstr "Modrá gama náhledu:"
+
+#original text: "Helpfile viewer (HTML):"
+msgid TEXT_SETUP_HELPFILE_VIEWER
+msgstr "Prohlí¾eè souboru nápovìdy (HTML):"
+
+#original text: "Command:"
+msgid TEXT_SETUP_FAX_COMMAND
+msgstr "Pøíkaz:"
+
+#original text: "Receiver option:"
+msgid TEXT_SETUP_FAX_RECEIVER_OPTION
+msgstr "Volba pøíjemce:"
+
+#original text: "Postscriptfile option:"
+msgid TEXT_SETUP_FAX_POSTSCRIPT_OPT
+msgstr "Volby postscriptového souboru:"
+
+#original text: "Normal mode option:"
+msgid TEXT_SETUP_FAX_NORMAL_MODE_OPT
+msgstr "Volby normálního re¾imu:"
+
+#original text: "Fine mode option:"
+msgid TEXT_SETUP_FAX_FINE_MODE_OPT
+msgstr "Volby re¾imu vysokého rozli¹ení:"
+
+#original text: "Viewer (Postscript):"
+msgid TEXT_SETUP_FAX_VIEWER
+msgstr "Prohlí¾eè (Postscript):"
+
+#original text: "Saving options"
+msgid NOTEBOOK_SAVING_OPTIONS
+msgstr "Volby zápisu"
+
+#original text: "Display options"
+msgid NOTEBOOK_DISPLAY_OPTIONS
+msgstr "Volby zobrazování"
+
+#original text: "Fax options"
+msgid NOTEBOOK_FAX_OPTIONS
+msgstr "Volby faxu"
+
+#original text: "Scan"
+msgid MENU_ITEM_SCAN
+msgstr "Skenování"
+
+#original text: "Copy"
+msgid MENU_ITEM_COPY
+msgstr "Kopírování"
+
+#original text: "Fax"
+msgid MENU_ITEM_FAX
+msgstr "Faxování"
+
+#original text: "Setup"
+msgid MENU_ITEM_SETUP
+msgstr "Nastavení"
+
+#original text: "Show tooltips"
+msgid MENU_ITEM_SHOW_TOOLTIPS
+msgstr "Ukazovat tipy"
+
+#original text: "Show preview"
+msgid MENU_ITEM_SHOW_PREVIEW
+msgstr "Ukazovat náhled"
+
+#original text: "Show histogram"
+msgid MENU_ITEM_SHOW_HISTOGRAM
+msgstr "Ukazovat histogram"
+
+#original text: "Show standard options"
+msgid MENU_ITEM_SHOW_STANDARDOPTIONS
+msgstr "Ukazovat standardní volby"
+
+#original text: "Show advanced options"
+msgid MENU_ITEM_SHOW_ADVANCEDOPTIONS
+msgstr "Ukazovat roz¹íøené volby"
+
+
+#original text: "Show resolution list"
+msgid MENU_ITEM_SHOW_RESOLUTIONLIST
+msgstr "Ukazovat seznam rozli¹ení"
+
+#original text: "Length unit"
+msgid MENU_ITEM_LENGTH_UNIT
+msgstr "Délková jednotka"
+
+#original text: "millimeters"
+msgid SUBMENU_ITEM_LENGTH_MILLIMETERS
+msgstr "milimetry"
+
+#original text: "centimeters"
+msgid SUBMENU_ITEM_LENGTH_CENTIMETERS
+msgstr "centimetry"
+
+#original text: "inches"
+msgid SUBMENU_ITEM_LENGTH_INCHES
+msgstr "palce"
+
+#original text: "Save device settings"
+msgid MENU_ITEM_SAVE_DEVICE_SETTINGS
+msgstr "Zapsat nastavení zaøízení"
+
+#original text: "Load device settings"
+msgid MENU_ITEM_LOAD_DEVICE_SETTINGS
+msgstr "Naèíst nastavení zaøízení"
+
+#original text: "Xsane doc"
+msgid MENU_ITEM_XSANE_DOC
+msgstr "Dokumentace Xsane"
+
+#original text: "Backend doc"
+msgid MENU_ITEM_BACKEND_DOC
+msgstr "Dokumentace rozhraní zaøízení"
+
+#original text: "Available backends"
+msgid MENU_ITEM_AVAILABLE_BACKENDS
+msgstr "Dospupná rozhraní zaøízení"
+
+#original text: "Scantips"
+msgid MENU_ITEM_SCANTIPS
+msgstr "Skenovací tipy"
+
+#original text: "no compression"
+msgid MENU_ITEM_TIFF_COMP_NONE
+msgstr "¾ádná komprese"
+
+#original text: "CCITT 1D Huffman compression"
+msgid MENU_ITEM_TIFF_COMP_CCITTRLE
+msgstr "Huffmanova komprese CCITT 1D"
+
+#original text: "CCITT Group 3 Fax compression"
+msgid MENU_ITEM_TIFF_COMP_CCITFAX3
+msgstr "Komprese CCITT Group 3 Fax"
+
+#original text: "CCITT Group 4 Fax compression"
+msgid MENU_ITEM_TIFF_COMP_CCITFAX4
+msgstr "Komprese CCITT Group 4 Fax"
+
+#original text: "JPEG DCT compression"
+msgid MENU_ITEM_TIFF_COMP_JPEG
+msgstr "Komprese JPEG DCT"
+
+#original text: "pack bits"
+msgid MENU_ITEM_TIFF_COMP_PACKBITS
+msgstr "bitové pakování"
+
+#original text: "by ext"
+msgid MENU_ITEM_FILETYPE_BY_EXT
+msgstr "podle pøípony"
+
+#original text: "Saving image"
+msgid PROGRESS_SAVING
+msgstr "Zapisuje se obrázek"
+
+#original text: "Saving fax image"
+msgid PROGRESS_SAVING_FAX
+msgstr "Zapisuje se faxový obrázek"
+
+#original text: "Converting data...."
+msgid PROGRESS_CONVERTING_DATA
+msgstr "Konvertují se data..."
+
+#original text: "Converting to postscript"
+msgid PROGRESS_CONVERTING_PS
+msgstr "Konvertuje se do Postscriptu"
+
+#original text: "Scanning"
+msgid PROGRESS_SCANNING
+msgstr "Skenuje se"
+
+#original text: "Receiving %s data for `%s'..."
+msgid PROGRESS_RECEIVING_SCAN
+msgstr "Snímají se data typu %s pro `%s'..."
+
+#original text: "Receiving %s data for photocopy ..."
+msgid PROGRESS_RECEIVING_COPY
+msgstr "Snímají se data typu %s pro fotokopii..."
+
+#original text: "Receiving %s data for fax ..."
+msgid PROGRESS_RECEIVING_FAX
+msgstr "Snímají se data typu %s pro fax..."
+
+#original text: "Receiving %s data for GIMP..."
+msgid PROGRESS_RECEIVING_GIMP
+msgstr "Snímají se data typu %s pro GIMP..."
+
+
+#original text: "Use XSane for SCANning, photoCOPYing, FAXing..."
+msgid DESC_XSANE_MODE
+msgstr "XSane slou¾í pro skenování, kopírování, faxování..."
+
+#original text: "Browse for image filename"
+msgid DESC_BROWSE_FILENAME
+msgstr "Hledání jména souboru"
+
+#original text: "Filename for scanned image"
+msgid DESC_FILENAME
+msgstr "Jméno souboru pro skenovaný obrázek"
+
+#original text: "Filename extension and type of image format"
+msgid DESC_FILETYPE
+msgstr "Pøípona jména souboru a typ obrázkového formátu"
+
+#original text: "Enter name of fax project"
+msgid DESC_FAXPROJECT
+msgstr "Zadání jméno faxového projektu"
+
+#original text: "Enter new name for faxpage"
+msgid DESC_FAXPAGENAME
+msgstr "Zadání jména faxové strany"
+
+#original text: "Enter receiver phone number or address"
+msgid DESC_FAXRECEIVER
+msgstr "Zadání telefonního èísla nebo adresy pøíjemce"
+
+#original text: "Select printer definition"
+msgid DESC_PRINTER_SELECT
+msgstr "Volba definice tiskárny"
+
+#original text: "Set scan resolution"
+msgid DESC_RESOLUTION
+msgstr "Nastavení rozli¹ení skenování"
+
+#original text: "Set zoomfactor"
+msgid DESC_ZOOM
+msgstr "Nastavení faktoru zmìny velikosti"
+
+#original text: "Set number of copies"
+msgid DESC_COPY_NUMBER
+msgstr "Nastavení poètu kopií"
+
+#original text: "Negative: Invert colors for scanning negatives\n" "e.g. swap black and white"
+msgid DESC_NEGATIVE
+msgstr "Negativ: Invertuje barvy pro skenování negativù\n" "napø. pøehodá èernou a bílou"
+
+#original text: "Set gamma value"
+msgid DESC_GAMMA
+msgstr "Nastavení gama hodnoty"
+
+#original text: "Set gamma value for red component"
+msgid DESC_GAMMA_R
+msgstr "Nastavení gama hodnoty èervené komponenty"
+
+#original text: "Set gamma value for green component"
+msgid DESC_GAMMA_G
+msgstr "Nastavení gama hodnoty zelené komponenty"
+
+#original text: "Set gamma value for blue component"
+msgid DESC_GAMMA_B
+msgstr "Nastavení gama hodnoty modré komponenty"
+
+#original text: "Set brightness"
+msgid DESC_BRIGHTNESS
+msgstr "Nastavení jasu"
+
+#original text: "Set brightness for red component"
+msgid DESC_BRIGHTNESS_R
+msgstr "Nastavení jasu èervené komponenty"
+
+#original text: "Set brightness for green component"
+msgid DESC_BRIGHTNESS_G
+msgstr "Nastavení jasu zelené komponenty"
+
+#original text: "Set brightness for blue component"
+msgid DESC_BRIGHTNESS_B
+msgstr "Nastavení jasu modré komponenty"
+
+#original text: "Set contrast"
+msgid DESC_CONTRAST
+msgstr "Nastavení kontrastu"
+
+#original text: "Set contrast for red component"
+msgid DESC_CONTRAST_R
+msgstr "Nastavení kontrastu èervené komponenty"
+
+#original text: "Set contrast for green component"
+msgid DESC_CONTRAST_G
+msgstr "Nastavení kontrastu zelené komponenty"
+
+#original text: "Set contrast for blue component"
+msgid DESC_CONTRAST_B
+msgstr "Nastavení kontrastu modré komponenty"
+
+#original text: "RGB default: Set enhancement values for red, green and blue to default values:\n" " gamma = 1.0\n" " brightness = 0\n" " contrast = 0"
+msgid DESC_RGB_DEFAULT
+msgstr "Implicitní RGB: Nastavení hodnot pro zpracování èervené, zelené a modré:\n" " gama = 1.0\n" " jas = 0\n" " kontrast = 0"
+
+#original text: "Autoadjust gamma, brightness and contrast in dependance of selected area"
+msgid DESC_ENH_AUTO
+msgstr "Automatické nastavení gamy, jasu a kontrastu v závislosti na vybrané oblasti"
+
+#original text: "Set default enhancement values:\n" "gamma = 1.0\n" "brightness = 0\n" "contrast = 0"
+msgid DESC_ENH_DEFAULT
+msgstr "Nastavení implicitních hodnot zpracování:\n" "gama = 1.0\n" "jas = 0\n" "kontrast = 0"
+
+#original text: "Restore enhancement values from preferences"
+msgid DESC_ENH_RESTORE
+msgstr "Obnovit hodnoty zpracování z pøedvoleb"
+
+#original text: "Store active enhancement values to preferences"
+msgid DESC_ENH_STORE
+msgstr "Ulo¾it hodnoty zpracování z pøedvoleb"
+
+#original text: "Show histogram of intensity/gray"
+msgid DESC_HIST_INTENSITY
+msgstr "Zobrazit histogram intenzity / ¹edi"
+
+#original text: "Show histogram of red component"
+msgid DESC_HIST_RED
+msgstr "Zobrazit histogram èervené komponenty"
+
+#original text: "Show histogram of green component"
+msgid DESC_HIST_GREEN
+msgstr "Zobrazit histogram zelené komponenty"
+
+#original text: "Show histogram of blue component"
+msgid DESC_HIST_BLUE
+msgstr "Zobrazit histogram modré komponenty"
+
+#original text: "Display histogram with lines instead of pixels"
+msgid DESC_HIST_PIXEL
+msgstr "Zoprazit èárový histogram místo plo¹ného"
+
+#original text: "Show logarithm of pixelcount"
+msgid DESC_HIST_LOG
+msgstr "Zobrazit logaritmy poètù pixelù"
+
+#original text: "Select definition to change"
+msgid DESC_PRINTER_SETUP
+msgstr "Volba definice ke zmìnì"
+
+#original text: "Define a name for the selection of this definition"
+msgid DESC_PRINTER_NAME
+msgstr "Zadání jména pro výbìr této definice"
+
+#original text: "Enter command to be executed in copy mode (e.g. \"lpr -\")"
+msgid DESC_PRINTER_COMMAND
+msgstr "Zadání pøíkazu, který má být vyvolán v re¾imu kopírování (napø. \"lpr -\")"
+
+#original text: "Enter option for copy numbers"
+msgid DESC_COPY_NUMBER_OPTION
+msgstr "Zadání volby poètu kopií"
+
+#original text: "Resolution with which images are printed and saved in postscript"
+msgid DESC_PRINTER_RESOLUTION
+msgstr "Rozli¹ení, ve kterém budou obrázky tisknuty a zapisovány do postscriptu"
+
+#original text: "Width of printable area in 1/72 inch"
+msgid DESC_PRINTER_WIDTH
+msgstr "©íøka tisknutelné plochy v dvaasedmdesátinách palce"
+
+#original text: "Height of printable area in 1/72 inch"
+msgid DESC_PRINTER_HEIGHT
+msgstr "Vý¹ka tisknutelné plochy v dvaasedmdesátinách palce"
+
+#original text: "Left offset from the edge of the paper to the printable area in 1/72 inch"
+msgid DESC_PRINTER_LEFTOFFSET
+msgstr "Posun od levého okraje papíru do tisknutelné plochy v dvaasedmdesátinách palce"
+
+#original text: "Bottom offset from the edge of the paper to the printable area in 1/72 inch"
+msgid DESC_PRINTER_BOTTOMOFFSET
+msgstr "Posun od spodního okraje papíru do tisknutelné plochy v dvaasedmdesátinách palce"
+
+#original text: "Additional gamma value for photocopy"
+msgid DESC_PRINTER_GAMMA
+msgstr "Dodateèná gama hodnota pro fotokopii"
+
+#original text: "Additional gamma value for red component for photocopy"
+msgid DESC_PRINTER_GAMMA_RED
+msgstr "Dodateèná gama hodnota pro èervenou komponentu pro fotokopii"
+
+#original text: "Additional gamma value for green component for photocopy"
+msgid DESC_PRINTER_GAMMA_GREEN
+msgstr "Dodateèná gama hodnota pro zelenou komponentu pro fotokopii"
+
+#original text: "Additional gamma value for blue component for photocopy"
+msgid DESC_PRINTER_GAMMA_BLUE
+msgstr "Dodateèná gama hodnota pro modrou komponentu pro fotokopii"
+
+#original text: "Quality in percent if image is saved as jpeg or tiff with jpeg compression"
+msgid DESC_JPEG_QUALITY
+msgstr "Kvalita v procentech, je-li obrázek zapisován jako jpeg nebo tiff s jpeg kompresí"
+
+#original text: "Compression if image is saved as png"
+msgid DESC_PNG_COMPRESSION
+msgstr "Typ komprese, je-li obrázek zapisován jako png"
+
+#original text: "Compression type if multi bit image is saved as tiff"
+msgid DESC_TIFF_COMPRESSION
+msgstr "Typ komprese, je-li obrázek zapisován jako vícebitový TIFF"
+
+#original text: "Compression type if lineart image is saved as tiff"
+msgid DESC_TIFF_COMPRESSION_1
+msgstr "Typ komprese, je-li obrázek zapisován jako jednobarevný TIFF"
+
+#original text: "Warn before overwriting an existing file"
+msgid DESC_OVERWRITE_WARNING
+msgstr "Varování pøed pøepsáním existujícího souboru"
+
+#original text: "If the filename is of the form \"name-001.ext\" " "(where the number of digits is free) " "the number is increased after a scan is finished"
+msgid DESC_INCREASE_COUNTER
+msgstr "Je-li jméno souboru ve tvaru \"jméno-001.pøíp\" (poèet èíslic je libovolný), èíslo je o skenování zvìt¹eno"
+
+#original text: "If filename counter is automatically increased, used numbers are skipped"
+msgid DESC_SKIP_EXISTING
+msgstr "Je-li èítaè souborù automaticky zvìt¹ován, pou¾itá èísla jsou pøeskoèena"
+
+#original text: "Use fixed main window size or scrolled, resizable main window"
+msgid DESC_MAIN_WINDOW_FIXED
+msgstr "U¾ití pevné velikosti hlavního okna nebo okna s posuvníky a promìnnou velikostí"
+
+#original text: "Preserve preview image for next program start"
+msgid DESC_PREVIEW_PRESERVE
+msgstr "Zachování náhledu pro pøí¹tí spu¹tìní programu"
+
+#original text: "Use an own colormap for preview if display depth is 8 bpp"
+msgid DESC_PREVIEW_COLORMAP
+msgstr "Pou¾ití vlastní barevné mapy náhledu, je-li obrazová hloubka 8"
+
+#original text: "Set gamma correction value for preview image"
+msgid DESC_PREVIEW_GAMMA
+msgstr "Nastavení gama korekce pro náhledová obrázek"
+
+#original text: "Set gamma correction value for red component of preview image"
+msgid DESC_PREVIEW_GAMMA_RED
+msgstr "Nastavení gama korekce pro èervenou komponentu náhledového obrázku"
+
+#original text: "Set gamma correction value for green component of preview image"
+msgid DESC_PREVIEW_GAMMA_GREEN
+msgstr "Nastavení gama korekce pro zelenou komponentu náhledového obrázku"
+
+#original text: "Set gamma correction value for blue component of preview image"
+msgid DESC_PREVIEW_GAMMA_BLUE
+msgstr "Nastavení gama korekce pro modrou komponentu náhledového obrázku"
+
+#original text: "Enter command to be executed to display helpfiles, must be a html-viewer!"
+msgid DESC_DOC_VIEWER
+msgstr "Nastevení pøíkazu k zobrazení souborù nápovìdy, musí být html prohlí¾eè!"
+
+#original text: "Enter command to be executed in fax mode"
+msgid DESC_FAX_COMMAND
+msgstr "Nastevení pøíkazu provádìného ve faxovém re¾imu"
+
+#original text: "Enter option to specify receiver"
+msgid DESC_FAX_RECEIVER_OPT
+msgstr "Nastevení volby urèující pøíjemce"
+
+#original text: "Enter option to specify postscript files following"
+msgid DESC_FAX_POSTSCRIPT_OPT
+msgstr "Nastevení volby k zadání postscriptových souborù"
+
+#original text: "Enter option to specify normal mode (low resolution)"
+msgid DESC_FAX_NORMAL_OPT
+msgstr "Nastavení volby k urèení normálního re¾imu (nízké rozli¹ení)"
+
+#original text: "Enter option to specify fine mode (high resolution)"
+msgid DESC_FAX_FINE_OPT
+msgstr "Nastavení volby k urèení kvalitního re¾imu (velké rozli¹ení)"
+
+#original text: "Enter command to be executed to view a fax"
+msgid DESC_FAX_VIEWER
+msgstr "Nastavení pøíkazu k zobrazení faxu"
+
+#original text: "Use high vertical resolution (196 lpi instead of 98 lpi)"
+msgid DESC_FAX_FINE_MODE
+msgstr "U¾ití vysokého svislého rozli¹ení (196 dpi namísto 98 dpi)"
+
+#original text: "Pick white point"
+msgid DESC_PIPETTE_WHITE
+msgstr "Nasátí bílého bodu"
+
+#original text: "Pick gray point"
+msgid DESC_PIPETTE_GRAY
+msgstr "Nasátí ¹edého bodu"
+
+#original text: "Pick black point"
+msgid DESC_PIPETTE_BLACK
+msgstr "Nasátí èerného bodu"
+
+#original text: "Use full scanarea"
+msgid DESC_ZOOM_FULL
+msgstr "U¾ití plné skenovací plochy"
+
+#original text: "Zoom 20% out"
+msgid DESC_ZOOM_OUT
+msgstr "Vzdálení o 20 %"
+
+#original text: "Zoom into selected area"
+msgid DESC_ZOOM_IN
+msgstr "Pøiblí¾ení zvolenou oblast"
+
+#original text: "Undo last zoom"
+msgid DESC_ZOOM_UNDO
+msgstr "Vrácení posledního pøiblí¾ení"
+
+#original text: "Select visible area"
+msgid DESC_FULL_PREVIEW_AREA
+msgstr "Volba viditelné oblasti"
+
+#original text: "Failed to determine home directory:"
+msgid ERR_HOME_DIR
+msgstr "Selhalo urèení domovského adresáøe:"
+
+#original text: "Filename too long"
+msgid ERR_FILENAME_TOO_LONG
+msgstr "Jméno souboru je pøíli¹ dlouhé"
+
+#original text: "Failed to set value of option"
+msgid ERR_SET_OPTION
+msgstr "Selhalo nastavení hodnoty volby"
+
+#original text: "Failed to obtain value of option"
+msgid ERR_GET_OPTION
+msgstr "Selhalo získání hodnoty volby"
+
+#original text: "Error obtaining option count"
+msgid ERR_OPTION_COUNT
+msgstr "Selhalo získání poètu voleb"
+
+#original text: "Failed to open device"
+msgid ERR_DEVICE_OPEN_FAILED
+msgstr "Otevøení zaøízení selhalo"
+
+#original text: "no devices available"
+msgid ERR_NO_DEVICES
+msgstr "nejsou k dispozici ¾ádná zaøízení"
+
+#original text: "Error during read:"
+msgid ERR_DURING_READ
+msgstr "Chyba bìhem ètení:"
+
+#original text: "Error during save:"
+msgid ERR_DURING_SAVE
+msgstr "Chyba bìhem zápisu:"
+
+#original text: "Can't handle depth"
+msgid ERR_BAD_DEPTH
+msgstr "Nelze zpracovat hloubku"
+
+#original text: "GIMP can't handle depth"
+msgid ERR_GIMP_BAD_DEPTH
+msgstr "GIMP neumí zpracovat hloubku"
+
+#original text: "Unknown file format for saving"
+msgid ERR_UNKNOWN_SAVING_FORMAT
+msgstr "Neznámý formát souboru pro zápis"
+
+#original text: "Failed to open"
+msgid ERR_OPEN_FAILED
+msgstr "Otevøení selhalo"
+
+#original text: "Failed to open pipe for executing printercommand"
+msgid ERR_FAILED_PRINTER_PIPE
+msgstr "Otevøení roury ke spu¹tìní pøíkazu tiskárny selhalo"
+
+#original text: "Failed to execute printercommand:"
+msgid ERR_FAILED_EXEC_PRINTER_CMD
+msgstr "Spu¹tìní pøíkazu tiskárny selhalo"
+
+#original text: "Failed to start scanner:"
+msgid ERR_FAILED_START_SCANNER
+msgstr "Spu¹tìní skeneru selhalo"
+
+#original text: "Failed to get parameters:"
+msgid ERR_FAILED_GET_PARAMS
+msgstr "Získání parametrù selhalo:"
+
+#original text: "No output format given"
+msgid ERR_NO_OUTPUT_FORMAT
+msgstr "Nebyl zadán výstupní formát"
+
+#original text: "out of memory"
+msgid ERR_NO_MEM
+msgstr "nedostatek pamìti"
+
+#original text: "LIBTIFF reports error"
+msgid ERR_LIBTIFF
+msgstr "LIBTIFF hlásí chybu"
+
+#original text: "LIBPNG reports error"
+msgid ERR_LIBPNG
+msgstr "LIBPNG hlásí chybu"
+
+#original text: "unknown type"
+msgid ERR_UNKNOWN_TYPE
+msgstr "neznámý typ"
+
+#original text: "unknown constraint type"
+msgid ERR_UNKNOWN_CONSTRAINT_TYPE
+msgstr "neznámý po¾adovaný typ"
+
+#original text: "Failed to execute documentation viewer:"
+msgid ERR_FAILD_EXEC_DOC_VIEWER
+msgstr "Spu¹tìní prohlí¾eèe dokumentace selhalo"
+
+#original text: "Failed to execute fax viewer:"
+msgid ERR_FAILD_EXEC_FAX_VIEWER
+msgstr "Spu¹tìní faxového prohlí¾eèe selhalo"
+
+#original text: "Failed to execute faxcommand:"
+msgid ERR_FAILED_EXEC_FAX_CMD
+msgstr "Spu¹tìní faxového pøíkazu selhalo:"
+
+#original text: "bad frame format"
+msgid ERR_BAD_FRAME_FORMAT
+msgstr "¹patný formát rámce"
+
+#original text: "unable to set resolution"
+msgid ERR_FAILED_SET_RESOLUTION
+msgstr "nepodaøilo se nastavit rozli¹ení"
+
+#original text: "error"
+msgid ERR_ERROR
+msgstr "chyba"
+
+#original text: "Sane major version number mismatch!"
+msgid ERR_MAJOR_VERSION_NR_CONFLICT
+msgstr "Hlavní èíslo verze Sane nesouhlasí!"
+
+#original text: "xsane major version ="
+msgid ERR_XSANE_MAJOR_VERSION
+msgstr "hlavní èíslo verze xsane ="
+
+#original text: "backend major version ="
+msgid ERR_BACKEND_MAJOR_VERSION
+msgstr "hlavní èíslo verze ovladaèe ="
+
+#original text: "*** PROGRAM ABORTED ***"
+msgid ERR_PROGRAM_ABORTED
+msgstr "*** PROGRAM ZRU©EN ***"
+
+#original text: "Failed to allocate image memory:"
+msgid ERR_FAILED_ALLOCATE_IMAGE
+msgstr "Selhalo získání pamìti pro obrázek:"
+
+#original text: "Preview cannot handle bit depth"
+msgid ERR_PREVIEW_BAD_DEPTH
+msgstr "Náhled neumí obslou¾it bitovou hloubku"
+
+#original text: "GIMP support missing"
+msgid ERR_GIMP_SUPPORT_MISSING
+msgstr "Chybí podpora programu GIMP"
+
+#original text: "Filename counter overflow"
+msgid WARN_COUNTER_OVERFLOW
+msgstr "Pøeteèení èítaèe jména souboru"
+
+#original text: "warning: option has no value constraint"
+msgid WARN_NO_VALUE_CONSTRAINT
+msgstr "varování: volba nezískala ¾ádnou hodnotu"
+
+#original text: "Ok"
+msgid ERR_BUTTON_OK
+msgstr "OK"
+
+#original text: "Error"
+msgid ERR_HEADER_ERROR
+msgstr "Chyba"
+
+#original text: "Warning"
+msgid ERR_HEADER_WARNING
+msgstr "Varování"
+
+#original text: "Failed to create file:"
+msgid ERR_FAILED_CREATE_FILE
+msgstr "Vytvoøení souboru selhalo"
+
+#original text: "Error while loading device settings:"
+msgid ERR_LOAD_DEVICE_SETTINGS
+msgstr "Chyba bìhem ètení nastavení zaøízení:"
+
+#original text: "is not a device-rc-file !!!"
+msgid ERR_NO_DRC_FILE
+msgstr "není soubor-záznamu-zaøízení!!!"
+
+#original text: "Failed to execute netscape!"
+msgid ERR_NETSCAPE_EXECUTE_FAIL
+msgstr "Spu¹tìní Netscape selhalo!"
+
+#original text: "Send fax: no receiver defined"
+msgid ERR_SENDFAX_RECEIVER_MISSING
+msgstr "Odeslání faxu: není definován pøíjemce"
+
+#original text: "has been created for device"
+msgid ERR_CREATED_FOR_DEVICE
+msgstr "byl vytvoøen pro zaøízení"
+
+#original text: "you want to use it for device"
+msgid ERR_USED_FOR_DEVICE
+msgstr "má být pou¾it pro zaøízení"
+
+#original text: "this may cause problems!"
+msgid ERR_MAY_CAUSE_PROBLEMS
+msgstr "to mù¾e zpùsobit problémy!"
+
+#original text: "Usage:"
+msgid TEXT_USAGE
+msgstr "U¾ití:"
+
+#original text: "[OPTION]... [DEVICE]"
+msgid TEXT_USAGE_OPTIONS
+msgstr "[VOLBA]... [ZAØÍZENÍ]"
+
+#original text: "Start up graphical user interface to access SANE (Scanner Access Now Easy) devices.\n\n-h, --help display this help message and exit\n-v, --version print version information\n\n-d, --device-settings file load device settings from file (without \".drc\")\n\n-s, --scan start with scan-mode active\n-c, --copy start with copy-mode active\n-f, --fax start with fax-mode active\n-n, --no-mode-selection disable menu for xsane mode selection\n\n-F, --Fixed fixed main window size (overwrite preferences value)\n-R, --Resizeable resizable, scrolled main window (overwrite preferences value)\n\n--display X11-display redirect output to X11-display\n--no-xshm do not use shared memory images\n--sync request a synchronous connection with the X11 server"
+msgid TEXT_HELP
+msgstr ""
+"Spu¹tìní grafického rozhraní pro pøístup k SANE zarízením.\n"
+"(SANE = Scanner Access Now Easy - pøístup ke skeneru je nyní snadný)\n"
+"\n"
+"-h, --help vypí¹e tuto nápovìdu a skonèí\n"
+"-v, --version vypí¹e oznaèení verze\n"
+"\n"
+"-d, --device-settings soubor naète nastavení zaøízení ze souboru (bez \".drc\")\n"
+"\n"
+"-s, --scan spustí se s aktivním re¾imem skenování\n"
+"-c, --copy spustí se s aktivním re¾imem kopírování\n"
+"-f, --fax spustí se s aktivním re¾imem faxování\n"
+"-n, --no-mode-selection zaká¾e menu volby xsane re¾imu\n"
+"\n"
+"-F, --Fixed pou¾ije pevnou velikost hlavního okna\n"
+" (pøepí¹e hodnotu pøedvolby)\n"
+"-R, --Resizeable pou¾ije hlavní okno s posuvníky a promìnnou velikostí\n"
+" (pøepí¹e hodnotu pøedvolby)\n"
+"\n"
+"--display X11-displej pøesmìruje výstup na X11-displej\n"
+"--no-xshm nepou¾ije sdílené pamì»ové obrazy\n"
+"--sync vy¾ádá synchronní spojení s X11 serverem"
+
+#original text: "Front-end to the SANE interface"
+msgid XSANE_GIMP_INSTALL_BLURB
+msgstr "U¾ivatelský program k rozhraní SANE"
+
+#original text: "This function provides access to scanners and other image acquisition devices through the SANE (Scanner Access Now Easy) interface."
+msgid XSANE_GIMP_INSTALL_HELP
+msgstr "Tato funkce nabízí pøes rozhrani SANE (Scanner Access Now Easy - pøístup ke skeneru je nyní snadný) pøístup ke skenerùm a jiným zaøízením ke snímání obrázkù"
+
+#original text: "<Toolbox>/File/Acquire/XSane: "
+msgid XSANE_GIMP_MENU
+msgstr "<Toolbox>/Soubor/Získat/XSane: "
+
+#original text: "<Toolbox>/Xtns/XSane/"
+msgid XSANE_GIMP_MENU_OLD
+msgstr "<Toolbox>/Roz¹./XSane/"
+
+#original text: "<Toolbox>/File/Acquire/XSane: Device dialog..."
+msgid XSANE_GIMP_MENU_DIALOG
+msgstr "<Toolbox>/Soubor/Získat/XSane: Dialog zaøízení..."
+
+#original text: "<Toolbox>/Xtns/XSane/Device dialog..."
+msgid XSANE_GIMP_MENU_DIALOG_OLD
+msgstr "<Toolbox>/Roz¹./XSane/Dialog zaøízení..."
+
+#original text: "flatbed scanner"
+msgid "flatbed scanner"
+msgstr "plo¹ný skener"
+
+#original text: "frame grabber"
+msgid "frame grabber"
+msgstr "snímaè políèek"
+
+#original text: "handheld scanner"
+msgid "handheld scanner"
+msgstr "ruèní ckener"
+
+#original text: "still camera"
+msgid "still camera"
+msgstr "digitální fotoaparát"
+
+#original text: "video camera"
+msgid "video camera"
+msgstr "videokamera"
+
+#original text: "virtual device"
+msgid "virtual device"
+msgstr "virtuální zaøízení"
+
+
+#original text: "Success"
+msgid "Success"
+msgstr "Úspìch"
+
+#original text: "Operation not supported"
+msgid "Operation not supported"
+msgstr "Operace není podporovaná"
+
+#original text: "Operation was cancelled"
+msgid "Operation was cancelled"
+msgstr "Operace byla zru¹ena"
+
+#original text: "Device busy"
+msgid "Device busy"
+msgstr "Zaøízení je v pou¾ívání"
+
+#original text: "Invalid argument"
+msgid "Invalid argument"
+msgstr "Neplatný argument"
+
+#original text: "End of file reached"
+msgid "End of file reached"
+msgstr "Dosa¾en konec souboru"
+
+#original text: "Document feeder jammed"
+msgid "Document feeder jammed"
+msgstr "Zmaèkaný papír v podavaèi"
+
+#original text: "Document feeder out of documents"
+msgid "Document feeder out of documents"
+msgstr "V podavaèi do¹ly dokumenty"
+
+#original text: "Scanner cover is open"
+msgid "Scanner cover is open"
+msgstr "Víko skeneru je otevøeno"
+
+#original text: "Error during device I/O"
+msgid "Error during device I/O"
+msgstr "Chyba bìhem V/V zaøízení"
+
+#original text: "Out of memory"
+msgid "Out of memory"
+msgstr "Nedostatek pamìti"
+
+#original text: "Access to resource has been denied"
+msgid "Access to resource has been denied"
+msgstr "Pøístup ke zdroji byl odmítnut"
+
diff --git a/po/de.gmo b/po/de.gmo
new file mode 100644
index 0000000..ddb7063
--- /dev/null
+++ b/po/de.gmo
Binary files differ
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..c6bf87d
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,1596 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#nls translation file for xsane
+#language: german (de)
+#by Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+
+#original text: "About"
+msgid "About"
+msgstr "Über"
+
+#original text: "authorization"
+msgid "authorization"
+msgstr "Autorisation"
+
+#original text: "info"
+msgid "info"
+msgstr "Informationen"
+
+#original text: "batch scan"
+msgid "batch scan"
+msgstr "Stapel Scan"
+
+#original text: "fax project"
+msgid "fax project"
+msgstr "Faxprojekt"
+
+#original text: "rename fax page"
+msgid "rename fax page"
+msgstr "Faxseite umbenennen"
+
+#original text: "setup"
+msgid "setup"
+msgstr "Konfiguration"
+
+#original text: "Histogram"
+msgid "Histogram"
+msgstr "Histogramm"
+
+#original text: "Standard options"
+msgid "Standard options"
+msgstr "Standard Optionen"
+
+#original text: "Advanced options"
+msgid "Advanced options"
+msgstr "Erweiterte Optionen"
+
+#original text: "device selection"
+msgid "device selection"
+msgstr "Geräteauswahl"
+
+#original text: "Preview"
+msgid "Preview"
+msgstr "Vorschau"
+
+#original text: "output filename"
+msgid "output filename"
+msgstr "Ausgabedatei"
+
+#original text: "save device settings"
+msgid "save device settings"
+msgstr "Speichere Geräteeinstellungen"
+
+#original text: "load device settings"
+msgid "load device settings"
+msgstr "Lade Geräteeinstellungen"
+
+#original text: "File"
+msgid "File"
+msgstr "Datei"
+
+#original text: "Preferences"
+msgid "Preferences"
+msgstr "Einstellungen"
+
+#original text: "View"
+msgid "View"
+msgstr "Ansicht"
+
+#original text: "Help"
+msgid "Help"
+msgstr "Hilfe"
+
+#original text: "About"
+msgid "About"
+msgstr "Über"
+
+#original text: "Info"
+msgid "Info"
+msgstr "Informationen"
+
+#original text: "Exit"
+msgid "Exit"
+msgstr "Beenden"
+
+#original text: "Raw image"
+msgid "Raw image"
+msgstr "Rohbild"
+
+#original text: "Enhanced image"
+msgid "Enhanced image"
+msgstr "Verbessertes Bild"
+
+#original text: "Start"
+msgid "Start"
+msgstr "Start"
+
+#original text: "Ok"
+msgid "Ok"
+msgstr "OK"
+
+#original text: "Apply"
+msgid "Apply"
+msgstr "Anwenden"
+
+#original text: "Cancel"
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#original text: "Close"
+msgid "Close"
+msgstr "Schließen"
+
+#original text: "Overwrite"
+msgid "Overwrite"
+msgstr "Überschreiben"
+
+#original text: "Add area"
+msgid "Add area"
+msgstr "Bereich hinzufügen"
+
+#original text: "Delete"
+msgid "Delete"
+msgstr "Löschen"
+
+#original text: "Show"
+msgid "Show"
+msgstr "Anzeigen"
+
+#original text: "Rename"
+msgid "Rename"
+msgstr "Umbenennen"
+
+#original text: "Create project"
+msgid "Create project"
+msgstr "Projekt erstellen"
+
+#original text: "Send project"
+msgid "Send project"
+msgstr "Projekt senden"
+
+#original text: "Delete project"
+msgid "Delete project"
+msgstr "Projekt löschen"
+
+#original text: "Add printer"
+msgid "Add printer"
+msgstr "Drucker hinzufügen"
+
+#original text: "Delete printer"
+msgid "Delete printer"
+msgstr "Drucker löschen"
+
+#original text: "Acquire Preview"
+msgid "Acquire Preview"
+msgstr "Vorschauscan"
+
+#original text: "Cancel Preview"
+msgid "Cancel Preview"
+msgstr "Vorschauscan abbrechen"
+
+#original text: "Fine mode"
+msgid "Fine mode"
+msgstr "Fein-Modus"
+
+#original text: "Overwrite warning"
+msgid "Overwrite warning"
+msgstr "Überschreibwarnung"
+
+#original text: "Increase filename counter"
+msgid "Increase filename counter"
+msgstr "Dateinamenzähler erhöhen"
+
+#original text: "Skip existing numbers"
+msgid "Skip existing numbers"
+msgstr "Existierende Werte überspringen"
+
+#original text: "Main window size fixed"
+msgid "Main window size fixed"
+msgstr "Feste Hauptfenstergröße"
+
+#original text: "Preserve preview image"
+msgid "Preserve preview image"
+msgstr "Behalte Vorschaubild"
+
+#original text: "Use private colormap"
+msgid "Use private colormap"
+msgstr "Benutze eigene Farbpalette"
+
+#original text: "Available devices:"
+msgid "Available devices:"
+msgstr "Erreichbare Geräte:"
+
+#original text: "XSane options"
+msgid "XSane options"
+msgstr "XSane Optionen"
+
+#original text: "XSane mode"
+msgid "XSane mode"
+msgstr "XSane Modus"
+
+#original text: "Scanner and backend:"
+msgid "Scanner and backend:"
+msgstr "Scanner und Backends"
+
+#original text: "Vendor:"
+msgid "Vendor:"
+msgstr "Hersteller:"
+
+#original text: "Model:"
+msgid "Model:"
+msgstr "Modell:"
+
+#original text: "Type:"
+msgid "Type:"
+msgstr "Typ:"
+
+#original text: "Device:"
+msgid "Device:"
+msgstr "Gerät:"
+
+#original text: "Loaded backend:"
+msgid "Loaded backend:"
+msgstr "Geladenes Backend:"
+
+#original text: "Sane version:"
+msgid "Sane version:"
+msgstr "sane Version:"
+
+#original text: "Recent values:"
+msgid "Recent values:"
+msgstr "Aktuelle Werte:"
+
+#original text: "Gamma correction by:"
+msgid "Gamma correction by:"
+msgstr "Gammakorrektur durch:"
+
+#original text: "scanner"
+msgid "scanner"
+msgstr "Scanner"
+
+#original text: "software (xsane)"
+msgid "software (xsane)"
+msgstr "Software (xsane)"
+
+#original text: "none"
+msgid "none"
+msgstr "keine"
+
+#original text: "Gamma input depth:"
+msgid "Gamma input depth:"
+msgstr "Bittiefe Gammaeingabe:"
+
+#original text: "Gamma output depth:"
+msgid "Gamma output depth:"
+msgstr "Bittiefe Gammaausgabe:"
+
+#original text: "Scanner output depth:"
+msgid "Scanner output depth:"
+msgstr "Bittieffe Scannerausgabe:"
+
+#original text: "XSane output formats:"
+msgid "XSane output formats:"
+msgstr "XSane Ausgabeformate:"
+
+#original text: "8 bit output formats:"
+msgid "8 bit output formats:"
+msgstr "8 Bit Ausgabeformate:"
+
+#original text: "16 bit output formats:"
+msgid "16 bit output formats:"
+msgstr "16 Bit Ausgabeformate:"
+
+#original text: "Authorization required for"
+msgid "Authorization required for"
+msgstr "Autorisation benötigt für"
+
+#original text: "Username :"
+msgid "Username :"
+msgstr "Benutzername:"
+
+#original text: "Password :"
+msgid "Password :"
+msgstr "Passwort:"
+
+#original text: "Invalid parameters."
+msgid "Invalid parameters."
+msgstr "Ungültige Parameter"
+
+#original text: "version:"
+msgid "version:"
+msgstr "Version:"
+
+#original text: "package"
+msgid "package"
+msgstr "Paket"
+
+#original text: "with GIMP support"
+msgid "with GIMP support"
+msgstr "mit GIMP-Unterstützung"
+
+#original text: "without GIMP support"
+msgid "without GIMP support"
+msgstr "ohne GIMP-Unterstützung"
+
+#original text: "compiled with GIMP-"
+msgid "compiled with GIMP-"
+msgstr "übersetzt mit GIMP-"
+
+#original text: "unknown"
+msgid "unknown"
+msgstr "unbekannt"
+
+#original text: "Email:"
+msgid "Email:"
+msgstr "E-Mail:"
+
+#original text: "File:"
+msgid "File:"
+msgstr "Datei:"
+
+#original text: "0x0: 0KB"
+msgid "0x0: 0KB"
+msgstr "0x0: 0KB"
+
+#original text: "Printer selection:"
+msgid "Printer selection:"
+msgstr "Druckerauswahl:"
+
+#original text: "Name:"
+msgid "Name:"
+msgstr "Name:"
+
+#original text: "Command:"
+msgid "Command:"
+msgstr "Befehl:"
+
+#original text: "Copy number option:"
+msgid "Copy number option:"
+msgstr "Option for Anzahl der Kopien:"
+
+#original text: "Resolution (dpi):"
+msgid "Resolution (dpi):"
+msgstr "Auflösung (dpi):"
+
+#original text: "Width (1/72 inch):"
+msgid "Width [mm]:"
+msgstr "Breite (1/72 Zoll):"
+
+#original text: "Height (1/72 inch):"
+msgid "Height [mm]:"
+msgstr "Höhe (1/72 Zoll):"
+
+#original text: "Left offset (1/72 inch):"
+msgid "Left offset [mm]:"
+msgstr "Linker Rand (1/72 Zoll):"
+
+#original text: "Bottom offset (1/72 inch):"
+msgid "Bottom offset [mm]:"
+msgstr "Unterer Rand (1/72 Zoll):"
+
+#original text: "Printer gamma value:"
+msgid "Printer gamma value:"
+msgstr "Drucker Gammawert:"
+
+#original text: "Printer gamma red:"
+msgid "Printer gamma red:"
+msgstr "Drucker Gammawert rot:"
+
+#original text: "Printer gamma green:"
+msgid "Printer gamma green:"
+msgstr "Drucker Gammawert grün:"
+
+#original text: "Printer gamma blue:"
+msgid "Printer gamma blue:"
+msgstr "Drucker Gammawert blau:"
+
+#original text: "JPEG image quality"
+msgid "JPEG image quality"
+msgstr "JPEG Bildqualität"
+
+#original text: "PNG image compression"
+msgid "PNG image compression"
+msgstr "PNG Bildkompression"
+
+#original text: "TIFF multi bit image compression"
+msgid "TIFF multi bit image compression"
+msgstr "TIFF multibit Bildkompression"
+
+#original text: "TIFF lineart image compression"
+msgid "TIFF lineart image compression"
+msgstr "TIFF lineart Bildkompression"
+
+#original text: "Preview gamma:"
+msgid "Preview gamma:"
+msgstr "Vorschau Gamma:"
+
+#original text: "Preview gamma red:"
+msgid "Preview gamma red:"
+msgstr "Vorschau Gamma rot:"
+
+#original text: "Preview gamma green:"
+msgid "Preview gamma green:"
+msgstr "Vorschau Gamma grün:"
+
+#original text: "Preview gamma blue:"
+msgid "Preview gamma blue:"
+msgstr "Vorschau Gamma blau:"
+
+#original text: "Helpfile viewer (HTML):"
+msgid "Helpfile viewer (HTML):"
+msgstr "Hilfedatei Betrachter (HTML):"
+
+#original text: "Command:"
+msgid "Command:"
+msgstr "Befehl:"
+
+#original text: "Receiver option:"
+msgid "Receiver option:"
+msgstr "Option für Empfängernummer"
+
+#original text: "Postscriptfile option:"
+msgid "Postscriptfile option:"
+msgstr "Option für Postscriptdatei:"
+
+#original text: "Normal mode option:"
+msgid "Normal mode option:"
+msgstr "Option für Normalmodus:"
+
+#original text: "Fine mode option:"
+msgid "Fine mode option:"
+msgstr "Option für Feinmodus:"
+
+#original text: "Viewer (Postscript):"
+msgid "Viewer (Postscript):"
+msgstr "Betrachter (Postscript):"
+
+#original text: "Copy options"
+msgid "Copy options"
+msgstr "Photokopie"
+
+#original text: "Saving options"
+msgid "Saving options"
+msgstr "Speichern"
+
+#original text: "Display options"
+msgid "Display options"
+msgstr "Darstellung"
+
+#original text: "Fax options"
+msgid "Fax options"
+msgstr "Fax"
+
+#original text: "Scan"
+msgid "Scan"
+msgstr "Scannen"
+
+#original text: "Copy"
+msgid "Copy"
+msgstr "Kopieren"
+
+#original text: "Fax"
+msgid "Fax"
+msgstr "Faxen"
+
+#original text: "Setup"
+msgid "Setup"
+msgstr "Konfiguration"
+
+#original text: "Show tooltips"
+msgid "Show tooltips"
+msgstr "Zeige Tipps"
+
+#original text: "Show preview"
+msgid "Show preview"
+msgstr "Zeige Vorschau"
+
+#original text: "Show histogram"
+msgid "Show histogram"
+msgstr "Zeige Histogramm"
+
+#original text: "Show standard options"
+msgid "Show standard options"
+msgstr "Zeige Standardoptionen"
+
+#original text: "Show advanced options"
+msgid "Show advanced options"
+msgstr "Zeige erweiterte Optionen"
+
+#original text: "Show resolution list"
+msgid "Show resolution list"
+msgstr "Zeige Auflösungsliste"
+
+#original text: "Length unit"
+msgid "Length unit"
+msgstr "Längeneinheit"
+
+#original text: "millimeters"
+msgid "millimeters"
+msgstr "Millimeter"
+
+#original text: "centimeters"
+msgid "centimeters"
+msgstr "Zentimeter"
+
+#original text: "inches"
+msgid "inches"
+msgstr "Zoll"
+
+#original text: "Save device settings"
+msgid "Save device settings"
+msgstr "Speichere Geräteeinstellungen"
+
+#original text: "Load device settings"
+msgid "Load device settings"
+msgstr "Lade Geräteeinstellungen"
+
+#original text: "Xsane doc"
+msgid "Xsane doc"
+msgstr "XSane Anleitung"
+
+#original text: "Backend doc"
+msgid "Backend doc"
+msgstr "Backend Anleitung"
+
+#original text: "Available backends"
+msgid "Available backends"
+msgstr "Erreichbare Backends"
+
+#original text: "Scantips"
+msgid "Scantips"
+msgstr "Scantipps"
+
+#original text: "Problems?"
+msgid "Problems?"
+msgstr "Probleme?"
+
+#original text: "no compression"
+msgid "no compression"
+msgstr "keine Kompression"
+
+#original text: "CCITT 1D Huffman compression"
+msgid "CCITT 1D Huffman compression"
+msgstr "CCITT 1D Huffman Kompression"
+
+#original text: "CCITT Group 3 Fax compression"
+msgid "CCITT Group 3 Fax compression"
+msgstr "CCITT Gruppe 3 Fax Kompression"
+
+#original text: "CCITT Group 4 Fax compression"
+msgid "CCITT Group 4 Fax compression"
+msgstr "CCITT Gruppe 4 Fax Kompression"
+
+#original text: "JPEG DCT compression"
+msgid "JPEG DCT compression"
+msgstr "JPEG DCT Kompression"
+
+#original text: "pack bits"
+msgid "pack bits"
+msgstr "gepackte Bits"
+
+#original text: "by ext"
+msgid "by ext"
+msgstr "nach Erw"
+
+#original text: "Saving image"
+msgid "Saving image"
+msgstr "Speichere Bild"
+
+#original text: "Saving fax image"
+msgid "Saving fax image"
+msgstr "Speichere Faxbild"
+
+#original text: "Converting data...."
+msgid "Converting data...."
+msgstr "Konvertiere Daten..."
+
+#original text: "Converting to postscript"
+msgid "Converting to postscript"
+msgstr "Konvertiere nach Postscript"
+
+#original text: "Scanning"
+msgid "Scanning"
+msgstr "Scanne"
+
+#original text: "Receiving %s data for `%s'..."
+msgid "Receiving %s data for `%s'..."
+msgstr "Empfange %s Daten für `%s'..."
+
+#original text: "Receiving %s data for photocopy ..."
+msgid "Receiving %s data for photocopy ..."
+msgstr "Empfange %s Daten für Photokopie"
+
+#original text: "Receiving %s data for fax ..."
+msgid "Receiving %s data for fax ..."
+msgstr "Empfange %s Daten für Fax ..."
+
+#original text: "Receiving %s data for GIMP..."
+msgid "Receiving %s data for GIMP..."
+msgstr "Empfange %s Daten für GIMP..."
+
+#original text: "Use XSane for SCANning, photoCOPYing, FAXing..."
+msgid "Use XSane for SCANning, photoCOPYing, FAXing..."
+msgstr "Benutze XSane zum Scannen, Kopieren oder Faxen"
+
+#original text: "Browse for image filename"
+msgid "Browse for image filename"
+msgstr "Suche nach Bild-Dateinamen"
+
+#original text: "Filename for scanned image"
+msgid "Filename for scanned image"
+msgstr "Dateiname für gescanntes Bild"
+
+#original text: "Filename extension and type of image format"
+msgid "Filename extension and type of image format"
+msgstr "Dateinamenerweiterung und Format der Bilddatei"
+
+#original text: "Enter name of fax project"
+msgid "Enter name of fax project"
+msgstr "Name des Faxprojekts"
+
+#original text: "Enter new name for faxpage"
+msgid "Enter new name for faxpage"
+msgstr "Name der Faxseite eingeben"
+
+#original text: "Enter receiver phone number or address"
+msgid "Enter receiver phone number or address"
+msgstr "Telephonnummer des Empfängers eingeben"
+
+#original text: "Select printer definition"
+msgid "Select printer definition"
+msgstr "Wähle Druckerdefinition"
+
+#original text: "Set scan resolution"
+msgid "Set scan resolution"
+msgstr "Bestimmt die Scanauflösung"
+
+#original text: "Set zoomfactor"
+msgid "Set zoomfactor"
+msgstr "Bestimmt den Vergrößerungsfaktor"
+
+#original text: "Set number of copies"
+msgid "Set number of copies"
+msgstr "Bestimmt die Anzahl der Kopien"
+
+#original text: "Negative: Invert colors for scanning negatives\n" "e.g. swap black and white"
+msgid "Negative: Invert colors for scanning negatives\n" "e.g. swap black and white"
+msgstr "Negativ: Invertiere Farben, zum Scannen von Negativen"
+
+#original text: "Set gamma value"
+msgid "Set gamma value"
+msgstr "Bestimmt Gammawert"
+
+#original text: "Set gamma value for red component"
+msgid "Set gamma value for red component"
+msgstr "Bestimmt Gammawert für rote Komponente"
+
+#original text: "Set gamma value for green component"
+msgid "Set gamma value for green component"
+msgstr "Bestimmt Gammawert für grüne Komponente"
+
+#original text: "Set gamma value for blue component"
+msgid "Set gamma value for blue component"
+msgstr "Bestimmt Gammawert für blaue Komponente"
+
+#original text: "Set brightness"
+msgid "Set brightness"
+msgstr "Bestimmt Helligkeit"
+
+#original text: "Set brightness for red component"
+msgid "Set brightness for red component"
+msgstr "Bestimmt Helligkeit für rote Komponente"
+
+#original text: "Set brightness for green component"
+msgid "Set brightness for green component"
+msgstr "Bestimmt Helligkeit für grüne Komponente"
+
+#original text: "Set brightness for blue component"
+msgid "Set brightness for blue component"
+msgstr "Bestimmt Helligkeit für blaue Komponente"
+
+#original text: "Set contrast"
+msgid "Set contrast"
+msgstr "Bestimmt Kontrast"
+
+#original text: "Set contrast for red component"
+msgid "Set contrast for red component"
+msgstr "Bestimmt Kontrast für rote Komponente"
+
+#original text: "Set contrast for green component"
+msgid "Set contrast for green component"
+msgstr "Bestimmt Kontrast für grüne Komponente"
+
+#original text: "Set contrast for blue component"
+msgid "Set contrast for blue component"
+msgstr "Bestimmt Kontrast für blaue Komponente"
+
+#original text: "RGB default: Set enhancement values for red, green and blue to default values:\n" " gamma = 1.0\n" " brightness = 0\n" " contrast = 0"
+msgid "RGB default: Set enhancement values for red, green and blue to default values:\n" " gamma = 1.0\n" " brightness = 0\n" " contrast = 0"
+msgstr "RGB Standard: Setzt Farbverbesserungswerte für rot, grün und blau auf Standardwerte:\n" "Gamma = 1.0\n" "Helligkeit = 0\n" "Kontrast = 0"
+
+#original text: "Autoadjust gamma, brightness and contrast in dependance of selected area"
+msgid "Autoadjust gamma, brightness and contrast in dependance of selected area"
+msgstr "Automatische Berechnung für Gamma, Helligkeit und Kontrast in Abhängigkeit vom ausgewählten Bereich"
+
+#original text: "Set default enhancement values:\n" "gamma = 1.0\n" "brightness = 0\n" "contrast = 0"
+msgid "Set default enhancement values:\n" "gamma = 1.0\n" "brightness = 0\n" "contrast = 0"
+msgstr "Setze Standardwerte für Farbverbesserung:\n" "Gamma = 1.0\n" "Helligkeit = 0\n" "Kontrast = 0"
+
+#original text: "Restore enhancement values from preferences"
+msgid "Restore enhancement values from preferences"
+msgstr "Lade Farbverbesserungswerte aus Einstellungen"
+
+#original text: "Store active enhancement values to preferences"
+msgid "Store active enhancement values to preferences"
+msgstr "Speichere Farbverbesserungswerte in Einstellungen"
+
+#original text: "Show histogram of intensity/gray"
+msgid "Show histogram of intensity/gray"
+msgstr "Zeige Histogramm für Intensität/grau"
+
+#original text: "Show histogram of red component"
+msgid "Show histogram of red component"
+msgstr "Zeige Histogramm für rote Komponente"
+
+#original text: "Show histogram of green component"
+msgid "Show histogram of green component"
+msgstr "Zeige Histogramm für grüne Komponente"
+
+#original text: "Show histogram of blue component"
+msgid "Show histogram of blue component"
+msgstr "Zeige Histogramm für blaue Komponente"
+
+#original text: "Display histogram with lines instead of pixels"
+msgid "Display histogram with lines instead of pixels"
+msgstr "Zeichne Histogramm mit Linien anstatt mit Punkten"
+
+#original text: "Show logarithm of pixelcount"
+msgid "Show logarithm of pixelcount"
+msgstr "Benutze Logarithmus der Pixelzahlen"
+
+#original text: "Select definition to change"
+msgid "Select definition to change"
+msgstr "Auswahl der zu ändernden Definition"
+
+#original text: "Define a name for the selection of this definition"
+msgid "Define a name for the selection of this definition"
+msgstr "Namen der Definition"
+
+#original text: "Enter command to be executed in copy mode (e.g. \"lpr -\")"
+msgid "Enter command to be executed in copy mode (e.g. \"lpr -\")"
+msgstr "Befehl der im Kopiermodus zum Drucken ausgeführt werden soll (z.B. \"lpr -\")"
+
+#original text: "Enter option for copy numbers"
+msgid "Enter option for copy numbers"
+msgstr "Option, mit der die Anzahl der Kopien angegeben wird"
+
+#original text: "Resolution with which images are printed and saved in postscript"
+msgid "Resolution with which images are printed and saved in postscript"
+msgstr "Auflösung, mit der Bilder gedrucht und im Postscriptformat gespeichert werden"
+
+#original text: "Width of printable area in 1/72 inch"
+msgid "Width of printable area in mm"
+msgstr "Breite des druckbaren Bereichs in 1/72 Zoll"
+
+#original text: "Height of printable area in 1/72 inch"
+msgid "Height of printable area in mm"
+msgstr "Höhe des druckbaren Bereichs in 1/72 Zoll"
+
+#original text: "Left offset from the edge of the paper to the printable area in 1/72 inch"
+msgid "Left offset from the edge of the paper to the printable area in mm"
+msgstr "Abstand vom linken Papierrand zum Beginn des druckbaren Bereichs in 1/72 Zoll"
+
+#original text: "Bottom offset from the edge of the paper to the printable area in 1/72 inch"
+msgid "Bottom offset from the edge of the paper to the printable area in mm"
+msgstr "Abstand vom unteren Papierrand zum Beginn des druckbaren Bereichs in 1/72 Zoll"
+
+#original text: "Additional gamma value for photocopy"
+msgid "Additional gamma value for photocopy"
+msgstr "Zusätzlicher Gammawert beim Photokopieren"
+
+#original text: "Additional gamma value for red component for photocopy"
+msgid "Additional gamma value for red component for photocopy"
+msgstr "Zusätzlicher Gammawert für rote Komponente beim Photokopieren"
+
+#original text: "Additional gamma value for green component for photocopy"
+msgid "Additional gamma value for green component for photocopy"
+msgstr "Zusätzlicher Gammawert für grüne Komponente beim Photokopieren"
+
+#original text: "Additional gamma value for blue component for photocopy"
+msgid "Additional gamma value for blue component for photocopy"
+msgstr "Zusätzlicher Gammawert für blaue Komponente beim Photokopieren"
+
+#original text: "Quality in percent if image is saved as jpeg or tiff with jpeg compression"
+msgid "Quality in percent if image is saved as jpeg or tiff with jpeg compression"
+msgstr "Qualität in Prozent wenn Bild als JPEG oder als TIFF mit JPEG-Kompression gespeichert wird"
+
+#original text: "Compression if image is saved as png"
+msgid "Compression if image is saved as png"
+msgstr "Kompression wenn Bild im PNG-Format gespeichert wird"
+
+#original text: "Compression type if multi bit image is saved as tiff"
+msgid "Compression type if multi bit image is saved as tiff"
+msgstr "Kompression wenn multibit Bild im TIFF-Format gespeichert wird"
+
+#original text: "Compression type if lineart image is saved as tiff"
+msgid "Compression type if lineart image is saved as tiff"
+msgstr "Kompression wenn lineart Bild im TIFF-Format gespeichert wird"
+
+#original text: "Warn before overwriting an existing file"
+msgid "Warn before overwriting an existing file"
+msgstr "Warne vorm Überschreiben exisitierender Dateien"
+
+#original text: "If the filename is of the form \"name-001.ext\" " "(where the number of digits is free) " "the number is increased after a scan is finished"
+msgid "If the filename is of the form \"name-001.ext\" " "(where the number of digits is free) " "the number is increased after a scan is finished"
+msgstr "... wenn der Dateiname folgender Form ist: \"name-001.erw\""
+
+#original text: "If filename counter is automatically increased, used numbers are skipped"
+msgid "If filename counter is automatically increased, used numbers are skipped"
+msgstr "Wenn der Dateinamenzähler automatisch erhöht wird, werden benutzte Dateinummern übersprungen"
+
+#original text: "Use fixed main window size or scrolled, resizable main window"
+msgid "Use fixed main window size or scrolled, resizable main window"
+msgstr "Verwende feste oder veränderbare Hauptfenstergröße"
+
+#original text: "Preserve preview image for next program start"
+msgid "Preserve preview image for next program start"
+msgstr "Behalte Vorschaubild für nächsten Programmstart"
+
+#original text: "Use an own colormap for preview if display depth is 8 bpp"
+msgid "Use an own colormap for preview if display depth is 8 bpp"
+msgstr "Benutze eigene Farbpalette für Vorscahubild, wenn die Bildschirmfarbtiefe 8 Bit beträgt"
+
+#original text: "Set gamma correction value for preview image"
+msgid "Set gamma correction value for preview image"
+msgstr "Bestimme Gammwert für Vorschaubild"
+
+#original text: "Set gamma correction value for red component of preview image"
+msgid "Set gamma correction value for red component of preview image"
+msgstr "Bestimme Gammwert der roten Komponente für Vorschaubild"
+
+#original text: "Set gamma correction value for green component of preview image"
+msgid "Set gamma correction value for green component of preview image"
+msgstr "Bestimme Gammwert der grünen Komponente für Vorschaubild"
+
+#original text: "Set gamma correction value for blue component of preview image"
+msgid "Set gamma correction value for blue component of preview image"
+msgstr "Bestimme Gammwert der blauen Komponente für Vorschaubild"
+
+#original text: "Enter command to be executed to display helpfiles, must be a html-viewer!"
+msgid "Enter command to be executed to display helpfiles, must be a html-viewer!"
+msgstr "Befehl, der ausgeführt werden soll, um Hilfedateien anzuzeigen, muß ein HTML-Betrachter sein!"
+
+#original text: "Enter command to be executed in fax mode"
+msgid "Enter command to be executed in fax mode"
+msgstr "Befehl, der zum Senden eines Faxprojekts ausgeführt werden soll"
+
+#original text: "Enter option to specify receiver"
+msgid "Enter option to specify receiver"
+msgstr "Option, mit der die Empfängertelephonnumer angegeben wird"
+
+#original text: "Enter option to specify postscript files following"
+msgid "Enter option to specify postscript files following"
+msgstr "Option, mit der angegeben wird, dass der Dateiname einer Postscriptdatei folgt"
+
+#original text: "Enter option to specify normal mode (low resolution)"
+msgid "Enter option to specify normal mode (low resolution)"
+msgstr "Option, mit der die vertikale Auflösung auf 98 lpi gestellt wird"
+
+#original text: "Enter option to specify fine mode (high resolution)"
+msgid "Enter option to specify fine mode (high resolution)"
+msgstr "Option, mit der die vertikale Auflösung auf 196 lpi gestellt wird"
+
+#original text: "Enter command to be executed to view a fax"
+msgid "Enter command to be executed to view a fax"
+msgstr "Befehl, der ausgeführt werden soll, um Faxseiten(Postscript) anzuzeigen"
+
+#original text: "Use high vertical resolution (196 lpi instead of 98 lpi)"
+msgid "Use high vertical resolution (196 lpi instead of 98 lpi)"
+msgstr "Benutze hohe vertikale Auflösung (196 lpi)"
+
+#original text: "Pick white point"
+msgid "Pick white point"
+msgstr "Wähle weißen Punkt"
+
+#original text: "Pick gray point"
+msgid "Pick gray point"
+msgstr "Wähle grauen Punkt"
+
+#original text: "Pick black point"
+msgid "Pick black point"
+msgstr "Wähle schwarzen Punkt"
+
+#original text: "Use full scanarea"
+msgid "Use full scanarea"
+msgstr "Zoomt auf kompletten Scanbereich"
+
+#original text: "Zoom 20% out"
+msgid "Zoom 20% out"
+msgstr "Zoomt um 20% heraus"
+
+#original text: "Zoom into selected area"
+msgid "Zoom into selected area"
+msgstr "Zoomt in den gewählten Bereich hinein"
+
+#original text: "Undo last zoom"
+msgid "Undo last zoom"
+msgstr "letzten Zoom rückgängig machen"
+
+#original text: "Select visible area"
+msgid "Select visible area"
+msgstr "Sichtbaren Bereich auswählen"
+
+#original text: "Failed to determine home directory:"
+msgid "Failed to determine home directory:"
+msgstr "Konnte Heimatverzeichnis nicht bestimmen"
+
+#original text: "Filename too long"
+msgid "Filename too long"
+msgstr "Dateiname zu lang"
+
+#original text: "Failed to set value of option"
+msgid "Failed to set value of option"
+msgstr "Fehler beim Ändern der Option"
+
+#original text: "Failed to obtain value of option"
+msgid "Failed to obtain value of option"
+msgstr "Fehler beim Lesen der Option"
+
+#original text: "Error obtaining option count"
+msgid "Error obtaining option count"
+msgstr "Konnte Anzahl der Optionen nicht bestimmen"
+
+#original text: "Failed to open device"
+msgid "Failed to open device"
+msgstr "Fehler beim Öffnen des Geräts"
+
+#original text: "no devices available"
+msgid "no devices available"
+msgstr "Keine Geräte erreichbar"
+
+#original text: "Error during read:"
+msgid "Error during read:"
+msgstr "Fehler beim Lesen:"
+
+#original text: "Error during save:"
+msgid "Error during save:"
+msgstr "Fehler beim Speichern:"
+
+#original text: "Can't handle depth"
+msgid "Can't handle depth"
+msgstr "Nicht unterstützte Bittiefe"
+
+#original text: "GIMP can't handle depth"
+msgid "GIMP can't handle depth"
+msgstr "GIMP Modus: nicht unterstützt Bittieffe"
+
+#original text: "Unknown file format for saving"
+msgid "Unknown file format for saving"
+msgstr "Unbekanntes Ausgabedateiformat"
+
+#original text: "Failed to open"
+msgid "Failed to open"
+msgstr "Fehler beim Öffnen von"
+
+#original text: "Failed to open pipe for executing printercommand"
+msgid "Failed to open pipe for executing printercommand"
+msgstr "Konnte Pipe für Druckbefehl nicht öffnen"
+
+#original text: "Failed to execute printercommand:"
+msgid "Failed to execute printercommand:"
+msgstr "Konnte Druckbefehl nicht ausführen"
+
+#original text: "Failed to start scanner:"
+msgid "Failed to start scanner:"
+msgstr "Konnte Scanner nicht starten"
+
+#original text: "Failed to get parameters:"
+msgid "Failed to get parameters:"
+msgstr "Konnte Parameter nicht lesen"
+
+#original text: "No output format given"
+msgid "No output format given"
+msgstr "Kein Ausgabedateiformat angegeben"
+
+#original text: "out of memory"
+msgid "out of memory"
+msgstr "Kein Speicher"
+
+#original text: "LIBTIFF reports error"
+msgid "LIBTIFF reports error"
+msgstr "LIBTIFF meldet Fehler"
+
+#original text: "LIBPNG reports error"
+msgid "LIBPNG reports error"
+msgstr "LIBPNG meldet Fehler"
+
+#original text: "unknown type"
+msgid "unknown type"
+msgstr "unbekannter Typ"
+
+#original text: "unknown constraint type"
+msgid "unknown constraint type"
+msgstr "unbekannter verpflichtender Typ"
+
+#original text: "Failed to execute documentation viewer:"
+msgid "Failed to execute documentation viewer:"
+msgstr "Konnte Hilfedateibetrachter nicht ausführen:"
+
+#original text: "Failed to execute fax viewer:"
+msgid "Failed to execute fax viewer:"
+msgstr "Konnte Faxbetrachter nicht ausführen:"
+
+#original text: "Failed to execute faxcommand:"
+msgid "Failed to execute faxcommand:"
+msgstr "Konnte Faxbefehl nicht ausführen:"
+
+#original text: "bad frame format"
+msgid "bad frame format"
+msgstr "unerwartetes FRAME-Format"
+
+#original text: "unable to set resolution"
+msgid "unable to set resolution"
+msgstr "konnte Auflösung nicht definieren"
+
+#original text: "error"
+msgid "error"
+msgstr "Fehler"
+
+#original text: "Sane major version number mismatch!"
+msgid "Sane major version number mismatch!"
+msgstr "Sane Hauptversionsnummern-Konflikt!"
+
+#original text: "xsane major version ="
+msgid "xsane major version ="
+msgstr "xsane Hauptversionsnummer ="
+
+#original text: "backend major version ="
+msgid "backend major version ="
+msgstr "backend Hauptversionsnummer ="
+
+#original text: "*** PROGRAM ABORTED ***"
+msgid "*** PROGRAM ABORTED ***"
+msgstr "*** PROGRAMM ABGEBROCHEN ***"
+
+#original text: "Failed to allocate image memory:"
+msgid "Failed to allocate image memory:"
+msgstr "Konnte Bildspeicher nicht allozieren:"
+
+#original text: "Preview cannot handle bit depth"
+msgid "Preview cannot handle bit depth"
+msgstr "Vorschau kann Bittiefe nicht handhaben:"
+
+#original text: "GIMP support missing"
+msgid "GIMP support missing"
+msgstr "GIMP Unterstützung fehlt"
+
+#original text: "Filename counter overflow"
+msgid "Filename counter overflow"
+msgstr "Dateinamenzähler übergelaufen"
+
+#original text: "warning: option has no value constraint"
+msgid "warning: option has no value constraint"
+msgstr "Warnung: Option hat keinen vorgeschriebenen Wert"
+
+#original text: "Ok"
+msgid "Ok"
+msgstr "OK"
+
+#original text: "Error"
+msgid "Error"
+msgstr "Fehler"
+
+#original text: "Warning"
+msgid "Warning"
+msgstr "Warnung"
+
+#original text: "Failed to create file:"
+msgid "Failed to create file:"
+msgstr "Fehler beim Erstellen der Datei:"
+
+#original text: "Error while loading device settings:"
+msgid "Error while loading device settings:"
+msgstr "Fehler beim Laden der Geräteeinstellungen"
+
+#original text: "is not a device-rc-file !!!"
+msgid "is not a device-rc-file !!!"
+msgstr "ist keine Geräteeinstellungs-Datei !!!"
+
+#original text: "Failed to execute netscape!"
+msgid "Failed to execute netscape!"
+msgstr "Konnte Netscape nicht aufrufen"
+
+#original text: "Send fax: no receiver defined"
+msgid "Send fax: no receiver defined"
+msgstr "Fax senden: kein Empfänger angegeben"
+
+#original text: "has been created for device"
+msgid "has been created for device"
+msgstr "wurde erstellt für das Gerät"
+
+#original text: "you want to use it for device"
+msgid "you want to use it for device"
+msgstr "wird benutzt für das Gerät"
+
+#original text: "this may cause problems!"
+msgid "this may cause problems!"
+msgstr "das kann zu Problemen führen!"
+
+#original text: "Usage:"
+msgid "Usage:"
+msgstr "Gebrauch:"
+
+#original text: "[OPTION]... [DEVICE]"
+msgid "[OPTION]... [DEVICE]"
+msgstr "[OPTION]... [GERÄTEDATEI]"
+
+#original text: "Start up graphical user interface to access SANE (Scanner Access Now Easy) devices.\n\n-h, --help display this help message and exit\n-v, --version print version information\n\n-d, --device-settings file load device settings from file (without \".drc\")\n\n-s, --scan start with scan-mode active\n-c, --copy start with copy-mode active\n-f, --fax start with fax-mode active\n-n, --no-mode-selection disable menu for xsane mode selection\n\n-F, --Fixed fixed main window size (overwrite preferences value)\n-R, --Resizeable resizable, scrolled main window (overwrite preferences value)\n\n--display X11-display redirect output to X11-display\n--no-xshm do not use shared memory images\n--sync request a synchronous connection with the X11 server"
+msgid "Start up graphical user interface to access SANE (Scanner Access Now Easy) devices.\n\n-h, --help display this help message and exit\n-v, --version print version information\n\n-d, --device-settings file load device settings from file (without \".drc\")\n\n-s, --scan start with scan-mode active\n-c, --copy start with copy-mode active\n-f, --fax start with fax-mode active\n-n, --no-mode-selection disable menu for xsane mode selection\n\n-F, --Fixed fixed main window size (overwrite preferences value)\n-R, --Resizeable resizable, scrolled main window (overwrite preferences value)\n\n--display X11-display redirect output to X11-display\n--no-xshm do not use shared memory images\n--sync request a synchronous connection with the X11 server"
+msgstr "" "Startet graphisches Benutzerinterface für SANE (Scanner Access Now Easy)\n" "\n" "-h, --help zeigt diesen Hilfetext\n" "-v, --version gibt Versionsinformation aus\n" "\n" "-d, --device-settings datei lädt Geräteeinstellungen von datei\n" "\n" "-s, --scan starte im Scanmodus\n" "-c, --copy starte im Kopiermodus\n" "-f, --fax starte im Faxmodus\n" "-n, --no-mode-selection deaktiviere Modusauswahl\n" "\n" "-F, --Fixed Hauptfenstergröße ist fest\n" "-R, --Resizeable Hauptfenstergröße ist veränderbar\n" "\n" "--display X11-display lenkt X-Ausgabe auf X11-display um\n" "--no-xshm keine shared memory Bilder benutzen\n" "--sync fordert synchrone Verbindung zum X-Server an"
+
+#original text: "Front-end to the SANE interface"
+msgid "Front-end to the SANE interface"
+msgstr "Frontend zum SANE-Interface"
+
+#original text: "This function provides access to scanners and other image acquisition devices through the SANE (Scanner Access Now Easy) interface."
+msgid "This function provides access to scanners and other image acquisition devices through the SANE (Scanner Access Now Easy) interface."
+msgstr "Diese Funktion gibt Zugang zu Scannern und anderen bilderzeugenden Geräten durch das SANE (Scanner Access Now Easy) Interface"
+
+#original text: "<Toolbox>/File/Acquire/XSane: "
+msgid "<Toolbox>/File/Acquire/XSane: "
+msgstr "<Toolbox>/File/Acquire/XSane: "
+
+#original text: "<Toolbox>/Xtns/XSane/"
+msgid "<Toolbox>/Xtns/XSane/"
+msgstr "<Toolbox>/Xtns/XSane/"
+
+#original text: "<Toolbox>/File/Acquire/XSane: Device dialog..."
+msgid "<Toolbox>/File/Acquire/XSane: Device dialog..."
+msgstr "<Toolbox>/File/Acquire/XSane: Geräteauswahl"
+
+#original text: "<Toolbox>/Xtns/XSane/Device dialog..."
+msgid "<Toolbox>/Xtns/XSane/Device dialog..."
+msgstr "<Toolbox>/Xtns/XSane/Geräteauswahl"
+
+
+#original text: "flatbed scanner"
+msgid "flatbed scanner"
+msgstr "Flachbettscanner"
+
+#original text: "frame grabber"
+msgid "frame grabber"
+msgstr "Framegrabber"
+
+#original text: "handheld scanner"
+msgid "handheld scanner"
+msgstr "Handscanner"
+
+#original text: "still camera"
+msgid "still camera"
+msgstr "Photokamera"
+
+#original text: "video camera"
+msgid "video camera"
+msgstr "Videokamera"
+
+#original text: "virtual device"
+msgid "virtual device"
+msgstr "virtuelles Gerät"
+
+
+
+#original text: "Success"
+msgid "Success"
+msgstr "Erfolg"
+
+#original text: "Operation not supported"
+msgid "Operation not supported"
+msgstr "Operation nicht unterstützt"
+
+#original text: "Operation was cancelled"
+msgid "Operation was cancelled"
+msgstr "Operation abgebrochen"
+
+#original text: "Device busy"
+msgid "Device busy"
+msgstr "Gerät besetzt"
+
+#original text: "Invalid argument"
+msgid "Invalid argument"
+msgstr "Ungültiges Argument"
+
+#original text: "End of file reached"
+msgid "End of file reached"
+msgstr "Dateiende erreicht"
+
+#original text: "Document feeder jammed"
+msgid "Document feeder jammed"
+msgstr "Dokumenteneinzug blockiert"
+
+#original text: "Document feeder out of documents"
+msgid "Document feeder out of documents"
+msgstr "Documenteneinzug ohne Papier"
+
+#original text: "Scanner cover is open"
+msgid "Scanner cover is open"
+msgstr "Scannerdeckel ist offen"
+
+#original text: "Error during device I/O"
+msgid "Error during device I/O"
+msgstr "Fehler während Geräte I/O"
+
+#original text: "Out of memory"
+msgid "Out of memory"
+msgstr "Kein Speicher"
+
+#original text: "Access to resource has been denied"
+msgid "Access to resource has been denied"
+msgstr "Zugang zum Gerät wurde verweigert"
+
diff --git a/po/de.po.in b/po/de.po.in
new file mode 100644
index 0000000..0376a83
--- /dev/null
+++ b/po/de.po.in
@@ -0,0 +1,1230 @@
+#include "../frontend/xsane-text.h"
+#define _(x) x
+
+#nls translation file for xsane
+#language: german (de)
+#by Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+
+#original text: "About"
+msgid WINDOW_ABOUT
+msgstr "Über"
+
+#original text: "authorization"
+msgid WINDOW_AUTHORIZE
+msgstr "Autorisation"
+
+#original text: "info"
+msgid WINDOW_INFO
+msgstr "Informationen"
+
+#original text: "batch scan"
+msgid WINDOW_BATCH_SCAN
+msgstr "Stapel Scan"
+
+#original text: "fax project"
+msgid WINDOW_FAX_PROJECT
+msgstr "Faxprojekt"
+
+#original text: "rename fax page"
+msgid WINDOW_FAX_RENAME
+msgstr "Faxseite umbenennen"
+
+#original text: "setup"
+msgid WINDOW_SETUP
+msgstr "Konfiguration"
+
+#original text: "Histogram"
+msgid WINDOW_HISTOGRAM
+msgstr "Histogramm"
+
+#original text: "Standard options"
+msgid WINDOW_STANDARD_OPTIONS
+msgstr "Standard Optionen"
+
+#original text: "Advanced options"
+msgid WINDOW_ADVANCED_OPTIONS
+msgstr "Erweiterte Optionen"
+
+#original text: "device selection"
+msgid WINDOW_DEVICE_SELECTION
+msgstr "Geräteauswahl"
+
+#original text: "Preview"
+msgid WINDOW_PREVIEW
+msgstr "Vorschau"
+
+#original text: "output filename"
+msgid WINDOW_OUTPUT_FILENAME
+msgstr "Ausgabedatei"
+
+#original text: "save device settings"
+msgid WINDOW_SAVE_SETTINGS
+msgstr "Speichere Geräteeinstellungen"
+
+#original text: "load device settings"
+msgid WINDOW_LOAD_SETTINGS
+msgstr "Lade Geräteeinstellungen"
+
+#original text: "File"
+msgid MENU_FILE
+msgstr "Datei"
+
+#original text: "Preferences"
+msgid MENU_PREFERENCES
+msgstr "Einstellungen"
+
+#original text: "View"
+msgid MENU_VIEW
+msgstr "Ansicht"
+
+#original text: "Help"
+msgid MENU_HELP
+msgstr "Hilfe"
+
+#original text: "About"
+msgid MENU_ITEM_ABOUT
+msgstr "Über"
+
+#original text: "Info"
+msgid MENU_ITEM_INFO
+msgstr "Informationen"
+
+#original text: "Exit"
+msgid MENU_ITEM_EXIT
+msgstr "Beenden"
+
+#original text: "Raw image"
+msgid FRAME_RAW_IMAGE
+msgstr "Rohbild"
+
+#original text: "Enhanced image"
+msgid FRAME_ENHANCED_IMAGE
+msgstr "Verbessertes Bild"
+
+#original text: "Start"
+msgid BUTTON_START
+msgstr "Start"
+
+#original text: "Ok"
+msgid BUTTON_OK
+msgstr "OK"
+
+#original text: "Apply"
+msgid BUTTON_APPLY
+msgstr "Anwenden"
+
+#original text: "Cancel"
+msgid BUTTON_CANCEL
+msgstr "Abbrechen"
+
+#original text: "Close"
+msgid BUTTON_CLOSE
+msgstr "Schließen"
+
+#original text: "Overwrite"
+msgid BUTTON_OVERWRITE
+msgstr "Überschreiben"
+
+#original text: "Add area"
+msgid BUTTON_ADD_AREA
+msgstr "Bereich hinzufügen"
+
+#original text: "Delete"
+msgid BUTTON_DELETE
+msgstr "Löschen"
+
+#original text: "Show"
+msgid BUTTON_SHOW
+msgstr "Anzeigen"
+
+#original text: "Rename"
+msgid BUTTON_RENAME
+msgstr "Umbenennen"
+
+#original text: "Create project"
+msgid BUTTON_CREATE_PROJECT
+msgstr "Projekt erstellen"
+
+#original text: "Send project"
+msgid BUTTON_SEND_PROJECT
+msgstr "Projekt senden"
+
+#original text: "Delete project"
+msgid BUTTON_DELETE_PROJECT
+msgstr "Projekt löschen"
+
+#original text: "Add printer"
+msgid BUTTON_ADD_PRINTER
+msgstr "Drucker hinzufügen"
+
+#original text: "Delete printer"
+msgid BUTTON_DELETE_PRINTER
+msgstr "Drucker löschen"
+
+#original text: "Acquire Preview"
+msgid BUTTON_PREVIEW_ACQUIRE
+msgstr "Vorschauscan"
+
+#original text: "Cancel Preview"
+msgid BUTTON_PREVIEW_CANCEL
+msgstr "Vorschauscan abbrechen"
+
+#original text: "Fine mode"
+msgid RADIO_BUTTON_FINE_MODE
+msgstr "Fein-Modus"
+
+#original text: "Overwrite warning"
+msgid RADIO_BUTTON_OVERWRITE_WARNING
+msgstr "Überschreibwarnung"
+
+#original text: "Increase filename counter"
+msgid RADIO_BUTTON_INCREASE_COUNTER
+msgstr "Dateinamenzähler erhöhen"
+
+#original text: "Skip existing numbers"
+msgid RADIO_BUTTON_SKIP_EXISTING_NRS
+msgstr "Existierende Werte überspringen"
+
+#original text: "Main window size fixed"
+msgid RADIO_BUTTON_WINDOW_FIXED
+msgstr "Feste Hauptfenstergröße"
+
+#original text: "Preserve preview image"
+msgid RADIO_BUTTON_PRESERVE_PRVIEW
+msgstr "Behalte Vorschaubild"
+
+#original text: "Use private colormap"
+msgid RADIO_BUTTON_PRIVATE_COLORMAP
+msgstr "Benutze eigene Farbpalette"
+
+#original text: "Available devices:"
+msgid TEXT_AVAILABLE_DEVICES
+msgstr "Erreichbare Geräte:"
+
+#original text: "XSane options"
+msgid TEXT_XSANE_OPTIONS
+msgstr "XSane Optionen"
+
+#original text: "XSane mode"
+msgid TEXT_XSANE_MODE
+msgstr "XSane Modus"
+
+#original text: "Scanner and backend:"
+msgid TEXT_SCANNER_BACKEND
+msgstr "Scanner und Backends"
+
+#original text: "Vendor:"
+msgid TEXT_VENDOR
+msgstr "Hersteller:"
+
+#original text: "Model:"
+msgid TEXT_MODEL
+msgstr "Modell:"
+
+#original text: "Type:"
+msgid TEXT_TYPE
+msgstr "Typ:"
+
+#original text: "Device:"
+msgid TEXT_DEVICE
+msgstr "Gerät:"
+
+#original text: "Loaded backend:"
+msgid TEXT_LOADED_BACKEND
+msgstr "Geladenes Backend:"
+
+#original text: "Sane version:"
+msgid TEXT_SANE_VERSION
+msgstr "sane Version:"
+
+#original text: "Recent values:"
+msgid TEXT_RECENT_VALUES
+msgstr "Aktuelle Werte:"
+
+#original text: "Gamma correction by:"
+msgid TEXT_GAMMA_CORR_BY
+msgstr "Gammakorrektur durch:"
+
+#original text: "scanner"
+msgid TEXT_SCANNER
+msgstr "Scanner"
+
+#original text: "software (xsane)"
+msgid TEXT_SOFTWARE_XSANE
+msgstr "Software (xsane)"
+
+#original text: "none"
+msgid TEXT_NONE
+msgstr "keine"
+
+#original text: "Gamma input depth:"
+msgid TEXT_GAMMA_INPUT_DEPTH
+msgstr "Bittiefe Gammaeingabe:"
+
+#original text: "Gamma output depth:"
+msgid TEXT_GAMMA_OUTPUT_DEPTH
+msgstr "Bittiefe Gammaausgabe:"
+
+#original text: "Scanner output depth:"
+msgid TEXT_SCANNER_OUTPUT_DEPTH
+msgstr "Bittieffe Scannerausgabe:"
+
+#original text: "XSane output formats:"
+msgid TEXT_OUTPUT_FORMATS
+msgstr "XSane Ausgabeformate:"
+
+#original text: "8 bit output formats:"
+msgid TEXT_8BIT_FORMATS
+msgstr "8 Bit Ausgabeformate:"
+
+#original text: "16 bit output formats:"
+msgid TEXT_16BIT_FORMATS
+msgstr "16 Bit Ausgabeformate:"
+
+#original text: "Authorization required for"
+msgid TEXT_AUTHORIZATION_REQ
+msgstr "Autorisation benötigt für"
+
+#original text: "Username :"
+msgid TEXT_USERNAME
+msgstr "Benutzername:"
+
+#original text: "Password :"
+msgid TEXT_PASSWORD
+msgstr "Passwort:"
+
+#original text: "Invalid parameters."
+msgid TEXT_INVALID_PARAMS
+msgstr "Ungültige Parameter"
+
+#original text: "version:"
+msgid TEXT_VERSION
+msgstr "Version:"
+
+#original text: "package"
+msgid TEXT_PACKAGE
+msgstr "Paket"
+
+#original text: "with GIMP support"
+msgid TEXT_WITH_GIMP_SUPPORT
+msgstr "mit GIMP-Unterstützung"
+
+#original text: "without GIMP support"
+msgid TEXT_WITHOUT_GIMP_SUPPORT
+msgstr "ohne GIMP-Unterstützung"
+
+#original text: "compiled with GIMP-"
+msgid TEXT_GIMP_VERSION
+msgstr "übersetzt mit GIMP-"
+
+#original text: "unknown"
+msgid TEXT_UNKNOWN
+msgstr "unbekannt"
+
+#original text: "Email:"
+msgid TEXT_EMAIL
+msgstr "E-Mail:"
+
+#original text: "File:"
+msgid TEXT_FILE
+msgstr "Datei:"
+
+#original text: "0x0: 0KB"
+msgid TEXT_INFO_BOX
+msgstr "0x0: 0KB"
+
+#original text: "Printer selection:"
+msgid TEXT_SETUP_PRINTER_SEL
+msgstr "Druckerauswahl:"
+
+#original text: "Name:"
+msgid TEXT_SETUP_PRINTER_NAME
+msgstr "Name:"
+
+#original text: "Command:"
+msgid TEXT_SETUP_PRINTER_CMD
+msgstr "Befehl:"
+
+#original text: "Copy number option:"
+msgid TEXT_SETUP_COPY_NR_OPT
+msgstr "Option for Anzahl der Kopien:"
+
+#original text: "Resolution (dpi):"
+msgid TEXT_SETUP_PRINTER_RES
+msgstr "Auflösung (dpi):"
+
+#original text: "Width (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_WIDTH
+msgstr "Breite (1/72 Zoll):"
+
+#original text: "Height (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_HEIGHT
+msgstr "Höhe (1/72 Zoll):"
+
+#original text: "Left offset (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_LEFT
+msgstr "Linker Rand (1/72 Zoll):"
+
+#original text: "Bottom offset (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_BOTTOM
+msgstr "Unterer Rand (1/72 Zoll):"
+
+#original text: "Printer gamma value:"
+msgid TEXT_SETUP_PRINTER_GAMMA
+msgstr "Drucker Gammawert:"
+
+#original text: "Printer gamma red:"
+msgid TEXT_SETUP_PRINTER_GAMMA_RED
+msgstr "Drucker Gammawert rot:"
+
+#original text: "Printer gamma green:"
+msgid TEXT_SETUP_PRINTER_GAMMA_GREEN
+msgstr "Drucker Gammawert grün:"
+
+#original text: "Printer gamma blue:"
+msgid TEXT_SETUP_PRINTER_GAMMA_BLUE
+msgstr "Drucker Gammawert blau:"
+
+#original text: "JPEG image quality"
+msgid TEXT_SETUP_JPEG_QUALITY
+msgstr "JPEG Bildqualität"
+
+#original text: "PNG image compression"
+msgid TEXT_SETUP_PNG_COMPRESSION
+msgstr "PNG Bildkompression"
+
+#original text: "TIFF multi bit image compression"
+msgid TEXT_SETUP_TIFF_COMPRESSION
+msgstr "TIFF multibit Bildkompression"
+
+#original text: "TIFF lineart image compression"
+msgid TEXT_SETUP_TIFF_COMPRESSION_1
+msgstr "TIFF lineart Bildkompression"
+
+#original text: "Preview gamma:"
+msgid TEXT_SETUP_PREVIEW_GAMMA
+msgstr "Vorschau Gamma:"
+
+#original text: "Preview gamma red:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_RED
+msgstr "Vorschau Gamma rot:"
+
+#original text: "Preview gamma green:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_GREEN
+msgstr "Vorschau Gamma grün:"
+
+#original text: "Preview gamma blue:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_BLUE
+msgstr "Vorschau Gamma blau:"
+
+#original text: "Helpfile viewer (HTML):"
+msgid TEXT_SETUP_HELPFILE_VIEWER
+msgstr "Hilfedatei Betrachter (HTML):"
+
+#original text: "Command:"
+msgid TEXT_SETUP_FAX_COMMAND
+msgstr "Befehl:"
+
+#original text: "Receiver option:"
+msgid TEXT_SETUP_FAX_RECEIVER_OPTION
+msgstr "Option für Empfängernummer"
+
+#original text: "Postscriptfile option:"
+msgid TEXT_SETUP_FAX_POSTSCRIPT_OPT
+msgstr "Option für Postscriptdatei:"
+
+#original text: "Normal mode option:"
+msgid TEXT_SETUP_FAX_NORMAL_MODE_OPT
+msgstr "Option für Normalmodus:"
+
+#original text: "Fine mode option:"
+msgid TEXT_SETUP_FAX_FINE_MODE_OPT
+msgstr "Option für Feinmodus:"
+
+#original text: "Viewer (Postscript):"
+msgid TEXT_SETUP_FAX_VIEWER
+msgstr "Betrachter (Postscript):"
+
+#original text: "Copy options"
+msgid NOTEBOOK_COPY_OPTIONS
+msgstr "Photokopie"
+
+#original text: "Saving options"
+msgid NOTEBOOK_SAVING_OPTIONS
+msgstr "Speichern"
+
+#original text: "Display options"
+msgid NOTEBOOK_DISPLAY_OPTIONS
+msgstr "Darstellung"
+
+#original text: "Fax options"
+msgid NOTEBOOK_FAX_OPTIONS
+msgstr "Fax"
+
+#original text: "Scan"
+msgid MENU_ITEM_SCAN
+msgstr "Scannen"
+
+#original text: "Copy"
+msgid MENU_ITEM_COPY
+msgstr "Kopieren"
+
+#original text: "Fax"
+msgid MENU_ITEM_FAX
+msgstr "Faxen"
+
+#original text: "Setup"
+msgid MENU_ITEM_SETUP
+msgstr "Konfiguration"
+
+#original text: "Show tooltips"
+msgid MENU_ITEM_SHOW_TOOLTIPS
+msgstr "Zeige Tipps"
+
+#original text: "Show preview"
+msgid MENU_ITEM_SHOW_PREVIEW
+msgstr "Zeige Vorschau"
+
+#original text: "Show histogram"
+msgid MENU_ITEM_SHOW_HISTOGRAM
+msgstr "Zeige Histogramm"
+
+#original text: "Show standard options"
+msgid MENU_ITEM_SHOW_STANDARDOPTIONS
+msgstr "Zeige Standardoptionen"
+
+#original text: "Show advanced options"
+msgid MENU_ITEM_SHOW_ADVANCEDOPTIONS
+msgstr "Zeige erweiterte Optionen"
+
+#original text: "Show resolution list"
+msgid MENU_ITEM_SHOW_RESOLUTIONLIST
+msgstr "Zeige Auflösungsliste"
+
+#original text: "Length unit"
+msgid MENU_ITEM_LENGTH_UNIT
+msgstr "Längeneinheit"
+
+#original text: "millimeters"
+msgid SUBMENU_ITEM_LENGTH_MILLIMETERS
+msgstr "Millimeter"
+
+#original text: "centimeters"
+msgid SUBMENU_ITEM_LENGTH_CENTIMETERS
+msgstr "Zentimeter"
+
+#original text: "inches"
+msgid SUBMENU_ITEM_LENGTH_INCHES
+msgstr "Zoll"
+
+#original text: "Save device settings"
+msgid MENU_ITEM_SAVE_DEVICE_SETTINGS
+msgstr "Speichere Geräteeinstellungen"
+
+#original text: "Load device settings"
+msgid MENU_ITEM_LOAD_DEVICE_SETTINGS
+msgstr "Lade Geräteeinstellungen"
+
+#original text: "Xsane doc"
+msgid MENU_ITEM_XSANE_DOC
+msgstr "XSane Anleitung"
+
+#original text: "Backend doc"
+msgid MENU_ITEM_BACKEND_DOC
+msgstr "Backend Anleitung"
+
+#original text: "Available backends"
+msgid MENU_ITEM_AVAILABLE_BACKENDS
+msgstr "Erreichbare Backends"
+
+#original text: "Scantips"
+msgid MENU_ITEM_SCANTIPS
+msgstr "Scantipps"
+
+#original text: "Problems?"
+msgid MENU_ITEM_PROBLEMS
+msgstr "Probleme?"
+
+#original text: "no compression"
+msgid MENU_ITEM_TIFF_COMP_NONE
+msgstr "keine Kompression"
+
+#original text: "CCITT 1D Huffman compression"
+msgid MENU_ITEM_TIFF_COMP_CCITTRLE
+msgstr "CCITT 1D Huffman Kompression"
+
+#original text: "CCITT Group 3 Fax compression"
+msgid MENU_ITEM_TIFF_COMP_CCITFAX3
+msgstr "CCITT Gruppe 3 Fax Kompression"
+
+#original text: "CCITT Group 4 Fax compression"
+msgid MENU_ITEM_TIFF_COMP_CCITFAX4
+msgstr "CCITT Gruppe 4 Fax Kompression"
+
+#original text: "JPEG DCT compression"
+msgid MENU_ITEM_TIFF_COMP_JPEG
+msgstr "JPEG DCT Kompression"
+
+#original text: "pack bits"
+msgid MENU_ITEM_TIFF_COMP_PACKBITS
+msgstr "gepackte Bits"
+
+#original text: "by ext"
+msgid MENU_ITEM_FILETYPE_BY_EXT
+msgstr "nach Erw"
+
+#original text: "Saving image"
+msgid PROGRESS_SAVING
+msgstr "Speichere Bild"
+
+#original text: "Saving fax image"
+msgid PROGRESS_SAVING_FAX
+msgstr "Speichere Faxbild"
+
+#original text: "Converting data...."
+msgid PROGRESS_CONVERTING_DATA
+msgstr "Konvertiere Daten..."
+
+#original text: "Converting to postscript"
+msgid PROGRESS_CONVERTING_PS
+msgstr "Konvertiere nach Postscript"
+
+#original text: "Scanning"
+msgid PROGRESS_SCANNING
+msgstr "Scanne"
+
+#original text: "Receiving %s data for `%s'..."
+msgid PROGRESS_RECEIVING_SCAN
+msgstr "Empfange %s Daten für `%s'..."
+
+#original text: "Receiving %s data for photocopy ..."
+msgid PROGRESS_RECEIVING_COPY
+msgstr "Empfange %s Daten für Photokopie"
+
+#original text: "Receiving %s data for fax ..."
+msgid PROGRESS_RECEIVING_FAX
+msgstr "Empfange %s Daten für Fax ..."
+
+#original text: "Receiving %s data for GIMP..."
+msgid PROGRESS_RECEIVING_GIMP
+msgstr "Empfange %s Daten für GIMP..."
+
+#original text: "Use XSane for SCANning, photoCOPYing, FAXing..."
+msgid DESC_XSANE_MODE
+msgstr "Benutze XSane zum Scannen, Kopieren oder Faxen"
+
+#original text: "Browse for image filename"
+msgid DESC_BROWSE_FILENAME
+msgstr "Suche nach Bild-Dateinamen"
+
+#original text: "Filename for scanned image"
+msgid DESC_FILENAME
+msgstr "Dateiname für gescanntes Bild"
+
+#original text: "Filename extension and type of image format"
+msgid DESC_FILETYPE
+msgstr "Dateinamenerweiterung und Format der Bilddatei"
+
+#original text: "Enter name of fax project"
+msgid DESC_FAXPROJECT
+msgstr "Name des Faxprojekts"
+
+#original text: "Enter new name for faxpage"
+msgid DESC_FAXPAGENAME
+msgstr "Name der Faxseite eingeben"
+
+#original text: "Enter receiver phone number or address"
+msgid DESC_FAXRECEIVER
+msgstr "Telephonnummer des Empfängers eingeben"
+
+#original text: "Select printer definition"
+msgid DESC_PRINTER_SELECT
+msgstr "Wähle Druckerdefinition"
+
+#original text: "Set scan resolution"
+msgid DESC_RESOLUTION
+msgstr "Bestimmt die Scanauflösung"
+
+#original text: "Set zoomfactor"
+msgid DESC_ZOOM
+msgstr "Bestimmt den Vergrößerungsfaktor"
+
+#original text: "Set number of copies"
+msgid DESC_COPY_NUMBER
+msgstr "Bestimmt die Anzahl der Kopien"
+
+#original text: "Negative: Invert colors for scanning negatives\n" "e.g. swap black and white"
+msgid DESC_NEGATIVE
+msgstr "Negativ: Invertiere Farben, zum Scannen von Negativen"
+
+#original text: "Set gamma value"
+msgid DESC_GAMMA
+msgstr "Bestimmt Gammawert"
+
+#original text: "Set gamma value for red component"
+msgid DESC_GAMMA_R
+msgstr "Bestimmt Gammawert für rote Komponente"
+
+#original text: "Set gamma value for green component"
+msgid DESC_GAMMA_G
+msgstr "Bestimmt Gammawert für grüne Komponente"
+
+#original text: "Set gamma value for blue component"
+msgid DESC_GAMMA_B
+msgstr "Bestimmt Gammawert für blaue Komponente"
+
+#original text: "Set brightness"
+msgid DESC_BRIGHTNESS
+msgstr "Bestimmt Helligkeit"
+
+#original text: "Set brightness for red component"
+msgid DESC_BRIGHTNESS_R
+msgstr "Bestimmt Helligkeit für rote Komponente"
+
+#original text: "Set brightness for green component"
+msgid DESC_BRIGHTNESS_G
+msgstr "Bestimmt Helligkeit für grüne Komponente"
+
+#original text: "Set brightness for blue component"
+msgid DESC_BRIGHTNESS_B
+msgstr "Bestimmt Helligkeit für blaue Komponente"
+
+#original text: "Set contrast"
+msgid DESC_CONTRAST
+msgstr "Bestimmt Kontrast"
+
+#original text: "Set contrast for red component"
+msgid DESC_CONTRAST_R
+msgstr "Bestimmt Kontrast für rote Komponente"
+
+#original text: "Set contrast for green component"
+msgid DESC_CONTRAST_G
+msgstr "Bestimmt Kontrast für grüne Komponente"
+
+#original text: "Set contrast for blue component"
+msgid DESC_CONTRAST_B
+msgstr "Bestimmt Kontrast für blaue Komponente"
+
+#original text: "RGB default: Set enhancement values for red, green and blue to default values:\n" " gamma = 1.0\n" " brightness = 0\n" " contrast = 0"
+msgid DESC_RGB_DEFAULT
+msgstr "RGB Standard: Setzt Farbverbesserungswerte für rot, grün und blau auf Standardwerte:\n" "Gamma = 1.0\n" "Helligkeit = 0\n" "Kontrast = 0"
+
+#original text: "Autoadjust gamma, brightness and contrast in dependance of selected area"
+msgid DESC_ENH_AUTO
+msgstr "Automatische Berechnung für Gamma, Helligkeit und Kontrast in Abhängigkeit vom ausgewählten Bereich"
+
+#original text: "Set default enhancement values:\n" "gamma = 1.0\n" "brightness = 0\n" "contrast = 0"
+msgid DESC_ENH_DEFAULT
+msgstr "Setze Standardwerte für Farbverbesserung:\n" "Gamma = 1.0\n" "Helligkeit = 0\n" "Kontrast = 0"
+
+#original text: "Restore enhancement values from preferences"
+msgid DESC_ENH_RESTORE
+msgstr "Lade Farbverbesserungswerte aus Einstellungen"
+
+#original text: "Store active enhancement values to preferences"
+msgid DESC_ENH_STORE
+msgstr "Speichere Farbverbesserungswerte in Einstellungen"
+
+#original text: "Show histogram of intensity/gray"
+msgid DESC_HIST_INTENSITY
+msgstr "Zeige Histogramm für Intensität/grau"
+
+#original text: "Show histogram of red component"
+msgid DESC_HIST_RED
+msgstr "Zeige Histogramm für rote Komponente"
+
+#original text: "Show histogram of green component"
+msgid DESC_HIST_GREEN
+msgstr "Zeige Histogramm für grüne Komponente"
+
+#original text: "Show histogram of blue component"
+msgid DESC_HIST_BLUE
+msgstr "Zeige Histogramm für blaue Komponente"
+
+#original text: "Display histogram with lines instead of pixels"
+msgid DESC_HIST_PIXEL
+msgstr "Zeichne Histogramm mit Linien anstatt mit Punkten"
+
+#original text: "Show logarithm of pixelcount"
+msgid DESC_HIST_LOG
+msgstr "Benutze Logarithmus der Pixelzahlen"
+
+#original text: "Select definition to change"
+msgid DESC_PRINTER_SETUP
+msgstr "Auswahl der zu ändernden Definition"
+
+#original text: "Define a name for the selection of this definition"
+msgid DESC_PRINTER_NAME
+msgstr "Namen der Definition"
+
+#original text: "Enter command to be executed in copy mode (e.g. \"lpr -\")"
+msgid DESC_PRINTER_COMMAND
+msgstr "Befehl der im Kopiermodus zum Drucken ausgeführt werden soll (z.B. \"lpr -\")"
+
+#original text: "Enter option for copy numbers"
+msgid DESC_COPY_NUMBER_OPTION
+msgstr "Option, mit der die Anzahl der Kopien angegeben wird"
+
+#original text: "Resolution with which images are printed and saved in postscript"
+msgid DESC_PRINTER_RESOLUTION
+msgstr "Auflösung, mit der Bilder gedrucht und im Postscriptformat gespeichert werden"
+
+#original text: "Width of printable area in 1/72 inch"
+msgid DESC_PRINTER_WIDTH
+msgstr "Breite des druckbaren Bereichs in 1/72 Zoll"
+
+#original text: "Height of printable area in 1/72 inch"
+msgid DESC_PRINTER_HEIGHT
+msgstr "Höhe des druckbaren Bereichs in 1/72 Zoll"
+
+#original text: "Left offset from the edge of the paper to the printable area in 1/72 inch"
+msgid DESC_PRINTER_LEFTOFFSET
+msgstr "Abstand vom linken Papierrand zum Beginn des druckbaren Bereichs in 1/72 Zoll"
+
+#original text: "Bottom offset from the edge of the paper to the printable area in 1/72 inch"
+msgid DESC_PRINTER_BOTTOMOFFSET
+msgstr "Abstand vom unteren Papierrand zum Beginn des druckbaren Bereichs in 1/72 Zoll"
+
+#original text: "Additional gamma value for photocopy"
+msgid DESC_PRINTER_GAMMA
+msgstr "Zusätzlicher Gammawert beim Photokopieren"
+
+#original text: "Additional gamma value for red component for photocopy"
+msgid DESC_PRINTER_GAMMA_RED
+msgstr "Zusätzlicher Gammawert für rote Komponente beim Photokopieren"
+
+#original text: "Additional gamma value for green component for photocopy"
+msgid DESC_PRINTER_GAMMA_GREEN
+msgstr "Zusätzlicher Gammawert für grüne Komponente beim Photokopieren"
+
+#original text: "Additional gamma value for blue component for photocopy"
+msgid DESC_PRINTER_GAMMA_BLUE
+msgstr "Zusätzlicher Gammawert für blaue Komponente beim Photokopieren"
+
+#original text: "Quality in percent if image is saved as jpeg or tiff with jpeg compression"
+msgid DESC_JPEG_QUALITY
+msgstr "Qualität in Prozent wenn Bild als JPEG oder als TIFF mit JPEG-Kompression gespeichert wird"
+
+#original text: "Compression if image is saved as png"
+msgid DESC_PNG_COMPRESSION
+msgstr "Kompression wenn Bild im PNG-Format gespeichert wird"
+
+#original text: "Compression type if multi bit image is saved as tiff"
+msgid DESC_TIFF_COMPRESSION
+msgstr "Kompression wenn multibit Bild im TIFF-Format gespeichert wird"
+
+#original text: "Compression type if lineart image is saved as tiff"
+msgid DESC_TIFF_COMPRESSION_1
+msgstr "Kompression wenn lineart Bild im TIFF-Format gespeichert wird"
+
+#original text: "Warn before overwriting an existing file"
+msgid DESC_OVERWRITE_WARNING
+msgstr "Warne vorm Überschreiben exisitierender Dateien"
+
+#original text: "If the filename is of the form \"name-001.ext\" " "(where the number of digits is free) " "the number is increased after a scan is finished"
+msgid DESC_INCREASE_COUNTER
+msgstr "... wenn der Dateiname folgender Form ist: \"name-001.erw\""
+
+#original text: "If filename counter is automatically increased, used numbers are skipped"
+msgid DESC_SKIP_EXISTING
+msgstr "Wenn der Dateinamenzähler automatisch erhöht wird, werden benutzte Dateinummern übersprungen"
+
+#original text: "Use fixed main window size or scrolled, resizable main window"
+msgid DESC_MAIN_WINDOW_FIXED
+msgstr "Verwende feste oder veränderbare Hauptfenstergröße"
+
+#original text: "Preserve preview image for next program start"
+msgid DESC_PREVIEW_PRESERVE
+msgstr "Behalte Vorschaubild für nächsten Programmstart"
+
+#original text: "Use an own colormap for preview if display depth is 8 bpp"
+msgid DESC_PREVIEW_COLORMAP
+msgstr "Benutze eigene Farbpalette für Vorscahubild, wenn die Bildschirmfarbtiefe 8 Bit beträgt"
+
+#original text: "Set gamma correction value for preview image"
+msgid DESC_PREVIEW_GAMMA
+msgstr "Bestimme Gammwert für Vorschaubild"
+
+#original text: "Set gamma correction value for red component of preview image"
+msgid DESC_PREVIEW_GAMMA_RED
+msgstr "Bestimme Gammwert der roten Komponente für Vorschaubild"
+
+#original text: "Set gamma correction value for green component of preview image"
+msgid DESC_PREVIEW_GAMMA_GREEN
+msgstr "Bestimme Gammwert der grünen Komponente für Vorschaubild"
+
+#original text: "Set gamma correction value for blue component of preview image"
+msgid DESC_PREVIEW_GAMMA_BLUE
+msgstr "Bestimme Gammwert der blauen Komponente für Vorschaubild"
+
+#original text: "Enter command to be executed to display helpfiles, must be a html-viewer!"
+msgid DESC_DOC_VIEWER
+msgstr "Befehl, der ausgeführt werden soll, um Hilfedateien anzuzeigen, muß ein HTML-Betrachter sein!"
+
+#original text: "Enter command to be executed in fax mode"
+msgid DESC_FAX_COMMAND
+msgstr "Befehl, der zum Senden eines Faxprojekts ausgeführt werden soll"
+
+#original text: "Enter option to specify receiver"
+msgid DESC_FAX_RECEIVER_OPT
+msgstr "Option, mit der die Empfängertelephonnumer angegeben wird"
+
+#original text: "Enter option to specify postscript files following"
+msgid DESC_FAX_POSTSCRIPT_OPT
+msgstr "Option, mit der angegeben wird, dass der Dateiname einer Postscriptdatei folgt"
+
+#original text: "Enter option to specify normal mode (low resolution)"
+msgid DESC_FAX_NORMAL_OPT
+msgstr "Option, mit der die vertikale Auflösung auf 98 lpi gestellt wird"
+
+#original text: "Enter option to specify fine mode (high resolution)"
+msgid DESC_FAX_FINE_OPT
+msgstr "Option, mit der die vertikale Auflösung auf 196 lpi gestellt wird"
+
+#original text: "Enter command to be executed to view a fax"
+msgid DESC_FAX_VIEWER
+msgstr "Befehl, der ausgeführt werden soll, um Faxseiten(Postscript) anzuzeigen"
+
+#original text: "Use high vertical resolution (196 lpi instead of 98 lpi)"
+msgid DESC_FAX_FINE_MODE
+msgstr "Benutze hohe vertikale Auflösung (196 lpi)"
+
+#original text: "Pick white point"
+msgid DESC_PIPETTE_WHITE
+msgstr "Wähle weißen Punkt"
+
+#original text: "Pick gray point"
+msgid DESC_PIPETTE_GRAY
+msgstr "Wähle grauen Punkt"
+
+#original text: "Pick black point"
+msgid DESC_PIPETTE_BLACK
+msgstr "Wähle schwarzen Punkt"
+
+#original text: "Use full scanarea"
+msgid DESC_ZOOM_FULL
+msgstr "Zoomt auf kompletten Scanbereich"
+
+#original text: "Zoom 20% out"
+msgid DESC_ZOOM_OUT
+msgstr "Zoomt um 20% heraus"
+
+#original text: "Zoom into selected area"
+msgid DESC_ZOOM_IN
+msgstr "Zoomt in den gewählten Bereich hinein"
+
+#original text: "Undo last zoom"
+msgid DESC_ZOOM_UNDO
+msgstr "letzten Zoom rückgängig machen"
+
+#original text: "Select visible area"
+msgid DESC_FULL_PREVIEW_AREA
+msgstr "Sichtbaren Bereich auswählen"
+
+#original text: "Failed to determine home directory:"
+msgid ERR_HOME_DIR
+msgstr "Konnte Heimatverzeichnis nicht bestimmen"
+
+#original text: "Filename too long"
+msgid ERR_FILENAME_TOO_LONG
+msgstr "Dateiname zu lang"
+
+#original text: "Failed to set value of option"
+msgid ERR_SET_OPTION
+msgstr "Fehler beim Ändern der Option"
+
+#original text: "Failed to obtain value of option"
+msgid ERR_GET_OPTION
+msgstr "Fehler beim Lesen der Option"
+
+#original text: "Error obtaining option count"
+msgid ERR_OPTION_COUNT
+msgstr "Konnte Anzahl der Optionen nicht bestimmen"
+
+#original text: "Failed to open device"
+msgid ERR_DEVICE_OPEN_FAILED
+msgstr "Fehler beim Öffnen des Geräts"
+
+#original text: "no devices available"
+msgid ERR_NO_DEVICES
+msgstr "Keine Geräte erreichbar"
+
+#original text: "Error during read:"
+msgid ERR_DURING_READ
+msgstr "Fehler beim Lesen:"
+
+#original text: "Error during save:"
+msgid ERR_DURING_SAVE
+msgstr "Fehler beim Speichern:"
+
+#original text: "Can't handle depth"
+msgid ERR_BAD_DEPTH
+msgstr "Nicht unterstützte Bittiefe"
+
+#original text: "GIMP can't handle depth"
+msgid ERR_GIMP_BAD_DEPTH
+msgstr "GIMP Modus: nicht unterstützt Bittieffe"
+
+#original text: "Unknown file format for saving"
+msgid ERR_UNKNOWN_SAVING_FORMAT
+msgstr "Unbekanntes Ausgabedateiformat"
+
+#original text: "Failed to open"
+msgid ERR_OPEN_FAILED
+msgstr "Fehler beim Öffnen von"
+
+#original text: "Failed to open pipe for executing printercommand"
+msgid ERR_FAILED_PRINTER_PIPE
+msgstr "Konnte Pipe für Druckbefehl nicht öffnen"
+
+#original text: "Failed to execute printercommand:"
+msgid ERR_FAILED_EXEC_PRINTER_CMD
+msgstr "Konnte Druckbefehl nicht ausführen"
+
+#original text: "Failed to start scanner:"
+msgid ERR_FAILED_START_SCANNER
+msgstr "Konnte Scanner nicht starten"
+
+#original text: "Failed to get parameters:"
+msgid ERR_FAILED_GET_PARAMS
+msgstr "Konnte Parameter nicht lesen"
+
+#original text: "No output format given"
+msgid ERR_NO_OUTPUT_FORMAT
+msgstr "Kein Ausgabedateiformat angegeben"
+
+#original text: "out of memory"
+msgid ERR_NO_MEM
+msgstr "Kein Speicher"
+
+#original text: "LIBTIFF reports error"
+msgid ERR_LIBTIFF
+msgstr "LIBTIFF meldet Fehler"
+
+#original text: "LIBPNG reports error"
+msgid ERR_LIBPNG
+msgstr "LIBPNG meldet Fehler"
+
+#original text: "unknown type"
+msgid ERR_UNKNOWN_TYPE
+msgstr "unbekannter Typ"
+
+#original text: "unknown constraint type"
+msgid ERR_UNKNOWN_CONSTRAINT_TYPE
+msgstr "unbekannter verpflichtender Typ"
+
+#original text: "Failed to execute documentation viewer:"
+msgid ERR_FAILD_EXEC_DOC_VIEWER
+msgstr "Konnte Hilfedateibetrachter nicht ausführen:"
+
+#original text: "Failed to execute fax viewer:"
+msgid ERR_FAILD_EXEC_FAX_VIEWER
+msgstr "Konnte Faxbetrachter nicht ausführen:"
+
+#original text: "Failed to execute faxcommand:"
+msgid ERR_FAILED_EXEC_FAX_CMD
+msgstr "Konnte Faxbefehl nicht ausführen:"
+
+#original text: "bad frame format"
+msgid ERR_BAD_FRAME_FORMAT
+msgstr "unerwartetes FRAME-Format"
+
+#original text: "unable to set resolution"
+msgid ERR_FAILED_SET_RESOLUTION
+msgstr "konnte Auflösung nicht definieren"
+
+#original text: "error"
+msgid ERR_ERROR
+msgstr "Fehler"
+
+#original text: "Sane major version number mismatch!"
+msgid ERR_MAJOR_VERSION_NR_CONFLICT
+msgstr "Sane Hauptversionsnummern-Konflikt!"
+
+#original text: "xsane major version ="
+msgid ERR_XSANE_MAJOR_VERSION
+msgstr "xsane Hauptversionsnummer ="
+
+#original text: "backend major version ="
+msgid ERR_BACKEND_MAJOR_VERSION
+msgstr "backend Hauptversionsnummer ="
+
+#original text: "*** PROGRAM ABORTED ***"
+msgid ERR_PROGRAM_ABORTED
+msgstr "*** PROGRAMM ABGEBROCHEN ***"
+
+#original text: "Failed to allocate image memory:"
+msgid ERR_FAILED_ALLOCATE_IMAGE
+msgstr "Konnte Bildspeicher nicht allozieren:"
+
+#original text: "Preview cannot handle bit depth"
+msgid ERR_PREVIEW_BAD_DEPTH
+msgstr "Vorschau kann Bittiefe nicht handhaben:"
+
+#original text: "GIMP support missing"
+msgid ERR_GIMP_SUPPORT_MISSING
+msgstr "GIMP Unterstützung fehlt"
+
+#original text: "Filename counter overflow"
+msgid WARN_COUNTER_OVERFLOW
+msgstr "Dateinamenzähler übergelaufen"
+
+#original text: "warning: option has no value constraint"
+msgid WARN_NO_VALUE_CONSTRAINT
+msgstr "Warnung: Option hat keinen vorgeschriebenen Wert"
+
+#original text: "Ok"
+msgid ERR_BUTTON_OK
+msgstr "OK"
+
+#original text: "Error"
+msgid ERR_HEADER_ERROR
+msgstr "Fehler"
+
+#original text: "Warning"
+msgid ERR_HEADER_WARNING
+msgstr "Warnung"
+
+#original text: "Failed to create file:"
+msgid ERR_FAILED_CREATE_FILE
+msgstr "Fehler beim Erstellen der Datei:"
+
+#original text: "Error while loading device settings:"
+msgid ERR_LOAD_DEVICE_SETTINGS
+msgstr "Fehler beim Laden der Geräteeinstellungen"
+
+#original text: "is not a device-rc-file !!!"
+msgid ERR_NO_DRC_FILE
+msgstr "ist keine Geräteeinstellungs-Datei !!!"
+
+#original text: "Failed to execute netscape!"
+msgid ERR_NETSCAPE_EXECUTE_FAIL
+msgstr "Konnte Netscape nicht aufrufen"
+
+#original text: "Send fax: no receiver defined"
+msgid ERR_SENDFAX_RECEIVER_MISSING
+msgstr "Fax senden: kein Empfänger angegeben"
+
+#original text: "has been created for device"
+msgid ERR_CREATED_FOR_DEVICE
+msgstr "wurde erstellt für das Gerät"
+
+#original text: "you want to use it for device"
+msgid ERR_USED_FOR_DEVICE
+msgstr "wird benutzt für das Gerät"
+
+#original text: "this may cause problems!"
+msgid ERR_MAY_CAUSE_PROBLEMS
+msgstr "das kann zu Problemen führen!"
+
+#original text: "Usage:"
+msgid TEXT_USAGE
+msgstr "Gebrauch:"
+
+#original text: "[OPTION]... [DEVICE]"
+msgid TEXT_USAGE_OPTIONS
+msgstr "[OPTION]... [GERÄTEDATEI]"
+
+#original text: "Start up graphical user interface to access SANE (Scanner Access Now Easy) devices.\n\n-h, --help display this help message and exit\n-v, --version print version information\n\n-d, --device-settings file load device settings from file (without \".drc\")\n\n-s, --scan start with scan-mode active\n-c, --copy start with copy-mode active\n-f, --fax start with fax-mode active\n-n, --no-mode-selection disable menu for xsane mode selection\n\n-F, --Fixed fixed main window size (overwrite preferences value)\n-R, --Resizeable resizable, scrolled main window (overwrite preferences value)\n\n--display X11-display redirect output to X11-display\n--no-xshm do not use shared memory images\n--sync request a synchronous connection with the X11 server"
+msgid TEXT_HELP
+msgstr "" "Startet graphisches Benutzerinterface für SANE (Scanner Access Now Easy)\n" "\n" "-h, --help zeigt diesen Hilfetext\n" "-v, --version gibt Versionsinformation aus\n" "\n" "-d, --device-settings datei lädt Geräteeinstellungen von datei\n" "\n" "-s, --scan starte im Scanmodus\n" "-c, --copy starte im Kopiermodus\n" "-f, --fax starte im Faxmodus\n" "-n, --no-mode-selection deaktiviere Modusauswahl\n" "\n" "-F, --Fixed Hauptfenstergröße ist fest\n" "-R, --Resizeable Hauptfenstergröße ist veränderbar\n" "\n" "--display X11-display lenkt X-Ausgabe auf X11-display um\n" "--no-xshm keine shared memory Bilder benutzen\n" "--sync fordert synchrone Verbindung zum X-Server an"
+
+#original text: "Front-end to the SANE interface"
+msgid XSANE_GIMP_INSTALL_BLURB
+msgstr "Frontend zum SANE-Interface"
+
+#original text: "This function provides access to scanners and other image acquisition devices through the SANE (Scanner Access Now Easy) interface."
+msgid XSANE_GIMP_INSTALL_HELP
+msgstr "Diese Funktion gibt Zugang zu Scannern und anderen bilderzeugenden Geräten durch das SANE (Scanner Access Now Easy) Interface"
+
+#original text: "<Toolbox>/File/Acquire/XSane: "
+msgid XSANE_GIMP_MENU
+msgstr "<Toolbox>/File/Acquire/XSane: "
+
+#original text: "<Toolbox>/Xtns/XSane/"
+msgid XSANE_GIMP_MENU_OLD
+msgstr "<Toolbox>/Xtns/XSane/"
+
+#original text: "<Toolbox>/File/Acquire/XSane: Device dialog..."
+msgid XSANE_GIMP_MENU_DIALOG
+msgstr "<Toolbox>/File/Acquire/XSane: Geräteauswahl"
+
+#original text: "<Toolbox>/Xtns/XSane/Device dialog..."
+msgid XSANE_GIMP_MENU_DIALOG_OLD
+msgstr "<Toolbox>/Xtns/XSane/Geräteauswahl"
+
+
+#original text: "flatbed scanner"
+msgid "flatbed scanner"
+msgstr "Flachbettscanner"
+
+#original text: "frame grabber"
+msgid "frame grabber"
+msgstr "Framegrabber"
+
+#original text: "handheld scanner"
+msgid "handheld scanner"
+msgstr "Handscanner"
+
+#original text: "still camera"
+msgid "still camera"
+msgstr "Photokamera"
+
+#original text: "video camera"
+msgid "video camera"
+msgstr "Videokamera"
+
+#original text: "virtual device"
+msgid "virtual device"
+msgstr "virtuelles Gerät"
+
+
+
+#original text: "Success"
+msgid "Success"
+msgstr "Erfolg"
+
+#original text: "Operation not supported"
+msgid "Operation not supported"
+msgstr "Operation nicht unterstützt"
+
+#original text: "Operation was cancelled"
+msgid "Operation was cancelled"
+msgstr "Operation abgebrochen"
+
+#original text: "Device busy"
+msgid "Device busy"
+msgstr "Gerät besetzt"
+
+#original text: "Invalid argument"
+msgid "Invalid argument"
+msgstr "Ungültiges Argument"
+
+#original text: "End of file reached"
+msgid "End of file reached"
+msgstr "Dateiende erreicht"
+
+#original text: "Document feeder jammed"
+msgid "Document feeder jammed"
+msgstr "Dokumenteneinzug blockiert"
+
+#original text: "Document feeder out of documents"
+msgid "Document feeder out of documents"
+msgstr "Documenteneinzug ohne Papier"
+
+#original text: "Scanner cover is open"
+msgid "Scanner cover is open"
+msgstr "Scannerdeckel ist offen"
+
+#original text: "Error during device I/O"
+msgid "Error during device I/O"
+msgstr "Fehler während Geräte I/O"
+
+#original text: "Out of memory"
+msgid "Out of memory"
+msgstr "Kein Speicher"
+
+#original text: "Access to resource has been denied"
+msgid "Access to resource has been denied"
+msgstr "Zugang zum Gerät wurde verweigert"
+
diff --git a/po/del-0.43.po.in b/po/del-0.43.po.in
new file mode 100644
index 0000000..5d99520
--- /dev/null
+++ b/po/del-0.43.po.in
@@ -0,0 +1,2 @@
+remove all LZW entries
+
diff --git a/po/del-0.44.po.in b/po/del-0.44.po.in
new file mode 100644
index 0000000..d37c848
--- /dev/null
+++ b/po/del-0.44.po.in
@@ -0,0 +1,4 @@
+Delete:
+
+NOTEBOOK_PRINTER_OPTION
+
diff --git a/po/del-0.47.po.in b/po/del-0.47.po.in
new file mode 100644
index 0000000..1b0b679
--- /dev/null
+++ b/po/del-0.47.po.in
@@ -0,0 +1,3 @@
+DELETE
+
+ERR_NETSCAPE_NOT_RUNNING
diff --git a/po/fr.gmo b/po/fr.gmo
new file mode 100644
index 0000000..b822a3a
--- /dev/null
+++ b/po/fr.gmo
Binary files differ
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 0000000..2db0b52
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,2137 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#nls translation file for xsane
+#language: french (fr)
+
+#original text: "About"
+msgid "About"
+msgstr "a propos"
+
+#original text: "authorization"
+msgid "authorization"
+msgstr "authorisation"
+
+#original text: "info"
+msgid "info"
+msgstr "info"
+
+#original text: "batch scan"
+msgid "batch scan"
+msgstr "scan en batch"
+
+#original text: "fax project"
+msgid "fax project"
+msgstr "projet fax"
+
+#original text: "rename fax page"
+msgid "rename fax page"
+msgstr "renommer la page de fax"
+
+#original text: "setup"
+msgid "setup"
+msgstr "Configuration"
+
+#original text: "Histogram"
+msgid "Histogram"
+msgstr "Histogramme"
+
+#original text: "Standard options"
+msgid "Standard options"
+msgstr "Options standards"
+
+#original text: "Advanced options"
+msgid "Advanced options"
+msgstr "Options avancées"
+
+#original text: "device selection"
+msgid "device selection"
+msgstr "sélection de périphérique"
+
+#original text: "Preview"
+msgid "Preview"
+msgstr "aperçu"
+
+#original text: "output filename"
+msgid "output filename"
+msgstr "fichier de sortie"
+
+#original text: "save device settings"
+msgid "save device settings"
+msgstr "enregistrer les paramétres du périphérique"
+
+#original text: "load device settings"
+msgid "load device settings"
+msgstr "charger les paramétres du périphérique"
+
+#original text: "File"
+msgid "File"
+msgstr "Fichier"
+
+#original text: "Preferences"
+msgid "Preferences"
+msgstr "Préférences"
+
+#original text: "Help"
+msgid "Help"
+msgstr "Aide"
+
+#original text: "About"
+msgid "About"
+msgstr "A propos"
+
+#original text: "Info"
+msgid "Info"
+msgstr "Info"
+
+#original text: "Exit"
+msgid "Exit"
+msgstr "Quitter"
+
+#original text: "Raw image"
+msgid "Raw image"
+msgstr "Image brute"
+
+#original text: "Enhanced image"
+msgid "Enhanced image"
+msgstr "Image améliorée"
+
+#original text: "Start"
+msgid "Start"
+msgstr "Départ"
+
+#original text: "Ok"
+msgid "Ok"
+msgstr "Ok"
+
+#original text: "Apply"
+msgid "Apply"
+msgstr "Appliquer"
+
+#original text: "Cancel"
+msgid "Cancel"
+msgstr "Annuler"
+
+#original text: "Close"
+msgid "Close"
+msgstr "Fermer"
+
+#original text: "Add area"
+msgid "Add area"
+msgstr "Ajouter une aire"
+
+#original text: "Delete"
+msgid "Delete"
+msgstr "Affacer"
+
+#original text: "Show"
+msgid "Show"
+msgstr "Montrer"
+
+#original text: "Rename"
+msgid "Rename"
+msgstr "Renommer"
+
+#original text: "Send project"
+msgid "Send project"
+msgstr "Envoyer projet"
+
+#original text: "Delete project"
+msgid "Delete project"
+msgstr "Effacer projet"
+
+#original text: "Add printer"
+msgid "Add printer"
+msgstr "Ajouter une imprimante"
+
+#original text: "Delete printer"
+msgid "Delete printer"
+msgstr "Enlever une imprimante"
+
+#original text: "Acquire Preview"
+msgid "Acquire Preview"
+msgstr "Acquisition de l'aperçu"
+
+#original text: "Cancel Preview"
+msgid "Cancel Preview"
+msgstr "Annuler l'aperçu"
+
+#original text: "Fine mode"
+msgid "Fine mode"
+msgstr "Mode Fin"
+
+#original text: "Overwrite warning"
+msgid "Overwrite warning"
+msgstr "Avertissement en cas d'écrasement"
+
+#original text: "Increase filename counter"
+msgid "Increase filename counter"
+msgstr "Incrémenter le compteur de nom de fichier"
+
+#original text: "Skip existing numbers"
+msgid "Skip existing numbers"
+msgstr "Éviter les nombres existants"
+
+#original text: "Main window size fixed"
+msgid "Main window size fixed"
+msgstr "Taille de la fenêtre principale fixe"
+
+#original text: "Preserve preview image"
+msgid "Preserve preview image"
+msgstr "Préserver l'image de l'aperçu"
+
+#original text: "Use private colormap"
+msgid "Use private colormap"
+msgstr "Utiliser une palette de couleurs privée"
+
+#original text: "Available devices:"
+msgid "Available devices:"
+msgstr "Périphériques disponibles:"
+
+#original text: "XSane options"
+msgid "XSane options"
+msgstr "Options de XSane"
+
+#original text: "XSane mode"
+msgid "XSane mode"
+msgstr "Mode XSane"
+
+#original text: "Scanner and backend:"
+msgid "Scanner and backend:"
+msgstr "Scanner et moteur:"
+
+#original text: "Vendor:"
+msgid "Vendor:"
+msgstr "Vendeur:"
+
+#original text: "Model:"
+msgid "Model:"
+msgstr "Modèle:"
+
+#original text: "Type:"
+msgid "Type:"
+msgstr "Type:"
+
+#original text: "Device:"
+msgid "Device:"
+msgstr "Périphérique:"
+
+#original text: "Loaded backend:"
+msgid "Loaded backend:"
+msgstr "Moteur chargé:"
+
+#original text: "Sane version:"
+msgid "Sane version:"
+msgstr "Version de Sane:"
+
+#original text: "Recent values:"
+msgid "Recent values:"
+msgstr "Valeurs récentes:"
+
+#original text: "Gamma correction by:"
+msgid "Gamma correction by:"
+msgstr "Correction Gamma par:"
+
+#original text: "scanner"
+msgid "scanner"
+msgstr "scanner"
+
+#original text: "software (xsane)"
+msgid "software (xsane)"
+msgstr "logiciel (xsane)"
+
+#original text: "none"
+msgid "none"
+msgstr "aucun"
+
+#original text: "Gamma input depth:"
+msgid "Gamma input depth:"
+msgstr ""
+
+#original text: "Gamma output depth:"
+msgid "Gamma output depth:"
+msgstr ""
+
+#original text: "Scanner output depth:"
+msgid "Scanner output depth:"
+msgstr ""
+
+#original text: "XSane output formats:"
+msgid "XSane output formats:"
+msgstr "Formats de sortie XSane:"
+
+#original text: "8 bit output formats:"
+msgid "8 bit output formats:"
+msgstr "Formats de sortie 8 bits:"
+
+#original text: "16 bit output formats:"
+msgid "16 bit output formats:"
+msgstr "Formats de sortie 16 bits:"
+
+#original text: "Authorization required for"
+msgid "Authorization required for"
+msgstr "Authorisation requise pour"
+
+#original text: "Username :"
+msgid "Username :"
+msgstr "Utilisateur:"
+
+#original text: "Password :"
+msgid "Password :"
+msgstr "Mot de passe:"
+
+#original text: "Invalid parameters."
+msgid "Invalid parameters."
+msgstr "Paramétres non valides"
+
+#original text: "version:"
+msgid "version:"
+msgstr "version"
+
+#original text: "package"
+msgid "package"
+msgstr "paquetage"
+
+#original text: "unknown"
+msgid "unknown"
+msgstr "inconnu"
+
+#original text: "0x0: 0KB"
+msgid "0x0: 0KB"
+msgstr "0x0: 0KB"
+
+#original text: "Printer selection:"
+msgid "Printer selection:"
+msgstr "Sélection de l'imprimante:"
+
+#original text: "Name:"
+msgid "Name:"
+msgstr "Nom:"
+
+#original text: "Command:"
+msgid "Command:"
+msgstr "Commande:"
+
+#original text: "Copy number option:"
+msgid "Copy number option:"
+msgstr "Option du nombre de copie:"
+
+#original text: "Resolution (dpi):"
+msgid "Resolution (dpi):"
+msgstr "Résolution (dpi):"
+
+#original text: "Width (1/72 inch):"
+msgid "Width (1/72 inch):"
+msgstr "Largeur (en 72ème de pouce):"
+
+#original text: "Height (1/72 inch):"
+msgid "Height (1/72 inch):"
+msgstr "Hauteur (en 72e de pouce):"
+
+#original text: "Left offset (1/72 inch):"
+msgid "Left offset (1/72 inch):"
+msgstr "Marge gauche (en 72ème de pouce):"
+
+#original text: "Bottom offset (1/72 inch):"
+msgid "Bottom offset (1/72 inch):"
+msgstr "Marge inférieure (en 72ème de pouce):"
+
+#original text: "Printer gamma value:"
+msgid "Printer gamma value:"
+msgstr "Valeur gamma de l'imprimante:"
+
+#original text: "Printer gamma red:"
+msgid "Printer gamma red:"
+msgstr "Valeur gamma rouge de l'imprimante:"
+
+#original text: "Printer gamma green:"
+msgid "Printer gamma green:"
+msgstr "Valeur gamma verte de l'imprimante:"
+
+#original text: "Printer gamma blue:"
+msgid "Printer gamma blue:"
+msgstr "Valeur gamma bleue de l'imprimante:"
+
+#original text: "JPEG image quality"
+msgid "JPEG image quality"
+msgstr "Qualité d'image JPEG"
+
+#original text: "PNG image compression"
+msgid "PNG image compression"
+msgstr "Compression des images PNG"
+
+#original text: "TIFF multi bit image compression"
+msgid "TIFF multi bit image compression"
+msgstr "Compression multi-bit des images TIFF"
+
+#original text: "TIFF lineart image compression"
+msgid "TIFF lineart image compression"
+msgstr "Compression d'image TIFF lineart"
+
+#original text: "Preview gamma:"
+msgid "Preview gamma:"
+msgstr "Gamma de l'aperçu:"
+
+#original text: "Preview gamma red:"
+msgid "Preview gamma red:"
+msgstr "Gamma rouge de l'aperçu:"
+
+#original text: "Preview gamma green:"
+msgid "Preview gamma green:"
+msgstr "Gamma vert de l'aperçu:"
+
+#original text: "Preview gamma blue:"
+msgid "Preview gamma blue:"
+msgstr "Gamma bleu de l'aperçu:"
+
+#original text: "Helpfile viewer (HTML):"
+msgid "Helpfile viewer (HTML):"
+msgstr "Afficheur de fichiers d'aide (HTML):"
+
+#original text: "Command:"
+msgid "Command:"
+msgstr ""
+
+#original text: "Receiver option:"
+msgid "Receiver option:"
+msgstr "Option de réception:"
+
+#original text: "Postscriptfile option:"
+msgid "Postscriptfile option:"
+msgstr "Option fichier PostScript:"
+
+#original text: "Normal mode option:"
+msgid "Normal mode option:"
+msgstr "Option du mode normal:"
+
+#original text: "Fine mode option:"
+msgid "Fine mode option:"
+msgstr "Option du mode fin:"
+
+#original text: "Viewer (Postscript):"
+msgid "Viewer (Postscript):"
+msgstr "Visualisateur (PostScript):"
+
+#original text: "Copy options"
+msgid "Copy options"
+msgstr "Options d'impression"
+
+#original text: "Saving options"
+msgid "Saving options"
+msgstr "Enregistrement des options"
+
+#original text: "Display options"
+msgid "Display options"
+msgstr "Options de l'affichage"
+
+#original text: "Fax options"
+msgid "Fax options"
+msgstr "Options de fax"
+
+#original text: "Scan"
+msgid "Scan"
+msgstr "Scanner"
+
+#original text: "Copy"
+msgid "Copy"
+msgstr "Copier"
+
+#original text: "Fax"
+msgid "Fax"
+msgstr "Faxer"
+
+#original text: "Setup"
+msgid "Setup"
+msgstr "Configuration"
+
+#original text: "Show tooltips"
+msgid "Show tooltips"
+msgstr "Affichage des bulles d'aide"
+
+#original text: "Show preview"
+msgid "Show preview"
+msgstr "Afficher l'aperçu"
+
+#original text: "Show histogram"
+msgid "Show histogram"
+msgstr "Afficher l'histogramme"
+
+#original text: "Show standard options"
+msgid "Show standard options"
+msgstr "Afficher les options standard"
+
+#original text: "Show advanced options"
+msgid "Show advanced options"
+msgstr "Afficher les options avancées"
+
+#original text: "Show resolution list"
+msgid "Show resolution list"
+msgstr "Afficher la liste des résolutions"
+
+#original text: "Length unit"
+msgid "Length unit"
+msgstr "Unité de longueur"
+
+#original text: "millimeters"
+msgid "millimeters"
+msgstr "millimétres"
+
+#original text: "centimeters"
+msgid "centimeters"
+msgstr "centimétres"
+
+#original text: "inches"
+msgid "inches"
+msgstr "pouces"
+
+#original text: "Save device settings"
+msgid "Save device settings"
+msgstr "Enregistrer les paramétres du périphérique"
+
+#original text: "Load device settings"
+msgid "Load device settings"
+msgstr "Charger les paramétres du périphérique"
+
+#original text: "Xsane doc"
+msgid "Xsane doc"
+msgstr "Doc Xsane"
+
+#original text: "Backend doc"
+msgid "Backend doc"
+msgstr "Doc moteur"
+
+#original text: "Available backends"
+msgid "Available backends"
+msgstr "Moteurs disponibles"
+
+#original text: "Scantips"
+msgid "Scantips"
+msgstr "Conseils d'utilisation"
+
+#original text: "no compression"
+msgid "no compression"
+msgstr "pas de compression"
+
+#original text: "CCITT 1D Huffman compression"
+msgid "CCITT 1D Huffman compression"
+msgstr "Compression CCITT 1D Huffman"
+
+#original text: "CCITT Group 3 Fax compression"
+msgid "CCITT Group 3 Fax compression"
+msgstr "Compression CCITT Group 3 Fax"
+
+#original text: "CCITT Group 4 Fax compression"
+msgid "CCITT Group 4 Fax compression"
+msgstr "Compression CCITT Group 4 Fax"
+
+#original text: "JPEG DCT compression"
+msgid "JPEG DCT compression"
+msgstr "Compression JPEG DCT"
+
+#original text: "pack bits"
+msgid "pack bits"
+msgstr ""
+
+#original text: "by ext"
+msgid "by ext"
+msgstr "par ext"
+
+#original text: "Use XSane for SCANning, photoCOPYing, FAXing..."
+msgid "Use XSane for SCANning, photoCOPYing, FAXing..."
+msgstr "Utilisez XSane pour SCANner, photoCOPIER, FAXer..."
+
+#original text: "Browse for image filename"
+msgid "Browse for image filename"
+msgstr "Parcourir"
+
+#original text: "Filename for scanned image"
+msgid "Filename for scanned image"
+msgstr "Nom de fichier pour l'image scannée"
+
+#original text: "Filename extension and type of image format"
+msgid "Filename extension and type of image format"
+msgstr "Definir le format de fichier d'image"
+
+#original text: "Enter name of fax project"
+msgid "Enter name of fax project"
+msgstr "Entrez le nom du projet fax"
+
+#original text: "Enter new name for faxpage"
+msgid "Enter new name for faxpage"
+msgstr "Entrez le nouveau nom pour la page de fax"
+
+#original text: "Enter receiver phone number or address"
+msgid "Enter receiver phone number or address"
+msgstr "Entrez l'option à spécifier au destinataire"
+
+#original text: "Select printer definition"
+msgid "Select printer definition"
+msgstr "Changer la définition de l'imprimante"
+
+#original text: "Set scan resolution"
+msgid "Set scan resolution"
+msgstr "Changer la résolution du scan"
+
+#original text: "Set zoomfactor"
+msgid "Set zoomfactor"
+msgstr "Changer le facteur de zoom"
+
+#original text: "Set number of copies"
+msgid "Set number of copies"
+msgstr "Entrez l'option du nombre de copies"
+
+#original text: "Negative: Invert colors for scanning negatives\n" "e.g. swap black and white"
+msgid "Negative: Invert colors for scanning negatives\n" "e.g. swap black and white"
+msgstr ""
+
+#original text: "Set gamma value"
+msgid "Set gamma value"
+msgstr ""
+
+#original text: "Set gamma value for red component"
+msgid "Set gamma value for red component"
+msgstr ""
+
+#original text: "Set gamma value for green component"
+msgid "Set gamma value for green component"
+msgstr ""
+
+#original text: "Set gamma value for blue component"
+msgid "Set gamma value for blue component"
+msgstr ""
+
+#original text: "Set brightness"
+msgid "Set brightness"
+msgstr ""
+
+#original text: "Set brightness for red component"
+msgid "Set brightness for red component"
+msgstr ""
+
+#original text: "Set brightness for green component"
+msgid "Set brightness for green component"
+msgstr ""
+
+#original text: "Set brightness for blue component"
+msgid "Set brightness for blue component"
+msgstr ""
+
+#original text: "Set contrast"
+msgid "Set contrast"
+msgstr ""
+
+#original text: "Set contrast for red component"
+msgid "Set contrast for red component"
+msgstr ""
+
+#original text: "Set contrast for green component"
+msgid "Set contrast for green component"
+msgstr ""
+
+#original text: "Set contrast for blue component"
+msgid "Set contrast for blue component"
+msgstr ""
+
+#original text: "RGB default: Set enhancement values for red, green and blue to default values:\n" " gamma = 1.0\n" " brightness = 0\n" " contrast = 0"
+msgid "RGB default: Set enhancement values for red, green and blue to default values:\n" " gamma = 1.0\n" " brightness = 0\n" " contrast = 0"
+msgstr ""
+
+#original text: "Autoadjust gamma, brightness and contrast in dependance of selected area"
+msgid "Autoadjust gamma, brightness and contrast in dependance of selected area"
+msgstr ""
+
+#original text: "Set default enhancement values:\n" "gamma = 1.0\n" "brightness = 0\n" "contrast = 0"
+msgid "Set default enhancement values:\n" "gamma = 1.0\n" "brightness = 0\n" "contrast = 0"
+msgstr ""
+
+#original text: "Restore enhancement values from preferences"
+msgid "Restore enhancement values from preferences"
+msgstr ""
+
+#original text: "Store active enhancement values to preferences"
+msgid "Store active enhancement values to preferences"
+msgstr ""
+
+#original text: "Show histogram of intensity/gray"
+msgid "Show histogram of intensity/gray"
+msgstr "Afficher l'histogramme de l'intensité/gris"
+
+#original text: "Show histogram of red component"
+msgid "Show histogram of red component"
+msgstr "Afficher l'histogramme du composant rouge"
+
+#original text: "Show histogram of green component"
+msgid "Show histogram of green component"
+msgstr "Afficher l'histogramme du composant vert"
+
+#original text: "Show histogram of blue component"
+msgid "Show histogram of blue component"
+msgstr "Afficher l'histogramme du composant bleu"
+
+#original text: "Display histogram with lines instead of pixels"
+msgid "Display histogram with lines instead of pixels"
+msgstr "Afficher l'histogramme avec des lignes à la place des pixels"
+
+#original text: "Show logarithm of pixelcount"
+msgid "Show logarithm of pixelcount"
+msgstr "Afficher le logarithme du nombre de pixels"
+
+#original text: "Select definition to change"
+msgid "Select definition to change"
+msgstr "Choisissez la définition à changer"
+
+#original text: "Define a name for the selection of this definition"
+msgid "Define a name for the selection of this definition"
+msgstr "Définissez un nom pour la sélection de cette définition"
+
+#original text: "Enter command to be executed in copy mode (e.g. \"lpr -\")"
+msgid "Enter command to be executed in copy mode (e.g. \"lpr -\")"
+msgstr "Entrez la commande a exécuter en mode copie (par ex.: \"lpr -\")"
+
+#original text: "Enter option for copy numbers"
+msgid "Enter option for copy numbers"
+msgstr "Entrez l'option du nombre de copies"
+
+#original text: "Resolution with which images are printed and saved in postscript"
+msgid "Resolution with which images are printed and saved in postscript"
+msgstr "Résolution à laquelle les images doivent être enregistrées et imprimées en PostScript"
+
+#original text: "Width of printable area in 1/72 inch"
+msgid "Width of printable area in 1/72 inch"
+msgstr "Largeur de la zone imprimable en 72ème de pouce"
+
+#original text: "Height of printable area in 1/72 inch"
+msgid "Height of printable area in 1/72 inch"
+msgstr "Hauteur de la zone imprimable en 72ème de pouce"
+
+#original text: "Left offset from the edge of the paper to the printable area in 1/72 inch"
+msgid "Left offset from the edge of the paper to the printable area in 1/72 inch"
+msgstr "Décallage entre le bord gauche du papier et l'aire imprimable en 72ème de pouce"
+
+#original text: "Bottom offset from the edge of the paper to the printable area in 1/72 inch"
+msgid "Bottom offset from the edge of the paper to the printable area in 1/72 inch"
+msgstr "Décallage entre le bord inférieur du papier et l'aire imprimable en 72ème de pouce"
+
+#original text: "Additional gamma value for photocopy"
+msgid "Additional gamma value for photocopy"
+msgstr "Gamma additionnel pour photocopie"
+
+#original text: "Additional gamma value for red component for photocopy"
+msgid "Additional gamma value for red component for photocopy"
+msgstr "Gamma additionnel pour la composante rouge pour photocopie"
+
+#original text: "Additional gamma value for green component for photocopy"
+msgid "Additional gamma value for green component for photocopy"
+msgstr "Gamma additionnel pour la composante verte pour photocopie"
+
+#original text: "Additional gamma value for blue component for photocopy"
+msgid "Additional gamma value for blue component for photocopy"
+msgstr "Gamma additionnel pour la composante bleue pour photocopie"
+
+#original text: "Quality in percent if image is saved as jpeg or tiff with jpeg compression"
+msgid "Quality in percent if image is saved as jpeg or tiff with jpeg compression"
+msgstr "Qualité en pourcentage si l'image est enregistrée en jpeg ou tiff avec compression jpeg"
+
+#original text: "Compression if image is saved as png"
+msgid "Compression if image is saved as png"
+msgstr "Compression si l'image est enregistrée en png"
+
+#original text: "Compression type if multi bit image is saved as tiff"
+msgid "Compression type if multi bit image is saved as tiff"
+msgstr "Type de compression si l'image multi-bit est enregistrée en tiff"
+
+#original text: "Compression type if lineart image is saved as tiff"
+msgid "Compression type if lineart image is saved as tiff"
+msgstr "Type de compression si l'image lineart est enregistrée en tiff"
+
+#original text: "Warn before overwriting an existing file"
+msgid "Warn before overwriting an existing file"
+msgstr "Avertir avant d'écraser un fichier existant"
+
+#original text: "If the filename is of the form \"name-001.ext\" " "(where the number of digits is free) " "the number is increased after a scan is finished"
+msgid "If the filename is of the form \"name-001.ext\" " "(where the number of digits is free) " "the number is increased after a scan is finished"
+msgstr "Si le nom de fichier est de la forme \"nom-001.ext\" (où le nombre de " "chiffres est libre), le nom est incrémenté lorsque le scan est terminé"
+
+#original text: "If filename counter is automatically increased, used numbers are skipped"
+msgid "If filename counter is automatically increased, used numbers are skipped"
+msgstr ""
+
+#original text: "Use fixed main window size or scrolled, resizable main window"
+msgid "Use fixed main window size or scrolled, resizable main window"
+msgstr "Si un compteur de noms de fichiers est utilisé, les nombres déjà utilisés sont évités"
+
+#original text: "Preserve preview image for next program start"
+msgid "Preserve preview image for next program start"
+msgstr "Préserver l'image de l'aperçu pour le prochain démarrage"
+
+#original text: "Use an own colormap for preview if display depth is 8 bpp"
+msgid "Use an own colormap for preview if display depth is 8 bpp"
+msgstr "Utiliser une palette de couleurs privée pour l'aperçu si l'affichage est en mode 8bits"
+
+#original text: "Set gamma correction value for preview image"
+msgid "Set gamma correction value for preview image"
+msgstr "Changer la valeur de la correction gamma pour l'image de l'aperçu"
+
+#original text: "Set gamma correction value for red component of preview image"
+msgid "Set gamma correction value for red component of preview image"
+msgstr "Changer la valeur de la correction gamma pour le composant rouge pour l'image de l'aperçu"
+
+#original text: "Set gamma correction value for green component of preview image"
+msgid "Set gamma correction value for green component of preview image"
+msgstr "Changer la valeur de la correction gamma pour le composant vert pour l'image de l'aperçu"
+
+#original text: "Set gamma correction value for blue component of preview image"
+msgid "Set gamma correction value for blue component of preview image"
+msgstr "Changer la valeur de la correction gamma pour le composant bleue pour l'image de l'aperçu"
+
+#original text: "Enter command to be executed to display helpfiles, must be a html-viewer!"
+msgid "Enter command to be executed to display helpfiles, must be a html-viewer!"
+msgstr "Entrez la commande a exécuter pour afficher les fichiers d'aide; doit être capable de lire du html"
+
+#original text: "Enter command to be executed in fax mode"
+msgid "Enter command to be executed in fax mode"
+msgstr "Entrez la commande à exécuter en mode fax"
+
+#original text: "Enter option to specify receiver"
+msgid "Enter option to specify receiver"
+msgstr "Entrez l'option à spécifier au destinataire"
+
+#original text: "Enter option to specify postscript files following"
+msgid "Enter option to specify postscript files following"
+msgstr "Entrez l'option à spécifier aux fichiers PostScript suivant"
+
+#original text: "Enter option to specify normal mode (low resolution)"
+msgid "Enter option to specify normal mode (low resolution)"
+msgstr "Entrez l'option à spécifier au mode normal (basse résolution)"
+
+#original text: "Enter option to specify fine mode (high resolution)"
+msgid "Enter option to specify fine mode (high resolution)"
+msgstr "Entrez l'option à spécifier au mode fin (haute résolution)"
+
+#original text: "Enter command to be executed to view a fax"
+msgid "Enter command to be executed to view a fax"
+msgstr "Entrez la commande à être exécuter pour voir un fax"
+
+#original text: "Use high vertical resolution (196 lpi instead of 98 lpi)"
+msgid "Use high vertical resolution (196 lpi instead of 98 lpi)"
+msgstr "Utiliser une plus grande résolution verticale (196 lpi à la place de 98 lpi)"
+
+#original text: "Pick white point"
+msgid "Pick white point"
+msgstr "Choisissez un point blanc"
+
+#original text: "Pick gray point"
+msgid "Pick gray point"
+msgstr "Choisissez un point gris"
+
+#original text: "Pick black point"
+msgid "Pick black point"
+msgstr "Choisissez un point noir"
+
+#original text: "Use full scanarea"
+msgid "Use full scanarea"
+msgstr "Utiliser l'aire de scan complète"
+
+#original text: "Zoom 20% out"
+msgid "Zoom 20% out"
+msgstr "Zoomer 20% en arrière"
+
+#original text: "Zoom into selected area"
+msgid "Zoom into selected area"
+msgstr "Zoomer l'aire sélectionnée"
+
+#original text: "Undo last zoom"
+msgid "Undo last zoom"
+msgstr "Annuler le dernier zoom"
+
+#original text: "Select visible area"
+msgid "Select visible area"
+msgstr "Sélectionner l'aire visible"
+
+#original text: "Failed to determine home directory:"
+msgid "Failed to determine home directory:"
+msgstr "Impossible de déterminer le répertoire personnel"
+
+#original text: "Filename too long"
+msgid "Filename too long"
+msgstr "Nom de fichier trop long"
+
+#original text: "Failed to set value of option"
+msgid "Failed to set value of option"
+msgstr "Échec du changement de la valeur de l'option"
+
+#original text: "Failed to obtain value of option"
+msgid "Failed to obtain value of option"
+msgstr "Échec de l'obtention de la valeur de l'option"
+
+#original text: "Error obtaining option count"
+msgid "Error obtaining option count"
+msgstr "Erreur de l'option 'count'"
+
+#original text: "Failed to open device"
+msgid "Failed to open device"
+msgstr ""
+
+#original text: "no devices available"
+msgid "no devices available"
+msgstr "aucun périphérique disponible"
+
+#original text: "Error during read:"
+msgid "Error during read:"
+msgstr ""
+
+#original text: "Error during save:"
+msgid "Error during save:"
+msgstr ""
+
+#original text: "Can't handle depth"
+msgid "Can't handle depth"
+msgstr ""
+
+#original text: "Unknown file format for saving"
+msgid "Unknown file format for saving"
+msgstr ""
+
+#original text: "Failed to open"
+msgid "Failed to open"
+msgstr ""
+
+#original text: "Failed to open pipe for executing printercommand"
+msgid "Failed to open pipe for executing printercommand"
+msgstr ""
+
+#original text: "Failed to execute printercommand:"
+msgid "Failed to execute printercommand:"
+msgstr ""
+
+#original text: "Failed to start scanner:"
+msgid "Failed to start scanner:"
+msgstr ""
+
+#original text: "Failed to get parameters:"
+msgid "Failed to get parameters:"
+msgstr ""
+
+#original text: "No output format given"
+msgid "No output format given"
+msgstr ""
+
+#original text: "out of memory"
+msgid "out of memory"
+msgstr ""
+
+#original text: "LIBTIFF reports error"
+msgid "LIBTIFF reports error"
+msgstr ""
+
+#original text: "LIBPNG reports error"
+msgid "LIBPNG reports error"
+msgstr ""
+
+#original text: "unknown type"
+msgid "unknown type"
+msgstr ""
+
+#original text: "unknown constraint type"
+msgid "unknown constraint type"
+msgstr ""
+
+#original text: "Failed to execute documentation viewer:"
+msgid "Failed to execute documentation viewer:"
+msgstr ""
+
+#original text: "Failed to execute fax viewer:"
+msgid "Failed to execute fax viewer:"
+msgstr ""
+
+#original text: "Failed to execute faxcommand:"
+msgid "Failed to execute faxcommand:"
+msgstr ""
+
+#original text: "bad frame format"
+msgid "bad frame format"
+msgstr ""
+
+#original text: "unable to set resolution"
+msgid "unable to set resolution"
+msgstr ""
+
+#original text: "error"
+msgid "error"
+msgstr "Erreur"
+
+#original text: "Sane major version number mismatch!"
+msgid "Sane major version number mismatch!"
+msgstr "Incohérence dans les numéros de version majeur de Sane!"
+
+#original text: "xsane major version ="
+msgid "xsane major version ="
+msgstr "version majeure de xsane ="
+
+#original text: "backend major version ="
+msgid "backend major version ="
+msgstr "version majeure du moteur ="
+
+#original text: "*** PROGRAM ABORTED ***"
+msgid "*** PROGRAM ABORTED ***"
+msgstr "*** ARRET DU PROGRAMME ***"
+
+#original text: "Failed to allocate image memory:"
+msgid "Failed to allocate image memory:"
+msgstr ""
+
+#original text: "Preview cannot handle bit depth"
+msgid "Preview cannot handle bit depth"
+msgstr ""
+
+#original text: "GIMP support missing"
+msgid "GIMP support missing"
+msgstr "le support pour GIMP est manquant"
+
+#original text: "Filename counter overflow"
+msgid "Filename counter overflow"
+msgstr ""
+
+#original text: "warning: option has no value constraint"
+msgid "warning: option has no value constraint"
+msgstr ""
+
+#original text: "Ok"
+msgid "Ok"
+msgstr ""
+
+#original text: "Error"
+msgid "Error"
+msgstr "Erreur"
+
+#original text: "Warning"
+msgid "Warning"
+msgstr "Avertissement"
+
+#original text: "Usage:"
+msgid "Usage:"
+msgstr "Usage:"
+
+#original text: "[OPTION]... [DEVICE]"
+msgid "[OPTION]... [DEVICE]"
+msgstr "[OPTION]... [PÉRIPHÉRIQUE]"
+
+#original text: "Start up graphical user interface to access SANE (Scanner Access Now Easy) devices.\n\n-h, --help display this help message and exit\n-v, --version print version information\n\n-d, --device-settings file load device settings from file (without \".drc\")\n\n-s, --scan start with scan-mode active\n-c, --copy start with copy-mode active\n-f, --fax start with fax-mode active\n-n, --no-mode-selection disable menu for xsane mode selection\n\n-F, --Fixed fixed main window size (overwrite preferences value)\n-R, --Resizeable resizable, scrolled main window (overwrite preferences value)\n\n--display X11-display redirect output to X11-display\n--no-xshm do not use shared memory images\n--sync request a synchronous connection with the X11 server"
+msgid "Start up graphical user interface to access SANE (Scanner Access Now Easy) devices.\n\n-h, --help display this help message and exit\n-v, --version print version information\n\n-d, --device-settings file load device settings from file (without \".drc\")\n\n-s, --scan start with scan-mode active\n-c, --copy start with copy-mode active\n-f, --fax start with fax-mode active\n-n, --no-mode-selection disable menu for xsane mode selection\n\n-F, --Fixed fixed main window size (overwrite preferences value)\n-R, --Resizeable resizable, scrolled main window (overwrite preferences value)\n\n--display X11-display redirect output to X11-display\n--no-xshm do not use shared memory images\n--sync request a synchronous connection with the X11 server"
+msgstr "" "Démarre l'interface graphique pour accéder à SANE (Scanner Access Now Easy).\n" "\n" "-h, --help affiche ce message d'aide et quitte\n" "-v, --version donne des informations sur la version\n" "\n" "-d, --device-settings file charge la configuration d'un périphérique à\n" " partir d'un fichier (sans \".drc\")\n" "\n" "-s, --scan démarre en mode scan\n" "-c, --copy démarre en mode copie\n" "-f, --fax démarre en mode fax\n" "-n, --no-mode-selection désactive le menu de sélection de mode\n" "\n" "-F, --Fixed fixe la taille de la fenêtre principale (sans\n" " tenir compte des préférences)" "-R, --Resizeable taille de la fenêtre principale variable (sans\n" " tenir compte des préférences)\n" "--display affichage-X11 redirige l'affichage vers un autre affichage X11\n" "--no-xshm n'utilise pas la mémoire partagée\n" "--sync demande une connexion synchrone avec le serveur X"
+
+
+#original text: "Success"
+msgid "Success"
+msgstr ""
+
+#original text: "Operation not supported"
+msgid "Operation not supported"
+msgstr ""
+
+#original text: "Operation was cancelled"
+msgid "Operation was cancelled"
+msgstr ""
+
+#original text: "Device busy"
+msgid "Device busy"
+msgstr ""
+
+#original text: "Invalid argument"
+msgid "Invalid argument"
+msgstr ""
+
+#original text: "End of file reached"
+msgid "End of file reached"
+msgstr ""
+
+#original text: "Document feeder jammed"
+msgid "Document feeder jammed"
+msgstr ""
+
+#original text: "Document feeder out of documents"
+msgid "Document feeder out of documents"
+msgstr ""
+
+#original text: "Scanner cover is open"
+msgid "Scanner cover is open"
+msgstr ""
+
+#original text: "Error during device I/O"
+msgid "Error during device I/O"
+msgstr ""
+
+#original text: "Out of memory"
+msgid "Out of memory"
+msgstr ""
+
+#original text: "Access to resource has been denied"
+msgid "Access to resource has been denied"
+msgstr ""
+
diff --git a/po/fr.po.in b/po/fr.po.in
new file mode 100644
index 0000000..4bd7f60
--- /dev/null
+++ b/po/fr.po.in
@@ -0,0 +1,1072 @@
+#include "../frontend/xsane-text.h"
+#define _(x) x
+
+#nls translation file for xsane
+#language: french (fr)
+#by Vincent Renardias <vincent@ldsol.com>
+
+#original text: "About"
+msgid WINDOW_ABOUT
+msgstr "a propos"
+
+#original text: "authorization"
+msgid WINDOW_AUTHORIZE
+msgstr "authorisation"
+
+#original text: "info"
+msgid WINDOW_INFO
+msgstr "info"
+
+#original text: "batch scan"
+msgid WINDOW_BATCH_SCAN
+msgstr "scan en batch"
+
+#original text: "fax project"
+msgid WINDOW_FAX_PROJECT
+msgstr "projet fax"
+
+#original text: "rename fax page"
+msgid WINDOW_FAX_RENAME
+msgstr "renommer la page de fax"
+
+#original text: "setup"
+msgid WINDOW_SETUP
+msgstr "Configuration"
+
+#original text: "Histogram"
+msgid WINDOW_HISTOGRAM
+msgstr "Histogramme"
+
+#original text: "Standard options"
+msgid WINDOW_STANDARD_OPTIONS
+msgstr "Options standards"
+
+#original text: "Advanced options"
+msgid WINDOW_ADVANCED_OPTIONS
+msgstr "Options avancées"
+
+#original text: "device selection"
+msgid WINDOW_DEVICE_SELECTION
+msgstr "sélection de périphérique"
+
+#original text: "Preview"
+msgid WINDOW_PREVIEW
+msgstr "aperçu"
+
+#original text: "output filename"
+msgid WINDOW_OUTPUT_FILENAME
+msgstr "fichier de sortie"
+
+#original text: "save device settings"
+msgid WINDOW_SAVE_SETTINGS
+msgstr "enregistrer les paramétres du périphérique"
+
+#original text: "load device settings"
+msgid WINDOW_LOAD_SETTINGS
+msgstr "charger les paramétres du périphérique"
+
+#original text: "File"
+msgid MENU_FILE
+msgstr "Fichier"
+
+#original text: "Preferences"
+msgid MENU_PREFERENCES
+msgstr "Préférences"
+
+#original text: "Help"
+msgid MENU_HELP
+msgstr "Aide"
+
+#original text: "About"
+msgid MENU_ITEM_ABOUT
+msgstr "A propos"
+
+#original text: "Info"
+msgid MENU_ITEM_INFO
+msgstr "Info"
+
+#original text: "Exit"
+msgid MENU_ITEM_EXIT
+msgstr "Quitter"
+
+#original text: "Raw image"
+msgid FRAME_RAW_IMAGE
+msgstr "Image brute"
+
+#original text: "Enhanced image"
+msgid FRAME_ENHANCED_IMAGE
+msgstr "Image améliorée"
+
+#original text: "Start"
+msgid BUTTON_START
+msgstr "Départ"
+
+#original text: "Ok"
+msgid BUTTON_OK
+msgstr "Ok"
+
+#original text: "Apply"
+msgid BUTTON_APPLY
+msgstr "Appliquer"
+
+#original text: "Cancel"
+msgid BUTTON_CANCEL
+msgstr "Annuler"
+
+#original text: "Close"
+msgid BUTTON_CLOSE
+msgstr "Fermer"
+
+#original text: "Add area"
+msgid BUTTON_ADD_AREA
+msgstr "Ajouter une aire"
+
+#original text: "Delete"
+msgid BUTTON_DELETE
+msgstr "Affacer"
+
+#original text: "Show"
+msgid BUTTON_SHOW
+msgstr "Montrer"
+
+#original text: "Rename"
+msgid BUTTON_RENAME
+msgstr "Renommer"
+
+#original text: "Send project"
+msgid BUTTON_SEND_PROJECT
+msgstr "Envoyer projet"
+
+#original text: "Delete project"
+msgid BUTTON_DELETE_PROJECT
+msgstr "Effacer projet"
+
+#original text: "Add printer"
+msgid BUTTON_ADD_PRINTER
+msgstr "Ajouter une imprimante"
+
+#original text: "Delete printer"
+msgid BUTTON_DELETE_PRINTER
+msgstr "Enlever une imprimante"
+
+#original text: "Acquire Preview"
+msgid BUTTON_PREVIEW_ACQUIRE
+msgstr "Acquisition de l'aperçu"
+
+#original text: "Cancel Preview"
+msgid BUTTON_PREVIEW_CANCEL
+msgstr "Annuler l'aperçu"
+
+#original text: "Fine mode"
+msgid RADIO_BUTTON_FINE_MODE
+msgstr "Mode Fin"
+
+#original text: "Overwrite warning"
+msgid RADIO_BUTTON_OVERWRITE_WARNING
+msgstr "Avertissement en cas d'écrasement"
+
+#original text: "Increase filename counter"
+msgid RADIO_BUTTON_INCREASE_COUNTER
+msgstr "Incrémenter le compteur de nom de fichier"
+
+#original text: "Skip existing numbers"
+msgid RADIO_BUTTON_SKIP_EXISTING_NRS
+msgstr "Éviter les nombres existants"
+
+#original text: "Main window size fixed"
+msgid RADIO_BUTTON_WINDOW_FIXED
+msgstr "Taille de la fenêtre principale fixe"
+
+#original text: "Preserve preview image"
+msgid RADIO_BUTTON_PRESERVE_PRVIEW
+msgstr "Préserver l'image de l'aperçu"
+
+#original text: "Use private colormap"
+msgid RADIO_BUTTON_PRIVATE_COLORMAP
+msgstr "Utiliser une palette de couleurs privée"
+
+#original text: "Available devices:"
+msgid TEXT_AVAILABLE_DEVICES
+msgstr "Périphériques disponibles:"
+
+#original text: "XSane options"
+msgid TEXT_XSANE_OPTIONS
+msgstr "Options de XSane"
+
+#original text: "XSane mode"
+msgid TEXT_XSANE_MODE
+msgstr "Mode XSane"
+
+#original text: "Scanner and backend:"
+msgid TEXT_SCANNER_BACKEND
+msgstr "Scanner et moteur:"
+
+#original text: "Vendor:"
+msgid TEXT_VENDOR
+msgstr "Vendeur:"
+
+#original text: "Model:"
+msgid TEXT_MODEL
+msgstr "Modèle:"
+
+#original text: "Type:"
+msgid TEXT_TYPE
+msgstr "Type:"
+
+#original text: "Device:"
+msgid TEXT_DEVICE
+msgstr "Périphérique:"
+
+#original text: "Loaded backend:"
+msgid TEXT_LOADED_BACKEND
+msgstr "Moteur chargé:"
+
+#original text: "Sane version:"
+msgid TEXT_SANE_VERSION
+msgstr "Version de Sane:"
+
+#original text: "Recent values:"
+msgid TEXT_RECENT_VALUES
+msgstr "Valeurs récentes:"
+
+#original text: "Gamma correction by:"
+msgid TEXT_GAMMA_CORR_BY
+msgstr "Correction Gamma par:"
+
+#original text: "scanner"
+msgid TEXT_SCANNER
+msgstr "scanner"
+
+#original text: "software (xsane)"
+msgid TEXT_SOFTWARE_XSANE
+msgstr "logiciel (xsane)"
+
+#original text: "none"
+msgid TEXT_NONE
+msgstr "aucun"
+
+#original text: "Gamma input depth:"
+msgid TEXT_GAMMA_INPUT_DEPTH
+msgstr ""
+
+#original text: "Gamma output depth:"
+msgid TEXT_GAMMA_OUTPUT_DEPTH
+msgstr ""
+
+#original text: "Scanner output depth:"
+msgid TEXT_SCANNER_OUTPUT_DEPTH
+msgstr ""
+
+#original text: "XSane output formats:"
+msgid TEXT_OUTPUT_FORMATS
+msgstr "Formats de sortie XSane:"
+
+#original text: "8 bit output formats:"
+msgid TEXT_8BIT_FORMATS
+msgstr "Formats de sortie 8 bits:"
+
+#original text: "16 bit output formats:"
+msgid TEXT_16BIT_FORMATS
+msgstr "Formats de sortie 16 bits:"
+
+#original text: "Authorization required for"
+msgid TEXT_AUTHORIZATION_REQ
+msgstr "Authorisation requise pour"
+
+#original text: "Username :"
+msgid TEXT_USERNAME
+msgstr "Utilisateur:"
+
+#original text: "Password :"
+msgid TEXT_PASSWORD
+msgstr "Mot de passe:"
+
+#original text: "Invalid parameters."
+msgid TEXT_INVALID_PARAMS
+msgstr "Paramétres non valides"
+
+#original text: "version:"
+msgid TEXT_VERSION
+msgstr "version"
+
+#original text: "package"
+msgid TEXT_PACKAGE
+msgstr "paquetage"
+
+#original text: "unknown"
+msgid TEXT_UNKNOWN
+msgstr "inconnu"
+
+#original text: "0x0: 0KB"
+msgid TEXT_INFO_BOX
+msgstr "0x0: 0KB"
+
+#original text: "Printer selection:"
+msgid TEXT_SETUP_PRINTER_SEL
+msgstr "Sélection de l'imprimante:"
+
+#original text: "Name:"
+msgid TEXT_SETUP_PRINTER_NAME
+msgstr "Nom:"
+
+#original text: "Command:"
+msgid TEXT_SETUP_PRINTER_CMD
+msgstr "Commande:"
+
+#original text: "Copy number option:"
+msgid TEXT_SETUP_COPY_NR_OPT
+msgstr "Option du nombre de copie:"
+
+#original text: "Resolution (dpi):"
+msgid TEXT_SETUP_PRINTER_RES
+msgstr "Résolution (dpi):"
+
+#original text: "Width (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_WIDTH
+msgstr "Largeur (en 72ème de pouce):"
+
+#original text: "Height (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_HEIGHT
+msgstr "Hauteur (en 72e de pouce):"
+
+#original text: "Left offset (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_LEFT
+msgstr "Marge gauche (en 72ème de pouce):"
+
+#original text: "Bottom offset (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_BOTTOM
+msgstr "Marge inférieure (en 72ème de pouce):"
+
+#original text: "Printer gamma value:"
+msgid TEXT_SETUP_PRINTER_GAMMA
+msgstr "Valeur gamma de l'imprimante:"
+
+#original text: "Printer gamma red:"
+msgid TEXT_SETUP_PRINTER_GAMMA_RED
+msgstr "Valeur gamma rouge de l'imprimante:"
+
+#original text: "Printer gamma green:"
+msgid TEXT_SETUP_PRINTER_GAMMA_GREEN
+msgstr "Valeur gamma verte de l'imprimante:"
+
+#original text: "Printer gamma blue:"
+msgid TEXT_SETUP_PRINTER_GAMMA_BLUE
+msgstr "Valeur gamma bleue de l'imprimante:"
+
+#original text: "JPEG image quality"
+msgid TEXT_SETUP_JPEG_QUALITY
+msgstr "Qualité d'image JPEG"
+
+#original text: "PNG image compression"
+msgid TEXT_SETUP_PNG_COMPRESSION
+msgstr "Compression des images PNG"
+
+#original text: "TIFF multi bit image compression"
+msgid TEXT_SETUP_TIFF_COMPRESSION
+msgstr "Compression multi-bit des images TIFF"
+
+#original text: "TIFF lineart image compression"
+msgid TEXT_SETUP_TIFF_COMPRESSION_1
+msgstr "Compression d'image TIFF lineart"
+
+#original text: "Preview gamma:"
+msgid TEXT_SETUP_PREVIEW_GAMMA
+msgstr "Gamma de l'aperçu:"
+
+#original text: "Preview gamma red:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_RED
+msgstr "Gamma rouge de l'aperçu:"
+
+#original text: "Preview gamma green:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_GREEN
+msgstr "Gamma vert de l'aperçu:"
+
+#original text: "Preview gamma blue:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_BLUE
+msgstr "Gamma bleu de l'aperçu:"
+
+#original text: "Helpfile viewer (HTML):"
+msgid TEXT_SETUP_HELPFILE_VIEWER
+msgstr "Afficheur de fichiers d'aide (HTML):"
+
+#original text: "Command:"
+msgid TEXT_SETUP_FAX_COMMAND
+msgstr ""
+
+#original text: "Receiver option:"
+msgid TEXT_SETUP_FAX_RECEIVER_OPTION
+msgstr "Option de réception:"
+
+#original text: "Postscriptfile option:"
+msgid TEXT_SETUP_FAX_POSTSCRIPT_OPT
+msgstr "Option fichier PostScript:"
+
+#original text: "Normal mode option:"
+msgid TEXT_SETUP_FAX_NORMAL_MODE_OPT
+msgstr "Option du mode normal:"
+
+#original text: "Fine mode option:"
+msgid TEXT_SETUP_FAX_FINE_MODE_OPT
+msgstr "Option du mode fin:"
+
+#original text: "Viewer (Postscript):"
+msgid TEXT_SETUP_FAX_VIEWER
+msgstr "Visualisateur (PostScript):"
+
+#original text: "Copy options"
+msgid NOTEBOOK_COPY_OPTIONS
+msgstr "Options d'impression"
+
+#original text: "Saving options"
+msgid NOTEBOOK_SAVING_OPTIONS
+msgstr "Enregistrement des options"
+
+#original text: "Display options"
+msgid NOTEBOOK_DISPLAY_OPTIONS
+msgstr "Options de l'affichage"
+
+#original text: "Fax options"
+msgid NOTEBOOK_FAX_OPTIONS
+msgstr "Options de fax"
+
+#original text: "Scan"
+msgid MENU_ITEM_SCAN
+msgstr "Scanner"
+
+#original text: "Copy"
+msgid MENU_ITEM_COPY
+msgstr "Copier"
+
+#original text: "Fax"
+msgid MENU_ITEM_FAX
+msgstr "Faxer"
+
+#original text: "Setup"
+msgid MENU_ITEM_SETUP
+msgstr "Configuration"
+
+#original text: "Show tooltips"
+msgid MENU_ITEM_SHOW_TOOLTIPS
+msgstr "Affichage des bulles d'aide"
+
+#original text: "Show preview"
+msgid MENU_ITEM_SHOW_PREVIEW
+msgstr "Afficher l'aperçu"
+
+#original text: "Show histogram"
+msgid MENU_ITEM_SHOW_HISTOGRAM
+msgstr "Afficher l'histogramme"
+
+#original text: "Show standard options"
+msgid MENU_ITEM_SHOW_STANDARDOPTIONS
+msgstr "Afficher les options standard"
+
+#original text: "Show advanced options"
+msgid MENU_ITEM_SHOW_ADVANCEDOPTIONS
+msgstr "Afficher les options avancées"
+
+#original text: "Show resolution list"
+msgid MENU_ITEM_SHOW_RESOLUTIONLIST
+msgstr "Afficher la liste des résolutions"
+
+#original text: "Length unit"
+msgid MENU_ITEM_LENGTH_UNIT
+msgstr "Unité de longueur"
+
+#original text: "millimeters"
+msgid SUBMENU_ITEM_LENGTH_MILLIMETERS
+msgstr "millimétres"
+
+#original text: "centimeters"
+msgid SUBMENU_ITEM_LENGTH_CENTIMETERS
+msgstr "centimétres"
+
+#original text: "inches"
+msgid SUBMENU_ITEM_LENGTH_INCHES
+msgstr "pouces"
+
+#original text: "Save device settings"
+msgid MENU_ITEM_SAVE_DEVICE_SETTINGS
+msgstr "Enregistrer les paramétres du périphérique"
+
+#original text: "Load device settings"
+msgid MENU_ITEM_LOAD_DEVICE_SETTINGS
+msgstr "Charger les paramétres du périphérique"
+
+#original text: "Xsane doc"
+msgid MENU_ITEM_XSANE_DOC
+msgstr "Doc Xsane"
+
+#original text: "Backend doc"
+msgid MENU_ITEM_BACKEND_DOC
+msgstr "Doc moteur"
+
+#original text: "Available backends"
+msgid MENU_ITEM_AVAILABLE_BACKENDS
+msgstr "Moteurs disponibles"
+
+#original text: "Scantips"
+msgid MENU_ITEM_SCANTIPS
+msgstr "Conseils d'utilisation"
+
+#original text: "no compression"
+msgid MENU_ITEM_TIFF_COMP_NONE
+msgstr "pas de compression"
+
+#original text: "CCITT 1D Huffman compression"
+msgid MENU_ITEM_TIFF_COMP_CCITTRLE
+msgstr "Compression CCITT 1D Huffman"
+
+#original text: "CCITT Group 3 Fax compression"
+msgid MENU_ITEM_TIFF_COMP_CCITFAX3
+msgstr "Compression CCITT Group 3 Fax"
+
+#original text: "CCITT Group 4 Fax compression"
+msgid MENU_ITEM_TIFF_COMP_CCITFAX4
+msgstr "Compression CCITT Group 4 Fax"
+
+#original text: "JPEG DCT compression"
+msgid MENU_ITEM_TIFF_COMP_JPEG
+msgstr "Compression JPEG DCT"
+
+#original text: "pack bits"
+msgid MENU_ITEM_TIFF_COMP_PACKBITS
+msgstr ""
+
+#original text: "by ext"
+msgid MENU_ITEM_FILETYPE_BY_EXT
+msgstr "par ext"
+
+#original text: "Use XSane for SCANning, photoCOPYing, FAXing..."
+msgid DESC_XSANE_MODE
+msgstr "Utilisez XSane pour SCANner, photoCOPIER, FAXer..."
+
+#original text: "Browse for image filename"
+msgid DESC_BROWSE_FILENAME
+msgstr "Parcourir"
+
+#original text: "Filename for scanned image"
+msgid DESC_FILENAME
+msgstr "Nom de fichier pour l'image scannée"
+
+#original text: "Filename extension and type of image format"
+msgid DESC_FILETYPE
+msgstr "Definir le format de fichier d'image"
+
+#original text: "Enter name of fax project"
+msgid DESC_FAXPROJECT
+msgstr "Entrez le nom du projet fax"
+
+#original text: "Enter new name for faxpage"
+msgid DESC_FAXPAGENAME
+msgstr "Entrez le nouveau nom pour la page de fax"
+
+#original text: "Enter receiver phone number or address"
+msgid DESC_FAXRECEIVER
+msgstr "Entrez l'option à spécifier au destinataire"
+
+#original text: "Select printer definition"
+msgid DESC_PRINTER_SELECT
+msgstr "Changer la définition de l'imprimante"
+
+#original text: "Set scan resolution"
+msgid DESC_RESOLUTION
+msgstr "Changer la résolution du scan"
+
+#original text: "Set zoomfactor"
+msgid DESC_ZOOM
+msgstr "Changer le facteur de zoom"
+
+#original text: "Set number of copies"
+msgid DESC_COPY_NUMBER
+msgstr "Entrez l'option du nombre de copies"
+
+#original text: "Negative: Invert colors for scanning negatives\n" "e.g. swap black and white"
+msgid DESC_NEGATIVE
+msgstr ""
+
+#original text: "Set gamma value"
+msgid DESC_GAMMA
+msgstr ""
+
+#original text: "Set gamma value for red component"
+msgid DESC_GAMMA_R
+msgstr ""
+
+#original text: "Set gamma value for green component"
+msgid DESC_GAMMA_G
+msgstr ""
+
+#original text: "Set gamma value for blue component"
+msgid DESC_GAMMA_B
+msgstr ""
+
+#original text: "Set brightness"
+msgid DESC_BRIGHTNESS
+msgstr ""
+
+#original text: "Set brightness for red component"
+msgid DESC_BRIGHTNESS_R
+msgstr ""
+
+#original text: "Set brightness for green component"
+msgid DESC_BRIGHTNESS_G
+msgstr ""
+
+#original text: "Set brightness for blue component"
+msgid DESC_BRIGHTNESS_B
+msgstr ""
+
+#original text: "Set contrast"
+msgid DESC_CONTRAST
+msgstr ""
+
+#original text: "Set contrast for red component"
+msgid DESC_CONTRAST_R
+msgstr ""
+
+#original text: "Set contrast for green component"
+msgid DESC_CONTRAST_G
+msgstr ""
+
+#original text: "Set contrast for blue component"
+msgid DESC_CONTRAST_B
+msgstr ""
+
+#original text: "RGB default: Set enhancement values for red, green and blue to default values:\n" " gamma = 1.0\n" " brightness = 0\n" " contrast = 0"
+msgid DESC_RGB_DEFAULT
+msgstr ""
+
+#original text: "Autoadjust gamma, brightness and contrast in dependance of selected area"
+msgid DESC_ENH_AUTO
+msgstr ""
+
+#original text: "Set default enhancement values:\n" "gamma = 1.0\n" "brightness = 0\n" "contrast = 0"
+msgid DESC_ENH_DEFAULT
+msgstr ""
+
+#original text: "Restore enhancement values from preferences"
+msgid DESC_ENH_RESTORE
+msgstr ""
+
+#original text: "Store active enhancement values to preferences"
+msgid DESC_ENH_STORE
+msgstr ""
+
+#original text: "Show histogram of intensity/gray"
+msgid DESC_HIST_INTENSITY
+msgstr "Afficher l'histogramme de l'intensité/gris"
+
+#original text: "Show histogram of red component"
+msgid DESC_HIST_RED
+msgstr "Afficher l'histogramme du composant rouge"
+
+#original text: "Show histogram of green component"
+msgid DESC_HIST_GREEN
+msgstr "Afficher l'histogramme du composant vert"
+
+#original text: "Show histogram of blue component"
+msgid DESC_HIST_BLUE
+msgstr "Afficher l'histogramme du composant bleu"
+
+#original text: "Display histogram with lines instead of pixels"
+msgid DESC_HIST_PIXEL
+msgstr "Afficher l'histogramme avec des lignes à la place des pixels"
+
+#original text: "Show logarithm of pixelcount"
+msgid DESC_HIST_LOG
+msgstr "Afficher le logarithme du nombre de pixels"
+
+#original text: "Select definition to change"
+msgid DESC_PRINTER_SETUP
+msgstr "Choisissez la définition à changer"
+
+#original text: "Define a name for the selection of this definition"
+msgid DESC_PRINTER_NAME
+msgstr "Définissez un nom pour la sélection de cette définition"
+
+#original text: "Enter command to be executed in copy mode (e.g. \"lpr -\")"
+msgid DESC_PRINTER_COMMAND
+msgstr "Entrez la commande a exécuter en mode copie (par ex.: \"lpr -\")"
+
+#original text: "Enter option for copy numbers"
+msgid DESC_COPY_NUMBER_OPTION
+msgstr "Entrez l'option du nombre de copies"
+
+#original text: "Resolution with which images are printed and saved in postscript"
+msgid DESC_PRINTER_RESOLUTION
+msgstr "Résolution à laquelle les images doivent être enregistrées et imprimées en PostScript"
+
+#original text: "Width of printable area in 1/72 inch"
+msgid DESC_PRINTER_WIDTH
+msgstr "Largeur de la zone imprimable en 72ème de pouce"
+
+#original text: "Height of printable area in 1/72 inch"
+msgid DESC_PRINTER_HEIGHT
+msgstr "Hauteur de la zone imprimable en 72ème de pouce"
+
+#original text: "Left offset from the edge of the paper to the printable area in 1/72 inch"
+msgid DESC_PRINTER_LEFTOFFSET
+msgstr "Décallage entre le bord gauche du papier et l'aire imprimable en 72ème de pouce"
+
+#original text: "Bottom offset from the edge of the paper to the printable area in 1/72 inch"
+msgid DESC_PRINTER_BOTTOMOFFSET
+msgstr "Décallage entre le bord inférieur du papier et l'aire imprimable en 72ème de pouce"
+
+#original text: "Additional gamma value for photocopy"
+msgid DESC_PRINTER_GAMMA
+msgstr "Gamma additionnel pour photocopie"
+
+#original text: "Additional gamma value for red component for photocopy"
+msgid DESC_PRINTER_GAMMA_RED
+msgstr "Gamma additionnel pour la composante rouge pour photocopie"
+
+#original text: "Additional gamma value for green component for photocopy"
+msgid DESC_PRINTER_GAMMA_GREEN
+msgstr "Gamma additionnel pour la composante verte pour photocopie"
+
+#original text: "Additional gamma value for blue component for photocopy"
+msgid DESC_PRINTER_GAMMA_BLUE
+msgstr "Gamma additionnel pour la composante bleue pour photocopie"
+
+#original text: "Quality in percent if image is saved as jpeg or tiff with jpeg compression"
+msgid DESC_JPEG_QUALITY
+msgstr "Qualité en pourcentage si l'image est enregistrée en jpeg ou tiff avec compression jpeg"
+
+#original text: "Compression if image is saved as png"
+msgid DESC_PNG_COMPRESSION
+msgstr "Compression si l'image est enregistrée en png"
+
+#original text: "Compression type if multi bit image is saved as tiff"
+msgid DESC_TIFF_COMPRESSION
+msgstr "Type de compression si l'image multi-bit est enregistrée en tiff"
+
+#original text: "Compression type if lineart image is saved as tiff"
+msgid DESC_TIFF_COMPRESSION_1
+msgstr "Type de compression si l'image lineart est enregistrée en tiff"
+
+#original text: "Warn before overwriting an existing file"
+msgid DESC_OVERWRITE_WARNING
+msgstr "Avertir avant d'écraser un fichier existant"
+
+#original text: "If the filename is of the form \"name-001.ext\" " "(where the number of digits is free) " "the number is increased after a scan is finished"
+msgid DESC_INCREASE_COUNTER
+msgstr "Si le nom de fichier est de la forme \"nom-001.ext\" (où le nombre de " "chiffres est libre), le nom est incrémenté lorsque le scan est terminé"
+
+#original text: "If filename counter is automatically increased, used numbers are skipped"
+msgid DESC_SKIP_EXISTING
+msgstr ""
+
+#original text: "Use fixed main window size or scrolled, resizable main window"
+msgid DESC_MAIN_WINDOW_FIXED
+msgstr "Si un compteur de noms de fichiers est utilisé, les nombres déjà utilisés sont évités"
+
+#original text: "Preserve preview image for next program start"
+msgid DESC_PREVIEW_PRESERVE
+msgstr "Préserver l'image de l'aperçu pour le prochain démarrage"
+
+#original text: "Use an own colormap for preview if display depth is 8 bpp"
+msgid DESC_PREVIEW_COLORMAP
+msgstr "Utiliser une palette de couleurs privée pour l'aperçu si l'affichage est en mode 8bits"
+
+#original text: "Set gamma correction value for preview image"
+msgid DESC_PREVIEW_GAMMA
+msgstr "Changer la valeur de la correction gamma pour l'image de l'aperçu"
+
+#original text: "Set gamma correction value for red component of preview image"
+msgid DESC_PREVIEW_GAMMA_RED
+msgstr "Changer la valeur de la correction gamma pour le composant rouge pour l'image de l'aperçu"
+
+#original text: "Set gamma correction value for green component of preview image"
+msgid DESC_PREVIEW_GAMMA_GREEN
+msgstr "Changer la valeur de la correction gamma pour le composant vert pour l'image de l'aperçu"
+
+#original text: "Set gamma correction value for blue component of preview image"
+msgid DESC_PREVIEW_GAMMA_BLUE
+msgstr "Changer la valeur de la correction gamma pour le composant bleue pour l'image de l'aperçu"
+
+#original text: "Enter command to be executed to display helpfiles, must be a html-viewer!"
+msgid DESC_DOC_VIEWER
+msgstr "Entrez la commande a exécuter pour afficher les fichiers d'aide; doit être capable de lire du html"
+
+#original text: "Enter command to be executed in fax mode"
+msgid DESC_FAX_COMMAND
+msgstr "Entrez la commande à exécuter en mode fax"
+
+#original text: "Enter option to specify receiver"
+msgid DESC_FAX_RECEIVER_OPT
+msgstr "Entrez l'option à spécifier au destinataire"
+
+#original text: "Enter option to specify postscript files following"
+msgid DESC_FAX_POSTSCRIPT_OPT
+msgstr "Entrez l'option à spécifier aux fichiers PostScript suivant"
+
+#original text: "Enter option to specify normal mode (low resolution)"
+msgid DESC_FAX_NORMAL_OPT
+msgstr "Entrez l'option à spécifier au mode normal (basse résolution)"
+
+#original text: "Enter option to specify fine mode (high resolution)"
+msgid DESC_FAX_FINE_OPT
+msgstr "Entrez l'option à spécifier au mode fin (haute résolution)"
+
+#original text: "Enter command to be executed to view a fax"
+msgid DESC_FAX_VIEWER
+msgstr "Entrez la commande à être exécuter pour voir un fax"
+
+#original text: "Use high vertical resolution (196 lpi instead of 98 lpi)"
+msgid DESC_FAX_FINE_MODE
+msgstr "Utiliser une plus grande résolution verticale (196 lpi à la place de 98 lpi)"
+
+#original text: "Pick white point"
+msgid DESC_PIPETTE_WHITE
+msgstr "Choisissez un point blanc"
+
+#original text: "Pick gray point"
+msgid DESC_PIPETTE_GRAY
+msgstr "Choisissez un point gris"
+
+#original text: "Pick black point"
+msgid DESC_PIPETTE_BLACK
+msgstr "Choisissez un point noir"
+
+#original text: "Use full scanarea"
+msgid DESC_ZOOM_FULL
+msgstr "Utiliser l'aire de scan complète"
+
+#original text: "Zoom 20% out"
+msgid DESC_ZOOM_OUT
+msgstr "Zoomer 20% en arrière"
+
+#original text: "Zoom into selected area"
+msgid DESC_ZOOM_IN
+msgstr "Zoomer l'aire sélectionnée"
+
+#original text: "Undo last zoom"
+msgid DESC_ZOOM_UNDO
+msgstr "Annuler le dernier zoom"
+
+#original text: "Select visible area"
+msgid DESC_FULL_PREVIEW_AREA
+msgstr "Sélectionner l'aire visible"
+
+#original text: "Failed to determine home directory:"
+msgid ERR_HOME_DIR
+msgstr "Impossible de déterminer le répertoire personnel"
+
+#original text: "Filename too long"
+msgid ERR_FILENAME_TOO_LONG
+msgstr "Nom de fichier trop long"
+
+#original text: "Failed to set value of option"
+msgid ERR_SET_OPTION
+msgstr "Échec du changement de la valeur de l'option"
+
+#original text: "Failed to obtain value of option"
+msgid ERR_GET_OPTION
+msgstr "Échec de l'obtention de la valeur de l'option"
+
+#original text: "Error obtaining option count"
+msgid ERR_OPTION_COUNT
+msgstr "Erreur de l'option 'count'"
+
+#original text: "Failed to open device"
+msgid ERR_DEVICE_OPEN_FAILED
+msgstr ""
+
+#original text: "no devices available"
+msgid ERR_NO_DEVICES
+msgstr "aucun périphérique disponible"
+
+#original text: "Error during read:"
+msgid ERR_DURING_READ
+msgstr ""
+
+#original text: "Error during save:"
+msgid ERR_DURING_SAVE
+msgstr ""
+
+#original text: "Can't handle depth"
+msgid ERR_BAD_DEPTH
+msgstr ""
+
+#original text: "Unknown file format for saving"
+msgid ERR_UNKNOWN_SAVING_FORMAT
+msgstr ""
+
+#original text: "Failed to open"
+msgid ERR_OPEN_FAILED
+msgstr ""
+
+#original text: "Failed to open pipe for executing printercommand"
+msgid ERR_FAILED_PRINTER_PIPE
+msgstr ""
+
+#original text: "Failed to execute printercommand:"
+msgid ERR_FAILED_EXEC_PRINTER_CMD
+msgstr ""
+
+#original text: "Failed to start scanner:"
+msgid ERR_FAILED_START_SCANNER
+msgstr ""
+
+#original text: "Failed to get parameters:"
+msgid ERR_FAILED_GET_PARAMS
+msgstr ""
+
+#original text: "No output format given"
+msgid ERR_NO_OUTPUT_FORMAT
+msgstr ""
+
+#original text: "out of memory"
+msgid ERR_NO_MEM
+msgstr ""
+
+#original text: "LIBTIFF reports error"
+msgid ERR_LIBTIFF
+msgstr ""
+
+#original text: "LIBPNG reports error"
+msgid ERR_LIBPNG
+msgstr ""
+
+#original text: "unknown type"
+msgid ERR_UNKNOWN_TYPE
+msgstr ""
+
+#original text: "unknown constraint type"
+msgid ERR_UNKNOWN_CONSTRAINT_TYPE
+msgstr ""
+
+#original text: "Failed to execute documentation viewer:"
+msgid ERR_FAILD_EXEC_DOC_VIEWER
+msgstr ""
+
+#original text: "Failed to execute fax viewer:"
+msgid ERR_FAILD_EXEC_FAX_VIEWER
+msgstr ""
+
+#original text: "Failed to execute faxcommand:"
+msgid ERR_FAILED_EXEC_FAX_CMD
+msgstr ""
+
+#original text: "bad frame format"
+msgid ERR_BAD_FRAME_FORMAT
+msgstr ""
+
+#original text: "unable to set resolution"
+msgid ERR_FAILED_SET_RESOLUTION
+msgstr ""
+
+#original text: "error"
+msgid ERR_ERROR
+msgstr "Erreur"
+
+#original text: "Sane major version number mismatch!"
+msgid ERR_MAJOR_VERSION_NR_CONFLICT
+msgstr "Incohérence dans les numéros de version majeur de Sane!"
+
+#original text: "xsane major version ="
+msgid ERR_XSANE_MAJOR_VERSION
+msgstr "version majeure de xsane ="
+
+#original text: "backend major version ="
+msgid ERR_BACKEND_MAJOR_VERSION
+msgstr "version majeure du moteur ="
+
+#original text: "*** PROGRAM ABORTED ***"
+msgid ERR_PROGRAM_ABORTED
+msgstr "*** ARRET DU PROGRAMME ***"
+
+#original text: "Failed to allocate image memory:"
+msgid ERR_FAILED_ALLOCATE_IMAGE
+msgstr ""
+
+#original text: "Preview cannot handle bit depth"
+msgid ERR_PREVIEW_BAD_DEPTH
+msgstr ""
+
+#original text: "GIMP support missing"
+msgid ERR_GIMP_SUPPORT_MISSING
+msgstr "le support pour GIMP est manquant"
+
+#original text: "Filename counter overflow"
+msgid WARN_COUNTER_OVERFLOW
+msgstr ""
+
+#original text: "warning: option has no value constraint"
+msgid WARN_NO_VALUE_CONSTRAINT
+msgstr ""
+
+#original text: "Ok"
+msgid ERR_BUTTON_OK
+msgstr ""
+
+#original text: "Error"
+msgid ERR_HEADER_ERROR
+msgstr "Erreur"
+
+#original text: "Warning"
+msgid ERR_HEADER_WARNING
+msgstr "Avertissement"
+
+#original text: "Usage:"
+msgid TEXT_USAGE
+msgstr "Usage:"
+
+#original text: "[OPTION]... [DEVICE]"
+msgid TEXT_USAGE_OPTIONS
+msgstr "[OPTION]... [PÉRIPHÉRIQUE]"
+
+#original text: "Start up graphical user interface to access SANE (Scanner Access Now Easy) devices.\n\n-h, --help display this help message and exit\n-v, --version print version information\n\n-d, --device-settings file load device settings from file (without \".drc\")\n\n-s, --scan start with scan-mode active\n-c, --copy start with copy-mode active\n-f, --fax start with fax-mode active\n-n, --no-mode-selection disable menu for xsane mode selection\n\n-F, --Fixed fixed main window size (overwrite preferences value)\n-R, --Resizeable resizable, scrolled main window (overwrite preferences value)\n\n--display X11-display redirect output to X11-display\n--no-xshm do not use shared memory images\n--sync request a synchronous connection with the X11 server"
+msgid TEXT_HELP
+msgstr "" "Démarre l'interface graphique pour accéder à SANE (Scanner Access Now Easy).\n" "\n" "-h, --help affiche ce message d'aide et quitte\n" "-v, --version donne des informations sur la version\n" "\n" "-d, --device-settings file charge la configuration d'un périphérique à\n" " partir d'un fichier (sans \".drc\")\n" "\n" "-s, --scan démarre en mode scan\n" "-c, --copy démarre en mode copie\n" "-f, --fax démarre en mode fax\n" "-n, --no-mode-selection désactive le menu de sélection de mode\n" "\n" "-F, --Fixed fixe la taille de la fenêtre principale (sans\n" " tenir compte des préférences)" "-R, --Resizeable taille de la fenêtre principale variable (sans\n" " tenir compte des préférences)\n" "--display affichage-X11 redirige l'affichage vers un autre affichage X11\n" "--no-xshm n'utilise pas la mémoire partagée\n" "--sync demande une connexion synchrone avec le serveur X"
+
+
+#original text: "Success"
+msgid "Success"
+msgstr ""
+
+#original text: "Operation not supported"
+msgid "Operation not supported"
+msgstr ""
+
+#original text: "Operation was cancelled"
+msgid "Operation was cancelled"
+msgstr ""
+
+#original text: "Device busy"
+msgid "Device busy"
+msgstr ""
+
+#original text: "Invalid argument"
+msgid "Invalid argument"
+msgstr ""
+
+#original text: "End of file reached"
+msgid "End of file reached"
+msgstr ""
+
+#original text: "Document feeder jammed"
+msgid "Document feeder jammed"
+msgstr ""
+
+#original text: "Document feeder out of documents"
+msgid "Document feeder out of documents"
+msgstr ""
+
+#original text: "Scanner cover is open"
+msgid "Scanner cover is open"
+msgstr ""
+
+#original text: "Error during device I/O"
+msgid "Error during device I/O"
+msgstr ""
+
+#original text: "Out of memory"
+msgid "Out of memory"
+msgstr ""
+
+#original text: "Access to resource has been denied"
+msgid "Access to resource has been denied"
+msgstr ""
+
diff --git a/po/make_newlanguage.po.in b/po/make_newlanguage.po.in
new file mode 100755
index 0000000..60e5f0b
--- /dev/null
+++ b/po/make_newlanguage.po.in
@@ -0,0 +1,3 @@
+gcc -E -P - <newlanguage.po.in.in | sed -e "s/^_/msgid /g" - | cat newlanguage.po.in.header - >newlanguage.po.in
+
+
diff --git a/po/newlanguage.po.in b/po/newlanguage.po.in
new file mode 100644
index 0000000..580ffa5
--- /dev/null
+++ b/po/newlanguage.po.in
@@ -0,0 +1,1567 @@
+#include "../frontend/xsane-text.h"
+#define _(x) x
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#nls translation file for xsane
+#language: newlanguage (abbreviation)
+
+#original text: "About"
+msgid WINDOW_ABOUT
+msgstr ""
+
+#original text: "authorization"
+msgid WINDOW_AUTHORIZE
+msgstr ""
+
+#original text: "info"
+msgid WINDOW_INFO
+msgstr ""
+
+#original text: "batch scan"
+msgid WINDOW_BATCH_SCAN
+msgstr ""
+
+#original text: "fax project"
+msgid WINDOW_FAX_PROJECT
+msgstr ""
+
+#original text: "rename fax page"
+msgid WINDOW_FAX_RENAME
+msgstr ""
+
+#original text: "setup"
+msgid WINDOW_SETUP
+msgstr ""
+
+#original text: "Histogram"
+msgid WINDOW_HISTOGRAM
+msgstr ""
+
+#original text: "Standard options"
+msgid WINDOW_STANDARD_OPTIONS
+msgstr ""
+
+#original text: "Advanced options"
+msgid WINDOW_ADVANCED_OPTIONS
+msgstr ""
+
+#original text: "device selection"
+msgid WINDOW_DEVICE_SELECTION
+msgstr ""
+
+#original text: "Preview"
+msgid WINDOW_PREVIEW
+msgstr ""
+
+#original text: "output filename"
+msgid WINDOW_OUTPUT_FILENAME
+msgstr ""
+
+#original text: "save device settings"
+msgid WINDOW_SAVE_SETTINGS
+msgstr ""
+
+#original text: "load device settings"
+msgid WINDOW_LOAD_SETTINGS
+msgstr ""
+
+#original text: "File"
+msgid MENU_FILE
+msgstr ""
+
+#original text: "Preferences"
+msgid MENU_PREFERENCES
+msgstr ""
+
+#original text: "View"
+msgid MENU_VIEW
+msgstr ""
+
+#original text: "Help"
+msgid MENU_HELP
+msgstr ""
+
+#original text: "About"
+msgid MENU_ITEM_ABOUT
+msgstr ""
+
+#original text: "Info"
+msgid MENU_ITEM_INFO
+msgstr ""
+
+#original text: "Exit"
+msgid MENU_ITEM_EXIT
+msgstr ""
+
+#original text: "Raw image"
+msgid FRAME_RAW_IMAGE
+msgstr ""
+
+#original text: "Enhanced image"
+msgid FRAME_ENHANCED_IMAGE
+msgstr ""
+
+#original text: "Start"
+msgid BUTTON_START
+msgstr ""
+
+#original text: "Ok"
+msgid BUTTON_OK
+msgstr ""
+
+#original text: "Apply"
+msgid BUTTON_APPLY
+msgstr ""
+
+#original text: "Cancel"
+msgid BUTTON_CANCEL
+msgstr ""
+
+#original text: "Close"
+msgid BUTTON_CLOSE
+msgstr ""
+
+#original text: "Overwrite"
+msgid BUTTON_OVERWRITE
+msgstr ""
+
+#original text: "Add area"
+msgid BUTTON_ADD_AREA
+msgstr ""
+
+#original text: "Delete"
+msgid BUTTON_DELETE
+msgstr ""
+
+#original text: "Show"
+msgid BUTTON_SHOW
+msgstr ""
+
+#original text: "Rename"
+msgid BUTTON_RENAME
+msgstr ""
+
+#original text: "Create project"
+msgid BUTTON_CREATE_PROJECT
+msgstr ""
+
+#original text: "Send project"
+msgid BUTTON_SEND_PROJECT
+msgstr ""
+
+#original text: "Delete project"
+msgid BUTTON_DELETE_PROJECT
+msgstr ""
+
+#original text: "Add printer"
+msgid BUTTON_ADD_PRINTER
+msgstr ""
+
+#original text: "Delete printer"
+msgid BUTTON_DELETE_PRINTER
+msgstr ""
+
+#original text: "Acquire Preview"
+msgid BUTTON_PREVIEW_ACQUIRE
+msgstr ""
+
+#original text: "Cancel Preview"
+msgid BUTTON_PREVIEW_CANCEL
+msgstr ""
+
+#original text: "Fine mode"
+msgid RADIO_BUTTON_FINE_MODE
+msgstr ""
+
+#original text: "Overwrite warning"
+msgid RADIO_BUTTON_OVERWRITE_WARNING
+msgstr ""
+
+#original text: "Increase filename counter"
+msgid RADIO_BUTTON_INCREASE_COUNTER
+msgstr ""
+
+#original text: "Skip existing numbers"
+msgid RADIO_BUTTON_SKIP_EXISTING_NRS
+msgstr ""
+
+#original text: "Main window size fixed"
+msgid RADIO_BUTTON_WINDOW_FIXED
+msgstr ""
+
+#original text: "Preserve preview image"
+msgid RADIO_BUTTON_PRESERVE_PRVIEW
+msgstr ""
+
+#original text: "Use private colormap"
+msgid RADIO_BUTTON_PRIVATE_COLORMAP
+msgstr ""
+
+#original text: "Available devices:"
+msgid TEXT_AVAILABLE_DEVICES
+msgstr ""
+
+#original text: "XSane options"
+msgid TEXT_XSANE_OPTIONS
+msgstr ""
+
+#original text: "XSane mode"
+msgid TEXT_XSANE_MODE
+msgstr ""
+
+#original text: "Scanner and backend:"
+msgid TEXT_SCANNER_BACKEND
+msgstr ""
+
+#original text: "Vendor:"
+msgid TEXT_VENDOR
+msgstr ""
+
+#original text: "Model:"
+msgid TEXT_MODEL
+msgstr ""
+
+#original text: "Type:"
+msgid TEXT_TYPE
+msgstr ""
+
+#original text: "Device:"
+msgid TEXT_DEVICE
+msgstr ""
+
+#original text: "Loaded backend:"
+msgid TEXT_LOADED_BACKEND
+msgstr ""
+
+#original text: "Sane version:"
+msgid TEXT_SANE_VERSION
+msgstr ""
+
+#original text: "Recent values:"
+msgid TEXT_RECENT_VALUES
+msgstr ""
+
+#original text: "Gamma correction by:"
+msgid TEXT_GAMMA_CORR_BY
+msgstr ""
+
+#original text: "scanner"
+msgid TEXT_SCANNER
+msgstr ""
+
+#original text: "software (xsane)"
+msgid TEXT_SOFTWARE_XSANE
+msgstr ""
+
+#original text: "none"
+msgid TEXT_NONE
+msgstr ""
+
+#original text: "Gamma input depth:"
+msgid TEXT_GAMMA_INPUT_DEPTH
+msgstr ""
+
+#original text: "Gamma output depth:"
+msgid TEXT_GAMMA_OUTPUT_DEPTH
+msgstr ""
+
+#original text: "Scanner output depth:"
+msgid TEXT_SCANNER_OUTPUT_DEPTH
+msgstr ""
+
+#original text: "XSane output formats:"
+msgid TEXT_OUTPUT_FORMATS
+msgstr ""
+
+#original text: "8 bit output formats:"
+msgid TEXT_8BIT_FORMATS
+msgstr ""
+
+#original text: "16 bit output formats:"
+msgid TEXT_16BIT_FORMATS
+msgstr ""
+
+#original text: "Authorization required for"
+msgid TEXT_AUTHORIZATION_REQ
+msgstr ""
+
+#original text: "Username :"
+msgid TEXT_USERNAME
+msgstr ""
+
+#original text: "Password :"
+msgid TEXT_PASSWORD
+msgstr ""
+
+#original text: "Invalid parameters."
+msgid TEXT_INVALID_PARAMS
+msgstr ""
+
+#original text: "version:"
+msgid TEXT_VERSION
+msgstr ""
+
+#original text: "package"
+msgid TEXT_PACKAGE
+msgstr ""
+
+#original text: "with GIMP support"
+msgid TEXT_WITH_GIMP_SUPPORT
+msgstr ""
+
+#original text: "without GIMP support"
+msgid TEXT_WITHOUT_GIMP_SUPPORT
+msgstr ""
+
+#original text: "compiled with GIMP-"
+msgid TEXT_GIMP_VERSION
+msgstr ""
+
+#original text: "unknown"
+msgid TEXT_UNKNOWN
+msgstr ""
+
+#original text: "Email:"
+msgid TEXT_EMAIL
+msgstr ""
+
+#original text: "File:"
+msgid TEXT_FILE
+msgstr ""
+
+#original text: "0x0: 0KB"
+msgid TEXT_INFO_BOX
+msgstr ""
+
+#original text: "Printer selection:"
+msgid TEXT_SETUP_PRINTER_SEL
+msgstr ""
+
+#original text: "Name:"
+msgid TEXT_SETUP_PRINTER_NAME
+msgstr ""
+
+#original text: "Command:"
+msgid TEXT_SETUP_PRINTER_CMD
+msgstr ""
+
+#original text: "Copy number option:"
+msgid TEXT_SETUP_COPY_NR_OPT
+msgstr ""
+
+#original text: "Resolution (dpi):"
+msgid TEXT_SETUP_PRINTER_RES
+msgstr ""
+
+#original text: "Width (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_WIDTH
+msgstr ""
+
+#original text: "Height (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_HEIGHT
+msgstr ""
+
+#original text: "Left offset (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_LEFT
+msgstr ""
+
+#original text: "Bottom offset (1/72 inch):"
+msgid TEXT_SETUP_PRINTER_BOTTOM
+msgstr ""
+
+#original text: "Printer gamma value:"
+msgid TEXT_SETUP_PRINTER_GAMMA
+msgstr ""
+
+#original text: "Printer gamma red:"
+msgid TEXT_SETUP_PRINTER_GAMMA_RED
+msgstr ""
+
+#original text: "Printer gamma green:"
+msgid TEXT_SETUP_PRINTER_GAMMA_GREEN
+msgstr ""
+
+#original text: "Printer gamma blue:"
+msgid TEXT_SETUP_PRINTER_GAMMA_BLUE
+msgstr ""
+
+#original text: "JPEG image quality"
+msgid TEXT_SETUP_JPEG_QUALITY
+msgstr ""
+
+#original text: "PNG image compression"
+msgid TEXT_SETUP_PNG_COMPRESSION
+msgstr ""
+
+#original text: "TIFF multi bit image compression"
+msgid TEXT_SETUP_TIFF_COMPRESSION
+msgstr ""
+
+#original text: "TIFF lineart image compression"
+msgid TEXT_SETUP_TIFF_COMPRESSION_1
+msgstr ""
+
+#original text: "Preview gamma:"
+msgid TEXT_SETUP_PREVIEW_GAMMA
+msgstr ""
+
+#original text: "Preview gamma red:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_RED
+msgstr ""
+
+#original text: "Preview gamma green:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_GREEN
+msgstr ""
+
+#original text: "Preview gamma blue:"
+msgid TEXT_SETUP_PREVIEW_GAMMA_BLUE
+msgstr ""
+
+#original text: "Helpfile viewer (HTML):"
+msgid TEXT_SETUP_HELPFILE_VIEWER
+msgstr ""
+
+#original text: "Command:"
+msgid TEXT_SETUP_FAX_COMMAND
+msgstr ""
+
+#original text: "Receiver option:"
+msgid TEXT_SETUP_FAX_RECEIVER_OPTION
+msgstr ""
+
+#original text: "Postscriptfile option:"
+msgid TEXT_SETUP_FAX_POSTSCRIPT_OPT
+msgstr ""
+
+#original text: "Normal mode option:"
+msgid TEXT_SETUP_FAX_NORMAL_MODE_OPT
+msgstr ""
+
+#original text: "Fine mode option:"
+msgid TEXT_SETUP_FAX_FINE_MODE_OPT
+msgstr ""
+
+#original text: "Viewer (Postscript):"
+msgid TEXT_SETUP_FAX_VIEWER
+msgstr ""
+
+#original text: "Copy options"
+msgid NOTEBOOK_COPY_OPTIONS
+msgstr ""
+
+#original text: "Saving options"
+msgid NOTEBOOK_SAVING_OPTIONS
+msgstr ""
+
+#original text: "Display options"
+msgid NOTEBOOK_DISPLAY_OPTIONS
+msgstr ""
+
+#original text: "Fax options"
+msgid NOTEBOOK_FAX_OPTIONS
+msgstr ""
+
+#original text: "Scan"
+msgid MENU_ITEM_SCAN
+msgstr ""
+
+#original text: "Copy"
+msgid MENU_ITEM_COPY
+msgstr ""
+
+#original text: "Fax"
+msgid MENU_ITEM_FAX
+msgstr ""
+
+#original text: "Setup"
+msgid MENU_ITEM_SETUP
+msgstr ""
+
+#original text: "Show tooltips"
+msgid MENU_ITEM_SHOW_TOOLTIPS
+msgstr ""
+
+#original text: "Show preview"
+msgid MENU_ITEM_SHOW_PREVIEW
+msgstr ""
+
+#original text: "Show histogram"
+msgid MENU_ITEM_SHOW_HISTOGRAM
+msgstr ""
+
+#original text: "Show standard options"
+msgid MENU_ITEM_SHOW_STANDARDOPTIONS
+msgstr ""
+
+#original text: "Show advanced options"
+msgid MENU_ITEM_SHOW_ADVANCEDOPTIONS
+msgstr ""
+
+
+#original text: "Show resolution list"
+msgid MENU_ITEM_SHOW_RESOLUTIONLIST
+msgstr ""
+
+#original text: "Length unit"
+msgid MENU_ITEM_LENGTH_UNIT
+msgstr ""
+
+#original text: "millimeters"
+msgid SUBMENU_ITEM_LENGTH_MILLIMETERS
+msgstr ""
+
+#original text: "centimeters"
+msgid SUBMENU_ITEM_LENGTH_CENTIMETERS
+msgstr ""
+
+#original text: "inches"
+msgid SUBMENU_ITEM_LENGTH_INCHES
+msgstr ""
+
+#original text: "Save device settings"
+msgid MENU_ITEM_SAVE_DEVICE_SETTINGS
+msgstr ""
+
+#original text: "Load device settings"
+msgid MENU_ITEM_LOAD_DEVICE_SETTINGS
+msgstr ""
+
+#original text: "Xsane doc"
+msgid MENU_ITEM_XSANE_DOC
+msgstr ""
+
+#original text: "Backend doc"
+msgid MENU_ITEM_BACKEND_DOC
+msgstr ""
+
+#original text: "Available backends"
+msgid MENU_ITEM_AVAILABLE_BACKENDS
+msgstr ""
+
+#original text: "Scantips"
+msgid MENU_ITEM_SCANTIPS
+msgstr ""
+
+#original text: "Problems?"
+msgid MENU_ITEM_PROBLEMS
+msgstr ""
+
+#original text: "no compression"
+msgid MENU_ITEM_TIFF_COMP_NONE
+msgstr ""
+
+#original text: "CCITT 1D Huffman compression"
+msgid MENU_ITEM_TIFF_COMP_CCITTRLE
+msgstr ""
+
+#original text: "CCITT Group 3 Fax compression"
+msgid MENU_ITEM_TIFF_COMP_CCITFAX3
+msgstr ""
+
+#original text: "CCITT Group 4 Fax compression"
+msgid MENU_ITEM_TIFF_COMP_CCITFAX4
+msgstr ""
+
+#original text: "JPEG DCT compression"
+msgid MENU_ITEM_TIFF_COMP_JPEG
+msgstr ""
+
+#original text: "pack bits"
+msgid MENU_ITEM_TIFF_COMP_PACKBITS
+msgstr ""
+
+#original text: "by ext"
+msgid MENU_ITEM_FILETYPE_BY_EXT
+msgstr ""
+
+#original text: "Saving image"
+msgid PROGRESS_SAVING
+msgstr ""
+
+#original text: "Saving fax image"
+msgid PROGRESS_SAVING_FAX
+msgstr ""
+
+#original text: "Converting data...."
+msgid PROGRESS_CONVERTING_DATA
+msgstr ""
+
+#original text: "Converting to postscript"
+msgid PROGRESS_CONVERTING_PS
+msgstr ""
+
+#original text: "Scanning"
+msgid PROGRESS_SCANNING
+msgstr ""
+
+#original text: "Receiving %s data for `%s'..."
+msgid PROGRESS_RECEIVING_SCAN
+msgstr ""
+
+#original text: "Receiving %s data for photocopy ..."
+msgid PROGRESS_RECEIVING_COPY
+msgstr ""
+
+#original text: "Receiving %s data for fax ..."
+msgid PROGRESS_RECEIVING_FAX
+msgstr ""
+
+#original text: "Receiving %s data for GIMP..."
+msgid PROGRESS_RECEIVING_GIMP
+msgstr ""
+
+
+#original text: "Use XSane for SCANning, photoCOPYing, FAXing..."
+msgid DESC_XSANE_MODE
+msgstr ""
+
+#original text: "Browse for image filename"
+msgid DESC_BROWSE_FILENAME
+msgstr ""
+
+#original text: "Filename for scanned image"
+msgid DESC_FILENAME
+msgstr ""
+
+#original text: "Filename extension and type of image format"
+msgid DESC_FILETYPE
+msgstr ""
+
+#original text: "Enter name of fax project"
+msgid DESC_FAXPROJECT
+msgstr ""
+
+#original text: "Enter new name for faxpage"
+msgid DESC_FAXPAGENAME
+msgstr ""
+
+#original text: "Enter receiver phone number or address"
+msgid DESC_FAXRECEIVER
+msgstr ""
+
+#original text: "Select printer definition"
+msgid DESC_PRINTER_SELECT
+msgstr ""
+
+#original text: "Set scan resolution"
+msgid DESC_RESOLUTION
+msgstr ""
+
+#original text: "Set zoomfactor"
+msgid DESC_ZOOM
+msgstr ""
+
+#original text: "Set number of copies"
+msgid DESC_COPY_NUMBER
+msgstr ""
+
+#original text: "Negative: Invert colors for scanning negatives\n" "e.g. swap black and white"
+msgid DESC_NEGATIVE
+msgstr ""
+
+#original text: "Set gamma value"
+msgid DESC_GAMMA
+msgstr ""
+
+#original text: "Set gamma value for red component"
+msgid DESC_GAMMA_R
+msgstr ""
+
+#original text: "Set gamma value for green component"
+msgid DESC_GAMMA_G
+msgstr ""
+
+#original text: "Set gamma value for blue component"
+msgid DESC_GAMMA_B
+msgstr ""
+
+#original text: "Set brightness"
+msgid DESC_BRIGHTNESS
+msgstr ""
+
+#original text: "Set brightness for red component"
+msgid DESC_BRIGHTNESS_R
+msgstr ""
+
+#original text: "Set brightness for green component"
+msgid DESC_BRIGHTNESS_G
+msgstr ""
+
+#original text: "Set brightness for blue component"
+msgid DESC_BRIGHTNESS_B
+msgstr ""
+
+#original text: "Set contrast"
+msgid DESC_CONTRAST
+msgstr ""
+
+#original text: "Set contrast for red component"
+msgid DESC_CONTRAST_R
+msgstr ""
+
+#original text: "Set contrast for green component"
+msgid DESC_CONTRAST_G
+msgstr ""
+
+#original text: "Set contrast for blue component"
+msgid DESC_CONTRAST_B
+msgstr ""
+
+#original text: "RGB default: Set enhancement values for red, green and blue to default values:\n" " gamma = 1.0\n" " brightness = 0\n" " contrast = 0"
+msgid DESC_RGB_DEFAULT
+msgstr ""
+
+#original text: "Autoadjust gamma, brightness and contrast in dependance of selected area"
+msgid DESC_ENH_AUTO
+msgstr ""
+
+#original text: "Set default enhancement values:\n" "gamma = 1.0\n" "brightness = 0\n" "contrast = 0"
+msgid DESC_ENH_DEFAULT
+msgstr ""
+
+#original text: "Restore enhancement values from preferences"
+msgid DESC_ENH_RESTORE
+msgstr ""
+
+#original text: "Store active enhancement values to preferences"
+msgid DESC_ENH_STORE
+msgstr ""
+
+#original text: "Show histogram of intensity/gray"
+msgid DESC_HIST_INTENSITY
+msgstr ""
+
+#original text: "Show histogram of red component"
+msgid DESC_HIST_RED
+msgstr ""
+
+#original text: "Show histogram of green component"
+msgid DESC_HIST_GREEN
+msgstr ""
+
+#original text: "Show histogram of blue component"
+msgid DESC_HIST_BLUE
+msgstr ""
+
+#original text: "Display histogram with lines instead of pixels"
+msgid DESC_HIST_PIXEL
+msgstr ""
+
+#original text: "Show logarithm of pixelcount"
+msgid DESC_HIST_LOG
+msgstr ""
+
+#original text: "Select definition to change"
+msgid DESC_PRINTER_SETUP
+msgstr ""
+
+#original text: "Define a name for the selection of this definition"
+msgid DESC_PRINTER_NAME
+msgstr ""
+
+#original text: "Enter command to be executed in copy mode (e.g. \"lpr -\")"
+msgid DESC_PRINTER_COMMAND
+msgstr ""
+
+#original text: "Enter option for copy numbers"
+msgid DESC_COPY_NUMBER_OPTION
+msgstr ""
+
+#original text: "Resolution with which images are printed and saved in postscript"
+msgid DESC_PRINTER_RESOLUTION
+msgstr ""
+
+#original text: "Width of printable area in 1/72 inch"
+msgid DESC_PRINTER_WIDTH
+msgstr ""
+
+#original text: "Height of printable area in 1/72 inch"
+msgid DESC_PRINTER_HEIGHT
+msgstr ""
+
+#original text: "Left offset from the edge of the paper to the printable area in 1/72 inch"
+msgid DESC_PRINTER_LEFTOFFSET
+msgstr ""
+
+#original text: "Bottom offset from the edge of the paper to the printable area in 1/72 inch"
+msgid DESC_PRINTER_BOTTOMOFFSET
+msgstr ""
+
+#original text: "Additional gamma value for photocopy"
+msgid DESC_PRINTER_GAMMA
+msgstr ""
+
+#original text: "Additional gamma value for red component for photocopy"
+msgid DESC_PRINTER_GAMMA_RED
+msgstr ""
+
+#original text: "Additional gamma value for green component for photocopy"
+msgid DESC_PRINTER_GAMMA_GREEN
+msgstr ""
+
+#original text: "Additional gamma value for blue component for photocopy"
+msgid DESC_PRINTER_GAMMA_BLUE
+msgstr ""
+
+#original text: "Quality in percent if image is saved as jpeg or tiff with jpeg compression"
+msgid DESC_JPEG_QUALITY
+msgstr ""
+
+#original text: "Compression if image is saved as png"
+msgid DESC_PNG_COMPRESSION
+msgstr ""
+
+#original text: "Compression type if multi bit image is saved as tiff"
+msgid DESC_TIFF_COMPRESSION
+msgstr ""
+
+#original text: "Compression type if lineart image is saved as tiff"
+msgid DESC_TIFF_COMPRESSION_1
+msgstr ""
+
+#original text: "Warn before overwriting an existing file"
+msgid DESC_OVERWRITE_WARNING
+msgstr ""
+
+#original text: "If the filename is of the form \"name-001.ext\" " "(where the number of digits is free) " "the number is increased after a scan is finished"
+msgid DESC_INCREASE_COUNTER
+msgstr ""
+
+#original text: "If filename counter is automatically increased, used numbers are skipped"
+msgid DESC_SKIP_EXISTING
+msgstr ""
+
+#original text: "Use fixed main window size or scrolled, resizable main window"
+msgid DESC_MAIN_WINDOW_FIXED
+msgstr ""
+
+#original text: "Preserve preview image for next program start"
+msgid DESC_PREVIEW_PRESERVE
+msgstr ""
+
+#original text: "Use an own colormap for preview if display depth is 8 bpp"
+msgid DESC_PREVIEW_COLORMAP
+msgstr ""
+
+#original text: "Set gamma correction value for preview image"
+msgid DESC_PREVIEW_GAMMA
+msgstr ""
+
+#original text: "Set gamma correction value for red component of preview image"
+msgid DESC_PREVIEW_GAMMA_RED
+msgstr ""
+
+#original text: "Set gamma correction value for green component of preview image"
+msgid DESC_PREVIEW_GAMMA_GREEN
+msgstr ""
+
+#original text: "Set gamma correction value for blue component of preview image"
+msgid DESC_PREVIEW_GAMMA_BLUE
+msgstr ""
+
+#original text: "Enter command to be executed to display helpfiles, must be a html-viewer!"
+msgid DESC_DOC_VIEWER
+msgstr ""
+
+#original text: "Enter command to be executed in fax mode"
+msgid DESC_FAX_COMMAND
+msgstr ""
+
+#original text: "Enter option to specify receiver"
+msgid DESC_FAX_RECEIVER_OPT
+msgstr ""
+
+#original text: "Enter option to specify postscript files following"
+msgid DESC_FAX_POSTSCRIPT_OPT
+msgstr ""
+
+#original text: "Enter option to specify normal mode (low resolution)"
+msgid DESC_FAX_NORMAL_OPT
+msgstr ""
+
+#original text: "Enter option to specify fine mode (high resolution)"
+msgid DESC_FAX_FINE_OPT
+msgstr ""
+
+#original text: "Enter command to be executed to view a fax"
+msgid DESC_FAX_VIEWER
+msgstr ""
+
+#original text: "Use high vertical resolution (196 lpi instead of 98 lpi)"
+msgid DESC_FAX_FINE_MODE
+msgstr ""
+
+#original text: "Pick white point"
+msgid DESC_PIPETTE_WHITE
+msgstr ""
+
+#original text: "Pick gray point"
+msgid DESC_PIPETTE_GRAY
+msgstr ""
+
+#original text: "Pick black point"
+msgid DESC_PIPETTE_BLACK
+msgstr ""
+
+#original text: "Use full scanarea"
+msgid DESC_ZOOM_FULL
+msgstr ""
+
+#original text: "Zoom 20% out"
+msgid DESC_ZOOM_OUT
+msgstr ""
+
+#original text: "Zoom into selected area"
+msgid DESC_ZOOM_IN
+msgstr ""
+
+#original text: "Undo last zoom"
+msgid DESC_ZOOM_UNDO
+msgstr ""
+
+#original text: "Select visible area"
+msgid DESC_FULL_PREVIEW_AREA
+msgstr ""
+
+#original text: "Failed to determine home directory:"
+msgid ERR_HOME_DIR
+msgstr ""
+
+#original text: "Filename too long"
+msgid ERR_FILENAME_TOO_LONG
+msgstr ""
+
+#original text: "Failed to set value of option"
+msgid ERR_SET_OPTION
+msgstr ""
+
+#original text: "Failed to obtain value of option"
+msgid ERR_GET_OPTION
+msgstr ""
+
+#original text: "Error obtaining option count"
+msgid ERR_OPTION_COUNT
+msgstr ""
+
+#original text: "Failed to open device"
+msgid ERR_DEVICE_OPEN_FAILED
+msgstr ""
+
+#original text: "no devices available"
+msgid ERR_NO_DEVICES
+msgstr ""
+
+#original text: "Error during read:"
+msgid ERR_DURING_READ
+msgstr ""
+
+#original text: "Error during save:"
+msgid ERR_DURING_SAVE
+msgstr ""
+
+#original text: "Can't handle depth"
+msgid ERR_BAD_DEPTH
+msgstr ""
+
+#original text: "GIMP can't handle depth"
+msgid ERR_GIMP_BAD_DEPTH
+msgstr ""
+
+#original text: "Unknown file format for saving"
+msgid ERR_UNKNOWN_SAVING_FORMAT
+msgstr ""
+
+#original text: "Failed to open"
+msgid ERR_OPEN_FAILED
+msgstr ""
+
+#original text: "Failed to open pipe for executing printercommand"
+msgid ERR_FAILED_PRINTER_PIPE
+msgstr ""
+
+#original text: "Failed to execute printercommand:"
+msgid ERR_FAILED_EXEC_PRINTER_CMD
+msgstr ""
+
+#original text: "Failed to start scanner:"
+msgid ERR_FAILED_START_SCANNER
+msgstr ""
+
+#original text: "Failed to get parameters:"
+msgid ERR_FAILED_GET_PARAMS
+msgstr ""
+
+#original text: "No output format given"
+msgid ERR_NO_OUTPUT_FORMAT
+msgstr ""
+
+#original text: "out of memory"
+msgid ERR_NO_MEM
+msgstr ""
+
+#original text: "LIBTIFF reports error"
+msgid ERR_LIBTIFF
+msgstr ""
+
+#original text: "LIBPNG reports error"
+msgid ERR_LIBPNG
+msgstr ""
+
+#original text: "unknown type"
+msgid ERR_UNKNOWN_TYPE
+msgstr ""
+
+#original text: "unknown constraint type"
+msgid ERR_UNKNOWN_CONSTRAINT_TYPE
+msgstr ""
+
+#original text: "Failed to execute documentation viewer:"
+msgid ERR_FAILD_EXEC_DOC_VIEWER
+msgstr ""
+
+#original text: "Failed to execute fax viewer:"
+msgid ERR_FAILD_EXEC_FAX_VIEWER
+msgstr ""
+
+#original text: "Failed to execute faxcommand:"
+msgid ERR_FAILED_EXEC_FAX_CMD
+msgstr ""
+
+#original text: "bad frame format"
+msgid ERR_BAD_FRAME_FORMAT
+msgstr ""
+
+#original text: "unable to set resolution"
+msgid ERR_FAILED_SET_RESOLUTION
+msgstr ""
+
+#original text: "error"
+msgid ERR_ERROR
+msgstr ""
+
+#original text: "Sane major version number mismatch!"
+msgid ERR_MAJOR_VERSION_NR_CONFLICT
+msgstr ""
+
+#original text: "xsane major version ="
+msgid ERR_XSANE_MAJOR_VERSION
+msgstr ""
+
+#original text: "backend major version ="
+msgid ERR_BACKEND_MAJOR_VERSION
+msgstr ""
+
+#original text: "*** PROGRAM ABORTED ***"
+msgid ERR_PROGRAM_ABORTED
+msgstr ""
+
+#original text: "Failed to allocate image memory:"
+msgid ERR_FAILED_ALLOCATE_IMAGE
+msgstr ""
+
+#original text: "Preview cannot handle bit depth"
+msgid ERR_PREVIEW_BAD_DEPTH
+msgstr ""
+
+#original text: "GIMP support missing"
+msgid ERR_GIMP_SUPPORT_MISSING
+msgstr ""
+
+#original text: "Filename counter overflow"
+msgid WARN_COUNTER_OVERFLOW
+msgstr ""
+
+#original text: "warning: option has no value constraint"
+msgid WARN_NO_VALUE_CONSTRAINT
+msgstr ""
+
+#original text: "Ok"
+msgid ERR_BUTTON_OK
+msgstr ""
+
+#original text: "Error"
+msgid ERR_HEADER_ERROR
+msgstr ""
+
+#original text: "Warning"
+msgid ERR_HEADER_WARNING
+msgstr ""
+
+#original text: "Failed to create file:"
+msgid ERR_FAILED_CREATE_FILE
+msgstr ""
+
+#original text: "Error while loading device settings:"
+msgid ERR_LOAD_DEVICE_SETTINGS
+msgstr ""
+
+#original text: "is not a device-rc-file !!!"
+msgid ERR_NO_DRC_FILE
+msgstr ""
+
+#original text: "Failed to execute netscape!"
+msgid ERR_NETSCAPE_EXECUTE_FAIL
+msgstr ""
+
+#original text: "Send fax: no receiver defined"
+msgid ERR_SENDFAX_RECEIVER_MISSING
+msgstr ""
+
+#original text: "has been created for device"
+msgid ERR_CREATED_FOR_DEVICE
+msgstr ""
+
+#original text: "you want to use it for device"
+msgid ERR_USED_FOR_DEVICE
+msgstr ""
+
+#original text: "this may cause problems!"
+msgid ERR_MAY_CAUSE_PROBLEMS
+msgstr ""
+
+#original text: "Usage:"
+msgid TEXT_USAGE
+msgstr ""
+
+#original text: "[OPTION]... [DEVICE]"
+msgid TEXT_USAGE_OPTIONS
+msgstr ""
+
+#original text: "Start up graphical user interface to access SANE (Scanner Access Now Easy) devices.\n\n-h, --help display this help message and exit\n-v, --version print version information\n\n-d, --device-settings file load device settings from file (without \".drc\")\n\n-s, --scan start with scan-mode active\n-c, --copy start with copy-mode active\n-f, --fax start with fax-mode active\n-n, --no-mode-selection disable menu for xsane mode selection\n\n-F, --Fixed fixed main window size (overwrite preferences value)\n-R, --Resizeable resizable, scrolled main window (overwrite preferences value)\n\n--display X11-display redirect output to X11-display\n--no-xshm do not use shared memory images\n--sync request a synchronous connection with the X11 server"
+msgid TEXT_HELP
+msgstr ""
+
+#original text: "Front-end to the SANE interface"
+msgid XSANE_GIMP_INSTALL_BLURB
+msgstr ""
+
+#original text: "This function provides access to scanners and other image acquisition devices through the SANE (Scanner Access Now Easy) interface."
+msgid XSANE_GIMP_INSTALL_HELP
+msgstr ""
+
+#original text: "<Toolbox>/File/Acquire/XSane: "
+msgid XSANE_GIMP_MENU
+msgstr ""
+
+#original text: "<Toolbox>/Xtns/XSane/"
+msgid XSANE_GIMP_MENU_OLD
+msgstr ""
+
+#original text: "<Toolbox>/File/Acquire/XSane: Device dialog..."
+msgid XSANE_GIMP_MENU_DIALOG
+msgstr ""
+
+#original text: "<Toolbox>/Xtns/XSane/Device dialog..."
+msgid XSANE_GIMP_MENU_DIALOG_OLD
+msgstr ""
+
+msgid "flatbed scanner"
+msgstr ""
+
+msgid "frame grabber"
+msgstr ""
+
+msgid "handheld scanner"
+msgstr ""
+
+msgid "still camera"
+msgstr ""
+
+msgid "video camera"
+msgstr ""
+
+msgid "virtual device"
+msgstr ""
+
+
+msgid "Success"
+msgstr ""
+
+msgid "Operation not supported"
+msgstr ""
+
+msgid "Operation was cancelled"
+msgstr ""
+
+msgid "Device busy"
+msgstr ""
+
+msgid "Invalid argument"
+msgstr ""
+
+msgid "End of file reached"
+msgstr ""
+
+msgid "Document feeder jammed"
+msgstr ""
+
+msgid "Document feeder out of documents"
+msgstr ""
+
+msgid "Scanner cover is open"
+msgstr ""
+
+msgid "Error during device I/O"
+msgstr ""
+
+msgid "Out of memory"
+msgstr ""
+
+msgid "Access to resource has been denied"
+msgstr ""
+
diff --git a/po/newlanguage.po.in.header b/po/newlanguage.po.in.header
new file mode 100644
index 0000000..bbc768b
--- /dev/null
+++ b/po/newlanguage.po.in.header
@@ -0,0 +1,2 @@
+#include "../frontend/xsane-text.h"
+#define _(x) x
diff --git a/po/newlanguage.po.in.in b/po/newlanguage.po.in.in
new file mode 100644
index 0000000..4423ce8
--- /dev/null
+++ b/po/newlanguage.po.in.in
@@ -0,0 +1,1211 @@
+#include "../frontend/xsane-text.h"
+#define _(x) x
+
+# nls translation file for xsane
+# language: newlanguage (abbreviation)
+
+# original text: WINDOW_ABOUT
+_WINDOW_ABOUT
+msgstr ""
+
+# original text: WINDOW_AUTHORIZE
+_WINDOW_AUTHORIZE
+msgstr ""
+
+# original text: WINDOW_INFO
+_WINDOW_INFO
+msgstr ""
+
+# original text: WINDOW_BATCH_SCAN
+_WINDOW_BATCH_SCAN
+msgstr ""
+
+# original text: WINDOW_FAX_PROJECT
+_WINDOW_FAX_PROJECT
+msgstr ""
+
+# original text: WINDOW_FAX_RENAME
+_WINDOW_FAX_RENAME
+msgstr ""
+
+# original text: WINDOW_SETUP
+_WINDOW_SETUP
+msgstr ""
+
+# original text: WINDOW_HISTOGRAM
+_WINDOW_HISTOGRAM
+msgstr ""
+
+# original text: WINDOW_STANDARD_OPTIONS
+_WINDOW_STANDARD_OPTIONS
+msgstr ""
+
+# original text: WINDOW_ADVANCED_OPTIONS
+_WINDOW_ADVANCED_OPTIONS
+msgstr ""
+
+# original text: WINDOW_DEVICE_SELECTION
+_WINDOW_DEVICE_SELECTION
+msgstr ""
+
+# original text: WINDOW_PREVIEW
+_WINDOW_PREVIEW
+msgstr ""
+
+# original text: WINDOW_OUTPUT_FILENAME
+_WINDOW_OUTPUT_FILENAME
+msgstr ""
+
+# original text: WINDOW_SAVE_SETTINGS
+_WINDOW_SAVE_SETTINGS
+msgstr ""
+
+# original text: WINDOW_LOAD_SETTINGS
+_WINDOW_LOAD_SETTINGS
+msgstr ""
+
+# original text: MENU_FILE
+_MENU_FILE
+msgstr ""
+
+# original text: MENU_PREFERENCES
+_MENU_PREFERENCES
+msgstr ""
+
+# original text: MENU_VIEW
+_MENU_VIEW
+msgstr ""
+
+# original text: MENU_HELP
+_MENU_HELP
+msgstr ""
+
+# original text: MENU_ITEM_ABOUT
+_MENU_ITEM_ABOUT
+msgstr ""
+
+# original text: MENU_ITEM_INFO
+_MENU_ITEM_INFO
+msgstr ""
+
+# original text: MENU_ITEM_EXIT
+_MENU_ITEM_EXIT
+msgstr ""
+
+# original text: FRAME_RAW_IMAGE
+_FRAME_RAW_IMAGE
+msgstr ""
+
+# original text: FRAME_ENHANCED_IMAGE
+_FRAME_ENHANCED_IMAGE
+msgstr ""
+
+# original text: BUTTON_START
+_BUTTON_START
+msgstr ""
+
+# original text: BUTTON_OK
+_BUTTON_OK
+msgstr ""
+
+# original text: BUTTON_APPLY
+_BUTTON_APPLY
+msgstr ""
+
+# original text: BUTTON_CANCEL
+_BUTTON_CANCEL
+msgstr ""
+
+# original text: BUTTON_CLOSE
+_BUTTON_CLOSE
+msgstr ""
+
+# original text: BUTTON_OVERWRITE
+_BUTTON_OVERWRITE
+msgstr ""
+
+# original text: BUTTON_ADD_AREA
+_BUTTON_ADD_AREA
+msgstr ""
+
+# original text: BUTTON_DELETE
+_BUTTON_DELETE
+msgstr ""
+
+# original text: BUTTON_SHOW
+_BUTTON_SHOW
+msgstr ""
+
+# original text: BUTTON_RENAME
+_BUTTON_RENAME
+msgstr ""
+
+# original text: BUTTON_CREATE_PROJECT
+_BUTTON_CREATE_PROJECT
+msgstr ""
+
+# original text: BUTTON_SEND_PROJECT
+_BUTTON_SEND_PROJECT
+msgstr ""
+
+# original text: BUTTON_DELETE_PROJECT
+_BUTTON_DELETE_PROJECT
+msgstr ""
+
+# original text: BUTTON_ADD_PRINTER
+_BUTTON_ADD_PRINTER
+msgstr ""
+
+# original text: BUTTON_DELETE_PRINTER
+_BUTTON_DELETE_PRINTER
+msgstr ""
+
+# original text: BUTTON_PREVIEW_ACQUIRE
+_BUTTON_PREVIEW_ACQUIRE
+msgstr ""
+
+# original text: BUTTON_PREVIEW_CANCEL
+_BUTTON_PREVIEW_CANCEL
+msgstr ""
+
+# original text: RADIO_BUTTON_FINE_MODE
+_RADIO_BUTTON_FINE_MODE
+msgstr ""
+
+# original text: RADIO_BUTTON_OVERWRITE_WARNING
+_RADIO_BUTTON_OVERWRITE_WARNING
+msgstr ""
+
+# original text: RADIO_BUTTON_INCREASE_COUNTER
+_RADIO_BUTTON_INCREASE_COUNTER
+msgstr ""
+
+# original text: RADIO_BUTTON_SKIP_EXISTING_NRS
+_RADIO_BUTTON_SKIP_EXISTING_NRS
+msgstr ""
+
+# original text: RADIO_BUTTON_WINDOW_FIXED
+_RADIO_BUTTON_WINDOW_FIXED
+msgstr ""
+
+# original text: RADIO_BUTTON_PRESERVE_PRVIEW
+_RADIO_BUTTON_PRESERVE_PRVIEW
+msgstr ""
+
+# original text: RADIO_BUTTON_PRIVATE_COLORMAP
+_RADIO_BUTTON_PRIVATE_COLORMAP
+msgstr ""
+
+# original text: TEXT_AVAILABLE_DEVICES
+_TEXT_AVAILABLE_DEVICES
+msgstr ""
+
+# original text: TEXT_XSANE_OPTIONS
+_TEXT_XSANE_OPTIONS
+msgstr ""
+
+# original text: TEXT_XSANE_MODE
+_TEXT_XSANE_MODE
+msgstr ""
+
+# original text: TEXT_SCANNER_BACKEND
+_TEXT_SCANNER_BACKEND
+msgstr ""
+
+# original text: TEXT_VENDOR
+_TEXT_VENDOR
+msgstr ""
+
+# original text: TEXT_MODEL
+_TEXT_MODEL
+msgstr ""
+
+# original text: TEXT_TYPE
+_TEXT_TYPE
+msgstr ""
+
+# original text: TEXT_DEVICE
+_TEXT_DEVICE
+msgstr ""
+
+# original text: TEXT_LOADED_BACKEND
+_TEXT_LOADED_BACKEND
+msgstr ""
+
+# original text: TEXT_SANE_VERSION
+_TEXT_SANE_VERSION
+msgstr ""
+
+# original text: TEXT_RECENT_VALUES
+_TEXT_RECENT_VALUES
+msgstr ""
+
+# original text: TEXT_GAMMA_CORR_BY
+_TEXT_GAMMA_CORR_BY
+msgstr ""
+
+# original text: TEXT_SCANNER
+_TEXT_SCANNER
+msgstr ""
+
+# original text: TEXT_SOFTWARE_XSANE
+_TEXT_SOFTWARE_XSANE
+msgstr ""
+
+# original text: TEXT_NONE
+_TEXT_NONE
+msgstr ""
+
+# original text: TEXT_GAMMA_INPUT_DEPTH
+_TEXT_GAMMA_INPUT_DEPTH
+msgstr ""
+
+# original text: TEXT_GAMMA_OUTPUT_DEPTH
+_TEXT_GAMMA_OUTPUT_DEPTH
+msgstr ""
+
+# original text: TEXT_SCANNER_OUTPUT_DEPTH
+_TEXT_SCANNER_OUTPUT_DEPTH
+msgstr ""
+
+# original text: TEXT_OUTPUT_FORMATS
+_TEXT_OUTPUT_FORMATS
+msgstr ""
+
+# original text: TEXT_8BIT_FORMATS
+_TEXT_8BIT_FORMATS
+msgstr ""
+
+# original text: TEXT_16BIT_FORMATS
+_TEXT_16BIT_FORMATS
+msgstr ""
+
+# original text: TEXT_AUTHORIZATION_REQ
+_TEXT_AUTHORIZATION_REQ
+msgstr ""
+
+# original text: TEXT_USERNAME
+_TEXT_USERNAME
+msgstr ""
+
+# original text: TEXT_PASSWORD
+_TEXT_PASSWORD
+msgstr ""
+
+# original text: TEXT_INVALID_PARAMS
+_TEXT_INVALID_PARAMS
+msgstr ""
+
+# original text: TEXT_VERSION
+_TEXT_VERSION
+msgstr ""
+
+# original text: TEXT_PACKAGE
+_TEXT_PACKAGE
+msgstr ""
+
+# original text: TEXT_WITH_GIMP_SUPPORT
+_TEXT_WITH_GIMP_SUPPORT
+msgstr ""
+
+# original text: TEXT_WITHOUT_GIMP_SUPPORT
+_TEXT_WITHOUT_GIMP_SUPPORT
+msgstr ""
+
+# original text: TEXT_GIMP_VERSION
+_TEXT_GIMP_VERSION
+msgstr ""
+
+# original text: TEXT_UNKNOWN
+_TEXT_UNKNOWN
+msgstr ""
+
+# original text: TEXT_EMAIL
+_TEXT_EMAIL
+msgstr ""
+
+# original text: TEXT_FILE
+_TEXT_FILE
+msgstr ""
+
+# original text: TEXT_INFO_BOX
+_TEXT_INFO_BOX
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_SEL
+_TEXT_SETUP_PRINTER_SEL
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_NAME
+_TEXT_SETUP_PRINTER_NAME
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_CMD
+_TEXT_SETUP_PRINTER_CMD
+msgstr ""
+
+# original text: TEXT_SETUP_COPY_NR_OPT
+_TEXT_SETUP_COPY_NR_OPT
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_RES
+_TEXT_SETUP_PRINTER_RES
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_WIDTH
+_TEXT_SETUP_PRINTER_WIDTH
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_HEIGHT
+_TEXT_SETUP_PRINTER_HEIGHT
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_LEFT
+_TEXT_SETUP_PRINTER_LEFT
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_BOTTOM
+_TEXT_SETUP_PRINTER_BOTTOM
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_GAMMA
+_TEXT_SETUP_PRINTER_GAMMA
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_GAMMA_RED
+_TEXT_SETUP_PRINTER_GAMMA_RED
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_GAMMA_GREEN
+_TEXT_SETUP_PRINTER_GAMMA_GREEN
+msgstr ""
+
+# original text: TEXT_SETUP_PRINTER_GAMMA_BLUE
+_TEXT_SETUP_PRINTER_GAMMA_BLUE
+msgstr ""
+
+# original text: TEXT_SETUP_JPEG_QUALITY
+_TEXT_SETUP_JPEG_QUALITY
+msgstr ""
+
+# original text: TEXT_SETUP_PNG_COMPRESSION
+_TEXT_SETUP_PNG_COMPRESSION
+msgstr ""
+
+# original text: TEXT_SETUP_TIFF_COMPRESSION
+_TEXT_SETUP_TIFF_COMPRESSION
+msgstr ""
+
+# original text: TEXT_SETUP_TIFF_COMPRESSION_1
+_TEXT_SETUP_TIFF_COMPRESSION_1
+msgstr ""
+
+# original text: TEXT_SETUP_PREVIEW_GAMMA
+_TEXT_SETUP_PREVIEW_GAMMA
+msgstr ""
+
+# original text: TEXT_SETUP_PREVIEW_GAMMA_RED
+_TEXT_SETUP_PREVIEW_GAMMA_RED
+msgstr ""
+
+# original text: TEXT_SETUP_PREVIEW_GAMMA_GREEN
+_TEXT_SETUP_PREVIEW_GAMMA_GREEN
+msgstr ""
+
+# original text: TEXT_SETUP_PREVIEW_GAMMA_BLUE
+_TEXT_SETUP_PREVIEW_GAMMA_BLUE
+msgstr ""
+
+# original text: TEXT_SETUP_HELPFILE_VIEWER
+_TEXT_SETUP_HELPFILE_VIEWER
+msgstr ""
+
+# original text: TEXT_SETUP_FAX_COMMAND
+_TEXT_SETUP_FAX_COMMAND
+msgstr ""
+
+# original text: TEXT_SETUP_FAX_RECEIVER_OPTION
+_TEXT_SETUP_FAX_RECEIVER_OPTION
+msgstr ""
+
+# original text: TEXT_SETUP_FAX_POSTSCRIPT_OPT
+_TEXT_SETUP_FAX_POSTSCRIPT_OPT
+msgstr ""
+
+# original text: TEXT_SETUP_FAX_NORMAL_MODE_OPT
+_TEXT_SETUP_FAX_NORMAL_MODE_OPT
+msgstr ""
+
+# original text: TEXT_SETUP_FAX_FINE_MODE_OPT
+_TEXT_SETUP_FAX_FINE_MODE_OPT
+msgstr ""
+
+# original text: TEXT_SETUP_FAX_VIEWER
+_TEXT_SETUP_FAX_VIEWER
+msgstr ""
+
+# original text: NOTEBOOK_COPY_OPTIONS
+_NOTEBOOK_COPY_OPTIONS
+msgstr ""
+
+# original text: NOTEBOOK_SAVING_OPTIONS
+_NOTEBOOK_SAVING_OPTIONS
+msgstr ""
+
+# original text: NOTEBOOK_DISPLAY_OPTIONS
+_NOTEBOOK_DISPLAY_OPTIONS
+msgstr ""
+
+# original text: NOTEBOOK_FAX_OPTIONS
+_NOTEBOOK_FAX_OPTIONS
+msgstr ""
+
+# original text: MENU_ITEM_SCAN
+_MENU_ITEM_SCAN
+msgstr ""
+
+# original text: MENU_ITEM_COPY
+_MENU_ITEM_COPY
+msgstr ""
+
+# original text: MENU_ITEM_FAX
+_MENU_ITEM_FAX
+msgstr ""
+
+# original text: MENU_ITEM_SETUP
+_MENU_ITEM_SETUP
+msgstr ""
+
+# original text: MENU_ITEM_SHOW_TOOLTIPS
+_MENU_ITEM_SHOW_TOOLTIPS
+msgstr ""
+
+# original text: MENU_ITEM_SHOW_PREVIEW
+_MENU_ITEM_SHOW_PREVIEW
+msgstr ""
+
+# original text: MENU_ITEM_SHOW_HISTOGRAM
+_MENU_ITEM_SHOW_HISTOGRAM
+msgstr ""
+
+# original text: MENU_ITEM_SHOW_STANDARDOPTIONS
+_MENU_ITEM_SHOW_STANDARDOPTIONS
+msgstr ""
+
+# original text: MENU_ITEM_SHOW_ADVANCEDOPTIONS
+_MENU_ITEM_SHOW_ADVANCEDOPTIONS
+msgstr ""
+
+
+# original text: MENU_ITEM_SHOW_RESOLUTIONLIST
+_MENU_ITEM_SHOW_RESOLUTIONLIST
+msgstr ""
+
+# original text: MENU_ITEM_LENGTH_UNIT
+_MENU_ITEM_LENGTH_UNIT
+msgstr ""
+
+# original text: SUBMENU_ITEM_LENGTH_MILLIMETERS
+_SUBMENU_ITEM_LENGTH_MILLIMETERS
+msgstr ""
+
+# original text: SUBMENU_ITEM_LENGTH_CENTIMETERS
+_SUBMENU_ITEM_LENGTH_CENTIMETERS
+msgstr ""
+
+# original text: SUBMENU_ITEM_LENGTH_INCHES
+_SUBMENU_ITEM_LENGTH_INCHES
+msgstr ""
+
+# original text: MENU_ITEM_SAVE_DEVICE_SETTINGS
+_MENU_ITEM_SAVE_DEVICE_SETTINGS
+msgstr ""
+
+# original text: MENU_ITEM_LOAD_DEVICE_SETTINGS
+_MENU_ITEM_LOAD_DEVICE_SETTINGS
+msgstr ""
+
+# original text: MENU_ITEM_XSANE_DOC
+_MENU_ITEM_XSANE_DOC
+msgstr ""
+
+# original text: MENU_ITEM_BACKEND_DOC
+_MENU_ITEM_BACKEND_DOC
+msgstr ""
+
+# original text: MENU_ITEM_AVAILABLE_BACKENDS
+_MENU_ITEM_AVAILABLE_BACKENDS
+msgstr ""
+
+# original text: MENU_ITEM_SCANTIPS
+_MENU_ITEM_SCANTIPS
+msgstr ""
+
+# original text: MENU_ITEM_PROBLEMS
+_MENU_ITEM_PROBLEMS
+msgstr ""
+
+# original text: MENU_ITEM_TIFF_COMP_NONE
+_MENU_ITEM_TIFF_COMP_NONE
+msgstr ""
+
+# original text: MENU_ITEM_TIFF_COMP_CCITTRLE
+_MENU_ITEM_TIFF_COMP_CCITTRLE
+msgstr ""
+
+# original text: MENU_ITEM_TIFF_COMP_CCITFAX3
+_MENU_ITEM_TIFF_COMP_CCITFAX3
+msgstr ""
+
+# original text: MENU_ITEM_TIFF_COMP_CCITFAX4
+_MENU_ITEM_TIFF_COMP_CCITFAX4
+msgstr ""
+
+# original text: MENU_ITEM_TIFF_COMP_JPEG
+_MENU_ITEM_TIFF_COMP_JPEG
+msgstr ""
+
+# original text: MENU_ITEM_TIFF_COMP_PACKBITS
+_MENU_ITEM_TIFF_COMP_PACKBITS
+msgstr ""
+
+# original text: MENU_ITEM_FILETYPE_BY_EXT
+_MENU_ITEM_FILETYPE_BY_EXT
+msgstr ""
+
+# original text: PROGRESS_SAVING
+_PROGRESS_SAVING
+msgstr ""
+
+# original text: PROGRESS_SAVING_FAX
+_PROGRESS_SAVING_FAX
+msgstr ""
+
+# original text: PROGRESS_CONVERTING_DATA
+_PROGRESS_CONVERTING_DATA
+msgstr ""
+
+# original text: PROGRESS_CONVERTING_PS
+_PROGRESS_CONVERTING_PS
+msgstr ""
+
+# original text: PROGRESS_SCANNING
+_PROGRESS_SCANNING
+msgstr ""
+
+# original text: PROGRESS_RECEIVING_SCAN
+_PROGRESS_RECEIVING_SCAN
+msgstr ""
+
+# original text: PROGRESS_RECEIVING_COPY
+_PROGRESS_RECEIVING_COPY
+msgstr ""
+
+# original text: PROGRESS_RECEIVING_FAX
+_PROGRESS_RECEIVING_FAX
+msgstr ""
+
+# original text: PROGRESS_RECEIVING_GIMP
+_PROGRESS_RECEIVING_GIMP
+msgstr ""
+
+
+# original text: DESC_XSANE_MODE
+_DESC_XSANE_MODE
+msgstr ""
+
+# original text: DESC_BROWSE_FILENAME
+_DESC_BROWSE_FILENAME
+msgstr ""
+
+# original text: DESC_FILENAME
+_DESC_FILENAME
+msgstr ""
+
+# original text: DESC_FILETYPE
+_DESC_FILETYPE
+msgstr ""
+
+# original text: DESC_FAXPROJECT
+_DESC_FAXPROJECT
+msgstr ""
+
+# original text: DESC_FAXPAGENAME
+_DESC_FAXPAGENAME
+msgstr ""
+
+# original text: DESC_FAXRECEIVER
+_DESC_FAXRECEIVER
+msgstr ""
+
+# original text: DESC_PRINTER_SELECT
+_DESC_PRINTER_SELECT
+msgstr ""
+
+# original text: DESC_RESOLUTION
+_DESC_RESOLUTION
+msgstr ""
+
+# original text: DESC_ZOOM
+_DESC_ZOOM
+msgstr ""
+
+# original text: DESC_COPY_NUMBER
+_DESC_COPY_NUMBER
+msgstr ""
+
+# original text: DESC_NEGATIVE
+_DESC_NEGATIVE
+msgstr ""
+
+# original text: DESC_GAMMA
+_DESC_GAMMA
+msgstr ""
+
+# original text: DESC_GAMMA_R
+_DESC_GAMMA_R
+msgstr ""
+
+# original text: DESC_GAMMA_G
+_DESC_GAMMA_G
+msgstr ""
+
+# original text: DESC_GAMMA_B
+_DESC_GAMMA_B
+msgstr ""
+
+# original text: DESC_BRIGHTNESS
+_DESC_BRIGHTNESS
+msgstr ""
+
+# original text: DESC_BRIGHTNESS_R
+_DESC_BRIGHTNESS_R
+msgstr ""
+
+# original text: DESC_BRIGHTNESS_G
+_DESC_BRIGHTNESS_G
+msgstr ""
+
+# original text: DESC_BRIGHTNESS_B
+_DESC_BRIGHTNESS_B
+msgstr ""
+
+# original text: DESC_CONTRAST
+_DESC_CONTRAST
+msgstr ""
+
+# original text: DESC_CONTRAST_R
+_DESC_CONTRAST_R
+msgstr ""
+
+# original text: DESC_CONTRAST_G
+_DESC_CONTRAST_G
+msgstr ""
+
+# original text: DESC_CONTRAST_B
+_DESC_CONTRAST_B
+msgstr ""
+
+# original text: DESC_RGB_DEFAULT
+_DESC_RGB_DEFAULT
+msgstr ""
+
+# original text: DESC_ENH_AUTO
+_DESC_ENH_AUTO
+msgstr ""
+
+# original text: DESC_ENH_DEFAULT
+_DESC_ENH_DEFAULT
+msgstr ""
+
+# original text: DESC_ENH_RESTORE
+_DESC_ENH_RESTORE
+msgstr ""
+
+# original text: DESC_ENH_STORE
+_DESC_ENH_STORE
+msgstr ""
+
+# original text: DESC_HIST_INTENSITY
+_DESC_HIST_INTENSITY
+msgstr ""
+
+# original text: DESC_HIST_RED
+_DESC_HIST_RED
+msgstr ""
+
+# original text: DESC_HIST_GREEN
+_DESC_HIST_GREEN
+msgstr ""
+
+# original text: DESC_HIST_BLUE
+_DESC_HIST_BLUE
+msgstr ""
+
+# original text: DESC_HIST_PIXEL
+_DESC_HIST_PIXEL
+msgstr ""
+
+# original text: DESC_HIST_LOG
+_DESC_HIST_LOG
+msgstr ""
+
+# original text: DESC_PRINTER_SETUP
+_DESC_PRINTER_SETUP
+msgstr ""
+
+# original text: DESC_PRINTER_NAME
+_DESC_PRINTER_NAME
+msgstr ""
+
+# original text: DESC_PRINTER_COMMAND
+_DESC_PRINTER_COMMAND
+msgstr ""
+
+# original text: DESC_COPY_NUMBER_OPTION
+_DESC_COPY_NUMBER_OPTION
+msgstr ""
+
+# original text: DESC_PRINTER_RESOLUTION
+_DESC_PRINTER_RESOLUTION
+msgstr ""
+
+# original text: DESC_PRINTER_WIDTH
+_DESC_PRINTER_WIDTH
+msgstr ""
+
+# original text: DESC_PRINTER_HEIGHT
+_DESC_PRINTER_HEIGHT
+msgstr ""
+
+# original text: DESC_PRINTER_LEFTOFFSET
+_DESC_PRINTER_LEFTOFFSET
+msgstr ""
+
+# original text: DESC_PRINTER_BOTTOMOFFSET
+_DESC_PRINTER_BOTTOMOFFSET
+msgstr ""
+
+# original text: DESC_PRINTER_GAMMA
+_DESC_PRINTER_GAMMA
+msgstr ""
+
+# original text: DESC_PRINTER_GAMMA_RED
+_DESC_PRINTER_GAMMA_RED
+msgstr ""
+
+# original text: DESC_PRINTER_GAMMA_GREEN
+_DESC_PRINTER_GAMMA_GREEN
+msgstr ""
+
+# original text: DESC_PRINTER_GAMMA_BLUE
+_DESC_PRINTER_GAMMA_BLUE
+msgstr ""
+
+# original text: DESC_JPEG_QUALITY
+_DESC_JPEG_QUALITY
+msgstr ""
+
+# original text: DESC_PNG_COMPRESSION
+_DESC_PNG_COMPRESSION
+msgstr ""
+
+# original text: DESC_TIFF_COMPRESSION
+_DESC_TIFF_COMPRESSION
+msgstr ""
+
+# original text: DESC_TIFF_COMPRESSION_1
+_DESC_TIFF_COMPRESSION_1
+msgstr ""
+
+# original text: DESC_OVERWRITE_WARNING
+_DESC_OVERWRITE_WARNING
+msgstr ""
+
+# original text: DESC_INCREASE_COUNTER
+_DESC_INCREASE_COUNTER
+msgstr ""
+
+# original text: DESC_SKIP_EXISTING
+_DESC_SKIP_EXISTING
+msgstr ""
+
+# original text: DESC_MAIN_WINDOW_FIXED
+_DESC_MAIN_WINDOW_FIXED
+msgstr ""
+
+# original text: DESC_PREVIEW_PRESERVE
+_DESC_PREVIEW_PRESERVE
+msgstr ""
+
+# original text: DESC_PREVIEW_COLORMAP
+_DESC_PREVIEW_COLORMAP
+msgstr ""
+
+# original text: DESC_PREVIEW_GAMMA
+_DESC_PREVIEW_GAMMA
+msgstr ""
+
+# original text: DESC_PREVIEW_GAMMA_RED
+_DESC_PREVIEW_GAMMA_RED
+msgstr ""
+
+# original text: DESC_PREVIEW_GAMMA_GREEN
+_DESC_PREVIEW_GAMMA_GREEN
+msgstr ""
+
+# original text: DESC_PREVIEW_GAMMA_BLUE
+_DESC_PREVIEW_GAMMA_BLUE
+msgstr ""
+
+# original text: DESC_DOC_VIEWER
+_DESC_DOC_VIEWER
+msgstr ""
+
+# original text: DESC_FAX_COMMAND
+_DESC_FAX_COMMAND
+msgstr ""
+
+# original text: DESC_FAX_RECEIVER_OPT
+_DESC_FAX_RECEIVER_OPT
+msgstr ""
+
+# original text: DESC_FAX_POSTSCRIPT_OPT
+_DESC_FAX_POSTSCRIPT_OPT
+msgstr ""
+
+# original text: DESC_FAX_NORMAL_OPT
+_DESC_FAX_NORMAL_OPT
+msgstr ""
+
+# original text: DESC_FAX_FINE_OPT
+_DESC_FAX_FINE_OPT
+msgstr ""
+
+# original text: DESC_FAX_VIEWER
+_DESC_FAX_VIEWER
+msgstr ""
+
+# original text: DESC_FAX_FINE_MODE
+_DESC_FAX_FINE_MODE
+msgstr ""
+
+# original text: DESC_PIPETTE_WHITE
+_DESC_PIPETTE_WHITE
+msgstr ""
+
+# original text: DESC_PIPETTE_GRAY
+_DESC_PIPETTE_GRAY
+msgstr ""
+
+# original text: DESC_PIPETTE_BLACK
+_DESC_PIPETTE_BLACK
+msgstr ""
+
+# original text: DESC_ZOOM_FULL
+_DESC_ZOOM_FULL
+msgstr ""
+
+# original text: DESC_ZOOM_OUT
+_DESC_ZOOM_OUT
+msgstr ""
+
+# original text: DESC_ZOOM_IN
+_DESC_ZOOM_IN
+msgstr ""
+
+# original text: DESC_ZOOM_UNDO
+_DESC_ZOOM_UNDO
+msgstr ""
+
+# original text: DESC_FULL_PREVIEW_AREA
+_DESC_FULL_PREVIEW_AREA
+msgstr ""
+
+# original text: ERR_HOME_DIR
+_ERR_HOME_DIR
+msgstr ""
+
+# original text: ERR_FILENAME_TOO_LONG
+_ERR_FILENAME_TOO_LONG
+msgstr ""
+
+# original text: ERR_SET_OPTION
+_ERR_SET_OPTION
+msgstr ""
+
+# original text: ERR_GET_OPTION
+_ERR_GET_OPTION
+msgstr ""
+
+# original text: ERR_OPTION_COUNT
+_ERR_OPTION_COUNT
+msgstr ""
+
+# original text: ERR_DEVICE_OPEN_FAILED
+_ERR_DEVICE_OPEN_FAILED
+msgstr ""
+
+# original text: ERR_NO_DEVICES
+_ERR_NO_DEVICES
+msgstr ""
+
+# original text: ERR_DURING_READ
+_ERR_DURING_READ
+msgstr ""
+
+# original text: ERR_DURING_SAVE
+_ERR_DURING_SAVE
+msgstr ""
+
+# original text: ERR_BAD_DEPTH
+_ERR_BAD_DEPTH
+msgstr ""
+
+# original text: ERR_GIMP_BAD_DEPTH
+_ERR_GIMP_BAD_DEPTH
+msgstr ""
+
+# original text: ERR_UNKNOWN_SAVING_FORMAT
+_ERR_UNKNOWN_SAVING_FORMAT
+msgstr ""
+
+# original text: ERR_OPEN_FAILED
+_ERR_OPEN_FAILED
+msgstr ""
+
+# original text: ERR_FAILED_PRINTER_PIPE
+_ERR_FAILED_PRINTER_PIPE
+msgstr ""
+
+# original text: ERR_FAILED_EXEC_PRINTER_CMD
+_ERR_FAILED_EXEC_PRINTER_CMD
+msgstr ""
+
+# original text: ERR_FAILED_START_SCANNER
+_ERR_FAILED_START_SCANNER
+msgstr ""
+
+# original text: ERR_FAILED_GET_PARAMS
+_ERR_FAILED_GET_PARAMS
+msgstr ""
+
+# original text: ERR_NO_OUTPUT_FORMAT
+_ERR_NO_OUTPUT_FORMAT
+msgstr ""
+
+# original text: ERR_NO_MEM
+_ERR_NO_MEM
+msgstr ""
+
+# original text: ERR_LIBTIFF
+_ERR_LIBTIFF
+msgstr ""
+
+# original text: ERR_LIBPNG
+_ERR_LIBPNG
+msgstr ""
+
+# original text: ERR_UNKNOWN_TYPE
+_ERR_UNKNOWN_TYPE
+msgstr ""
+
+# original text: ERR_UNKNOWN_CONSTRAINT_TYPE
+_ERR_UNKNOWN_CONSTRAINT_TYPE
+msgstr ""
+
+# original text: ERR_FAILD_EXEC_DOC_VIEWER
+_ERR_FAILD_EXEC_DOC_VIEWER
+msgstr ""
+
+# original text: ERR_FAILD_EXEC_FAX_VIEWER
+_ERR_FAILD_EXEC_FAX_VIEWER
+msgstr ""
+
+# original text: ERR_FAILED_EXEC_FAX_CMD
+_ERR_FAILED_EXEC_FAX_CMD
+msgstr ""
+
+# original text: ERR_BAD_FRAME_FORMAT
+_ERR_BAD_FRAME_FORMAT
+msgstr ""
+
+# original text: ERR_FAILED_SET_RESOLUTION
+_ERR_FAILED_SET_RESOLUTION
+msgstr ""
+
+# original text: ERR_ERROR
+_ERR_ERROR
+msgstr ""
+
+# original text: ERR_MAJOR_VERSION_NR_CONFLICT
+_ERR_MAJOR_VERSION_NR_CONFLICT
+msgstr ""
+
+# original text: ERR_XSANE_MAJOR_VERSION
+_ERR_XSANE_MAJOR_VERSION
+msgstr ""
+
+# original text: ERR_BACKEND_MAJOR_VERSION
+_ERR_BACKEND_MAJOR_VERSION
+msgstr ""
+
+# original text: ERR_PROGRAM_ABORTED
+_ERR_PROGRAM_ABORTED
+msgstr ""
+
+# original text: ERR_FAILED_ALLOCATE_IMAGE
+_ERR_FAILED_ALLOCATE_IMAGE
+msgstr ""
+
+# original text: ERR_PREVIEW_BAD_DEPTH
+_ERR_PREVIEW_BAD_DEPTH
+msgstr ""
+
+# original text: ERR_GIMP_SUPPORT_MISSING
+_ERR_GIMP_SUPPORT_MISSING
+msgstr ""
+
+# original text: WARN_COUNTER_OVERFLOW
+_WARN_COUNTER_OVERFLOW
+msgstr ""
+
+# original text: WARN_NO_VALUE_CONSTRAINT
+_WARN_NO_VALUE_CONSTRAINT
+msgstr ""
+
+# original text: ERR_BUTTON_OK
+_ERR_BUTTON_OK
+msgstr ""
+
+# original text: ERR_HEADER_ERROR
+_ERR_HEADER_ERROR
+msgstr ""
+
+# original text: ERR_HEADER_WARNING
+_ERR_HEADER_WARNING
+msgstr ""
+
+# original text: ERR_FAILED_CREATE_FILE
+_ERR_FAILED_CREATE_FILE
+msgstr ""
+
+# original text: ERR_LOAD_DEVICE_SETTINGS
+_ERR_LOAD_DEVICE_SETTINGS
+msgstr ""
+
+# original text: ERR_NO_DRC_FILE
+_ERR_NO_DRC_FILE
+msgstr ""
+
+# original text: ERR_NETSCAPE_EXECUTE_FAIL
+_ERR_NETSCAPE_EXECUTE_FAIL
+msgstr ""
+
+# original text: ERR_SENDFAX_RECEIVER_MISSING
+_ERR_SENDFAX_RECEIVER_MISSING
+msgstr ""
+
+# original text: ERR_CREATED_FOR_DEVICE
+_ERR_CREATED_FOR_DEVICE
+msgstr ""
+
+# original text: ERR_USED_FOR_DEVICE
+_ERR_USED_FOR_DEVICE
+msgstr ""
+
+# original text: ERR_MAY_CAUSE_PROBLEMS
+_ERR_MAY_CAUSE_PROBLEMS
+msgstr ""
+
+# original text: TEXT_USAGE
+_TEXT_USAGE
+msgstr ""
+
+# original text: TEXT_USAGE_OPTIONS
+_TEXT_USAGE_OPTIONS
+msgstr ""
+
+# original text: TEXT_HELP
+_TEXT_HELP
+msgstr ""
+
+# original text: XSANE_GIMP_INSTALL_BLURB
+_XSANE_GIMP_INSTALL_BLURB
+msgstr ""
+
+# original text: XSANE_GIMP_INSTALL_HELP
+_XSANE_GIMP_INSTALL_HELP
+msgstr ""
+
+# original text: XSANE_GIMP_MENU
+_XSANE_GIMP_MENU
+msgstr ""
+
+# original text: XSANE_GIMP_MENU_OLD
+_XSANE_GIMP_MENU_OLD
+msgstr ""
+
+# original text: XSANE_GIMP_MENU_DIALOG
+_XSANE_GIMP_MENU_DIALOG
+msgstr ""
+
+# original text: XSANE_GIMP_MENU_DIALOG_OLD
+_XSANE_GIMP_MENU_DIALOG_OLD
+msgstr ""
+
+_"flatbed scanner"
+msgstr ""
+
+_"frame grabber"
+msgstr ""
+
+_"handheld scanner"
+msgstr ""
+
+_"still camera"
+msgstr ""
+
+_"video camera"
+msgstr ""
+
+_"virtual device"
+msgstr ""
+
+
+_"Success"
+msgstr ""
+
+_"Operation not supported"
+msgstr ""
+
+_"Operation was cancelled"
+msgstr ""
+
+_"Device busy"
+msgstr ""
+
+_"Invalid argument"
+msgstr ""
+
+_"End of file reached"
+msgstr ""
+
+_"Document feeder jammed"
+msgstr ""
+
+_"Document feeder out of documents"
+msgstr ""
+
+_"Scanner cover is open"
+msgstr ""
+
+_"Error during device I/O"
+msgstr ""
+
+_"Out of memory"
+msgstr ""
+
+_"Access to resource has been denied"
+msgstr ""
+
diff --git a/po/po.in2po b/po/po.in2po
new file mode 100755
index 0000000..f202c20
--- /dev/null
+++ b/po/po.in2po
@@ -0,0 +1,8 @@
+if [ $# != 1 ]
+then
+echo "Usage: po.in2po language-abrevation"
+echo "eg: po.in2po fr"
+exit -1
+fi
+gcc -E -P - <$1.po.in >$1.po
+
diff --git a/po/remake_language.po.in b/po/remake_language.po.in
new file mode 100755
index 0000000..38c3ed6
--- /dev/null
+++ b/po/remake_language.po.in
@@ -0,0 +1,10 @@
+if [ $# != 1 ]
+then
+echo "Usage: remake_language.po.in file[.po.in]"
+exit -1
+fi
+cat $1.po.in | sed -e "/#original text/D" -e "/msgid/P" -e "s/msgid /_/g" - | sed -e "s/msgid/#original text:/g" >$1.po.in.tmp
+gcc -E -P - <$1.po.in.tmp | sed -e "s/^_/msgid /g" - | cat newlanguage.po.in.header - >$1.po.in
+rm $1.po.in.tmp
+
+
diff --git a/sanei/Makefile b/sanei/Makefile
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/sanei/Makefile
diff --git a/xsane-0.50.lsm b/xsane-0.50.lsm
new file mode 100644
index 0000000..c859862
--- /dev/null
+++ b/xsane-0.50.lsm
@@ -0,0 +1,17 @@
+Begin3
+Title: XSANE
+Version: 0.50
+Entered-date: 11JAN2000
+Description: XSANE is a gtk based X11 frontend for
+ SANE (Scanner Access Now Easy)
+Keywords: scanner, graphical user interface, GUI
+Author: Oliver.Rauch@Wolfsburg.DE (Oliver.Rauch)
+Maintained-by: Oliver.Rauch@Wolfsburg.DE (Oliver.Rauch)
+Primary-site: http://www.wolfsburg.de/~rauch/sane/sane-xsane.html
+ 646kB xsane-0.50.tar.gz
+Alternate-site:
+Platforms: AIX, Digital Unix, HP Apollo Domain/OS, FreeBSD, HP-UX, IRIX,
+ Linux (Alpha, m68k, SPARC, x86), NetBSD, OpenStep (x86),
+ SCO OpenServer 5.x (x86), Solaris (SPARC, x86), SunOS
+Copying-policy: GPL
+End
diff --git a/xsane-convert-to-0.46.c b/xsane-convert-to-0.46.c
new file mode 100644
index 0000000..0b7afd3
--- /dev/null
+++ b/xsane-convert-to-0.46.c
@@ -0,0 +1,85 @@
+#include "stdio.h"
+
+main(int argc, char *argv[])
+{
+ double val_double;
+ long int val_sane;
+ char option[255];
+ char *string = 0;
+ char *filename = 0;
+ FILE *file;
+ int len = 0;
+
+ if (argc != 2) /* error ? */
+ {
+ fprintf(stderr,"USAGE: %s file.drc >outputfile.drc\n", argv[0]);
+ return;
+ }
+
+ filename = argv[1];
+
+ file = fopen(filename, "r");
+ if (file == 0) /* error ? */
+ {
+ fprintf(stderr,"Could not open %s for reading *** ABORTED ***\n", filename);
+ return;
+ }
+
+ while (!feof(file))
+ {
+ fgets(option, sizeof(option), file); /* get option name */
+ option[strlen(option)-1] = 0; /* remove cr */
+
+ len = strlen(option);
+
+ if (len)
+ {
+ if (option[len-1] == 34)
+ {
+ option[len-1] = 0; /* remove " */
+ }
+ }
+ string = option+1;
+
+ if ((!strcmp(string, "xsane-main-window-x-position")) ||
+ (!strcmp(string, "xsane-main-window-y-position")) ||
+ (!strcmp(string, "xsane-main-window-width")) ||
+ (!strcmp(string, "xsane-main-window-height")) ||
+ (!strcmp(string, "xsane-standard-options-window-x-position")) ||
+ (!strcmp(string, "xsane-standard-options-window-y-position")) ||
+ (!strcmp(string, "xsane-advanced-options-window-x-position")) ||
+ (!strcmp(string, "xsane-advanced-options-window-y-position")) ||
+ (!strcmp(string, "xsane-histogram-window-x-position")) ||
+ (!strcmp(string, "xsane-histogram-window-y-position")) ||
+ (!strcmp(string, "xsane-preview-window-x-position")) ||
+ (!strcmp(string, "xsane-preview-window-y-position")) ||
+ (!strcmp(string, "xsane-preview-window-width")) ||
+ (!strcmp(string, "xsane-preview-window-height")) ||
+ (!strcmp(string, "xsane-gamma")) ||
+ (!strcmp(string, "xsane-gamma-red")) ||
+ (!strcmp(string, "xsane-gamma-green")) ||
+ (!strcmp(string, "xsane-gamma-blue")) ||
+ (!strcmp(string, "xsane-brightness")) ||
+ (!strcmp(string, "xsane-brightness-red")) ||
+ (!strcmp(string, "xsane-brightness-green")) ||
+ (!strcmp(string, "xsane-brightness-blue")) ||
+ (!strcmp(string, "xsane-contrast")) ||
+ (!strcmp(string, "xsane-contrast-red")) ||
+ (!strcmp(string, "xsane-contrast-green")) ||
+ (!strcmp(string, "xsane-contrast-blue")))
+ {
+ printf("\"%s\"\n", string);
+ fscanf(file, "%lf\n", &val_double);
+ val_sane = val_double * 65536;
+ printf("%d\n", val_sane);
+ }
+ else
+ {
+ printf("\"%s\"\n", string);
+ fgets(option, sizeof(option), file); /* get option name */
+ option[strlen(option)-1] = 0; /* remove cr */
+ printf("%s\n", option);
+ }
+ }
+ fclose(file);
+}
diff --git a/xsane-convert-to-0.49.c b/xsane-convert-to-0.49.c
new file mode 100644
index 0000000..59975eb
--- /dev/null
+++ b/xsane-convert-to-0.49.c
@@ -0,0 +1,65 @@
+#include "stdio.h"
+
+#define MM_PER_INCH 25.4
+
+main(int argc, char *argv[])
+{
+ int val_in;
+ int val_out;
+ char option[255];
+ char *string = 0;
+ char *filename = 0;
+ FILE *file;
+ int len = 0;
+
+ if (argc != 2) /* error ? */
+ {
+ fprintf(stderr,"USAGE: %s old-xsane.rc >new-xsane.rc\n", argv[0]);
+ return;
+ }
+
+ filename = argv[1];
+
+ file = fopen(filename, "r");
+ if (file == 0) /* error ? */
+ {
+ fprintf(stderr,"Could not open %s for reading *** ABORTED ***\n", filename);
+ return;
+ }
+
+ while (!feof(file))
+ {
+ fgets(option, sizeof(option), file); /* get option name */
+ option[strlen(option)-1] = 0; /* remove cr */
+
+ len = strlen(option);
+
+ if (len)
+ {
+ if (option[len-1] == 34)
+ {
+ option[len-1] = 0; /* remove " */
+ }
+ }
+ string = option+1;
+
+ if ((!strcmp(string, "printer-width")) ||
+ (!strcmp(string, "printer-height")) ||
+ (!strcmp(string, "printer-left-offset")) ||
+ (!strcmp(string, "printer-bottom-offset")))
+ {
+ printf("\"%s\"\n", string);
+ fscanf(file, "%d\n", &val_in);
+ val_out = val_in * 65536 * MM_PER_INCH/72.0;
+ printf("%d\n", val_out);
+ }
+ else
+ {
+ printf("\"%s\"\n", string);
+ fgets(option, sizeof(option), file); /* get option name */
+ option[strlen(option)-1] = 0; /* remove cr */
+ printf("%s\n", option);
+ }
+ }
+ fclose(file);
+}
diff --git a/xsane.AUTHOR b/xsane.AUTHOR
new file mode 100644
index 0000000..9f4fb83
--- /dev/null
+++ b/xsane.AUTHOR
@@ -0,0 +1,2 @@
+author: Oliver Rauch <Oliver.Rauch@Wolfsburg.DE>
+
diff --git a/xsane.CHANGES b/xsane.CHANGES
new file mode 100644
index 0000000..3491a27
--- /dev/null
+++ b/xsane.CHANGES
@@ -0,0 +1,711 @@
+CHANGES FOR FRONTEND XSANE FOR SANE:
+------------------------------------
+
+xsane-0.11 beta and before:
+---------------------------
+
+ - based on gtk-1.0.x
+ - histogram
+ - online color enhancement
+ - gamma table: tested with
+ - 8, 10 and 12 input bits per color
+ - 8 output bits per color
+ - standard and advanced options in own (non scrollable) window
+ - photocopy function via postscript output (gray + color, not lineart)
+ - frontend/Makefile.in changed for xsane
+
+
+xsane-0.11 -> 0.12:
+-------------------
+
+ - added ps, jpeg and png(1+8bit) output format, selected by filename
+ - added lineart support for ps
+ - changed configure.in and config.h.in and included them into xsane
+ - changed device selection dialog: scanner vendor and model added
+ - added xsane-logo (winner from gimp-contest) to device-selection and about-window,
+ it is loaded from SANE_DATA_PATH/sane/xsane-logo.xpm (/usr/local/share/sane/...)
+ - histogram window now always exists and may be hidden
+ - changed handling of devicename given as commandline option:
+ sane_get_devices is called and the vendor, model and type get identified,
+ if the given device name does not fit to the beginning of an existing device name
+ the device selection is opened
+
+
+xsane-0.12 -> 0.13:
+-------------------
+
+ - file format detection now works with case insensetive
+ - changed font for device selection
+ - changed output format of device list for selection
+ - disabled gamma table for 1 bit grayscale (lineart)
+ - improved error handling of saving routines
+ - removed ram eater in preview routine
+ - added default gamma upload into preview scan routine
+ - added tiff-output-format
+ - changed lineart to grayscale conversion in saving-routines
+ - added test if selected output format is supported before scan
+
+
+
+xsane-0.13 -> 0.14:
+-------------------
+
+ - added info window that displays hidden options/values
+ - xsane compiles without sane-source-package now,
+ sane must be installed.
+ - if scan is started with save for unsupported graphics format
+ an error message comes up before scanning is started
+ - tested for param.depth>1 for gamma correction
+ - added test for sane major version number, abort if mismatch
+
+
+xsane-0.14 -> 0.15:
+-------------------
+
+ - if device is given as commandline option it is now loaded again
+ if it is not in the devicelist
+ - moved some functions in xsane.c out of a #ifdef HAVE_LIBGIMP .. #endif-block
+ - added sliders in the gray/red/green/blue-levels for black/gray/white points
+ - gamma correction in preview is now only done if depth > 1
+ - enhancement sliders are not shown in lineart mode any more
+
+
+xsane-0.15 -> 0.16:
+-------------------
+
+ - moved save-routines to xsane-save, named xsane* to xsane-*
+ - included progress-routines into xsane.c
+ - moved xsane.h to xsane-text.h
+ - moved definitions and external used function headers to xsane.h
+ - added test for depth > 1 before calculating preview histogram
+ - added test for preview_gamma_data_red before calculating preview histogram
+ - added test for preview_gamma_data_red before doing preview gamma correction
+ - added p->image_data_raw = malloc(3*p->image_width*p->image_height);
+ in xsane-preview.c/scan_start
+ - added authorization_callback routine
+ - renamed a lot of routines * -> xsane_*
+ - added p->previous_selection.active = FALSE; draw_selection(p);
+ to preview_gamma_correction to redraw selection
+ - added preview_update(p); to scan_done in xsane-preview.c to reactivate selection
+ - added header for saving >8bpp raw data (SANE_GRAYSCALE_RAW, SANE_RGB_RAW)
+ - added 16 bit saving routines for pnm(ascii), png and raw
+ - added 16 bit routines to xsane_read_image_data, added 16 bit gamma software support
+
+
+xsane-0.16 -> 0.17:
+-------------------
+
+ - xsane-gtk.c moved free(elem->menu); elem->menu = 0; in panel_destroy out of
+ the for-loop
+ - added some #ifdefs #endifs around saving routines for TIFF, PNG and JPEG
+ - added BIT_DEPTH as well known option, preview sets this value to 8 if it is greater than 8
+ - added range checks in calculation for auto enhancement values
+ - calculation of auto enhancement values is not called in lineart mode any more
+
+
+xsane-0.17 -> 0.18:
+-------------------
+
+ - added quit_xsane in xsane_choose_dialog_ok_callback if no device was opened
+ - added sane_get_parameters(..) in xsane_scan_dialog
+ - added xsane_increase_counter_in_filename to xsane-save.[ch]
+ - Filename counter is automatically increased after scan
+ - Changed setup_dialog callbacks, cancel does work now
+ - zoomfactor is calculated now if copy mode is selected
+ - added tooltips for xsane setup options
+ - changed "destroy"-event of authorization dialog to "delete_event"
+ - in gsg_message made the ok button default
+ - added gsg_decision routine
+ - added overwrite warning
+ - postscript images are saved in original size in scan mode now
+
+
+xsane-0.18 -> 0.19:
+-------------------
+
+ - added cancel callback routine for conversion/saving routines
+ - printer_resolution now is set if OK is pressed in setup
+ - overwrite warning is not shown in copy mode any more
+ - changed fclose to pclose for closing pipe to printer command
+ - restored xsane.resolution in xsane_pref_device_restore
+ - added Help menu, called Netscape -remote to open help-files
+ - set sensetivity of xsane dialog and histogram dialog while
+ scan and preview scan to false
+ - added some help(html) files to the doc directory
+
+
+xsane-0.19 -> 0.20:
+-------------------
+
+ - improved online help
+ - added own version number for xsane, there are three version
+ numbers now:
+ - xsane version
+ - sane version
+ - package version (e.g if there is a package of different frontends)
+ - added gamma value (gray, red, green, blue) for printer (copy mode)
+ - changed sane-style.rc -> xsane.style.rc
+ - changed PATH_SANE_DATA_DIR -> old PATH_SANE_DATA_DIR/sane
+ - preview gamma correction is done by the xsane gamma correction instead of
+ the Xserver gamma correction, there are also values for red, green and blue
+ now.
+ - spilt setup window into notebook pages
+ - replaced in xsane_pref_set_unit_callback preview_update by preview_area_resize,
+ the ruler units are updated now if unit is changed
+ - made menue length unit inactive if length unit is pixel
+ - added dialogs for batch scan list and fax page list, but not finished and disabled
+ - changed local includes from <...> to "..."
+ - test for filetype is only done in scanmode now
+ - added list of (up to 10) printers for photocopy mode
+ - added error messages if failed to open files
+ - added sigpipe_handler for handling broken pipe while writing to printercommand
+
+
+xsane-0.20 -> 0.21:
+-------------------
+
+ - in xsane-preview.c if backend does not use scanareaselection dev_selection[i]
+ is set to width/height of image
+ - replaced most sprintf by snprintf
+ - made menue length unit inactive if scanare is nut supported by the backend
+ - set maximum value in 16 bit saving routines to 16 bit/65535
+ - 1 bit/pixel png file is saved with 1 bit/pixel instead of 8 bit/pixel now
+ - added support for gtk-1.2
+ - font are set in xsane-style.rc now
+
+
+xsane-0.21 -> 0.22:
+-------------------
+
+ - split xsane.c in:
+ - xsane.c
+ - xsane-setup.c
+ - xsane-gamma.c
+ - xsane-front-gtk.c
+ - xsane-scan.c
+ - renamed xsane-gtk.c to xsane-back-gtk.c
+ - removed libtool from package
+ - added experimental fax support
+
+xsane-0.22 -> 0.23:
+-------------------
+
+ - changed configure.in, removed some unnecessary parts
+ and added error messages if gtk or sane is not installed
+
+ - removed copy-mode resolution bug (was not changed if zoom slider was moved)
+ - removed bug in faxmode if faxproject did not exist (fclose(0))
+ - changed definition of struct xsane and struct xsane_setup
+ - added documentation-viewer-command to setup, netscaperemote is selected
+ via the keyword "netscape-remote"
+
+xsane-0.23 -> 0.24:
+-------------------
+
+ - removed some bugs in gamma value calculation for real scan (preview was ok)
+ - added activation for some windows after scan error
+ - removed bugs in startup if no device is available or selected,
+ the xsane.rc-file keeps untouched now
+
+
+xsane-0.24 -> 0.25:
+-------------------
+
+ - moved xsane_pixmap_new as xsane_create_histogram from xsane-front-gtk.c to
+ xsane-gamma.c
+ - now putting the histogram sliders directly into the slider preview instead
+ of drawing into the preview window, the sliders are not erased by other
+ other windows now
+ - added block_update_param flag, the update_param and update_histogram routines
+ are now called only one time if the preview scan area is changed
+ - added changing of one edge in preview scanarea (left mousebotton near the edge)
+ - added moving of preview scanarea (middle or right mousebutton)
+ - moved creation of histogram dialog to xsane-gamma.c
+ - removed some bugs in the preview, resizing the preview window should work now
+ - added an experimental zoom for the preview
+
+
+xsane-0.25 -> 0.26:
+-------------------
+
+ - removed some preview_update calls or replaced them by preview_update_selection
+ - renamed preview_update to preview_update_surface and made surface_changed a parameter
+ - ruler scaling is now ok in resized windows and zoomed previews
+ - added some range checks in preview_calculate_histogram
+ - parts in the preview window that are not part of the scan area are painted gray now
+ - added image_surface to preview structure, it stands for the surface of the scanned preview image
+ - renamed preview_get_image_scale to preview_get_scale_preview_to_image
+ - added routine preview_get_scale_device_to_preview
+ - added Zoom 20% out routine
+ - the selected area can be larger than the viewable preview now
+ - added Pipette functions (pick black, gray and white) - mouse pointer does change to pipetty icon
+ - p->aspect is calculated by image-size now if the surface is not defined (INF) in
+ preview_update_surface
+ - preview_update_surface is called now after preview scan and preview_restore_image
+ - moved the "Help" menu in the main dialog to the right
+
+
+xsane-0.26 -> 0.27:
+-------------------
+
+ - added scantips and index of backends to help menu
+ - changed configure.in, libpng should be found on (all ?) systems now
+ - black and white point sliders use the two additional pixels now
+ - user can preset (reduce) the preview area now
+ - added "Select visible area" button
+ - removed some bugs in gray gamma value calculation for real scan (preview was ok)
+ - setup of faxoptions: normal, fine and postscript option is saved now
+
+
+xsane-0.27 -> 0.28:
+-------------------
+
+ - added option negative into enhancement and changed create_gamma
+ draw_histogram and auto_enhancement to work with it!
+
+ - increased contrast range from -100..+100 to -100..+200
+ and brightness range from -100..+100 to -200..+200
+ because the old values were not sufficent for scanning negatives
+
+ - added selection for number of copies in copy mode
+
+
+xsane-0.28 -> 0.29:
+-------------------
+
+ - removed bug in xsane_set_resolution that could cause a segmentation fault
+ - added support for resolution of type CONSTRAINT_WORD_LIST
+ - xsane-mode (scan, copy, fax) can be selected as command line option (-s, -c, -f) now
+ - most texts that are defined in xsane are defined in xsane-text now
+
+
+xsane-0.29 -> 0.30:
+-------------------
+
+ - removed bug in xsane_set_resolution, now highest resolution can be set if
+ resolution is a list!
+ - added RGBI support - must be activated in xsane.h (SUPPORT_RGBI)
+ - added options rgb default and negative to preferences
+ - enhancement values are saved with device settings now
+ - The filename can be specified now for the file in which the device settings are saved
+ or from which they are loaded.
+ - changed extension from ".rc" to ".drc" (device rc)
+ - added header "XSANE_DEVICE_RC" to identify it as device-rc-file
+ - added calculation for color components to auto enhancement
+ - pipette functions: middle mouse button defines shadow/gray/highlight
+ for color components, left mouse button only defines gray values!
+ - auto enhancement values are set to standard values in
+ xsane_calculate_histogram if no values could be calculated
+ - histogram is cleared when sensitivity is set to false
+ - improved calculation of auto enhancement values
+ - increased contrast range from -100..+200 to -100..+300 (gray) and
+ -300..+300 (color) and brightness range from -200..+200 to -300..+300
+
+
+xsane-0.30 -> 0.31:
+-------------------
+
+ - changed filename character transformation: erase " ", "_" -> "__", "/" -> "_"
+ - device settings standard file name is vendor:model
+ so it does not matter any more if the sg-device name has changed
+ - the xsane main window can be a fixed or a scrolled, resizable window now.
+ selection is done with setup/display/"main window fixed",
+ the main window mode can be overwritten by specifying a command
+ line option:
+ -R or --Resizeable activates the resizeable, scrolled window,
+ -F or --Fixed activates the fixed (non resizable) window (default)
+ - histogram is cleared when info dialog or about dialog is opened
+ - changed version option from -V to -v
+ - added support for Automatic Document Feeder (scan until error)
+ this is experimentary because in the SANE-standard there is
+ no way defined how a frontend can identify an ADF.
+ The backend has to load the next document automatically!
+ - in xsane_enhancement_update replaced gtk_signal_emit_by_name
+ by gtk_signal_emit
+ - moved more texts to xsane-text.h
+ - changed all RGBI -> RGBA because the 4th channel is ALPHA
+ I think that SANE_FRAME_RGBA will be added to the sane standard
+ - gtk+-1.2.0 is minimum requirement: removed tests for
+ gtk_tooltips_set_tips, gtk_scrolled_window_add_with_viewport
+ and gtk_events_pending that were needed for gtk+-1.0.x
+ - added option "--device-settings file" to define default
+ filename for device-settings
+ - corrected "legal" size in preview
+ - added device_text to info and preview window title
+ - moved color definition to xsane_creat_histogram_dialog
+ - pixmap colors depend on histogram_dialog now because
+ the histogram dialog is the first dialog that exists
+ - renamed all gtk functions like defined in gtkcompat.h
+ (gtk+-1.0.x -> gtk+-1.2.x)
+ - removed bug in device selection, device can be selected
+ now with keyboard
+ - xsane info window prints gamma depth "none" in 1 bit modes
+
+
+xsane-0.31 -> 0.32:
+-------------------
+
+ - added option --no-mode-selection/-s to disable menu for
+ xsane mode selection
+ - prepared text outputs (in xsane-text.h) for NLS/gettext support
+ - multiple \n in scanf while reading saved preview image removed
+ - added AM_PROG_CC_STDC to configure.in for HP/UX
+ - added a break statement after each default in switch block
+ - changed test for multiple image scan, when sane_read returned with
+ SANE_STATUS_GOOD when the image is finished we start a new scan,
+ SANE_STATUS_EOF is expected when scanning should be stopped.
+ This way the Automatic Document Feeder is supported a way
+ like planned in the sane standard, the backend says
+ if the frontend shall call sane_start repeatadly.
+
+
+xsane-0.32 -> 0.33:
+-------------------
+
+ - removed change about SANE_STATUS_GOOD in multiple image mode.
+ Adf mode is detected by scanmode again. This would be better
+ selected by a mulit_image bit in the preferences block.
+ - added common rotuine xsane_set_sensitivity to xsane-front-gtk.c
+ - renamed xsane_test_adf to xsane_test_multi_scan
+
+
+xsane-0.33 -> 0.34:
+-------------------
+
+ - the preview selection is based on device coordinates instead of
+ preview window coordinates now
+ - added preview buttons and preview viewport to xsane_set_sensitivity
+ - info and about dialog use xsane_set_sensitivity now
+ - dummy_filename is created and opened for writing AFTER sane_start is called.
+ - sane_start() == NO_DOCS is not handled as error any more
+ - xsane_scan_done -> sane_cancel is called now if an error occurs
+ - if an error occurs while scanning the created file is removed
+ - xsane windows/buttons get inactive while setup dialog is open
+ - xsane_scan_done -> sane_cancel is called when main window is closed
+ (while scanning)
+ - if there are no standard device settings at program startup, xsane
+ take the backend predefined resolution (before this was set to 100)
+ - if no scanarea options are given, the preview works with
+ [0,INF] instead of [-INF,INF] now
+ - transformed all gif files in directory doc to jpeg format because of
+ all the trouble about the gif licence. Will never use gif again!
+
+
+xsane-0.34 -> 0.35:
+-------------------
+
+ - corrected doc/Makefile.in for change gif->jpg
+ - added tiff compression type selection for multi bit and one bit images to
+ setup:
+ none, CCITT 1D Huffman compression, CCITT Group 3 Fax compression,
+ CCITT Group 4 Fax compression, Lempel-Ziv & Welch, JPEG DCT compression,
+ pack bits
+ - implemented real single-bit format for tiff
+ - setup/jpeg quality selection is enabled if jpeglib or libtiff is available
+ - added gimp_image_set_resolution(...) to gimp saving routine
+ - added test for libgimp/gimpfeatures.h to configure.in and config.h.in
+ - disabled sensetivity while filename browse window is open
+ - added handling if fileselection window was closed
+ - moved filename "Browse" button from the right to to the left with disk-image inside
+ - (added image filetype menu to the image filename line - not ready)
+ - replaced button-texts negative, rgb default, auto, default, store and
+ restore by icons
+
+
+xsane-0.35 -> 0.36:
+-------------------
+
+ - moved xsane_generate_dummy_filename in xsane-scan.c out of a
+ #ifdef HAVE_LIBGIMP_H block
+ - changed some icons
+ - added #ifdef HAVE_LIBTIFF around TIFF-relevant definitions in
+ xsane_setup_dialog in xsane-setup.c
+ - included NLS/gettext version 0.10.35
+ - texts that are created by xsane can be converted to other languages
+ now - texts created by the backend can not be translated yet!
+ - added gettext relevant routines to aclocal.m4 and correct some bugs
+ - added french translation - thanks to Vincent Renardias <vincent@ldsol.com>
+ - added german translation table
+ - translation files "*.po" are created by "*.po.in" with help of the
+ preprocessor of gcc, all texts are #defined in frontend/xsane-text.h
+
+
+xsane-0.36 -> 0.37:
+-------------------
+
+ - added some texts to xsane-text.h and newlanguage.po.in[.in],
+ created file add-0.37.po.in where the new entries are listed
+ - moved generation of xsane.backend (backendname like umax)
+ from xsane_help_build_menu to xsane_device_dialog, needed for
+ translation of backend options
+ - added translation for backend options:
+ Backend translation is done with translation table sane-BACKENDNAME.mo
+ - removed bug in preview_update_selection()
+ (forgotten p->selection.active = TRUE)
+ The selection box is updated correct now
+ - removed bug in aclocal.m4: not fount "-lintl" when gettext is in glibc
+
+
+xsane-0.37 -> 0.38:
+-------------------
+
+ - changed STANDALONE -> XSANE_STANDALONE and
+ GIMP_EXTENSION -> XSANE_GIMP_EXTENSION because GIMP_EXTENSION
+ now (gimp-1.1.10) is used in the Gimp
+ - changed brightness and contrast range maximum form 300 to 400 %
+ - moved gimp installation texts to xsane-text.h
+ added entries to po/newlamguage*
+ - xsane -g now does not print anything and does not abort if gimp
+ support is compiled in
+ - changed lib/Makefile.in and sanei/Makefile in, make install should
+ work without a previous make now
+ - xsane gimp-plugin is selected via file/acquire now when
+ gimp-version >= 1.1.9
+ - . removed ../intl/libintl.a form frontend/Makefile.in and
+ . added CATOBJEXT=UNKNOWN and XGETTEXT=":" in if "gettext is in libc"
+ to aclocal.m4
+ hope this solves problems with missing "-lintl" now on all systems
+ - moved "show xxx" menu items form menu "Preferences" to menu "View"
+ - added continuous update to histogram sliders and preview selection
+ - added preferences menu item "Update policy"
+ - now options are only changable if SANE_CAP_SOFT_SELECT is set
+ - added test for bitdepth in xsane_scan_dialog for GIMP mode,
+ error message pops up when unsupported bit depths are selected
+ - moved case XSANE_PNM16 out of a #ifdef HAVE_LIBPNG block
+ - position of all windows and size of main window and preview window
+ is save in device settings, setting preview window geometry
+ does not work because window does not exist at relevant times.
+
+
+xsane-0.38 -> 0.39:
+-------------------
+
+ - bounded contrast to >=-100.0
+ - Added test if GIMP_CHECK_VERSION is defined
+
+
+xsane-0.39 -> 0.40:
+-------------------
+
+ - device name is saved in drc file now
+ - xsane version is saved in drc file now
+ - warning is printed if device rc file was not created for active device
+ - removed member device from struct preferences - was never used
+ - changed frontend/Makefile.in (XSCAN->BINPROGS)
+ - changed configure.in:
+ - changed order of some checks
+ - added status messages at the end
+ - added "--enable-intl-patch" which adds -lintl to check for libsane
+ - added "--disable-gimp"
+ - added "--disable-jpeg"
+ - added "--disable-tiff"
+ - added "--disable-png"
+ - moved xsane_generate_dummy_filename and fopen() into if XSANE_STANDALONE block,
+ there is no empty file created in gimp mode any more.
+
+
+xsane-0.40 -> 0.41:
+-------------------
+
+ - renamed xsane-incons.h -> xsane-icons.c and xsane-icons-def.h -> xsane-icons.h
+ - moved all includes that are needed by most xsane sources to xsane.h
+ problem with missing stdio.h is solved that way
+ - changed configure script:
+ - check for sane is moved to the end because of missing libintl,
+ - check for png is done with x_includes and x_libraries,
+ and libpng is added to lib after all checks are done
+
+
+xsane-0.41 -> 0.42:
+-------------------
+
+ - changed configure.in, error message about missing sane is also printed if sane.h
+ is not found.
+ - changed info row (size box, start button): the start button is made smaller when
+ the info box needs more place
+ - changed calculateion of size in info row from unisgned long to float
+ because unsigned long / 10 were to small to fit A4 with 1200x1200 dpi
+ - changed png part of configure, HAVE_LIBPNG is now defined again
+ - corrected png lineart saving
+
+
+xsane-0.42 -> 0.43:
+-------------------
+
+ - disabled LZW-compression for TIFF.
+ Unisys holds a patent for LZW compression. I am not sure
+ about the licence status of LZW and TIFF. GIF is not supported
+ because of the licence problem. LZW for TIFF is disabled now.
+ - removed all LZW entries in sourcecode and translation tables
+
+
+xsane-0.43 -> 0.44:
+-------------------
+
+ - renamed NOTEBOOK_PRINTER_OPTIONS to NOTEBOOK_COPY_OPTIONS
+ - added sane-problems-doc.html to the help menu
+ - added functions around "by ext" menu
+ - all functions in xsane-back-gtk.c are named with xsane_back_gtk_* now
+
+
+xsane-0.44 -> 0.45:
+-------------------
+
+ - added *s = 0; in sanei_codec_ascii.c when reading a string that
+ does not start with '"'
+
+ - added test "if (!w.status)" when reading a string in sanei_load_values.c
+ the missing test caused a segfault when a string was expected but
+ the line did not start with '"'
+
+ - merged together all needed sanei_* routines in xsane-rc-io.c
+ and renamed all sanei_* to xsane_rc_io_*, removed subdir sanei
+ and changed xsane.c and xsane-preferences.c to use xsane-rc-io.[ch]
+ and reprogrammed some things.
+
+ - renamed all xsane_pref_device_* to xsane_device_preferences_*
+ and moved them to xsane-device-preferences.c
+
+ - renamed sanei_w_[load|save]_values to xsane_device_preferencs_[load|save]_values
+ and moved them to xsane-device-preferences.c
+
+
+xsane-0.45 -> 0.46:
+-------------------
+
+ - changed xsane_rc_io_w_space: returns ENODATA instead of EINVAL at EOF
+
+ - added xsane_rc_io_w_skip_newline
+
+ - changed xsane_device_preferences_load_values:
+ - begin at start of file is only inciated if w.status == ENODATA
+ - if w.status is an other error, the line is skipped
+
+ - moved and renamed w_string, w_int, w_double from xsane-preferences.c
+ to xsane_rc_pref_* in xsane-rc-io.c
+
+ - repleaced fprintf/fscanf for reading xsane device preferences by
+ xsane_rc_io_w_* routines
+ This way the floating point values (xsane- gamma, brightness and contrast)
+ are saved different and the *.drc-files are incompatible in that point.
+
+ - added test for lineart mode (depth == 1) in xsane_enhancement_update
+ solves segmentation fault problem when device settings with lineart enabled
+ are loaded
+
+
+xsane-0.46 -> 0.47:
+-------------------
+
+ - if helpfile viewer is netscape-remote and netscape is not running
+ it is started
+
+ - replaced ENODATA (used for EOF detection in xsane-rc-io and
+ xsane-device-preferences) by XSANE_EOF (=-1)
+ (ENODATA is not defined on all systems)
+
+ - If faxproject does not exist, project data entries are made insensitive
+ and buttons "send project" and "delete project" are replaced by "create project"
+
+ - Added missing "&" in xsane_device_preferences_save_values:
+ xsane_rc_io_w_array(w, &len, (void **) &word_array, (WireCodecFunc) xsane_rc_io_w_word, sizeof(SANE_Word));
+ that cause segmentation fault when writing bool, int or fixpoint arrays.
+
+
+xsane-0.47 -> 0.48:
+-------------------
+
+ - "START" button is made insensitive in fax mode if project does not exist.
+
+ - Preview window is created at the same time as the main dialog and it is destroyed
+ at program end. Disabling "show preview" hides the preview window. This way the preview
+ window placement does work correct.
+
+ - set default values in xsane_device_preferences_load_file(char *filename)
+ before reading the saved values, show_preview default = true
+
+ - Mouse pointers display relevant mode icons in preview window now.
+
+ - In copy mode the maximum selectable size that fits to the selected printer is drawn
+ by a rect now. Selection is limited to the printer size.
+
+ - if no local xsane.rc, xsane-style.rc or DEVICE.drc file exists it is loaded from SANE_DATA_DIR/xsane
+
+ - all xsane rc files are placed in a subdirectory xsane now (~/.sane/xsane, SANE_DATA/DIR/xsane)
+
+ - temporary files (previews, conversions) are saved in /tmp (defined in SANE_PATH_TMP in xsane.h) now
+
+ - added window decoration icon (top left) to each xsane window (does work with kwm, does not work with fvwm2)
+
+ - added warning icon and error icon
+
+ - removed xsane_files_exit_callback, now xsane_scan_win_delete is used for all exit program calls
+
+ - conversion-* and preview-* files are created with permission "-rw-------",
+ images- and project-files are created with "preferences.image_umask"
+ xsane.rc and *.drc are created with XSANE_DEFAULT_UMASK defined in xsane.h
+
+ - added file permission selection in preferences/saving options for image file and for directory (faxproject)
+
+ - disabled fileoptions (mkdir, rm, mv) in loading/saving preferences
+
+
+xsane-0.48 -> 0.49:
+-------------------
+
+ - added support for different x/y resolutions and zoom factors,
+ the y-resolution slider is added to the xsane main dialog now
+
+ - in gimp mode x- and y-resolution infos are set correct now
+
+ - added resolution and zoom icons for x- and y-dimension
+
+ - added fax_width and fax_height to preferences
+
+ - added paper size frame in fax mode preview
+
+ - added czech translation - thanks to by Stanislav Brabec <utx@k332.feld.cvut.cz>
+
+ - changed gimp_install_procedure(...): "RGB, GRAY" -> 0
+
+ - changed printer geometry setup from 1/72 ich to mm
+
+ - added setup entries for fax- width, height, left_offset and bottom_offset
+
+ - corrected terminating \0 of strings in sane_choose_device
+
+ - when button "Negative" is pressed the white/gray/black points
+ are also inverted
+
+ - split preview_restore_image into preview_restore_image and
+ preview_restore_image_from_file, it can zoom into a saved
+ image now.
+
+ - zoom functions are done now without a new preview scan.
+ 3 different zoom levels are stored.
+
+ - in xsane_scan_start the output file is only opend once in multi pass scan
+ three pass scan does work now again.
+
+ - added several missing routines for gamma correction in three pass scan
+
+
+xsane-0.49 -> 0.50:
+-------------------
+
+ - removed bug in calculation of paper size in copy and fax mode
+
+ - added support for rotate image in xsane_save_ps
+
+ - added support for rotate (landscape mode) in copy mode and save-ps mode
+ and added preferences menu "Rotate Postscript"
+
+ - added bugfix for gtk_tooltips_set_colors as long as it does not work in gtk
+
+ - improved memory allocation routines and error handling in preview
+
+ - after the main window is created the resolution, resolution_x amd resolution_y
+ are made up to date now
+
+ - changed dynamic menue list definition in xsane_setup for TIFF_COMPRESSION menu
+
diff --git a/xsane.COPYING b/xsane.COPYING
new file mode 100644
index 0000000..60549be
--- /dev/null
+++ b/xsane.COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ 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 2 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/xsane.IMAGE b/xsane.IMAGE
new file mode 100644
index 0000000..c730fbb
--- /dev/null
+++ b/xsane.IMAGE
@@ -0,0 +1,4 @@
+The SANE/XSANE-Image is the winner of the Gimp-Contest in December 1998.
+It has been created by Stefan Kamphausen <kampi@physik3.gwdg.de>
+
+The image is placed in SANE_DATA_DIR/sane/ = /usr/local/share/sane
diff --git a/xsane.INSTALL b/xsane.INSTALL
new file mode 100644
index 0000000..3bee8dc
--- /dev/null
+++ b/xsane.INSTALL
@@ -0,0 +1,48 @@
+REQUIREMENTS:
+-------------
+- You need sane-1.0 or newer installed!
+ If you installed sane from an rpm binary, you also have to install sane-devel.rpm !!!
+ Pay attention the sane-rpm and sane-devel-rpm are of the same version.
+ Sane-0.xx is NOT SUPPORTED!
+- You need gtk+-1.2.x and suitable glib-1.2.x
+- For png support you need libz and libpng installed!
+- For jpeg support you need jpeglib installed!
+- For tiff support you need libtiff installed!
+- gcc (tested with gcc-v2.7.2.3), don`t use g++/c++ compilers,
+ the egcs compiler sometimes makes problems!!!
+- To run xsane as gimp plugin: gimp has to be installed before configuring and
+ compiling xsane. Use gimp-1.0.4 or above. Take care that gimp-1.1.x are
+ development versions, gimp-1.1.3 does work, gimp-1.1.4 does not work!
+
+
+COMPILATION AND INSTALLATION:
+-----------------------------
+DO THE FOLLOWING AS NORMAL USER, NOT AS ROOT:
+- Unpack the xsane archiv in a directory of your choice.
+- Enter xsane-0.xx directory.
+- To compile call ./configure and make.
+ - If you use kwm (KDE window manager), call configure with environment
+ variable CPPFLAGS set to
+ "-DXSANE_BUGGY_WINDOWMANAGER_WINDOW_POSITION".
+ - When you already called ./configure it may be good to do a
+ make distclean
+ before you call ./configure again.
+ If that does not work, remove config.cache:
+ rm -f config.cache
+
+DO THE FOLLOWING AS ROOT:
+- Call make install
+
+DO THE FOLLOWING AS NORMAL USER:
+- Call xsane.
+
+- If you get an error message that libsane-dll.so.1 is not found, you have to
+ tell your system where the SANE-libraries are installed.
+ For linux: edit /etc/ld.so.conf and add a line with the path to the
+ libraries (normally /usr/local/lib/sane), then call ldconfig.
+ THIS MUST BE DONE AS ROOT!
+ If you use a SuSE linux, you may have to edit /etc/ld.so.conf.in instead and call
+ SuSEconfig instead of ldconfig.
+
+If something does not work like expected read file xsane.PROBLEMS
+
diff --git a/xsane.LANGUAGES b/xsane.LANGUAGES
new file mode 100644
index 0000000..c77db9e
--- /dev/null
+++ b/xsane.LANGUAGES
@@ -0,0 +1,14 @@
+Since version 0.36 xsane supports NLS, you can add a translation
+file for your language now. If you want to add a new language to
+xsane please read the file po/README.ADD_NEW_LANGUAGE!
+
+Backend text translation is done by an own translation table for the
+backend sane-"backendname".mo that has to be made available by the backend!
+
+To select your language, set environment variable LANG to the
+abbreviation of your language, eg:
+
+export LANG=de
+
+Oliver Rauch
+
diff --git a/xsane.NEWS b/xsane.NEWS
new file mode 100644
index 0000000..228e219
--- /dev/null
+++ b/xsane.NEWS
@@ -0,0 +1,19 @@
+
+ NEWS:
+
+****************************************************************
+* *
+* xsane-0.49: *
+* The format of the xsane.rc file has changed: the printer *
+* geometry values are saved in mm instead of 1/72 inch now. *
+* Use xsane-convert-to-0.49 to convert xsane.rc BEFORE you *
+* start xsane! *
+* To compile it call *
+* make xsane-convert-to-0.49 *
+* *
+****************************************************************
+
+ if you update from a version before xsane-0.48 please
+ read xsane.OLDER_NEWS
+
+
diff --git a/xsane.OLDER_NEWS b/xsane.OLDER_NEWS
new file mode 100644
index 0000000..08c291d
--- /dev/null
+++ b/xsane.OLDER_NEWS
@@ -0,0 +1,19 @@
+----------------------------------------------------------------
+ OLDER NEWS:
+
+ xsane-0.48:
+ If you use KDE (kwm), call configure with environment
+ variable CPPFLAGS set to
+ "-DXSANE_BUGGY_WINDOWMANAGER_WINDOW_POSITION"
+
+
+ xsane-0.46:
+ The format of the *.drc files has changed from xsane-0.45 to
+ xsane-0.46. Use xsane-convert-to-0.46 to convert the files
+ ~/.sane/xsane/*.drc BEFORE you start xsane!
+
+ To compile it call
+ make xsane-convert-to-0.46
+
+----------------------------------------------------------------
+
diff --git a/xsane.ONLINEHELP b/xsane.ONLINEHELP
new file mode 100644
index 0000000..4036518
--- /dev/null
+++ b/xsane.ONLINEHELP
@@ -0,0 +1,13 @@
+The onlinehelp viewer can be selected.
+If it shall be done via netscape remote-commands,
+you have to enter the keyword "netscape-remote" as viewer.
+Netscape must be running.
+
+The helpfiles are located in PATH_SANE_DATA_DIR/
+(this is typlically /usr/local/share/sane).
+The file that is loaded is sane-backendname-doc.html,
+the backend may use more html-files:
+sane-backendname-*-doc.html
+
+Images that are only for the backend helpfile should
+have the name sane-backendname-*.*
diff --git a/xsane.PROBLEMS b/xsane.PROBLEMS
new file mode 100644
index 0000000..65e56e7
--- /dev/null
+++ b/xsane.PROBLEMS
@@ -0,0 +1,64 @@
+READ THIS FILE IF YOU EXPERIENCE ANY PROBLEM
+
+ - If you get segmentation faults or unexpected problems:
+ - make sure there is only one sane version installed before
+ you compile xsane
+ (try as root: $find / -name "*sane*" | less)
+ - If you compiled xsane/gtk/glib with the egcs compiler try
+ recompiling all with the "normal" gcc compiler (test with gcc -v)!
+
+ - If you get an error message that libsane-dll.so.1 is not found, you have to
+ tell your system where the SANE-libraries are installed.
+ For linux: edit /etc/ld.so.conf and add a line with the path to the
+ libraries (normally /usr/local/lib/sane), then call ldconfig.
+ THIS MUST BE DONE A ROOT!
+ If you use a SuSE linux, edit /etc/ld.so.conf.in instead and call
+ SuSEconfig instead of ldconfig.
+
+ - The online-help-viewer is now selectable.
+ If you use kde you can enter kdehelp in setup/display.
+ Preselected is netscape with usage of remote commands.
+
+ On some SuSE systems there only is "Netscape" and no "netscape" in the path,
+ in this case you have to set a symbolic link:
+
+ ln -s /usr/bin/Netscape /usr/bin/netscape
+
+ - If you call ./configure a second time, it may be good to call
+ make distclean
+ before that, if that does not work, remove config.cache:
+ rm -f config.cache
+
+ - If the compilation aborts with
+ /usr/lib/libgimp.so: undefined reference to `g_debug'
+ /usr/lib/libgimp.so: undefined reference to `g_message'
+ /usr/lib/libgimp.so: undefined reference to `g_warning'
+ /usr/lib/libgimp.so: undefined reference to `g_error'
+ update to gimp-1.0.4 or newer!
+
+ - If the compilation aborts with
+ sanei_wire.c:49: sane/sane.h: No such file or directory
+ you did not install sane-devel.rpm! Get sane-devel.rpm from
+ the site you got sane.rpm and install it!
+
+ - If make aborts with missing library "-lintl" try
+ make distclean
+ ./configure --with-included-gettext
+
+ - If configure does not find libsane, try
+ ./configure --enable-intl-patch
+
+ - If gtk+ is compiled with NLS/gettext, you have to use the same
+ gettext version. So if gtk+ is compiled with gettext in libc
+ do NOT compile xsane with included gettext!
+ Otherwise gtk will crash when gtk texts shall be translated.
+
+ - If you are running BSD and gtk-config is not in your path or is
+ named-gtk?.?-config, make sure environment variable GTK_CONFIG
+ is set with full path to the config file that shall be used
+
+ - If you get a segmentation fault when opening the preview (or histogram)
+ window and your system is IRIX, make sure the default visual is 24-bit
+ (edit /usr/lib/X11/xdm/Xservers)
+
+
diff --git a/xsane.TODO b/xsane.TODO
new file mode 100644
index 0000000..dc68ac7
--- /dev/null
+++ b/xsane.TODO
@@ -0,0 +1,62 @@
+This is a list of what I want to change/include for xsane.
+If you have any suggestions: mail to Oliver.Rauch@Wolfsburg.DE
+
+(+ planned to do this soon/higher priority, - comes later/lower priority)
+
+errors:
+ + autoenhancement crashes if selected area is totally white
+ + segfault if pipette pick out of preview image
+
+first steps:
+ * options:
+ - fax-function:
+ - add send delayed option
+ - add options for sender/receiver Name
+ - what about faxprojects with mixed normal- and fine-mode pages?
+ - zoom ?
+ - email-function:
+ - based on fax mode
+ - image type = ?
+ - resolution selectable
+ - create a html mail
+ - mail editor = ?
+ - copy mode:
+ + select image position on printer (centered/left/right/free) for copy
+ and show it in the preview.
+ + selection of portrait/landscape for output
+ - scan mode into postscript file:
+ - define image position on paper the same way it is done in copy mode
+ - add postscript definition to setup and handle it as printer
+ like copy mode options:
+ - resolution
+ - with, height, dx, dy
+ - preview:
+ + 16 bit preview scan, gamma conversion to 8 bit
+ + preview always in greyscale or always in color
+ - force aspect ratio of selection area
+ - force size of selection area
+ - add oversampling factor for preview resolution to
+ improve zoomed previews without a new scan
+ - enhancement:
+ - move threshold in lineart-mode to main window ?
+ - add grayscale preview scan -> gamma 0/255 -> displayed preview for lineart mode
+ + batch scan function
+
+ * internal:
+ - include much more parameters when saving images
+ - test memory after all calls of malloc
+ - make better backend-dependend option handling and error handling (mostly done!)
+ - other output formats for saving - *** which? ***
+ - gif will not be supported because of licence
+ - more/better online helpfiles
+ - printer setup: geometry in inch/millimeter/centimeter
+
+second steps:
+ - correct gtk custom gamma functions and include it
+ - include special functions for GNOME/KDE - *** DOES ANYONE HAVE ANY SUGGESTIONS TO THIS ? ***
+ - GNOME:
+ - gnome-print support?
+ - session management
+ - drag and drop for preview image?
+ + add color management - may be via xcmsdb
+
diff --git a/xsane.WIP b/xsane.WIP
new file mode 100644
index 0000000..df72c82
--- /dev/null
+++ b/xsane.WIP
@@ -0,0 +1,4 @@
+
+- Added quantization in xsane_resolution_scale_update(GtkAdjustment *adj_data, double *val)
+ in xsane-front-gtk.c, this quantisation is not done by gtk, so xsane has to do it.
+