summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-05-05 13:19:37 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-05-05 13:19:37 +0000
commitc6e0c2d3f66468bf0dc4e71f4e96ccfca86b93c5 (patch)
tree1f6f65e4d4b91da48baff77a20c0f2ffa10aabfc /Build/source
parentc53b86a4f756fd2a535206176fa9a3f36485ca34 (diff)
xpdfopen 0.80 (replacing pdfopen 0.5)
git-svn-id: svn://tug.org/texlive/trunk@18111 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/Makefile.in2
-rwxr-xr-xBuild/source/configure68
-rw-r--r--Build/source/libs/Makefile.in2
-rwxr-xr-xBuild/source/libs/configure68
-rw-r--r--Build/source/m4/kpse-pkgs.m42
-rw-r--r--Build/source/texk/Makefile.in2
-rwxr-xr-xBuild/source/texk/configure68
-rw-r--r--Build/source/utils/Makefile.in2
-rw-r--r--Build/source/utils/README9
-rwxr-xr-xBuild/source/utils/configure92
-rw-r--r--Build/source/utils/pdfopen/ChangeLog25
-rw-r--r--Build/source/utils/pdfopen/Makefile.am20
-rw-r--r--Build/source/utils/pdfopen/README83
-rw-r--r--Build/source/utils/pdfopen/ac/withenable.ac13
-rw-r--r--Build/source/utils/pdfopen/pdfclose.c47
-rw-r--r--Build/source/utils/pdfopen/pdfopen.c92
-rw-r--r--Build/source/utils/pdfopen/sendx.c288
-rw-r--r--Build/source/utils/pdfopen/sendx.h15
-rw-r--r--Build/source/utils/xpdfopen/ChangeLog70
-rw-r--r--Build/source/utils/xpdfopen/Makefile.am21
-rw-r--r--Build/source/utils/xpdfopen/Makefile.am.orig20
-rw-r--r--Build/source/utils/xpdfopen/Makefile.in (renamed from Build/source/utils/pdfopen/Makefile.in)13
-rw-r--r--Build/source/utils/xpdfopen/README89
-rw-r--r--Build/source/utils/xpdfopen/ac/withenable.ac13
-rw-r--r--Build/source/utils/xpdfopen/aclocal.m4 (renamed from Build/source/utils/pdfopen/aclocal.m4)0
-rwxr-xr-xBuild/source/utils/xpdfopen/configure (renamed from Build/source/utils/pdfopen/configure)28
-rw-r--r--Build/source/utils/xpdfopen/configure.ac (renamed from Build/source/utils/pdfopen/configure.ac)4
-rw-r--r--Build/source/utils/xpdfopen/configure.ac.orig25
-rw-r--r--Build/source/utils/xpdfopen/pdfclose.c71
-rw-r--r--Build/source/utils/xpdfopen/pdfopen.c375
-rw-r--r--Build/source/utils/xpdfopen/sendx.c408
-rw-r--r--Build/source/utils/xpdfopen/sendx.h19
-rw-r--r--Build/source/utils/xpdfopen/utils.c46
-rw-r--r--Build/source/utils/xpdfopen/utils.h13
-rw-r--r--Build/source/utils/xpdfopen/xpdfopen.h36
-rw-r--r--Build/source/utils/xpdfopen/xpdfopen.pdf (renamed from Build/source/utils/pdfopen/xpdfopen.pdf)bin86995 -> 86995 bytes
-rw-r--r--Build/source/utils/xpdfopen/xpdfopen.tex (renamed from Build/source/utils/pdfopen/xpdfopen.tex)0
37 files changed, 1387 insertions, 762 deletions
diff --git a/Build/source/Makefile.in b/Build/source/Makefile.in
index d2115b8ceac..fef740a2229 100644
--- a/Build/source/Makefile.in
+++ b/Build/source/Makefile.in
@@ -65,7 +65,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/kpse-common.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/utils/chktex/ac/withenable.ac \
$(top_srcdir)/utils/dialog/ac/withenable.ac \
- $(top_srcdir)/utils/pdfopen/ac/withenable.ac \
$(top_srcdir)/utils/ps2eps/ac/withenable.ac \
$(top_srcdir)/utils/psutils/ac/withenable.ac \
$(top_srcdir)/utils/t1utils/ac/withenable.ac \
@@ -76,6 +75,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/kpse-common.m4 \
$(top_srcdir)/utils/xindy-new/ac/clisp.ac \
$(top_srcdir)/utils/xindy/ac/withenable.ac \
$(top_srcdir)/utils/xindy/ac/xindy.ac \
+ $(top_srcdir)/utils/xpdfopen/ac/withenable.ac \
$(top_srcdir)/texk/web2c/ac/withenable.ac \
$(top_srcdir)/texk/web2c/ac/web2c.ac \
$(top_srcdir)/texk/afm2pl/ac/withenable.ac \
diff --git a/Build/source/configure b/Build/source/configure
index 2e8da8d515d..0712740bb59 100755
--- a/Build/source/configure
+++ b/Build/source/configure
@@ -891,7 +891,6 @@ enable_cxx_runtime_hack
enable_libtool_hack
enable_chktex
enable_dialog
-enable_pdfopen
enable_ps2eps
enable_psutils
enable_t1utils
@@ -903,6 +902,7 @@ enable_xindy_docs
with_clisp_runtime
with_xindy_recode
enable_xindy
+enable_xpdfopen
enable_web2c
with_tex_banner
with_editor
@@ -1681,7 +1681,6 @@ Optional Features:
--enable-libtool-hack ignore libtool dependency_libs
--enable-chktex build the chktex package
--disable-dialog do not build the dialog package
- --disable-pdfopen do not build the pdfopen package
--disable-ps2eps do not build the ps2eps package
--disable-psutils do not build the psutils package
--disable-t1utils do not build the t1utils package
@@ -1691,6 +1690,7 @@ Optional Features:
--enable-xindy-rules build and install make-rules package
--enable-xindy-docs build and install documentation
--enable-xindy build the xindy package
+ --disable-xpdfopen do not build the xpdfopen package
--disable-web2c do not build the web2c (TeX & Co.) package
--enable-auto-core cause TeX&MF to dump core, given a certain
filename
@@ -3141,38 +3141,6 @@ $as_echo "$as_me: Assuming \`--enable-dialog=$enable_dialog'" >&6;}
esac
-## utils/pdfopen/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/pdfopen/
-## configure options and TL libraries required for pdfopen
-if test "x$with_x" = xno; then :
- case $enable_pdfopen in #(
- "") :
- { $as_echo "$as_me:${as_lineno-$LINENO}: \`--without-x' -> \`--disable-pdfopen'" >&5
-$as_echo "$as_me: \`--without-x' -> \`--disable-pdfopen'" >&6;}
- enable_pdfopen=no
- ac_configure_args="$ac_configure_args '--disable-pdfopen'" ;; #(
- yes) :
- as_fn_error "Sorry, incompatible options \`--without-x' and \`--enable-pdfopen'" "$LINENO" 5 ;; #(
- *) :
- ;;
-esac
-fi
-# Check whether --enable-pdfopen was given.
-if test "${enable_pdfopen+set}" = set; then :
- enableval=$enable_pdfopen;
-fi
-case $enable_pdfopen in #(
- yes|no) :
- ;; #(
- *) :
-
- enable_pdfopen=$enable_all_pkgs
- { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-pdfopen=$enable_pdfopen'" >&5
-$as_echo "$as_me: Assuming \`--enable-pdfopen=$enable_pdfopen'" >&6;}
- ac_configure_args="$ac_configure_args '--enable-pdfopen=$enable_pdfopen'"
- ;;
-esac
-
-
## utils/ps2eps/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/ps2eps/
## configure options and TL libraries required for ps2eps
# Check whether --enable-ps2eps was given.
@@ -3383,6 +3351,38 @@ if test "${with_xindy_recode+set}" = set; then :
fi
+## utils/xpdfopen/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/xpdfopen/
+## configure options and TL libraries required for xpdfopen
+if test "x$with_x" = xno; then :
+ case $enable_xpdfopen in #(
+ "") :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: \`--without-x' -> \`--disable-xpdfopen'" >&5
+$as_echo "$as_me: \`--without-x' -> \`--disable-xpdfopen'" >&6;}
+ enable_xpdfopen=no
+ ac_configure_args="$ac_configure_args '--disable-xpdfopen'" ;; #(
+ yes) :
+ as_fn_error "Sorry, incompatible options \`--without-x' and \`--enable-xpdfopen'" "$LINENO" 5 ;; #(
+ *) :
+ ;;
+esac
+fi
+# Check whether --enable-xpdfopen was given.
+if test "${enable_xpdfopen+set}" = set; then :
+ enableval=$enable_xpdfopen;
+fi
+case $enable_xpdfopen in #(
+ yes|no) :
+ ;; #(
+ *) :
+
+ enable_xpdfopen=$enable_all_pkgs
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-xpdfopen=$enable_xpdfopen'" >&5
+$as_echo "$as_me: Assuming \`--enable-xpdfopen=$enable_xpdfopen'" >&6;}
+ ac_configure_args="$ac_configure_args '--enable-xpdfopen=$enable_xpdfopen'"
+ ;;
+esac
+
+
## texk/web2c/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory texk/web2c/
## configure options and TL libraries required for web2c
diff --git a/Build/source/libs/Makefile.in b/Build/source/libs/Makefile.in
index 8a59120f095..feadddb27bf 100644
--- a/Build/source/libs/Makefile.in
+++ b/Build/source/libs/Makefile.in
@@ -67,7 +67,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../m4/kpse-common.m4 \
$(top_srcdir)/../m4/kpse-zziplib-flags.m4 \
$(top_srcdir)/../utils/chktex/ac/withenable.ac \
$(top_srcdir)/../utils/dialog/ac/withenable.ac \
- $(top_srcdir)/../utils/pdfopen/ac/withenable.ac \
$(top_srcdir)/../utils/ps2eps/ac/withenable.ac \
$(top_srcdir)/../utils/psutils/ac/withenable.ac \
$(top_srcdir)/../utils/t1utils/ac/withenable.ac \
@@ -78,6 +77,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../m4/kpse-common.m4 \
$(top_srcdir)/../utils/xindy-new/ac/clisp.ac \
$(top_srcdir)/../utils/xindy/ac/withenable.ac \
$(top_srcdir)/../utils/xindy/ac/xindy.ac \
+ $(top_srcdir)/../utils/xpdfopen/ac/withenable.ac \
$(top_srcdir)/../texk/web2c/ac/withenable.ac \
$(top_srcdir)/../texk/web2c/ac/web2c.ac \
$(top_srcdir)/../texk/afm2pl/ac/withenable.ac \
diff --git a/Build/source/libs/configure b/Build/source/libs/configure
index 924fad2f4bd..d89231714c4 100755
--- a/Build/source/libs/configure
+++ b/Build/source/libs/configure
@@ -646,7 +646,6 @@ enable_cxx_runtime_hack
enable_libtool_hack
enable_chktex
enable_dialog
-enable_pdfopen
enable_ps2eps
enable_psutils
enable_t1utils
@@ -658,6 +657,7 @@ enable_xindy_docs
with_clisp_runtime
with_xindy_recode
enable_xindy
+enable_xpdfopen
enable_web2c
with_tex_banner
with_editor
@@ -1419,7 +1419,6 @@ Optional Features:
--enable-libtool-hack ignore libtool dependency_libs
--enable-chktex build the chktex package
--disable-dialog do not build the dialog package
- --disable-pdfopen do not build the pdfopen package
--disable-ps2eps do not build the ps2eps package
--disable-psutils do not build the psutils package
--disable-t1utils do not build the t1utils package
@@ -1429,6 +1428,7 @@ Optional Features:
--enable-xindy-rules build and install make-rules package
--enable-xindy-docs build and install documentation
--enable-xindy build the xindy package
+ --disable-xpdfopen do not build the xpdfopen package
--disable-web2c do not build the web2c (TeX & Co.) package
--enable-auto-core cause TeX&MF to dump core, given a certain
filename
@@ -2260,38 +2260,6 @@ $as_echo "$as_me: Assuming \`--enable-dialog=$enable_dialog'" >&6;}
esac
-## utils/pdfopen/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/pdfopen/
-## configure options and TL libraries required for pdfopen
-if test "x$with_x" = xno; then :
- case $enable_pdfopen in #(
- "") :
- { $as_echo "$as_me:${as_lineno-$LINENO}: \`--without-x' -> \`--disable-pdfopen'" >&5
-$as_echo "$as_me: \`--without-x' -> \`--disable-pdfopen'" >&6;}
- enable_pdfopen=no
- ac_configure_args="$ac_configure_args '--disable-pdfopen'" ;; #(
- yes) :
- as_fn_error "Sorry, incompatible options \`--without-x' and \`--enable-pdfopen'" "$LINENO" 5 ;; #(
- *) :
- ;;
-esac
-fi
-# Check whether --enable-pdfopen was given.
-if test "${enable_pdfopen+set}" = set; then :
- enableval=$enable_pdfopen;
-fi
-case $enable_pdfopen in #(
- yes|no) :
- ;; #(
- *) :
-
- enable_pdfopen=$enable_all_pkgs
- { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-pdfopen=$enable_pdfopen'" >&5
-$as_echo "$as_me: Assuming \`--enable-pdfopen=$enable_pdfopen'" >&6;}
- ac_configure_args="$ac_configure_args '--enable-pdfopen=$enable_pdfopen'"
- ;;
-esac
-
-
## utils/ps2eps/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/ps2eps/
## configure options and TL libraries required for ps2eps
# Check whether --enable-ps2eps was given.
@@ -2502,6 +2470,38 @@ if test "${with_xindy_recode+set}" = set; then :
fi
+## utils/xpdfopen/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/xpdfopen/
+## configure options and TL libraries required for xpdfopen
+if test "x$with_x" = xno; then :
+ case $enable_xpdfopen in #(
+ "") :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: \`--without-x' -> \`--disable-xpdfopen'" >&5
+$as_echo "$as_me: \`--without-x' -> \`--disable-xpdfopen'" >&6;}
+ enable_xpdfopen=no
+ ac_configure_args="$ac_configure_args '--disable-xpdfopen'" ;; #(
+ yes) :
+ as_fn_error "Sorry, incompatible options \`--without-x' and \`--enable-xpdfopen'" "$LINENO" 5 ;; #(
+ *) :
+ ;;
+esac
+fi
+# Check whether --enable-xpdfopen was given.
+if test "${enable_xpdfopen+set}" = set; then :
+ enableval=$enable_xpdfopen;
+fi
+case $enable_xpdfopen in #(
+ yes|no) :
+ ;; #(
+ *) :
+
+ enable_xpdfopen=$enable_all_pkgs
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-xpdfopen=$enable_xpdfopen'" >&5
+$as_echo "$as_me: Assuming \`--enable-xpdfopen=$enable_xpdfopen'" >&6;}
+ ac_configure_args="$ac_configure_args '--enable-xpdfopen=$enable_xpdfopen'"
+ ;;
+esac
+
+
## texk/web2c/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory texk/web2c/
## configure options and TL libraries required for web2c
diff --git a/Build/source/m4/kpse-pkgs.m4 b/Build/source/m4/kpse-pkgs.m4
index ce2c6587eec..1eb5b821509 100644
--- a/Build/source/m4/kpse-pkgs.m4
+++ b/Build/source/m4/kpse-pkgs.m4
@@ -73,7 +73,6 @@ AC_DEFUN([KPSE_UTILS_PKGS],
[m4_define([kpse_utils_pkgs], [
chktex
dialog
-pdfopen
ps2eps
psutils
t1utils
@@ -81,6 +80,7 @@ tpic2pdftex
vlna
xindy-new
xindy
+xpdfopen
])]) # KPSE_UTILS_PKGS
# KPSE_TEXK_PKGS()
diff --git a/Build/source/texk/Makefile.in b/Build/source/texk/Makefile.in
index 331b6bbefeb..6e41d7008b7 100644
--- a/Build/source/texk/Makefile.in
+++ b/Build/source/texk/Makefile.in
@@ -67,7 +67,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../m4/kpse-common.m4 \
$(top_srcdir)/../m4/kpse-zziplib-flags.m4 \
$(top_srcdir)/../utils/chktex/ac/withenable.ac \
$(top_srcdir)/../utils/dialog/ac/withenable.ac \
- $(top_srcdir)/../utils/pdfopen/ac/withenable.ac \
$(top_srcdir)/../utils/ps2eps/ac/withenable.ac \
$(top_srcdir)/../utils/psutils/ac/withenable.ac \
$(top_srcdir)/../utils/t1utils/ac/withenable.ac \
@@ -78,6 +77,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../m4/kpse-common.m4 \
$(top_srcdir)/../utils/xindy-new/ac/clisp.ac \
$(top_srcdir)/../utils/xindy/ac/withenable.ac \
$(top_srcdir)/../utils/xindy/ac/xindy.ac \
+ $(top_srcdir)/../utils/xpdfopen/ac/withenable.ac \
$(top_srcdir)/../texk/web2c/ac/withenable.ac \
$(top_srcdir)/../texk/web2c/ac/web2c.ac \
$(top_srcdir)/../texk/afm2pl/ac/withenable.ac \
diff --git a/Build/source/texk/configure b/Build/source/texk/configure
index 68a96385379..325aa09f31d 100755
--- a/Build/source/texk/configure
+++ b/Build/source/texk/configure
@@ -646,7 +646,6 @@ enable_cxx_runtime_hack
enable_libtool_hack
enable_chktex
enable_dialog
-enable_pdfopen
enable_ps2eps
enable_psutils
enable_t1utils
@@ -658,6 +657,7 @@ enable_xindy_docs
with_clisp_runtime
with_xindy_recode
enable_xindy
+enable_xpdfopen
enable_web2c
with_tex_banner
with_editor
@@ -1440,7 +1440,6 @@ Optional Features:
--enable-libtool-hack ignore libtool dependency_libs
--enable-chktex build the chktex package
--disable-dialog do not build the dialog package
- --disable-pdfopen do not build the pdfopen package
--disable-ps2eps do not build the ps2eps package
--disable-psutils do not build the psutils package
--disable-t1utils do not build the t1utils package
@@ -1450,6 +1449,7 @@ Optional Features:
--enable-xindy-rules build and install make-rules package
--enable-xindy-docs build and install documentation
--enable-xindy build the xindy package
+ --disable-xpdfopen do not build the xpdfopen package
--disable-web2c do not build the web2c (TeX & Co.) package
--enable-auto-core cause TeX&MF to dump core, given a certain
filename
@@ -2281,38 +2281,6 @@ $as_echo "$as_me: Assuming \`--enable-dialog=$enable_dialog'" >&6;}
esac
-## utils/pdfopen/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/pdfopen/
-## configure options and TL libraries required for pdfopen
-if test "x$with_x" = xno; then :
- case $enable_pdfopen in #(
- "") :
- { $as_echo "$as_me:${as_lineno-$LINENO}: \`--without-x' -> \`--disable-pdfopen'" >&5
-$as_echo "$as_me: \`--without-x' -> \`--disable-pdfopen'" >&6;}
- enable_pdfopen=no
- ac_configure_args="$ac_configure_args '--disable-pdfopen'" ;; #(
- yes) :
- as_fn_error "Sorry, incompatible options \`--without-x' and \`--enable-pdfopen'" "$LINENO" 5 ;; #(
- *) :
- ;;
-esac
-fi
-# Check whether --enable-pdfopen was given.
-if test "${enable_pdfopen+set}" = set; then :
- enableval=$enable_pdfopen;
-fi
-case $enable_pdfopen in #(
- yes|no) :
- ;; #(
- *) :
-
- enable_pdfopen=$enable_all_pkgs
- { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-pdfopen=$enable_pdfopen'" >&5
-$as_echo "$as_me: Assuming \`--enable-pdfopen=$enable_pdfopen'" >&6;}
- ac_configure_args="$ac_configure_args '--enable-pdfopen=$enable_pdfopen'"
- ;;
-esac
-
-
## utils/ps2eps/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/ps2eps/
## configure options and TL libraries required for ps2eps
# Check whether --enable-ps2eps was given.
@@ -2523,6 +2491,38 @@ if test "${with_xindy_recode+set}" = set; then :
fi
+## utils/xpdfopen/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/xpdfopen/
+## configure options and TL libraries required for xpdfopen
+if test "x$with_x" = xno; then :
+ case $enable_xpdfopen in #(
+ "") :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: \`--without-x' -> \`--disable-xpdfopen'" >&5
+$as_echo "$as_me: \`--without-x' -> \`--disable-xpdfopen'" >&6;}
+ enable_xpdfopen=no
+ ac_configure_args="$ac_configure_args '--disable-xpdfopen'" ;; #(
+ yes) :
+ as_fn_error "Sorry, incompatible options \`--without-x' and \`--enable-xpdfopen'" "$LINENO" 5 ;; #(
+ *) :
+ ;;
+esac
+fi
+# Check whether --enable-xpdfopen was given.
+if test "${enable_xpdfopen+set}" = set; then :
+ enableval=$enable_xpdfopen;
+fi
+case $enable_xpdfopen in #(
+ yes|no) :
+ ;; #(
+ *) :
+
+ enable_xpdfopen=$enable_all_pkgs
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-xpdfopen=$enable_xpdfopen'" >&5
+$as_echo "$as_me: Assuming \`--enable-xpdfopen=$enable_xpdfopen'" >&6;}
+ ac_configure_args="$ac_configure_args '--enable-xpdfopen=$enable_xpdfopen'"
+ ;;
+esac
+
+
## texk/web2c/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory texk/web2c/
## configure options and TL libraries required for web2c
diff --git a/Build/source/utils/Makefile.in b/Build/source/utils/Makefile.in
index 336973ae9da..6d3932412a8 100644
--- a/Build/source/utils/Makefile.in
+++ b/Build/source/utils/Makefile.in
@@ -67,7 +67,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../m4/kpse-common.m4 \
$(top_srcdir)/../m4/kpse-zziplib-flags.m4 \
$(top_srcdir)/../utils/chktex/ac/withenable.ac \
$(top_srcdir)/../utils/dialog/ac/withenable.ac \
- $(top_srcdir)/../utils/pdfopen/ac/withenable.ac \
$(top_srcdir)/../utils/ps2eps/ac/withenable.ac \
$(top_srcdir)/../utils/psutils/ac/withenable.ac \
$(top_srcdir)/../utils/t1utils/ac/withenable.ac \
@@ -78,6 +77,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../m4/kpse-common.m4 \
$(top_srcdir)/../utils/xindy-new/ac/clisp.ac \
$(top_srcdir)/../utils/xindy/ac/withenable.ac \
$(top_srcdir)/../utils/xindy/ac/xindy.ac \
+ $(top_srcdir)/../utils/xpdfopen/ac/withenable.ac \
$(top_srcdir)/../texk/web2c/ac/withenable.ac \
$(top_srcdir)/../texk/web2c/ac/web2c.ac \
$(top_srcdir)/../texk/afm2pl/ac/withenable.ac \
diff --git a/Build/source/utils/README b/Build/source/utils/README
index 00374b2ff0b..1f9e9fb5353 100644
--- a/Build/source/utils/README
+++ b/Build/source/utils/README
@@ -16,10 +16,6 @@ chktex 1.6.4 - checked 3may10
dialog 1.1-20100119 - checked 21jan10
ftp://invisible-island.net/dialog/dialog.tar.gz
-pdfopen 0.5 - checked 26nov06
- (really xpdfopen)
- http://tex.aanhet.net/pdfopen
-
ps2eps 1.64 - checked 19feb08
http://www.ipv6.tm.uka.de/~bless/ps2eps
@@ -36,7 +32,6 @@ tpic2pdftex
vlna 1.2 - checked 26jun08
ftp://math.feld.cvut.cz/pub/olsak/vlna
-
xindy 2.3 - checked 24mar08
(with numerous adaptations for TL by Vladimir)
http://www.ctan.org/indexing/xindy/
@@ -45,6 +40,10 @@ After building clisp as described below, run the TL
Build --enable-xindy CLISP=$clisp_builddir/clisp
to include xindy in the build. It is disabled by default.
+xpdfopen 0.80 - checked 5may10
+ http://mirror.ctan.org/support/xpdfopen.zip
+
+
Do NOT use nohup when building clisp; this may cause weird build
problems. Regular redirections of stdout/stderr seem ok.
diff --git a/Build/source/utils/configure b/Build/source/utils/configure
index 479d35586a4..80ff50e7a04 100755
--- a/Build/source/utils/configure
+++ b/Build/source/utils/configure
@@ -646,7 +646,6 @@ enable_cxx_runtime_hack
enable_libtool_hack
enable_chktex
enable_dialog
-enable_pdfopen
enable_ps2eps
enable_psutils
enable_t1utils
@@ -658,6 +657,7 @@ enable_xindy_docs
with_clisp_runtime
with_xindy_recode
enable_xindy
+enable_xpdfopen
enable_web2c
with_tex_banner
with_editor
@@ -780,14 +780,14 @@ host_alias
target_alias'
ac_subdirs_all='chktex
dialog
-pdfopen
ps2eps
psutils
t1utils
tpic2pdftex
vlna
xindy-new
-xindy'
+xindy
+xpdfopen'
# Initialize some variables set by options.
ac_init_help=
@@ -1417,7 +1417,6 @@ Optional Features:
--enable-libtool-hack ignore libtool dependency_libs
--enable-chktex build the chktex package
--disable-dialog do not build the dialog package
- --disable-pdfopen do not build the pdfopen package
--disable-ps2eps do not build the ps2eps package
--disable-psutils do not build the psutils package
--disable-t1utils do not build the t1utils package
@@ -1427,6 +1426,7 @@ Optional Features:
--enable-xindy-rules build and install make-rules package
--enable-xindy-docs build and install documentation
--enable-xindy build the xindy package
+ --disable-xpdfopen do not build the xpdfopen package
--disable-web2c do not build the web2c (TeX & Co.) package
--enable-auto-core cause TeX&MF to dump core, given a certain
filename
@@ -2258,38 +2258,6 @@ $as_echo "$as_me: Assuming \`--enable-dialog=$enable_dialog'" >&6;}
esac
-## utils/pdfopen/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/pdfopen/
-## configure options and TL libraries required for pdfopen
-if test "x$with_x" = xno; then :
- case $enable_pdfopen in #(
- "") :
- { $as_echo "$as_me:${as_lineno-$LINENO}: \`--without-x' -> \`--disable-pdfopen'" >&5
-$as_echo "$as_me: \`--without-x' -> \`--disable-pdfopen'" >&6;}
- enable_pdfopen=no
- ac_configure_args="$ac_configure_args '--disable-pdfopen'" ;; #(
- yes) :
- as_fn_error "Sorry, incompatible options \`--without-x' and \`--enable-pdfopen'" "$LINENO" 5 ;; #(
- *) :
- ;;
-esac
-fi
-# Check whether --enable-pdfopen was given.
-if test "${enable_pdfopen+set}" = set; then :
- enableval=$enable_pdfopen;
-fi
-case $enable_pdfopen in #(
- yes|no) :
- ;; #(
- *) :
-
- enable_pdfopen=$enable_all_pkgs
- { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-pdfopen=$enable_pdfopen'" >&5
-$as_echo "$as_me: Assuming \`--enable-pdfopen=$enable_pdfopen'" >&6;}
- ac_configure_args="$ac_configure_args '--enable-pdfopen=$enable_pdfopen'"
- ;;
-esac
-
-
## utils/ps2eps/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/ps2eps/
## configure options and TL libraries required for ps2eps
# Check whether --enable-ps2eps was given.
@@ -2500,6 +2468,38 @@ if test "${with_xindy_recode+set}" = set; then :
fi
+## utils/xpdfopen/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/xpdfopen/
+## configure options and TL libraries required for xpdfopen
+if test "x$with_x" = xno; then :
+ case $enable_xpdfopen in #(
+ "") :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: \`--without-x' -> \`--disable-xpdfopen'" >&5
+$as_echo "$as_me: \`--without-x' -> \`--disable-xpdfopen'" >&6;}
+ enable_xpdfopen=no
+ ac_configure_args="$ac_configure_args '--disable-xpdfopen'" ;; #(
+ yes) :
+ as_fn_error "Sorry, incompatible options \`--without-x' and \`--enable-xpdfopen'" "$LINENO" 5 ;; #(
+ *) :
+ ;;
+esac
+fi
+# Check whether --enable-xpdfopen was given.
+if test "${enable_xpdfopen+set}" = set; then :
+ enableval=$enable_xpdfopen;
+fi
+case $enable_xpdfopen in #(
+ yes|no) :
+ ;; #(
+ *) :
+
+ enable_xpdfopen=$enable_all_pkgs
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Assuming \`--enable-xpdfopen=$enable_xpdfopen'" >&5
+$as_echo "$as_me: Assuming \`--enable-xpdfopen=$enable_xpdfopen'" >&6;}
+ ac_configure_args="$ac_configure_args '--enable-xpdfopen=$enable_xpdfopen'"
+ ;;
+esac
+
+
## texk/web2c/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory texk/web2c/
## configure options and TL libraries required for web2c
@@ -4631,16 +4631,6 @@ if test -x $srcdir/dialog/configure; then
fi
-if test -x $srcdir/pdfopen/configure; then
- test "x$enable_pdfopen" = xno || SUBUTILS="$SUBUTILS pdfopen"
- DIST_SUBUTILS="$DIST_SUBUTILS pdfopen"
- if false; then
- subdirs="$subdirs pdfopen"
-
- fi
-fi
-
-
if test -x $srcdir/ps2eps/configure; then
test "x$enable_ps2eps" = xno || SUBUTILS="$SUBUTILS ps2eps"
DIST_SUBUTILS="$DIST_SUBUTILS ps2eps"
@@ -4711,6 +4701,16 @@ if test -x $srcdir/xindy/configure; then
fi
+if test -x $srcdir/xpdfopen/configure; then
+ test "x$enable_xpdfopen" = xno || SUBUTILS="$SUBUTILS xpdfopen"
+ DIST_SUBUTILS="$DIST_SUBUTILS xpdfopen"
+ if false; then
+ subdirs="$subdirs xpdfopen"
+
+ fi
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SUBUTILS" >&5
diff --git a/Build/source/utils/pdfopen/ChangeLog b/Build/source/utils/pdfopen/ChangeLog
deleted file mode 100644
index 8acb751ea09..00000000000
--- a/Build/source/utils/pdfopen/ChangeLog
+++ /dev/null
@@ -1,25 +0,0 @@
-2009-08-22 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- Avoid maximal compiler warnings.
- * pdfopen.c: Use strdup'ed literal string (malloc+strcpy) to
- initialize non-constant string.
- * sendx.[ch]: Constify string args of all functions.
- Consistently use wname for window name string param.
- (close_channel): ANSI C function definition.
-
-2009-08-19 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- * Makefile.am (AM_CFLAGS), configure.ac: Enable compiler warnings.
- * pdfopen.c (usage), pdfclose.c (usage): Declare as static.
-
- * sendx.h (new): Declare prototypes for functions in sendx.c.
- * Makefile.am (pdfopen_SOURCES, pdfclose_SOURCES): Add sendx.h.
- * pdfopen.c, pdfclose.c, sendx.c: #include "sendx.h".
-
- * sendx.c (GetRootWindow): Slightly reformulate to avoid compiler
- warning (strict-aliasing rules).
-
-2009-05-06 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- Adapt to TL2009 build system.
-
diff --git a/Build/source/utils/pdfopen/Makefile.am b/Build/source/utils/pdfopen/Makefile.am
deleted file mode 100644
index 227bacf38db..00000000000
--- a/Build/source/utils/pdfopen/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-## Makefile.am for the TeX Live subdirectory utils/pdfopen/
-##
-## Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
-## You may freely use, modify and/or distribute this file.
-##
-ACLOCAL_AMFLAGS = -I ../../m4
-
-AM_CFLAGS = $(WARNING_CFLAGS)
-INCLUDES = $(X_CFLAGS)
-
-LDADD = $(X_LIBS) -lX11 -lXmu $(X_EXTRA_LIBS)
-
-bin_PROGRAMS = pdfopen pdfclose
-
-pdfopen_SOURCES = pdfopen.c sendx.c sendx.h
-
-pdfclose_SOURCES = pdfclose.c sendx.c sendx.h
-
-EXTRA_DIST = xpdfopen.pdf xpdfopen.tex
-
diff --git a/Build/source/utils/pdfopen/README b/Build/source/utils/pdfopen/README
deleted file mode 100644
index 3072326118c..00000000000
--- a/Build/source/utils/pdfopen/README
+++ /dev/null
@@ -1,83 +0,0 @@
-
----------------------------------------------------------
-Pdfopen 0.51 - Send open/close commands to Acrobat Reader
----------------------------------------------------------
-
-This is a Linux (X11) implementation of Fabrice Popineau's pdfclose/
-pdfopen commands to control the Acrobat Reader.
-
-The libX code was borrowed from Reinhard Fobbe's Sendx library for
-Tcl/Tk, and the programs use the same license, copied below.
-
-Version 0.3 adds support for Adobe Reader 7.0 for Linux.
-(different window titles and key shortcuts)
-
-Version 0.4 uses autoconf
-
-Version 0.5 fixes an incorrect autoconf variable, supports
-building under X11R5, handles pathnames on the command-line,
-and fixes a bug where pdfopen did not exit correctly after
-(automatically) starting acroread.
-
-Version 0.51 uses the strrchr() function instead of rindex()
-to allow compilation on non-BSD derived unix platforms.
-
-The command lines do not behave precisely the same as under Windows,
-because the Linux Reader behaves somewhat different: it is not
-scriptable, but it is possible to 'fake' keypresses.
-
-Both commands have only one meaningful argument:
-
- pdfclose --file <pdfname>
- Closes an existing window with the name <pdfname>
-
- pdfopen --file <pdfname>
- Opens a window with the name <pdfname> (starting a reader if
- necesary), or it reloads <pdfname> if it was already open.
-
-Note: <pdfname> is the name of the X window, not a filename.
-
-
-Without argument, the pdfopen program sends a "Ctrl-<-" to an existing X
-window with the name "Acrobat Reader", and "Alt-<-" to a window with the
-name "Adobe Reader", if such windows exist.
-
-The --all and --page arguments of Fabrice's programs are silently ignored.
-
-
-Taco Hoekwater <taco@metatex.org>
-
-Dordrecht, The Netherlands, March 2005.
-
-
-License terms:
---------------
-The following terms apply to all files associated with the software unless
-explicitly disclaimed in individual files.
-
-The authors hereby grant permission to use, copy, modify, distribute,
-and license this software and its documentation for any purpose, provided
-that existing copyright notices are retained in all copies and that this
-notice is included verbatim in any distributions. No written agreement,
-license, or royalty fee is required for any of the authorized uses.
-Modifications to this software may be copyrighted by their authors
-and need not follow the licensing terms described here, provided that
-the new terms are clearly indicated on the first page of each file where
-they apply.
-
-IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
-FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
-ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
-DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE
-IS PROVIDED ON AN &quot;AS IS&quot; BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
-NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
-MODIFICATIONS.
-
-
-
-
diff --git a/Build/source/utils/pdfopen/ac/withenable.ac b/Build/source/utils/pdfopen/ac/withenable.ac
deleted file mode 100644
index 5aed0888cd2..00000000000
--- a/Build/source/utils/pdfopen/ac/withenable.ac
+++ /dev/null
@@ -1,13 +0,0 @@
-## utils/pdfopen/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/pdfopen/
-dnl
-dnl Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
-dnl You may freely use, modify and/or distribute this file.
-dnl
-## configure options and TL libraries required for pdfopen
-AS_IF([test "x$with_x" = xno],
- [AS_CASE([$enable_pdfopen],
- [""], [AC_MSG_NOTICE([`--without-x' -> `--disable-pdfopen'])
- enable_pdfopen=no
- ac_configure_args="$ac_configure_args '--disable-pdfopen'"],
- [yes], [AC_MSG_ERROR([Sorry, incompatible options `--without-x' and `--enable-pdfopen'])])])
-KPSE_ENABLE_PROG([pdfopen])
diff --git a/Build/source/utils/pdfopen/pdfclose.c b/Build/source/utils/pdfopen/pdfclose.c
deleted file mode 100644
index 9bb3d5ce247..00000000000
--- a/Build/source/utils/pdfopen/pdfclose.c
+++ /dev/null
@@ -1,47 +0,0 @@
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "sendx.h"
-
-#define READERWINPREFIX "Adobe Reader - "
-#define SUCCESS(a) (!a)
-
-static void usage (void) {
- puts ("pdfclose 0.5: you are mistaking me for an actual program.\n");
- puts (" pdfclose --file filename.pdf");
- puts ("\n");
-}
-
-
-int main (int argc, char **argv){
- char *filename;
- char *winname;
- if (argc == 3 && strcmp(argv[1],"--file") == 0) {
- filename = malloc(strlen(argv[2])+1);
- if (filename == NULL) {
- puts ("out of memory\n");
- exit(EXIT_FAILURE);
- }
- strcpy(filename,argv[2]);
- if(sendx_control_token("W",filename)) {
- /* failed try reader 7 */
- winname = malloc(strlen(argv[2])+1+strlen(READERWINPREFIX));
- if (winname == NULL) {
- puts ("out of memory\n");
- exit(EXIT_FAILURE);
- }
- strcpy (winname, READERWINPREFIX);
- strcpy ((winname+strlen(READERWINPREFIX)), filename);
- sendx_control_token("W",winname);
- }
- } else if (argc == 2 && strcmp(argv[1],"--all") == 0) {
- ;
- } else {
- usage();
- }
- exit(EXIT_SUCCESS);
-}
-
diff --git a/Build/source/utils/pdfopen/pdfopen.c b/Build/source/utils/pdfopen/pdfopen.c
deleted file mode 100644
index f968f6fd042..00000000000
--- a/Build/source/utils/pdfopen/pdfopen.c
+++ /dev/null
@@ -1,92 +0,0 @@
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include "sendx.h"
-
-static void usage (void) {
- puts ("pdfopen 0.51: you are mistaking me for an actual program.\n");
- puts(" pdfopen [--file filename.pdf]");
- puts ("\nusing no arguments tells the Reader to 'go back'.\n");
-}
-
-#define READERFIVE "Acrobat Reader"
-#define READERNAME "Adobe Reader"
-#define READERWINPREFIX "Adobe Reader - "
-#define SUCCESS(a) (!a)
-
-int main (int argc, char **argv){
- char *newargv[3];
- char *winname;
- char *filename;
- char *basefile;
- pid_t reader;
- if (argc == 5 &&
- (strcmp(argv[3],"--page") == 0
- && strcmp(argv[1],"--file") == 0 )) {
- argc = 3;
- }
- if (argc == 3 && strcmp(argv[1],"--file") == 0) {
- filename = malloc(strlen(argv[2])+1);
- basefile = malloc(strlen(argv[2])+1);
- if (filename == NULL || basefile == NULL) {
- puts ("out of memory\n");
- exit(EXIT_FAILURE);
- }
- strcpy(filename,argv[2]);
- strcpy(basefile,filename);
- if (strrchr(basefile,'/'))
- basefile = strrchr(basefile,'/')+1;
-
- winname = malloc(strlen(argv[2])+1+strlen(READERWINPREFIX));
- if (winname == NULL ) {
- puts ("out of memory\n");
- exit(EXIT_FAILURE);
- }
- strcpy (winname,READERWINPREFIX);
- strcpy ((winname+strlen(READERWINPREFIX)), basefile);
- if (SUCCESS(sendx_control_token("W",winname))) {
- sendx_alt_token("Left",READERNAME); /* that's seven */
- sendx_control_token("Left",READERNAME);
- /* that's seven, with artificial five keymaps */
- } else if (SUCCESS(sendx_control_token("W",filename))) {
- sendx_control_token("Left",READERFIVE); /* that's five */
- } else if (SUCCESS(sendx_control_token("W",basefile))) {
- sendx_control_token("Left",READERFIVE); /* that's five */
- } else {
- if((reader = fork()) >= 0) {
- if (reader) {
- waitpid(reader,NULL,WNOHANG);
- } else {
- newargv[0] = malloc(strlen("acroread")+1);
- if (newargv[0] == NULL) {
- puts ("out of memory\n");
- exit(EXIT_FAILURE);
- }
- strcpy(newargv[0], "acroread");
- newargv[1] = filename;
- newargv[2] = NULL;
- if(execvp("acroread",newargv)) {
- puts ("acroread startup failed\n");
- exit(EXIT_FAILURE);
- }
- }
- } else {
- puts ("fork failed\n");
- exit(EXIT_FAILURE);
- }
- }
- } else if (argc != 1) {
- usage();
- } else {
- sendx_alt_token("Left",READERNAME);
- sendx_control_token("Left",READERNAME); /* that's seven */
- sendx_control_token("Left",READERFIVE);
- }
- exit(EXIT_SUCCESS);
-}
-
diff --git a/Build/source/utils/pdfopen/sendx.c b/Build/source/utils/pdfopen/sendx.c
deleted file mode 100644
index 41defc8a6dc..00000000000
--- a/Build/source/utils/pdfopen/sendx.c
+++ /dev/null
@@ -1,288 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#include <X11/keysym.h>
-#include <X11/cursorfont.h>
-
-#include "sendx.h"
-
-static char *display_name = NULL;
-static Display *display;
-static Window root;
-static Window window = None;
-static XKeyEvent event;
-
-static char error_message[256];
-static int error_status = 0;
-
-static void
-throw_exception3(const char *msg, const char *s, int i) {
- sprintf(error_message, msg, s, i);
- error_status = 1;
-}
-
-static void
-throw_exception3s(const char *msg1, const char *msg2, const char *msg3) {
- sprintf(error_message, msg1, msg2, msg3);
- error_status = 1;
-}
-
-static void
-throw_exception(const char *msg) {
- strncpy(error_message,msg,256);
- error_status = 1;
-}
-
-/* Added for window managers like swm and tvtwm that follow solbourne's
- * virtual root window concept
- */
-static Window
-GetRootWindow (Display * disp, int scrn)
-{
- Atom __SWM_VROOT = None;
- Window root, rootReturn, parentReturn, *children;
- unsigned int numChildren;
- unsigned i;
-
- root = RootWindow (disp, scrn);
-
- /* see if there is a virtual root */
- __SWM_VROOT = XInternAtom (disp, "__SWM_VROOT", False);
- XQueryTree (disp, root, &rootReturn, &parentReturn, &children, &numChildren);
- for (i = 0; i < numChildren; i++)
- {
- Atom actual_type;
- int actual_format;
- unsigned long nitems, bytesafter;
- unsigned char *prop_return = NULL;
-
- if (XGetWindowProperty (disp, children[i], __SWM_VROOT, 0, 1,
- False, XA_WINDOW, &actual_type, &actual_format,
- &nitems, &bytesafter, &prop_return) ==
- Success && prop_return)
- {
- root = *(Window *)prop_return;
- break;
- }
- }
- if (children)
- XFree ((char *) children);
- return (root);
-}
-
-
-/* - - - - - - - - -
-
- * [These functions are from the file "dsimple.c" used with xwininfo.]
- *
- * Written by Mark Lillibridge. Last updated 7/1/87
- *
- *
- * Window_With_Name: routine to locate a window with a given name on a display.
- * If no window with the given name is found, 0 is returned.
- * If more than one window has the given name, the first
- * one found will be returned. Only top and its subwindows
- * are looked at. Normally, top should be the Root Window.
- */
-static Window
-Window_With_Name (Display * dpy, Window top, const char *wname)
-{
- Window *children, dummy;
- unsigned int nchildren;
- unsigned i;
- Window w = 0;
- char *window_name;
-
- if (XFetchName (dpy, top, &window_name) && !strcmp (window_name, wname))
- return (top);
-
- if (!XQueryTree (dpy, top, &dummy, &dummy, &children, &nchildren))
- return (0);
-
- for (i = 0; i < nchildren; i++)
- {
- w = Window_With_Name (dpy, children[i], wname);
- if (w)
- break;
- }
- if (children)
- XFree ((char *) children);
- return (w);
-}
-
-
-
-static int
-open_channel (const char *wname)
-{
-/* display_name = ":0.0"; */
- if ((display = XOpenDisplay (display_name)) == NULL)
- {
- throw_exception ("can't open display");
- return 1;
- }
- if ((root = GetRootWindow (display, DefaultScreen (display))) == 0)
- {
- throw_exception ("Cannot get DefaultScreen");
- return 1;
- }
-
- if ((wname[0] == '\0') && (window != None))
- {} /* take selected window */
- else if (wname[0] != '\0')
- {
- if ((window = Window_With_Name (display, root, wname)) == None)
- {
- throw_exception3s ("Display %s: can't open window named \"%s\"",
- XDisplayName (display_name), wname);
- return 1;
- }
- }
- else
- {
- throw_exception3 ("bad condition in %s at line %d", __FILE__, __LINE__);
- return 1;
- }
-
- event.type = KeyPress;
- event.serial = 0;
- event.send_event = False;
- event.display = display;
- event.x = event.y = event.x_root = event.y_root = 0;
- event.time = CurrentTime;
- event.same_screen = True;
- event.subwindow = None;
- event.window = window;
- event.root = root;
- return 0;
-}
-
-static void
-close_channel (void)
-{
-/* XFlush(display); */
- XCloseDisplay (display);
-}
-
-static void
-sendx_channel (KeySym ks, int km)
-{
-/* 0=regular, 1=shift, 2=lock, 4=control */
- if (ks < 256)
- {
- event.state = isupper ((char) ks);
- switch (ks)
- {
- case 0x08:
- ks = XK_BackSpace;
- break;
- case 0x09:
- ks = XK_Tab;
- break;
- case 0x0A:
- ks = XK_Linefeed;
- break;
- case 0x0B:
- ks = XK_Clear;
- break;
- case 0x0D:
- ks = XK_Return;
- break;
- case 0x13:
- ks = XK_Pause;
- break;
- case 0x14:
- ks = XK_Scroll_Lock;
- break;
- case 0x1B:
- ks = XK_Escape;
- break;
- }
- }
- else
- event.state = 0;
- event.type = KeyPress;
- event.state = km ; // Mod1Mask
- event.keycode = XKeysymToKeycode (display, ks);
- if (XSendEvent (display, window, True, 0xfff, (XEvent *) & event) == 0)
- throw_exception ("Error in XSendEvent");
- event.type = KeyRelease;
- if (XSendEvent (display, window, True, 0xfff, (XEvent *) & event) == 0)
- throw_exception ("Error in XSendEvent");
- return;
-}
-
-int
-sendx_string (const char *string, const char *wname)
-{
- const char *p;
- if (open_channel (wname))
- return error_status;
- p = string;
- while (*p)
- sendx_channel (*p++,0);
- close_channel ();
- return error_status;
-}
-
-int
-sendx_token (const char *string, const char *wname)
-{
- if (open_channel (wname))
- return error_status;
- sendx_channel (XStringToKeysym (string),0);
- close_channel ();
- return error_status;
-}
-
-
-int
-sendx_alt_token (const char *string, const char *wname)
-{
- if (open_channel (wname))
- return error_status;
- sendx_channel (XStringToKeysym (string),Mod1Mask);
- close_channel ();
- return error_status;
-}
-
-int
-sendx_controlalt_token (const char *string, const char *wname)
-{
- if (open_channel (wname))
- return error_status;
- sendx_channel (XStringToKeysym (string), Mod1Mask | ControlMask);
- close_channel ();
- return error_status;
-}
-
-
-int
-sendx_control_token (const char *string, const char *wname)
-{
- if (open_channel (wname))
- return error_status;
- sendx_channel (XStringToKeysym (string),ControlMask);
- close_channel ();
- return error_status;
-}
-
-/*
- void
- PrintKeySyms ()
- {
- int i;
- for (i = 32; i < 127; i++)
- {
- printf ("%s[%c] ", XKeysymToString (i), i);
- }
- for (i = 128 + 32; i < 128 + 127; i++)
- {
- printf ("%s[%c] ", XKeysymToString (i), i);
- }
- printf ("\n");
- }
- */
diff --git a/Build/source/utils/pdfopen/sendx.h b/Build/source/utils/pdfopen/sendx.h
deleted file mode 100644
index c570dbb5920..00000000000
--- a/Build/source/utils/pdfopen/sendx.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* sendx.h: declare prototypes for functions defined in sendx.c
- *
- * Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
- * You may freely use, modify and/or distribute this file.
- */
-#ifndef SENDX_H
-#define SENDX_H
-
-extern int sendx_string (const char *string, const char *wname);
-extern int sendx_token (const char *string, const char *wname);
-extern int sendx_alt_token (const char *string, const char *wname);
-extern int sendx_controlalt_token (const char *string, const char *wname);
-extern int sendx_control_token (const char *string, const char *wname);
-
-#endif
diff --git a/Build/source/utils/xpdfopen/ChangeLog b/Build/source/utils/xpdfopen/ChangeLog
new file mode 100644
index 00000000000..f320dcfe95c
--- /dev/null
+++ b/Build/source/utils/xpdfopen/ChangeLog
@@ -0,0 +1,70 @@
+2010-05-03 Jim Diamond <jim.diamond@acadiau.ca>
+
+ * pdfclose.c: make it work with all of AR{5,7,8,9} and xpdf.
+ * pdfopen.c: add ability to parse and send function-keys.
+ Add code (commented out) in an attempt to
+ support okular (see code comments).
+ * sendx.c: add code (commented out) in an attempt to
+ support okular (see code comments).
+ * configure.ac: add changes suggested by Peter Breitenlohner.
+
+
+2010-04-24 Jim Diamond <jim.diamond@acadiau.ca>
+
+ * utils.[ch]: put a function to create window titles there
+ * xpdfopen.h: put constants related to the titles of various
+ PDF viewers there
+ * pdfclose.c: modify to use utils.c and xpdfopen.h
+ * pdfopen.c: major modifications so it works with AR7, AR8, AR9
+ xpdf and maybe AR5, and so that it might be
+ relatively straightforward to add other PDF viewers.
+ The default viewer is AR9, this can be overridden
+ by an environment variable and a command-line
+ argument.
+ * sendx.c: Reset the error status in open_channel() so that an
+ error return doesn't become permanent.
+ Fixed mask param in XSendEvent().
+
+
+2010-04-21 Jim Diamond <jim.diamond@acadiau.ca>
+
+ * pdfopen.c: Fold in some changes submitted by
+ Peter Breitenlohner <tex-live@tug.org>
+ * pdfopen.c: Fold in some changes submitted by
+ Peter Breitenlohner <tex-live@tug.org>
+ and reformat the code.
+
+
+2010-04-11 Jim Diamond <jim.diamond@acadiau.ca>
+
+ * pdfopen.c: Update (in a non-backward-compatible way) to
+ work with AR 9. Save old version in pdfopen-AR-7-and-8.c.
+
+
+2009-08-22 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Avoid maximal compiler warnings.
+ * pdfopen.c: Use strdup'ed literal string (malloc+strcpy) to
+ initialize non-constant string.
+ * sendx.[ch]: Constify string args of all functions.
+ Consistently use wname for window name string param.
+ (close_channel): ANSI C function definition.
+
+
+2009-08-19 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * Makefile.am (AM_CFLAGS), configure.ac: Enable compiler warnings.
+ * pdfopen.c (usage), pdfclose.c (usage): Declare as static.
+
+ * sendx.h (new): Declare prototypes for functions in sendx.c.
+ * Makefile.am (pdfopen_SOURCES, pdfclose_SOURCES): Add sendx.h.
+ * pdfopen.c, pdfclose.c, sendx.c: #include "sendx.h".
+
+ * sendx.c (GetRootWindow): Slightly reformulate to avoid compiler
+ warning (strict-aliasing rules).
+
+
+2009-05-06 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Adapt to TL2009 build system.
+
diff --git a/Build/source/utils/xpdfopen/Makefile.am b/Build/source/utils/xpdfopen/Makefile.am
new file mode 100644
index 00000000000..34b87c703e0
--- /dev/null
+++ b/Build/source/utils/xpdfopen/Makefile.am
@@ -0,0 +1,21 @@
+## Makefile.am for the TeX Live subdirectory utils/xpdfopen/
+##
+## Copyright (C) 2009, 2010 Peter Breitenlohner <tex-live@tug.org>
+## You may freely use, modify and/or distribute this file.
+##
+ACLOCAL_AMFLAGS = -I ../../m4
+
+AM_CFLAGS = $(WARNING_CFLAGS)
+INCLUDES = $(X_CFLAGS)
+
+LDADD = $(X_LIBS) -lX11 -lXmu $(X_EXTRA_LIBS)
+
+bin_PROGRAMS = pdfopen pdfclose
+
+pdfopen_SOURCES = pdfopen.c sendx.c utils.c sendx.h xpdfopen.h utils.h
+
+pdfclose_SOURCES = pdfclose.c sendx.c utils.c sendx.h xpdfopen.h utils.h
+
+EXTRA_DIST = xpdfopen.pdf xpdfopen.tex
+
+EXTRA_DIST += Makefile.am.orig configure.ac.orig \ No newline at end of file
diff --git a/Build/source/utils/xpdfopen/Makefile.am.orig b/Build/source/utils/xpdfopen/Makefile.am.orig
new file mode 100644
index 00000000000..cf371f66516
--- /dev/null
+++ b/Build/source/utils/xpdfopen/Makefile.am.orig
@@ -0,0 +1,20 @@
+
+AM_CFLAGS = $(X_CFLAGS)
+## Add warnings for gcc-3.4
+AM_CFLAGS += -Wall -Wunused -Wimplicit -Wreturn-type
+AM_CFLAGS += -Wdeclaration-after-statement -Wno-unknown-pragmas
+AM_CFLAGS += -Wmissing-prototypes -Wmissing-declarations -Wparentheses
+AM_CFLAGS += -Wswitch -Wtrigraphs -Wpointer-arith -Wcast-qual
+AM_CFLAGS += -Wcast-align -Wwrite-strings -Wold-style-definition
+
+LDADD = $(X_LIBS) -lX11 -lXmu $(X_EXTRA_LIBS)
+
+EXTRA_DIST = pdfopen-AR-7-and-8.c
+
+bin_PROGRAMS = pdfopen pdfclose
+
+pdfopen_SOURCES = pdfopen.c sendx.c utils.c sendx.h xpdfopen.h utils.h
+
+pdfclose_SOURCES = pdfclose.c sendx.c utils.c sendx.h xpdfopen.h utils.h
+
+
diff --git a/Build/source/utils/pdfopen/Makefile.in b/Build/source/utils/xpdfopen/Makefile.in
index 45b3f6f2fee..9e3316fd4c4 100644
--- a/Build/source/utils/pdfopen/Makefile.in
+++ b/Build/source/utils/xpdfopen/Makefile.in
@@ -55,12 +55,13 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
-am_pdfclose_OBJECTS = pdfclose.$(OBJEXT) sendx.$(OBJEXT)
+am_pdfclose_OBJECTS = pdfclose.$(OBJEXT) sendx.$(OBJEXT) \
+ utils.$(OBJEXT)
pdfclose_OBJECTS = $(am_pdfclose_OBJECTS)
pdfclose_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
pdfclose_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-am_pdfopen_OBJECTS = pdfopen.$(OBJEXT) sendx.$(OBJEXT)
+am_pdfopen_OBJECTS = pdfopen.$(OBJEXT) sendx.$(OBJEXT) utils.$(OBJEXT)
pdfopen_OBJECTS = $(am_pdfopen_OBJECTS)
pdfopen_LDADD = $(LDADD)
pdfopen_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
@@ -182,9 +183,10 @@ ACLOCAL_AMFLAGS = -I ../../m4
AM_CFLAGS = $(WARNING_CFLAGS)
INCLUDES = $(X_CFLAGS)
LDADD = $(X_LIBS) -lX11 -lXmu $(X_EXTRA_LIBS)
-pdfopen_SOURCES = pdfopen.c sendx.c sendx.h
-pdfclose_SOURCES = pdfclose.c sendx.c sendx.h
-EXTRA_DIST = xpdfopen.pdf xpdfopen.tex
+pdfopen_SOURCES = pdfopen.c sendx.c utils.c sendx.h xpdfopen.h utils.h
+pdfclose_SOURCES = pdfclose.c sendx.c utils.c sendx.h xpdfopen.h utils.h
+EXTRA_DIST = xpdfopen.pdf xpdfopen.tex Makefile.am.orig \
+ configure.ac.orig
all: all-am
.SUFFIXES:
@@ -276,6 +278,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdfclose.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdfopen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendx.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
diff --git a/Build/source/utils/xpdfopen/README b/Build/source/utils/xpdfopen/README
new file mode 100644
index 00000000000..51b532c7bcc
--- /dev/null
+++ b/Build/source/utils/xpdfopen/README
@@ -0,0 +1,89 @@
+------------------------------------------------------------------
+Pdfopen 0.80 - Send open/close commands to Acrobat Reader and xpdf
+------------------------------------------------------------------
+
+This is a Linux (X11) implementation of Fabrice Popineau's pdfclose/
+pdfopen commands to control Acrobat Reader and xpdf.
+
+The libX code was borrowed from Reinhard Fobbe's Sendx library for
+Tcl/Tk, and the programs use the same license, copied below.
+
+Version 0.3 adds support for Adobe Reader 7.0 for Linux.
+(different window titles and key shortcuts)
+
+Version 0.4 uses autoconf
+
+Version 0.5 fixes an incorrect autoconf variable, supports
+building under X11R5, handles pathnames on the command-line,
+and fixes a bug where pdfopen did not exit correctly after
+(automatically) starting acroread.
+
+Version 0.51 uses the strrchr() function instead of rindex()
+to allow compilation on non-BSD derived unix platforms.
+
+Version 0.61 attempts to do something useful with Adobe Reader 8,
+even though it is impossible to restore the viewport.
+
+Version 0.80 adds an implementation for AR 9 and xpdf.
+
+The AR command lines do not behave precisely the same as under Windows,
+because the Linux Reader behaves somewhat differently: it is not
+scriptable, but it is possible to 'fake' keypresses.
+
+
+pdfopen has the following call sequence:
+ pdfopen [-viewer <ar9|ar9-tab|ar8|ar7|ar5|xpdf>] <pdf file name>
+The 'ar9' version uses the '-openInNewWindow' option, the 'ar9-tab'
+version does not (so if there is already an AR9 window open, a new tab
+will be opened in that window).
+
+
+pdfclose has the following call sequence:
+ pdfclose <pdf file name>
+This program closes an existing AR5, AR7, AR8, AR9 or xpdf window
+displaying the given PDF file.
+
+
+Version 0.80 compiles on Linux (Slackware64 13.0, anyway) with
+the following command:
+ gcc -Wall pdfopen.c sendx.c utils.c -o pdfopen -lX11 -s
+should you not want to go through the process of creating and running
+a configure program.
+
+
+Taco Hoekwater <taco@metatex.org> (Version(s) up to 0.61)
+Dordrecht, The Netherlands, December 2008.
+
+Jim Diamond <jim.diamond@acadiau.ca> (Version 0.80)
+Acadia University, Wolfville, Nova Scotia, Canada; April 2010.
+
+
+
+
+License terms:
+--------------
+The following terms apply to all files associated with the software
+unless explicitly disclaimed in individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose,
+provided that existing copyright notices are retained in all copies
+and that this notice is included verbatim in any distributions. No
+written agreement, license, or royalty fee is required for any of the
+authorized uses. Modifications to this software may be copyrighted by
+their authors and need not follow the licensing terms described here,
+provided that the new terms are clearly indicated on the first page of
+each file where they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
+NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN &quot;AS IS&quot;
+BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
+MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
diff --git a/Build/source/utils/xpdfopen/ac/withenable.ac b/Build/source/utils/xpdfopen/ac/withenable.ac
new file mode 100644
index 00000000000..1cc4b4b3f0a
--- /dev/null
+++ b/Build/source/utils/xpdfopen/ac/withenable.ac
@@ -0,0 +1,13 @@
+## utils/xpdfopen/ac/withenable.ac: configure.ac fragment for the TeX Live subdirectory utils/xpdfopen/
+dnl
+dnl Copyright (C) 2009, 2010 Peter Breitenlohner <tex-live@tug.org>
+dnl You may freely use, modify and/or distribute this file.
+dnl
+## configure options and TL libraries required for xpdfopen
+AS_IF([test "x$with_x" = xno],
+ [AS_CASE([$enable_xpdfopen],
+ [""], [AC_MSG_NOTICE([`--without-x' -> `--disable-xpdfopen'])
+ enable_xpdfopen=no
+ ac_configure_args="$ac_configure_args '--disable-xpdfopen'"],
+ [yes], [AC_MSG_ERROR([Sorry, incompatible options `--without-x' and `--enable-xpdfopen'])])])
+KPSE_ENABLE_PROG([xpdfopen])
diff --git a/Build/source/utils/pdfopen/aclocal.m4 b/Build/source/utils/xpdfopen/aclocal.m4
index f004a0e2d53..f004a0e2d53 100644
--- a/Build/source/utils/pdfopen/aclocal.m4
+++ b/Build/source/utils/xpdfopen/aclocal.m4
diff --git a/Build/source/utils/pdfopen/configure b/Build/source/utils/xpdfopen/configure
index 36a93820686..680da49b1be 100755
--- a/Build/source/utils/pdfopen/configure
+++ b/Build/source/utils/xpdfopen/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for pdfopen for TeX Live 0.51.
+# Generated by GNU Autoconf 2.65 for xpdfopen for TeX Live 0.80.
#
# Report bugs to <tex-k@tug.org>.
#
@@ -549,10 +549,10 @@ MFLAGS=
MAKEFLAGS=
# Identity of this package.
-PACKAGE_NAME='pdfopen for TeX Live'
-PACKAGE_TARNAME='pdfopen-for-tex-live'
-PACKAGE_VERSION='0.51'
-PACKAGE_STRING='pdfopen for TeX Live 0.51'
+PACKAGE_NAME='xpdfopen for TeX Live'
+PACKAGE_TARNAME='xpdfopen-for-tex-live'
+PACKAGE_VERSION='0.80'
+PACKAGE_STRING='xpdfopen for TeX Live 0.80'
PACKAGE_BUGREPORT='tex-k@tug.org'
PACKAGE_URL=''
@@ -1207,7 +1207,7 @@ if test "$ac_init_help" = "long"; then
# 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 <<_ACEOF
-\`configure' configures pdfopen for TeX Live 0.51 to adapt to many kinds of systems.
+\`configure' configures xpdfopen for TeX Live 0.80 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1256,7 +1256,7 @@ Fine tuning of the installation directories:
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root
- [DATAROOTDIR/doc/pdfopen-for-tex-live]
+ [DATAROOTDIR/doc/xpdfopen-for-tex-live]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
@@ -1278,7 +1278,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pdfopen for TeX Live 0.51:";;
+ short | recursive ) echo "Configuration of xpdfopen for TeX Live 0.80:";;
esac
cat <<\_ACEOF
@@ -1376,7 +1376,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-pdfopen for TeX Live configure 0.51
+xpdfopen for TeX Live configure 0.80
generated by GNU Autoconf 2.65
Copyright (C) 2009 Free Software Foundation, Inc.
@@ -1581,7 +1581,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by pdfopen for TeX Live $as_me 0.51, which was
+It was created by xpdfopen for TeX Live $as_me 0.80, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@
@@ -2392,8 +2392,8 @@ fi
# Define the identity of the package.
- PACKAGE='pdfopen-for-tex-live'
- VERSION='0.51'
+ PACKAGE='xpdfopen-for-tex-live'
+ VERSION='0.80'
cat >>confdefs.h <<_ACEOF
@@ -4892,7 +4892,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by pdfopen for TeX Live $as_me 0.51, which was
+This file was extended by xpdfopen for TeX Live $as_me 0.80, which was
generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -4949,7 +4949,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-pdfopen for TeX Live config.status 0.51
+xpdfopen for TeX Live config.status 0.80
configured by $0, generated by GNU Autoconf 2.65,
with options \\"\$ac_cs_config\\"
diff --git a/Build/source/utils/pdfopen/configure.ac b/Build/source/utils/xpdfopen/configure.ac
index bae004ef959..715745e1388 100644
--- a/Build/source/utils/pdfopen/configure.ac
+++ b/Build/source/utils/xpdfopen/configure.ac
@@ -1,12 +1,12 @@
dnl Process this file with autoconf to produce a configure script.
dnl
-dnl Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+dnl Copyright (C) 2009, 2010 Peter Breitenlohner <tex-live@tug.org>
dnl
dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
-AC_INIT([pdfopen for TeX Live], [0.51], [tex-k@tug.org])
+AC_INIT([xpdfopen for TeX Live], [0.80], [tex-k@tug.org])
AC_PREREQ([2.65])
AC_CONFIG_SRCDIR([pdfopen.c])
AC_CONFIG_AUX_DIR([../../build-aux])
diff --git a/Build/source/utils/xpdfopen/configure.ac.orig b/Build/source/utils/xpdfopen/configure.ac.orig
new file mode 100644
index 00000000000..88c475350a8
--- /dev/null
+++ b/Build/source/utils/xpdfopen/configure.ac.orig
@@ -0,0 +1,25 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl this is for autoconf 2.5x
+
+AC_INIT(pdfopen, 0.80, jim.diamond@acadiau.ca)
+
+AC_CONFIG_AUX_DIR(config)
+
+AM_INIT_AUTOMAKE()
+
+AC_CONFIG_FILES(Makefile)
+
+AC_PROG_CC
+
+dnl AC_PROG_INSTALL
+
+dnl Checks for header files.
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+
+dnl Checks for library functions.
+
+dnl Find Xlibs.
+AC_PATH_XTRA
+
+AC_OUTPUT
diff --git a/Build/source/utils/xpdfopen/pdfclose.c b/Build/source/utils/xpdfopen/pdfclose.c
new file mode 100644
index 00000000000..121a42762f9
--- /dev/null
+++ b/Build/source/utils/xpdfopen/pdfclose.c
@@ -0,0 +1,71 @@
+/*
+ * pdfclose.c
+ *
+ * Modified by Jim Diamond (jim.diamond@acadiau.ca) 2010/04/21
+ * and Peter Breitenlohner <tex-live@tug.org> (2009).
+ *
+ * This program does not take a viewer argument, and just tries to close
+ * any known viewer displaying the given file.
+ *
+ * V 0.80
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "sendx.h"
+#include "xpdfopen.h"
+#include "utils.h"
+
+
+char * progname; /* set in main(); NOT static! */
+
+
+
+static void
+usage(void)
+{
+ fprintf(stderr, "Usage: %s <file.pdf>\n", progname);
+}
+
+
+
+static int
+try_name(const char * filename, const char * title_format)
+{
+ char * winname;
+ int ret ;
+
+ winname = make_window_name(title_format, filename);
+ if (winname == NULL)
+ return 99;
+
+ ret = sendx_control_token("W", winname);
+ free(winname);
+
+ return ret;
+}
+
+
+
+int
+main (int argc, char * argv[])
+{
+ progname = argv[0];
+
+ if (argc != 2)
+ {
+ usage();
+ return EXIT_FAILURE;
+ }
+
+ if (try_name(argv[1], AR9_WIN_NAME_FMT)) /* both AR8 and AR9 */
+ if (try_name(argv[1], XPDF_WIN_NAME_FMT))
+ if (try_name(argv[1], AR7_WIN_NAME_FMT))
+ if (try_name(argv[1], AR5_WIN_NAME_FMT))
+ return EXIT_FAILURE;
+
+ return EXIT_SUCCESS;
+}
diff --git a/Build/source/utils/xpdfopen/pdfopen.c b/Build/source/utils/xpdfopen/pdfopen.c
new file mode 100644
index 00000000000..abee956964a
--- /dev/null
+++ b/Build/source/utils/xpdfopen/pdfopen.c
@@ -0,0 +1,375 @@
+/*
+ * pdfopen.c.
+ *
+ * Heavily modified by Jim Diamond (jim.diamond@acadiau.ca) 2010/04/11
+ * to work with AR 9 and xpdf.
+ * Also some mods by Peter Breitenlohner <tex-live@tug.org> from 2009
+ * and suggestions from 2010.
+ *
+ * Note 1: the calling sequence was changed considerably to match what
+ * the program actually seemed to do as well as what made sense to me.
+ *
+ * Note 2: if there are two instances of acroread displaying that file,
+ * only one is reloaded.
+ *
+ * Further modified 2010/05/03 to work with ar5, and to include some code
+ * that does *not* work with okular (see note below).
+ *
+ * Note 3: Unlike xpdf and AR[5,7,8,9], okular will not accept X events
+ * from this program unless the okular window has focus. On my system
+ * (Slackware64 13.0, using fvwm2), the functions I added to sendx.c to try
+ * to change the focus to the okular window do not work. (See also the
+ * comments in sendx.c.) If anyone cares to contribute working code,
+ * please send it to me for inclusion.
+ */
+
+#define VERSION "0.80"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include "sendx.h"
+#include "xpdfopen.h"
+#include "utils.h"
+
+#define MAX_OPTIONS 10
+#define MAX_RELOAD_CMDS 10
+
+/* A string unlikely to be used as a real command by a PDF viewer */
+#define FORK_EXEC_CMD "*FORK EXEC*"
+
+
+/* Used in the pdf_viewer_t type... see comment below */
+typedef enum
+{
+ USE_SENDX, USE_FORK_EXEC
+} reload_method_t;
+
+
+/*
+ * This struct contains the information needed for both
+ * (a) initially starting up a PDF viewer, and
+ * (b) telling the viewer to reload the document.
+ * Of course, the viewer has to support that functionality.
+ * Two possible ways are supported.
+ * (a) Send the viewer's window (a) simulated keypress(ss)
+ * (b) fork()/exec() a second instance of the program which somehow signals
+ * the running instance. Note that this is problematical if the
+ * arguments for the "reload" case are different than the options
+ * for the "start up the viewer" case, because the command-line
+ * (and environment variable) syntax have to be extended.
+ * Arguably, if both the start-up and reload can be done with shell
+ * commands, the user should just write a shell script and be done with
+ * it.
+ * These could be extended with this as well:
+ * (c) send a Unix signal to the currently running viewer.
+ * This would require augmenting reload_method_t and pdf_viewer_t.
+ */
+
+typedef struct
+{
+ const char * short_name; /* cmd line option name */
+ const char * program_name; /* program to exec() */
+ reload_method_t method; /* method to induce reload */
+ const char * window_name; /* when no file is viewed */
+ const char * window_name_fmt; /* fmt string for file viewed */
+ const char * exec_pre_options[MAX_OPTIONS]; /* before filename in cmd */
+ const char * exec_post_options[MAX_OPTIONS];/* after filename in cmd */
+ const char * reload_cmds[MAX_RELOAD_CMDS]; /* cmds to reload a file */
+} pdf_viewer_t;
+
+
+/* Reload commands (or prefixes thereof) */
+#define CTRL "Ctrl-"
+#define ALT "Alt-"
+#define CTRL_ALT "Ctrl-Alt-"
+#define FN "Fn-"
+#define FOCUS_IN "FOCUS-IN"
+#define FOCUS_OUT "FOCUS-OUT"
+
+
+
+/*
+ * The first struct represents the default viewer with the default options.
+ */
+pdf_viewer_t pdf_viewers[] =
+{
+ {"ar9", "acroread", USE_SENDX,
+ AR9_WIN_NAME, AR9_WIN_NAME_FMT,
+ {"-openInNewWindow", NULL},
+ {NULL},
+ {"Ctrl-R", NULL}},
+ {"ar9-tab", "acroread", USE_SENDX,
+ AR9_WIN_NAME, AR9_WIN_NAME_FMT,
+ {NULL},
+ {NULL},
+ {"Ctrl-R", NULL}},
+ {"ar8", "acroread", USE_SENDX,
+ AR8_WIN_NAME, AR8_WIN_NAME_FMT,
+ {NULL},
+ {NULL},
+ {"Ctrl-W", FORK_EXEC_CMD, NULL}},
+ {"ar7", "acroread", USE_SENDX,
+ AR7_WIN_NAME, AR7_WIN_NAME_FMT,
+ {NULL},
+ {NULL},
+ {"Ctrl-W", "Alt-Left", NULL}},
+ {"ar5", "acroread", USE_SENDX,
+ AR5_WIN_NAME, AR5_WIN_NAME_FMT,
+ {NULL},
+ {NULL},
+ {"Ctrl-W", "Alt-Left", NULL}},
+ /*
+ * xpdf also allows 'xpdf -remote tex -reload', but if that xpdf server
+ * is not running, rather than a failure return, a blank window is
+ * opened. This is not much good to us.
+ * Using "tex-server" as the server name is an arbitrary choice.
+ */
+ {"xpdf", "xpdf", USE_SENDX,
+ XPDF_WIN_NAME, XPDF_WIN_NAME_FMT,
+ {"-remote", "tex-server", NULL},
+ {NULL},
+ {"r", NULL}},
+#ifdef TRY_OCULAR
+ {"okular", "okular", USE_SENDX,
+ OKULAR_WIN_NAME, OKULAR_WIN_NAME_FMT,
+ {NULL},
+ {NULL},
+ {FOCUS_IN, "Fn-F5", FOCUS_OUT, NULL}},
+#endif
+};
+
+char * progname; /* set in main(); NOT static! */
+
+#define DEFAULT_VIEWER (pdf_viewers[0].short_name)
+
+
+
+static void
+usage(void)
+{
+ int i;
+ int viewers = sizeof(pdf_viewers) / sizeof(pdf_viewers[0]);
+
+ fprintf(stderr, "Usage: %s [-viewer <prog>] <file.pdf>\n", progname);
+ fprintf(stderr, "\tIf the PDF viewer <prog> is displaying <file.pdf>, "
+ "reload that file.\n");
+ fprintf(stderr, "\tOtherwise call <prog> to display <file.pdf>.\n");
+ fprintf(stderr, "\tThe default viewer program is %s.\n", DEFAULT_VIEWER);
+ fprintf(stderr, "\tImplemented viewers are");
+ for (i = 0; i < viewers - 1; i++)
+ fprintf(stderr, " '%s'", pdf_viewers[i].short_name);
+ fprintf(stderr, " and '%s'.\n", pdf_viewers[viewers - 1].short_name);
+ fprintf(stderr, "\tThis is version %s of %s\n", VERSION, progname);
+}
+
+
+
+/*
+ * Send one "command" to the given window.
+ * The command can be of these forms (for X an upper case letter or arrow
+ * key, such as "Left", and D one or more digits; see sendx.c):
+ * - Ctrl-X
+ * - Alt-X
+ * - Ctrl-Atl-X
+ * - Fn-FD
+ * - FOCUS-[IN|OUT]
+ * - <string> (not starting with any of the above prefixes)
+ * Allow other variations on the cases of "Ctrl" and "Alt".
+ *
+ * Return 0 on success, non-0 otherwise.
+ */
+
+static int
+send_command(const char * window_name, const char * reload_cmd)
+{
+ int alt_len, ctrl_len, ctrl_alt_len, fn_len, focus_len;
+
+ if (!strcmp(reload_cmd, FORK_EXEC_CMD))
+ return 999;
+
+ ctrl_alt_len = strlen(CTRL_ALT);
+ if (!strncasecmp(CTRL_ALT, reload_cmd, ctrl_alt_len))
+ return sendx_controlalt_token(reload_cmd + ctrl_alt_len, window_name);
+
+ ctrl_len = strlen(CTRL);
+ if (!strncasecmp(CTRL, reload_cmd, ctrl_len))
+ return sendx_control_token(reload_cmd + ctrl_len, window_name);
+
+ alt_len = strlen(ALT);
+ if (!strncasecmp(ALT, reload_cmd, alt_len))
+ return sendx_alt_token(reload_cmd + alt_len, window_name);
+
+ fn_len = strlen(FN);
+ if (!strncasecmp(FN, reload_cmd, fn_len))
+ return sendx_token(reload_cmd + fn_len, window_name);
+
+ focus_len = strlen(FOCUS_IN);
+ if (!strncasecmp(FOCUS_IN, reload_cmd, focus_len))
+ return set_focus(window_name);
+
+ focus_len = strlen(FOCUS_OUT);
+ if (!strncasecmp(FOCUS_OUT, reload_cmd, focus_len))
+ return reset_focus();
+
+ return sendx_string(reload_cmd, window_name);
+}
+
+
+
+/*
+ * Try to reload the file, then if not successful to start up a new
+ * instance of the viewer program.
+ * Return 0 on success, non-0 otherwise.
+ */
+
+static int
+view_file(const char * filename, int viewer_index)
+{
+ char * window_name;
+ pid_t pid;
+ int success = 0;
+ pdf_viewer_t pdf_viewer = pdf_viewers[viewer_index];
+ const char ** reload_cmds = pdf_viewer.reload_cmds;
+
+ /* First try to reload the file */
+ switch (pdf_viewers[viewer_index].method)
+ {
+ case USE_SENDX:
+ window_name = make_window_name(pdf_viewer.window_name_fmt, filename);
+ if (window_name == NULL)
+ return 99;
+ while (*reload_cmds)
+ {
+ /*
+ * Note: there is a race condition in the sendx.c code which
+ * can cause the program to crash and burn with a 'BadWindow'
+ * fault. This has been observed for AR8 (but not AR7, oddly)
+ * after the ^W causes AR8 to change the window name. It seems
+ * that Window_With_Name() tries to access a BadWindow within
+ * its recursive call.
+ * If this continues to be a problem, a usleep() may make the
+ * problem go away.
+ */
+ success = ! send_command(window_name, *reload_cmds);
+ if (! success && reload_cmds != pdf_viewer.reload_cmds)
+ {
+ /*
+ * In some cases the window name might be changed because
+ * of the first command.
+ * For example, in AR7 the first command (^W) "closes"
+ * the document, and the window title changes to reflect
+ * the fact there is no document. So try that command with
+ * the "plain" window name.
+ */
+ success = ! send_command(pdf_viewer.window_name, *reload_cmds);
+ }
+ if (! success)
+ break;
+ reload_cmds++;
+ }
+ break;
+
+ case USE_FORK_EXEC:
+ return 2; /* TODO: someone who cares can put some code here */
+ break;
+
+ default:
+ fprintf(stderr, "%s: internal error: invalid reload_method. Sorry.\n",
+ progname);
+ return 99;
+ break;
+ }
+
+ if (success)
+ return 0;
+
+ /*
+ * No luck re-loading the file.
+ * (Try to) start a new instance of the viewer program.
+ */
+ if ((pid = fork()) == 0)
+ {
+ const char * argv_list[2 * MAX_OPTIONS + 3];
+ const char ** p;
+ int i = 0;
+
+ argv_list[i++] = pdf_viewer.program_name;
+ for (p = pdf_viewer.exec_pre_options; *p;)
+ argv_list[i++] = *p++;
+ argv_list[i++] = filename;
+ for (p = pdf_viewer.exec_post_options; *p;)
+ argv_list[i++] = *p++;
+ argv_list[i++] = NULL;
+ if (execvp(pdf_viewer.program_name, (char **)argv_list))
+ {
+ fprintf(stderr, "%s: %s startup failed\n", progname,
+ pdf_viewer.program_name);
+ return 5;
+ }
+ }
+ else if (pid < 0)
+ {
+ fprintf(stderr, "%s: fork() failed!?\n", progname);
+ return 10;
+ }
+
+ return 0;
+}
+
+
+
+int
+main(int argc, char * argv[])
+{
+ const char * viewer = pdf_viewers[0].short_name;
+ char * env_viewer;
+ int i;
+ int viewer_index = -1;
+
+ progname = argv[0];
+
+ env_viewer = getenv("PDF_VIEWER");
+ if (env_viewer != NULL)
+ viewer = env_viewer;
+
+ if (argc == 4 && !strcmp(argv[1], "-viewer"))
+ {
+ viewer = argv[2];
+ argc -= 2;
+ argv += 2;
+ }
+
+ if (argc != 2)
+ {
+ fprintf(stderr, "%s: invalid number of arguments\n", progname);
+ usage();
+ return EXIT_FAILURE;
+ }
+
+ for (i = 0; i < sizeof(pdf_viewers) / sizeof(pdf_viewers[0]); i++)
+ {
+ if (!strcmp(pdf_viewers[i].short_name, viewer))
+ {
+ viewer_index = i;
+ break;
+ }
+ }
+
+ if (viewer_index < 0)
+ {
+ fprintf(stderr, "%s: Unknown PDF viewer '%s'\n", progname, viewer);
+ usage();
+
+ return EXIT_FAILURE;
+ }
+
+ if (view_file(argv[1], viewer_index))
+ return EXIT_FAILURE;
+
+ return EXIT_SUCCESS;
+}
diff --git a/Build/source/utils/xpdfopen/sendx.c b/Build/source/utils/xpdfopen/sendx.c
new file mode 100644
index 00000000000..f97cfb59d5a
--- /dev/null
+++ b/Build/source/utils/xpdfopen/sendx.c
@@ -0,0 +1,408 @@
+/*
+ * Modified by Jim Diamond (jim.diamond@acadiau.ca) April 24, 2010
+ * to reset error_status to 0 at the beginning of open_channel().
+ *
+ * Also replaced 0xfff with KeyPressMask and KeyReleaseMask (as
+ * appropriate) in sendx_channel(); otherwise (at least in Slackware64 13.0)
+ * the events also get sent to the terminal running pdfopen; this is a Bad
+ * Thing.
+ *
+ * Also added set_focus() and reset_focus() functions.
+ * NOTE: they do not work, at least under FVWM2 on Slackware64-13.0.
+ * They return success, but the focus never changes (or is reverted to the
+ * window containing the mouse before a call to sendx_token() can do its
+ * work).
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/keysym.h>
+#include <X11/cursorfont.h>
+
+#include "sendx.h"
+
+static char * display_name = NULL;
+static Display * display;
+static Window root;
+static Window window = None;
+static XKeyEvent event;
+
+static char error_message[256];
+static int error_status = 0;
+
+
+static void
+throw_exception3(const char * msg, const char * s, int i)
+{
+ sprintf(error_message, msg, s, i);
+ error_status = 1;
+}
+
+
+static void
+throw_exception3s(const char * msg1, const char * msg2, const char * msg3)
+{
+ sprintf(error_message, msg1, msg2, msg3);
+ error_status = 1;
+}
+
+
+static void
+throw_exception(const char * msg)
+{
+ strncpy(error_message, msg, 256);
+ error_status = 1;
+}
+
+
+
+/*
+ * Added for window managers like swm and tvtwm that follow solbourne's
+ * virtual root window concept
+ */
+static Window
+GetRootWindow(Display * disp, int scrn)
+{
+ Atom __SWM_VROOT = None;
+ Window root, rootReturn, parentReturn, * children;
+ unsigned int numChildren;
+ unsigned i;
+
+ root = RootWindow(disp, scrn);
+
+ /*
+ * see if there is a virtual root
+ */
+ __SWM_VROOT = XInternAtom(disp, "__SWM_VROOT", False);
+ XQueryTree(disp, root, &rootReturn, &parentReturn, &children, &numChildren);
+
+ for (i = 0; i < numChildren; i++)
+ {
+ Atom actual_type;
+ int actual_format;
+ unsigned long nitems, bytesafter;
+ unsigned char * prop_return = NULL;
+
+ if (XGetWindowProperty(disp, children[i], __SWM_VROOT, 0, 1,
+ False, XA_WINDOW, &actual_type, &actual_format,
+ &nitems, &bytesafter, &prop_return)
+ == Success && prop_return)
+ {
+ root = *(Window *)prop_return;
+ break;
+ }
+ }
+
+ if (children)
+ XFree((char *)children);
+
+ return (root);
+}
+
+
+
+/*
+ * [These functions are from the file "dsimple.c" used with xwininfo.]
+ *
+ * Written by Mark Lillibridge. Last updated 7/1/87
+ *
+ * Window_With_Name: routine to locate a window with a given name on a
+ * display. If no window with the given name is found, 0 is returned.
+ * If more than one window has the given name, the first one found
+ * will be returned. Only top and its subwindows are looked at.
+ * Normally, top should be the Root Window.
+ */
+
+static Window
+Window_With_Name(Display * dpy, Window top, const char * name)
+{
+ Window * children, dummy;
+ unsigned int nchildren;
+ unsigned i;
+ Window w = 0;
+ char * window_name;
+
+ if (XFetchName(dpy, top, &window_name) && !strcmp(window_name, name))
+ return (top);
+
+ if (!XQueryTree(dpy, top, &dummy, &dummy, &children, &nchildren))
+ return (0);
+
+ for (i = 0; i < nchildren; i++)
+ {
+ w = Window_With_Name(dpy, children[i], name);
+ if (w)
+ break;
+ }
+
+ if (children)
+ XFree((char *)children);
+
+ return (w);
+}
+
+
+
+static int
+open_channel(const char * wname)
+{
+ /*
+ * display_name = ":0.0";
+ */
+
+ error_status = 0;
+
+ if ((display = XOpenDisplay(display_name)) == NULL)
+ {
+ throw_exception("can't open display");
+ return 1;
+ }
+
+ if ((root = GetRootWindow(display, DefaultScreen(display))) == 0)
+ {
+ throw_exception("Cannot get DefaultScreen");
+ return 1;
+ }
+
+ if ((wname[0] == '\0') && (window != None))
+ {
+ } /* take selected window */
+ else if (wname[0] != '\0')
+ {
+ if ((window = Window_With_Name(display, root, wname)) == None)
+ {
+ throw_exception3s("Display %s: can't open window named \"%s\"",
+ XDisplayName(display_name), wname);
+ return 1;
+ }
+ }
+ else
+ {
+ throw_exception3("bad condition in %s at line %d", __FILE__, __LINE__);
+ return 1;
+ }
+
+ event.type = KeyPress;
+ event.serial = 0;
+ event.send_event = False;
+ event.display = display;
+ event.x = event.y = event.x_root = event.y_root = 0;
+ event.time = CurrentTime;
+ event.same_screen = True;
+ event.subwindow = None;
+ event.window = window;
+ event.root = root;
+
+ return 0;
+}
+
+
+
+static void
+close_channel(void)
+{
+ /*
+ * XFlush(display);
+ */
+ XCloseDisplay(display);
+}
+
+
+
+static void
+sendx_channel(KeySym ks, int km)
+{
+ /*
+ * km: 0=regular, 1=shift, 2=lock, 4=control
+ */
+ if (ks < 256)
+ {
+ event.state = isupper((char)ks);
+ switch (ks)
+ {
+ case 0x08:
+ ks = XK_BackSpace;
+ break;
+ case 0x09:
+ ks = XK_Tab;
+ break;
+ case 0x0A:
+ ks = XK_Linefeed;
+ break;
+ case 0x0B:
+ ks = XK_Clear;
+ break;
+ case 0x0D:
+ ks = XK_Return;
+ break;
+ case 0x13:
+ ks = XK_Pause;
+ break;
+ case 0x14:
+ ks = XK_Scroll_Lock;
+ break;
+ case 0x1B:
+ ks = XK_Escape;
+ break;
+ }
+ }
+ else
+ event.state = 0;
+
+ event.type = KeyPress;
+ event.state = km; // Mod1Mask
+ event.keycode = XKeysymToKeycode(display, ks);
+
+ if (XSendEvent(display, window, True, KeyPressMask, (XEvent *)&event) == 0)
+ throw_exception("Error in XSendEvent");
+
+ event.type = KeyRelease;
+ if (XSendEvent(display, window, True, KeyReleaseMask, (XEvent *)&event)
+ == 0)
+ throw_exception("Error in XSendEvent");
+
+ return;
+}
+
+
+
+int
+sendx_string(const char * string, const char * window)
+{
+ const char * p;
+
+ if (open_channel(window))
+ return error_status;
+
+ p = string;
+ while (*p)
+ sendx_channel(*p++, 0);
+ close_channel();
+
+ return error_status;
+}
+
+
+
+int
+sendx_token(const char * string, const char * window)
+{
+ if (open_channel(window))
+ return error_status;
+
+ sendx_channel(XStringToKeysym(string), 0);
+ close_channel();
+
+ return error_status;
+}
+
+
+
+int
+sendx_alt_token(const char * string, const char * window)
+{
+ if (open_channel(window))
+ return error_status;
+
+ sendx_channel(XStringToKeysym(string), Mod1Mask);
+ close_channel();
+
+ return error_status;
+}
+
+
+
+int
+sendx_controlalt_token(const char * string, const char * window)
+{
+ if (open_channel(window))
+ return error_status;
+
+ sendx_channel(XStringToKeysym(string), Mod1Mask | ControlMask);
+ close_channel();
+
+ return error_status;
+}
+
+
+
+int
+sendx_control_token(const char * string, const char * window)
+{
+ if (open_channel(window))
+ return error_status;
+
+ sendx_channel(XStringToKeysym(string), ControlMask);
+ close_channel();
+
+ return error_status;
+}
+
+
+
+
+static Window previous_window;
+static int previous_window_set = 0;
+static int revert_to;
+
+/*
+ * Attempt to give focus to the given window.
+ * Return 0 on success, non-0 on failure.
+ * Record the previous window for reset_focus() on success.
+ */
+
+int
+set_focus(const char * wname)
+{
+ if ((display = XOpenDisplay(display_name)) == NULL)
+ {
+ throw_exception("can't open display");
+ return 1;
+ }
+
+ if ((root = GetRootWindow(display, DefaultScreen(display))) == 0)
+ {
+ throw_exception("Cannot get DefaultScreen");
+ return 1;
+ }
+
+ (void)XGetInputFocus(display, &previous_window, &revert_to);
+ if (XSetInputFocus(display, Window_With_Name(display, root, wname),
+ previous_window, CurrentTime))
+ {
+ previous_window_set = 1;
+ return 0;
+ }
+
+ throw_exception3s("Display %s: can't focus window named \"%s\"",
+ XDisplayName(display_name), wname);
+ return 1;
+}
+
+
+
+int
+reset_focus(void)
+{
+ if (previous_window_set)
+ {
+ XSetInputFocus(display, previous_window, revert_to, CurrentTime);
+ previous_window_set = 0;
+ return 0;
+ }
+
+ throw_exception("reset_focus() called when previous window not saved");
+ return 1;
+}
+
+
+
+/*
+ * void PrintKeySyms () { int i; for (i = 32; i < 127; i++) { printf ("%s[%c]
+ * ", XKeysymToString (i), i); } for (i = 128 + 32; i < 128 + 127; i++) {
+ * printf ("%s[%c] ", XKeysymToString (i), i); } printf ("\n"); }
+ */
diff --git a/Build/source/utils/xpdfopen/sendx.h b/Build/source/utils/xpdfopen/sendx.h
new file mode 100644
index 00000000000..569a33f9494
--- /dev/null
+++ b/Build/source/utils/xpdfopen/sendx.h
@@ -0,0 +1,19 @@
+/*
+ * sendx.h: declare prototypes for functions defined in sendx.c
+ *
+ * Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+ * You may freely use, modify and/or distribute this file.
+ */
+
+#ifndef SENDX_H
+#define SENDX_H
+
+extern int sendx_string(const char * string, const char * wname);
+extern int sendx_token(const char * string, const char * wname);
+extern int sendx_alt_token(const char * string, const char * wname);
+extern int sendx_controlalt_token(const char * string, const char * wname);
+extern int sendx_control_token(const char * string, const char * wname);
+extern int set_focus(const char * wname);
+extern int reset_focus(void);
+
+#endif
diff --git a/Build/source/utils/xpdfopen/utils.c b/Build/source/utils/xpdfopen/utils.c
new file mode 100644
index 00000000000..a75be79a02e
--- /dev/null
+++ b/Build/source/utils/xpdfopen/utils.c
@@ -0,0 +1,46 @@
+/*
+ * utils.c: Items common to pdfopen and pdfclose.
+ *
+ * Copyright (C) 2010 Jim Diamond <jim.diamond@acadiau.ca>
+ * You may freely use, modify and/or distribute this file.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "utils.h"
+#include "xpdfopen.h"
+
+extern char * progname;
+
+/*
+ * Allocate memory and create a window name.
+ * Return a pointer to the new string or NULL on failure.
+ *
+ * The caller is responsible for free()ing the memory allocated here.
+ *
+ * Note: acroread (at least AR 7, 8, 9) uses only the basename in the
+ * window title.
+ * xpdf uses the whole file name.
+ * Other PDF viewers may need other treatment.
+ */
+
+char *
+make_window_name(const char * fmt, const char * filename)
+{
+ char * window_name;
+ const char * title_name;
+
+ title_name = filename;
+ if (strrchr(title_name, '/') != NULL
+ && strncasecmp(fmt, XPDF_WIN_NAME, strlen(XPDF_WIN_NAME)))
+ title_name = strrchr(title_name, '/') + 1;
+
+ window_name = malloc(strlen(fmt) + strlen(title_name) + 1);
+ if (window_name != NULL)
+ sprintf(window_name, fmt, title_name);
+ else
+ fprintf(stderr, "%s: out of memory\n", progname);
+
+ return window_name;
+}
diff --git a/Build/source/utils/xpdfopen/utils.h b/Build/source/utils/xpdfopen/utils.h
new file mode 100644
index 00000000000..2eae6e88bf3
--- /dev/null
+++ b/Build/source/utils/xpdfopen/utils.h
@@ -0,0 +1,13 @@
+/*
+ * utils.h: declare prototypes for functions defined in utils.c
+ *
+ * Copyright (C) 2010 Jim Diamond <jim.diamond@acadiau.ca>
+ * You may freely use, modify and/or distribute this file.
+ */
+
+#ifndef UTILS_H
+#define UTILS_H
+
+char * make_window_name(const char * fmt, const char * basename);
+
+#endif
diff --git a/Build/source/utils/xpdfopen/xpdfopen.h b/Build/source/utils/xpdfopen/xpdfopen.h
new file mode 100644
index 00000000000..7430edc4229
--- /dev/null
+++ b/Build/source/utils/xpdfopen/xpdfopen.h
@@ -0,0 +1,36 @@
+/*
+ * xpdfopen.h: declare constants of possible use for xpdfopen programs.
+ *
+ * Copyright (C) 2010 Jim Diamond <jim.diamond@acadiau.ca>
+ *
+ * You may freely use, modify and/or distribute this file.
+ */
+
+#ifndef XPDFOPEN_H
+#define XPDFOPEN_H
+
+/*
+ * <prog>_WIN_NAME is the name of the window when no file is open.
+ * <prog>_WIN_NAME_FMT is the (sprintf) format to generate the name
+ * when a file is being displayed.
+ */
+
+#define AR5_WIN_NAME "Acrobat Reader" /* Is this correct? */
+#define AR5_WIN_NAME_FMT "%s" /* Is this correct? */
+
+#define AR7_WIN_NAME "Adobe Reader"
+#define AR7_WIN_NAME_FMT AR7_WIN_NAME " - %s"
+
+#define AR8_WIN_NAME "Adobe Reader"
+#define AR8_WIN_NAME_FMT "%s - " AR8_WIN_NAME
+
+#define AR9_WIN_NAME "Adobe Reader"
+#define AR9_WIN_NAME_FMT "%s - " AR9_WIN_NAME
+
+#define XPDF_WIN_NAME "Xpdf"
+#define XPDF_WIN_NAME_FMT XPDF_WIN_NAME ": %s"
+
+#define OKULAR_WIN_NAME "Okular"
+#define OKULAR_WIN_NAME_FMT "%s - " OKULAR_WIN_NAME
+
+#endif
diff --git a/Build/source/utils/pdfopen/xpdfopen.pdf b/Build/source/utils/xpdfopen/xpdfopen.pdf
index fe41c8352ae..fe41c8352ae 100644
--- a/Build/source/utils/pdfopen/xpdfopen.pdf
+++ b/Build/source/utils/xpdfopen/xpdfopen.pdf
Binary files differ
diff --git a/Build/source/utils/pdfopen/xpdfopen.tex b/Build/source/utils/xpdfopen/xpdfopen.tex
index d0348f622da..d0348f622da 100644
--- a/Build/source/utils/pdfopen/xpdfopen.tex
+++ b/Build/source/utils/xpdfopen/xpdfopen.tex