Update xpr to version 1.1.0

Removes support for old DEC printers
pull/1/head
matthieu 2022-07-15 10:24:18 +00:00
parent d14607210c
commit c17f728a49
14 changed files with 418 additions and 684 deletions

View File

@ -1,3 +1,187 @@
commit 2ca9da7c52152add1567deb11000cf9570577b12
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jul 10 15:55:09 2022 -0700
xpr 1.1.0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 5a3ca5e4f239db8be0975052911ceae1d4e4a3dc
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Apr 2 12:11:44 2022 -0700
xdpr.man: minor corrections
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit aafb02ad1e0580775d1f25b2a2469ccd9744e8f8
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat Apr 2 12:09:55 2022 -0700
man pages: remove out-of-date COPYRIGHT section
The information previously listed here didn't match what is present in
the source code or the COPYING file, and the X(7) man page doesn't list
any license information as this had claimed.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit d028dd60ebde9d7e5aeb3f7a6e5bc3dfbd8577d5
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue Dec 7 12:44:25 2021 -0800
Build xz tarballs instead of bzip2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 2ce8015efcf0828208dcd4da0fcf36c66012a0b8
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Tue Nov 30 11:28:14 2021 -0800
gitlab CI: enable Static Application Security Testing (SAST)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit f7ae6067fd186c22c4cc0a3b57d776e492a520b1
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Nov 28 17:30:33 2021 -0800
gitlab CI: Use ci-fairy image template
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 0d8629839550c50edcf648a1f4391d3f2bb56b1d
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Nov 28 11:59:06 2021 -0800
Fix spelling/wording issues
Found by using:
codespell --builtin clear,rare,usage,informal,code,names
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 2bcbe24155c6a631ddddcab6ce6f435a7dca62bd
Author: Matthieu Herrb <matthieu@herrb.eu>
Date: Mon Oct 25 11:44:27 2021 +0200
remove extra 3rd parameter to open()
When O_CREAT is not present in flags, this parameter is ignored.
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
commit f7d5299db57e3e6ae654e561349c54a01b417e78
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Sep 12 14:48:36 2021 -0700
gitlab CI: add a basic build test
Based on the config from libX11
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 91c9f2bf4de6a508b537afb95d45cab750a439d0
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Aug 1 15:21:52 2021 -0700
Remove support for Digital LN03 laser printer
This DEC printer from the early 1980's is not widely used today.
This was the last remaining printer using the "sixel" and "sixmap"
support, so those functions were removed as well.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 6c22fc002e2b5a08c8678db673afa32fefea07a3
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Aug 1 14:56:54 2021 -0700
Remove support for Digital LA100 dot matrix printer
This DEC printer from the early 1980's is not widely used today.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 9d9a64e094e4eb8ec5f391b7dd131231f9106dd6
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Aug 1 14:46:18 2021 -0700
xpr.man: show current version in footer instead of X11R6
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 63e5e8f9e50efa30fc7c6a4a0689ceba834a1c9c
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Aug 1 14:41:15 2021 -0700
xpr.man: remove duplicate "HP" from PaintJet XL Color name
HP is not in fact so nice that we need to name it twice.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit bcd74f809413dee8682d8c51b08f6a6360c9b9e5
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Aug 1 14:29:55 2021 -0700
Use time_t instead of long with time() & ctime()
Fixes: #1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 26ef28fd82d610c1908ca9a8ae3fda75c52befa3
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Wed Nov 21 17:16:45 2018 -0800
Update configure.ac bug URL for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit c322eb8f9eb6caf9d9903abd04c95043dc0e0457
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Nov 16 22:44:28 2018 -0800
Update README for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit ce80499aa7cadb253a815673bf6934df8132990a
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat May 5 12:49:40 2018 -0700
Standardize indentation in validate_visual()
Fixes gcc 7.3 warnings:
x2jet.c: In function validate_visual:
x2jet.c:1057:5: warning: this if clause does not guard... [-Wmisleading-indentation]
if (depth > 8) invalid_depth_for_visual(depth, "GrayScale"); break;
^~
x2jet.c:1057:70: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the if
if (depth > 8) invalid_depth_for_visual(depth, "GrayScale"); break;
^~~~~
x2jet.c:1059:5: warning: this if clause does not guard... [-Wmisleading-indentation]
if (depth > 8) invalid_depth_for_visual(depth, "StaticGray"); break;
^~
x2jet.c:1059:70: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the if
if (depth > 8) invalid_depth_for_visual(depth, "StaticGray"); break;
^~~~~
x2jet.c:1061:5: warning: this if clause does not guard... [-Wmisleading-indentation]
if (depth > 8) invalid_depth_for_visual(depth, "PseudoColor"); break;
^~
x2jet.c:1061:70: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the if
if (depth > 8) invalid_depth_for_visual(depth, "PseudoColor"); break;
^~~~~
x2jet.c:1063:5: warning: this if clause does not guard... [-Wmisleading-indentation]
if (depth > 8) invalid_depth_for_visual(depth, "StaticColor"); break;
^~
x2jet.c:1063:70: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the if
if (depth > 8) invalid_depth_for_visual(depth, "StaticColor"); break;
^~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 0b852ef27abda922ae18b8042acd18104b25d596
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Mar 9 18:17:12 2018 -0800
@ -479,7 +663,7 @@ Date: Wed Jul 20 19:32:03 2005 +0000
configure cache, you cache it, and the cached value is probably wrong.
commit e3928f9b676c1054790b5ef69b8a568e80482189
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Fri Jul 1 21:10:15 2005 +0000
symlink.sh: add xplsprinters.sgml xprehashprinterlist.sgml xdpr.script

View File

@ -25,7 +25,6 @@ AM_CFLAGS = $(CWARNFLAGS) $(XPR_CFLAGS) -DNOINLINE
xpr_LDADD = $(XPR_LIBS)
xpr_SOURCES = \
lncmd.h \
pmp.h \
x2jet.c \
x2pmp.c \
@ -44,7 +43,7 @@ xdpr: xdpr.script
CLEANFILES = xdpr
EXTRA_DIST = xdpr.script ChangeLog autogen.sh
EXTRA_DIST = xdpr.script ChangeLog autogen.sh README.md
MAINTAINERCLEANFILES=ChangeLog

View File

@ -75,7 +75,7 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = xpr$(EXEEXT)
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
compile config.guess config.sub depcomp install-sh missing
@ -294,6 +294,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@ -305,7 +306,6 @@ top_srcdir = @top_srcdir@
AM_CFLAGS = $(CWARNFLAGS) $(XPR_CFLAGS) -DNOINLINE
xpr_LDADD = $(XPR_LIBS)
xpr_SOURCES = \
lncmd.h \
pmp.h \
x2jet.c \
x2pmp.c \
@ -318,7 +318,7 @@ appman_PRE = \
bin_SCRIPTS = xdpr
CLEANFILES = xdpr $(appman_DATA)
EXTRA_DIST = xdpr.script ChangeLog autogen.sh $(appman_PRE)
EXTRA_DIST = xdpr.script ChangeLog autogen.sh README.md $(appman_PRE)
MAINTAINERCLEANFILES = ChangeLog
appmandir = $(APP_MAN_DIR)
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)

View File

@ -1,26 +0,0 @@
xpr takes as input a window dump file produced by xwd
and formats it for output on various types of printers.
All questions regarding this software should be directed at the
Xorg mailing list:
http://lists.freedesktop.org/mailman/listinfo/xorg
Please submit bug reports to the Xorg bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
The master development code repository can be found at:
git://anongit.freedesktop.org/git/xorg/app/xpr
http://cgit.freedesktop.org/xorg/app/xpr
For patch submission instructions, see:
http://www.x.org/wiki/Development/Documentation/SubmittingPatches
For more information on the git code manager, see:
http://wiki.x.org/wiki/GitPage

18
app/xpr/README.md Normal file
View File

@ -0,0 +1,18 @@
xpr takes as input a window dump file produced by xwd
and formats it for output on various types of printers.
All questions regarding this software should be directed at the
Xorg mailing list:
https://lists.x.org/mailman/listinfo/xorg
The primary development code repository can be found at:
https://gitlab.freedesktop.org/xorg/app/xpr
Please submit bug reports and requests to merge patches there.
For patch submission instructions, see:
https://www.x.org/wiki/Development/Documentation/SubmittingPatches

222
app/xpr/aclocal.m4 vendored
View File

@ -19,32 +19,63 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# 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.
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a
dnl configuration script generated by Autoconf, you may include it under
dnl the same distribution terms that you use for the rest of that
dnl program.
dnl PKG_PREREQ(MIN-VERSION)
dnl -----------------------
dnl Since: 0.29
dnl
dnl Verify that the version of the pkg-config macros are at least
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
dnl installed version of pkg-config, this checks the developer's version
dnl of pkg.m4 when generating configure.
dnl
dnl To ensure that this macro is defined, also add:
dnl m4_ifndef([PKG_PREREQ],
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
dnl ----------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
@ -66,18 +97,19 @@ if test -n "$PKG_CONFIG"; then
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
])dnl PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
# only at the first occurence in configure.ac, so if the first place
# it's called might be skipped (such as if it is within an "if", you
# have to call PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------------------------------
dnl Since: 0.18
dnl
dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
@ -87,8 +119,10 @@ m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
dnl ---------------------------------------------
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
@ -100,10 +134,11 @@ m4_define([_PKG_CONFIG],
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
])dnl _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl ---------------------------
dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@ -111,26 +146,24 @@ if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
])dnl _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl --------------------------------------------------------------
dnl Since: 0.4.0
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
@ -140,11 +173,11 @@ and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
@ -161,7 +194,7 @@ installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
@ -177,16 +210,40 @@ else
AC_MSG_RESULT([yes])
$3
fi[]dnl
])# PKG_CHECK_MODULES
])dnl PKG_CHECK_MODULES
# PKG_INSTALLDIR(DIRECTORY)
# -------------------------
# Substitutes the variable pkgconfigdir as the location where a module
# should install pkg-config .pc files. By default the directory is
# $libdir/pkgconfig, but the default can be changed by passing
# DIRECTORY. The user can override through the --with-pkgconfigdir
# parameter.
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------------------
dnl Since: 0.29
dnl
dnl Checks for existence of MODULES and gathers its build flags with
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
dnl and VARIABLE-PREFIX_LIBS from --libs.
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
dnl configure.ac.
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
_save_PKG_CONFIG=$PKG_CONFIG
PKG_CONFIG="$PKG_CONFIG --static"
PKG_CHECK_MODULES($@)
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
])dnl PKG_CHECK_MODULES_STATIC
dnl PKG_INSTALLDIR([DIRECTORY])
dnl -------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable pkgconfigdir as the location where a module
dnl should install pkg-config .pc files. By default the directory is
dnl $libdir/pkgconfig, but the default can be changed by passing
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
@ -197,16 +254,18 @@ AC_ARG_WITH([pkgconfigdir],
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
]) dnl PKG_INSTALLDIR
])dnl PKG_INSTALLDIR
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
# -------------------------
# Substitutes the variable noarch_pkgconfigdir as the location where a
# module should install arch-independent pkg-config .pc files. By
# default the directory is $datadir/pkgconfig, but the default can be
# changed by passing DIRECTORY. The user can override through the
# --with-noarch-pkgconfigdir parameter.
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
dnl --------------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
dnl module should install arch-independent pkg-config .pc files. By
dnl default the directory is $datadir/pkgconfig, but the default can be
dnl changed by passing DIRECTORY. The user can override through the
dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
@ -217,7 +276,24 @@ AC_ARG_WITH([noarch-pkgconfigdir],
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
]) dnl PKG_NOARCH_INSTALLDIR
])dnl PKG_NOARCH_INSTALLDIR
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------
dnl Since: 0.28
dnl
dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
#

View File

@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# 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, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -53,7 +53,7 @@ func_file_conv ()
MINGW*)
file_conv=mingw
;;
CYGWIN*)
CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@ -67,7 +67,7 @@ func_file_conv ()
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

22
app/xpr/configure vendored
View File

@ -729,6 +729,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -809,6 +810,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1061,6 +1063,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1198,7 +1209,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1351,6 +1362,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -10422,8 +10434,8 @@ AM_BACKSLASH='\'
# Checks for pkg-config packages
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XPR" >&5
$as_echo_n "checking for XPR... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmuu x11 xproto >= 7.0.25" >&5
$as_echo_n "checking for xmuu x11 xproto >= 7.0.25... " >&6; }
if test -n "$XPR_CFLAGS"; then
pkg_cv_XPR_CFLAGS="$XPR_CFLAGS"
@ -10463,7 +10475,7 @@ fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@ -10490,7 +10502,7 @@ Alternatively, you may set the environment variables XPR_CFLAGS
and XPR_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}

View File

@ -1,51 +0,0 @@
/*
Copyright (c) 1985 X Consortium
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from the X Consortium.
*/
/* lncmd.h - Command sequences DEC printers, in particular LN0x laser
printers */
/*
#define LN_RIS "\033c" Obsolete; causes LN03+ problems
*/
#define LN_STR "\033[!p"
#define LN_SSU "\033[%d I"
#define LN_PUM_SET "\033[11h"
#define LN_PFS "\033[%s J"
#define LN_DECSLRM "\033[%d;%ds"
#define LN_HPA "\033[%d`"
#define LN_VPA "\033[%dd"
#define LN_SIXEL_GRAPHICS "\033P%d;%d;%dq"
#define LN_ST "\033\\"
#define LN_DECOPM_SET "\033[?52h"
#define LN_DECOPM_RESET "\033[?52I"
#define LN_SGR "\033[1%dm"
#define LN_PUM "\033[11I"
#define LN_LNM "\033[20h"

View File

@ -1054,13 +1054,21 @@ void validate_visual(void)
switch (xwd_header.visual_class) {
case GrayScale:
if (depth > 8) invalid_depth_for_visual(depth, "GrayScale"); break;
if (depth > 8)
invalid_depth_for_visual(depth, "GrayScale");
break;
case StaticGray:
if (depth > 8) invalid_depth_for_visual(depth, "StaticGray"); break;
if (depth > 8)
invalid_depth_for_visual(depth, "StaticGray");
break;
case PseudoColor:
if (depth > 8) invalid_depth_for_visual(depth, "PseudoColor"); break;
if (depth > 8)
invalid_depth_for_visual(depth, "PseudoColor");
break;
case StaticColor:
if (depth > 8) invalid_depth_for_visual(depth, "StaticColor"); break;
if (depth > 8)
invalid_depth_for_visual(depth, "StaticColor");
break;
case DirectColor:
if (depth != 12 && depth != 24)
invalid_depth_for_visual(depth, "DirectColor");

View File

@ -1,4 +1,4 @@
.TH XDPR 1 "Release 6" "X Version 11"
.TH XDPR 1 __xorgversion__
.SH NAME
xdpr \- dump an X window directly to a printer
.SH SYNOPSIS
@ -60,29 +60,23 @@ Normally,
.I xdpr
gets the host and display number to use from the environment
variable ``DISPLAY.''
One can, however, specify them explicitly; see \fIX\fP(1).
One can, however, specify them explicitly; see \fIX\fP(__miscmansuffix__).
.TP
.B \-device \fIdevtype\fP
Specifies the device on which the file will be printed. Currently supported:
.RS 12
.PD 0
.TP
.B la100
Digital LA100
.TP
.B ljet
HP LaserJet series and other monochrome PCL devices
such as ThinkJet, QuietJet, RuggedWriter, \s-1HP\s+12560 series,
and HP 2930 series printers
.TP
.B ln03
Digital LN03
.TP
.B pjet
HP PaintJet (color mode)
.TP
.B pjetxl
HP HP PaintJet XL Color Graphics Printer (color mode)
HP PaintJet XL Color Graphics Printer (color mode)
.TP
.B pp
IBM PP3812
@ -123,10 +117,6 @@ which display to use by default.
.TP 10
PRINTER
which printer to use by default.
.SH COPYRIGHT
Copyright X Consortium
.br
See \fIX(__miscmansuffix__)\fP for a full statement of rights and permissions.
.SH AUTHORS
Paul Boutin, MIT Project Athena
.br

View File

@ -33,12 +33,12 @@ from the X Consortium.
*
* Author: Michael R. Gretzinger, MIT Project Athena
*
* Modified by Marvin Solomon, Univeristy of Wisconsin, to handle Apple
* Modified by Marvin Solomon, University of Wisconsin, to handle Apple
* Laserwriter (PostScript) devices (-device ps).
* Also accepts the -compact flag that produces more compact output
* by using run-length encoding on white (1) pixels.
* This version does not (yet) support the following options
* -append -dump -noff -nosixopt -split
* -append -dump -noff -split
*
* Changes
* Copyright 1986 by Marvin Solomon and the University of Wisconsin
@ -84,7 +84,6 @@ from the X Consortium.
#ifndef WIN32
#include <pwd.h>
#endif
#include "lncmd.h"
#include "xpr.h"
#include <X11/XWDFile.h>
#include <X11/Xmu/SysUtil.h>
@ -122,8 +121,6 @@ int debug = 0;
#define F_PORTRAIT 1
#define F_LANDSCAPE 2
#define F_DUMP 4
#define F_NOSIXOPT 8
#define F_APPEND 16
#define F_NOFF 32
#define F_REPORT 64
@ -216,35 +213,6 @@ char *convert_data(
GrayPtr gray,
XColor *colors,
int flags);
static
void dump_sixmap(
register unsigned char (*sixmap)[],
int iw,
int ih);
static
void build_sixmap(
int ih,
int iw,
unsigned char (*sixmap)[],
int hpad,
XWDFileHeader *win,
const char *data);
static
void ln03_setup(
int iw,
int ih,
enum orientation orientation,
int scale,
int left,
int top,
int *left_margin,
int *top_margin,
int flags,
const char *header,
const char *trailer);
static void ln03_finish(void);
static void la100_setup(int iw, int ih, int scale);
static void la100_finish(void);
static void dump_prolog(int flags);
static int points(int n);
static char *escape(const char *s);
@ -261,21 +229,6 @@ void ps_setup(
const char *trailer,
const char *name);
static void ps_finish(void);
static
void ln03_output_sixels(
unsigned char (*sixmap)[],
int iw,
int ih,
int nosixopt,
int split,
int scale,
int top_margin,
int left_margin);
static void la100_output_sixels(
unsigned char (*sixmap)[],
int iw,
int ih,
int nosixopt);
static void ps_output_bits(
int iw,
int ih,
@ -303,16 +256,12 @@ int main(int argc, char **argv)
{
unsigned long swaptest = 1;
XWDFileHeader win;
register unsigned char (*sixmap)[];
register int i;
register int iw;
register int ih;
register int sixel_count;
char *w_name;
int scale, width, height, flags, split;
int left, top;
int top_margin, left_margin;
int hpad;
char *header, *trailer;
int plane;
int density, render;
@ -356,7 +305,10 @@ int main(int argc, char **argv)
(flags & F_SLIDE),
device, cutoff, gamma, render);
exit(0);
} else if (device != PS) {
fprintf(stderr, "xpr: device not supported\n");
}
/* everything past here is for device == PS */
/* read in window header */
fullread(0, (char *)&win, sizeof win);
@ -420,42 +372,13 @@ int main(int argc, char **argv)
setup_layout(device, (int) win.pixmap_width, (int) win.pixmap_height,
flags, width, height, header, trailer, &scale, &orientation);
if (device == PS) {
iw = win.pixmap_width;
ih = win.pixmap_height;
sixmap = NULL;
} else {
/* calculate w and h cell count */
iw = win.pixmap_width;
ih = (win.pixmap_height + 5) / 6;
hpad = (ih * 6) - win.pixmap_height;
iw = win.pixmap_width;
ih = win.pixmap_height;
/* build pixcells from input file */
sixel_count = iw * ih;
sixmap = (unsigned char (*)[])malloc((unsigned)sixel_count);
build_sixmap(iw, ih, sixmap, hpad, &win, data);
}
/* output commands and sixel graphics */
if (device == LN03) {
/* ln03_grind_fonts(sixmap, iw, ih, scale, &pixmap); */
ln03_setup(iw, ih, orientation, scale, left, top,
&left_margin, &top_margin, flags, header, trailer);
ln03_output_sixels(sixmap, iw, ih, (flags & F_NOSIXOPT), split,
scale, top_margin, left_margin);
ln03_finish();
} else if (device == LA100) {
la100_setup(iw, ih, scale);
la100_output_sixels(sixmap, iw, ih, (flags & F_NOSIXOPT));
la100_finish();
} else if (device == PS) {
ps_setup(iw, ih, orientation, scale, left, top,
flags, header, trailer, w_name);
ps_output_bits(iw, ih, flags, orientation, &win, data);
ps_finish();
} else {
fprintf(stderr, "xpr: device not supported\n");
}
ps_setup(iw, ih, orientation, scale, left, top,
flags, header, trailer, w_name);
ps_output_bits(iw, ih, flags, orientation, &win, data);
ps_finish();
/* print some statistics */
if (flags & F_REPORT) {
@ -465,8 +388,6 @@ int main(int argc, char **argv)
fprintf(stderr, "Orientation: %s, Scale: %d\n",
(orientation==PORTRAIT) ? "Portrait" : "Landscape", scale);
}
if (((device == LN03) || (device == LA100)) && (flags & F_DUMP))
dump_sixmap(sixmap, iw, ih);
exit(EXIT_SUCCESS);
}
@ -498,7 +419,7 @@ usage(void)
fprintf(stderr, "usage: %s [options] [file]\n%s", progname,
" -append <file> -noff -output <file>\n"
" -compact\n"
" -device {ln03 | la100 | ps | lw | pp | ljet | pjet | pjetxl}\n"
" -device {ps | lw | pp | ljet | pjet | pjetxl}\n"
" -dump\n"
" -gamma <correction>\n"
" -gray {2 | 3 | 4}\n"
@ -507,7 +428,6 @@ usage(void)
" -landscape -portrait\n"
" -left <inches> -top <inches>\n"
" -noposition\n"
" -nosixopt\n"
" -plane <n>\n"
" -psfig\n"
" -render <type>\n"
@ -581,8 +501,6 @@ void parse_args(
argc--; argv++;
if (argc == 0) missing_arg(arg);
*cutoff = min((atof(*argv) / 100.0 * 0xFFFF), 0xFFFF);
} else if (!strcmp(*argv, "-dump")) {
*flags |= F_DUMP;
} else if (!strcmp(*argv, "-density")) {
argc--; argv++;
if (argc == 0) missing_arg(arg);
@ -590,11 +508,7 @@ void parse_args(
} else if (!strcmp(*argv, "-device")) {
argc--; argv++;
if (argc == 0) missing_arg(arg);
if (!strcmp(*argv, "ln03")) {
*device = LN03;
} else if (!strcmp(*argv, "la100")) {
*device = LA100;
} else if (!strcmp(*argv, "ps")) {
if (!strcmp(*argv, "ps")) {
*device = PS;
} else if (!strcmp(*argv, "lw")) {
*device = PS;
@ -644,8 +558,6 @@ void parse_args(
argc--; argv++;
if (argc == 0) missing_arg(arg);
*left = (int)(300.0 * atof(*argv));
} else if (!strcmp(*argv, "-nosixopt")) {
*flags |= F_NOSIXOPT;
} else if (!strcmp(*argv, "-noff")) {
*flags |= F_NOFF;
} else if (!strcmp(*argv, "-noposition")) {
@ -760,7 +672,7 @@ void setup_layout(
if (trailer != NULL) win_height += 75;
/* check maximum width and height; set orientation and scale*/
if (device == LN03 || device == PS) {
if (device == PS) {
if ((win_width < win_height || (flags & F_PORTRAIT)) &&
!(flags & F_LANDSCAPE)) {
*orientation = PORTRAIT;
@ -777,7 +689,7 @@ void setup_layout(
h_scale = h_max / win_height;
*scale = min(w_scale, h_scale);
}
} else { /* device == LA100 */
} else {
*orientation = PORTRAIT;
*scale = W_MAX / win_width;
}
@ -980,214 +892,6 @@ char *convert_data(
return (out_image->data);
}
static
void dump_sixmap(
register unsigned char (*sixmap)[],
int iw,
int ih)
{
register int i, j;
register unsigned char *c;
c = (unsigned char *)sixmap;
fprintf(stderr, "Sixmap:\n");
for (i = 0; i < ih; i++) {
for (j = 0; j < iw; j++) {
fprintf(stderr, "%02X ", *c++);
}
fprintf(stderr, "\n\n");
}
}
static
void build_sixmap(
int ih,
int iw,
unsigned char (*sixmap)[],
int hpad,
XWDFileHeader *win,
const char *data)
{
int iwb = win->bytes_per_line;
unsigned char *line[6];
register unsigned char *c;
register int i, j;
#ifdef NOINLINE
register int w;
#endif
register int sixel;
unsigned char *buffer = (unsigned char *)data;
c = (unsigned char *)sixmap;
while (--ih >= 0) {
for (i = 0; i <= 5; i++) {
line[i] = buffer;
buffer += iwb;
}
if ((ih == 0) && (hpad > 0)) {
unsigned char *ffbuf;
ffbuf = (unsigned char *)malloc((unsigned)iwb);
for (j = 0; j < iwb; j++)
ffbuf[j] = 0xFF;
for (; --hpad >= 0; i--)
line[i] = ffbuf;
}
#ifndef NOINLINE
for (i = 0; i < iw; i++) {
sixel = extzv(line[0], i, 1);
sixel |= extzv(line[1], i, 1) << 1;
sixel |= extzv(line[2], i, 1) << 2;
sixel |= extzv(line[3], i, 1) << 3;
sixel |= extzv(line[4], i, 1) << 4;
sixel |= extzv(line[5], i, 1) << 5;
*c++ = sixel;
}
#else
for (i = 0, w = iw; w > 0; i++) {
for (j = 0; j <= 7; j++) {
sixel = ((line[0][i] >> j) & 1);
sixel |= ((line[1][i] >> j) & 1) << 1;
sixel |= ((line[2][i] >> j) & 1) << 2;
sixel |= ((line[3][i] >> j) & 1) << 3;
sixel |= ((line[4][i] >> j) & 1) << 4;
sixel |= ((line[5][i] >> j) & 1) << 5;
*c++ = sixel;
if (--w == 0) break;
}
}
#endif
}
}
/*
ln03_grind_fonts(sixmap, iw, ih, scale, pixmap)
unsigned char (*sixmap)[];
int iw;
int ih;
int scale;
struct pixmap (**pixmap)[];
{
}
*/
static
void ln03_setup(
int iw,
int ih,
enum orientation orientation,
int scale,
int left,
int top,
int *left_margin,
int *top_margin,
int flags,
const char *header,
const char *trailer)
{
register int i;
register int lm, tm, xm;
char buf[256];
register char *bp = buf;
if (!(flags & F_APPEND)) {
sprintf(bp, LN_STR); bp += 4;
sprintf(bp, LN_SSU, 7); bp += 5;
sprintf(bp, LN_PUM_SET); bp += sizeof LN_PUM_SET - 1;
}
if (orientation == PORTRAIT) {
lm = (left > 0)? left : (((W_MAX - scale * iw) / 2) + W_MARGIN);
tm = (top > 0)? top : (((H_MAX - scale * ih * 6) / 2) + H_MARGIN);
sprintf(bp, LN_PFS, "?20"); bp += 7;
sprintf(bp, LN_DECOPM_SET); bp += sizeof LN_DECOPM_SET - 1;
sprintf(bp, LN_DECSLRM, lm, W_PAGE - lm); bp += strlen(bp);
} else {
lm = (left > 0)? left : (((H_MAX - scale * iw) / 2) + H_MARGIN);
tm = (top > 0)? top : (((W_MAX - scale * ih * 6) / 2) + W_MARGIN);
sprintf(bp, LN_PFS, "?21"); bp += 7;
sprintf(bp, LN_DECOPM_SET); bp += sizeof LN_DECOPM_SET - 1;
sprintf(bp, LN_DECSLRM, lm, H_PAGE - lm); bp += strlen(bp);
}
if (header != NULL) {
sprintf(bp, LN_VPA, tm - 100); bp += strlen(bp);
i = strlen(header);
xm = (((scale * iw) - (i * 30)) / 2) + lm;
sprintf(bp, LN_HPA, xm); bp += strlen(bp);
sprintf(bp, LN_SGR, 3); bp += strlen(bp);
memmove(bp, header, i);
bp += i;
}
if (trailer != NULL) {
sprintf(bp, LN_VPA, tm + (scale * ih * 6) + 75); bp += strlen(bp);
i = strlen(trailer);
xm = (((scale * iw) - (i * 30)) / 2) + lm;
sprintf(bp, LN_HPA, xm); bp += strlen(bp);
sprintf(bp, LN_SGR, 3); bp += strlen(bp);
memmove(bp, trailer, i);
bp += i;
}
sprintf(bp, LN_HPA, lm); bp += strlen(bp);
sprintf(bp, LN_VPA, tm); bp += strlen(bp);
sprintf(bp, LN_SIXEL_GRAPHICS, 9, 0, scale); bp += strlen(bp);
sprintf(bp, "\"1;1"); bp += 4; /* Pixel aspect ratio */
write(1, buf, bp-buf);
*top_margin = tm;
*left_margin = lm;
}
static
void ln03_finish(void)
{
char buf[256];
register char *bp = buf;
sprintf(bp, LN_DECOPM_RESET); bp += sizeof LN_DECOPM_SET - 1;
sprintf(bp, LN_LNM); bp += 5;
sprintf(bp, LN_PUM); bp += 5;
sprintf(bp, LN_PFS, "?20"); bp += 7;
sprintf(bp, LN_SGR, 0); bp += strlen(bp);
sprintf(bp, LN_HPA, 1); bp += strlen(bp);
sprintf(bp, LN_VPA, 1); bp += strlen(bp);
write(1, buf, bp-buf);
}
/*ARGSUSED*/
static
void la100_setup(int iw, int ih, int scale)
{
char buf[256];
register char *bp;
int lm, tm;
bp = buf;
lm = ((80 - (int)((double)iw / 6.6)) / 2) - 1;
if (lm < 1) lm = 1;
tm = ((66 - (int)((double)ih / 2)) / 2) - 1;
if (tm < 1) tm = 1;
sprintf(bp, "\033[%d;%ds", lm, 81-lm); bp += strlen(bp);
sprintf(bp, "\033[?7l"); bp += 5;
sprintf(bp, "\033[%dd", tm); bp += strlen(bp);
sprintf(bp, "\033[%d`", lm); bp += strlen(bp);
sprintf(bp, "\033P0q"); bp += 4;
write(1, buf, bp-buf);
}
#define LA100_RESET "\033[1;80s\033[?7h"
static
void la100_finish(void)
{
write(1, LA100_RESET, sizeof LA100_RESET - 1);
}
#define COMMENTVERSION "PS-Adobe-1.0"
#ifdef XPROLOG
@ -1376,7 +1080,7 @@ void ps_setup(
#else
struct passwd *pswd;
#endif
long clock;
time_t clock;
int lm, bm; /* left (bottom) margin */
/* calculate margins */
@ -1487,148 +1191,6 @@ void ps_finish(void)
while (*p) printf("%s\n",*p++);
}
static
void ln03_output_sixels(
unsigned char (*sixmap)[],
int iw,
int ih,
int nosixopt,
int split,
int scale,
int top_margin,
int left_margin)
{
unsigned char *buf;
register unsigned char *bp;
int i;
int j;
register int k;
register unsigned char *c;
register int lastc;
register int count;
char snum[6];
register char *snp;
bp = (unsigned char *)malloc((unsigned)(iw*ih+512));
buf = bp;
count = 0;
lastc = -1;
c = (unsigned char *)sixmap;
split = ih / split; /* number of lines per page */
iw--; /* optimization */
for (i = 0; i < ih; i++) {
for (j = 0; j <= iw; j++) {
if (!nosixopt) {
if (*c == lastc && j < iw) {
count++;
c++;
continue;
}
if (count >= 3) {
bp--;
count++;
*bp++ = '!';
snp = snum;
while (count > 0) {
k = count / 10;
*snp++ = count - (k * 10) + '0';
count = k;
}
while (--snp >= snum) *bp++ = *snp;
*bp++ = (~lastc & 0x3F) + 0x3F;
} else if (count > 0) {
lastc = (~lastc & 0x3F) + 0x3F;
do {
*bp++ = lastc;
} while (--count > 0);
}
}
lastc = *c++;
*bp++ = (~lastc & 0x3F) + 0x3F;
}
*bp++ = '-'; /* New line */
lastc = -1;
if ((i % split) == 0 && i != 0) {
sprintf((char *)bp, LN_ST); bp += sizeof LN_ST - 1;
*bp++ = '\f';
sprintf((char *)bp, LN_VPA, top_margin + (i * 6 * scale));
bp += strlen((char *)bp);
sprintf((char *)bp, LN_HPA, left_margin);
bp += strlen((char *)bp);
sprintf((char *)bp, LN_SIXEL_GRAPHICS, 9, 0, scale);
bp += strlen((char *)bp);
sprintf((char *)bp, "\"1;1"); bp += 4;
}
}
sprintf((char *)bp, LN_ST); bp += sizeof LN_ST - 1;
write(1, (char *)buf, bp-buf);
}
/*ARGSUSED*/
static
void la100_output_sixels(
unsigned char (*sixmap)[],
int iw,
int ih,
int nosixopt)
{
unsigned char *buf;
register unsigned char *bp;
int i;
register int j, k;
register unsigned char *c;
register int lastc;
register int count;
char snum[6];
bp = (unsigned char *)malloc((unsigned)(iw*ih+512));
buf = bp;
count = 0;
lastc = -1;
c = (unsigned char *)sixmap;
for (i = 0; i < ih; i++) {
for (j = 0; j < iw; j++) {
if (*c == lastc && (j+1) < iw) {
count++;
c++;
continue;
}
if (count >= 2) {
bp -= 2;
count = 2 * (count + 1);
*bp++ = '!';
k = 0;
while (count > 0) {
snum[k++] = (count % 10) + '0';
count /= 10;
}
while (--k >= 0) *bp++ = snum[k];
*bp++ = (~lastc & 0x3F) + 0x3F;
count = 0;
} else if (count > 0) {
lastc = (~lastc & 0x3F) + 0x3F;
do {
*bp++ = lastc;
*bp++ = lastc;
} while (--count > 0);
}
lastc = (~*c & 0x3F) + 0x3F;
*bp++ = lastc;
*bp++ = lastc;
lastc = *c++;
}
*bp++ = '-'; /* New line */
lastc = -1;
}
sprintf((char *)bp, LN_ST); bp += sizeof LN_ST - 1;
*bp++ = '\f';
write(1, (char *)buf, bp-buf);
}
#define LINELEN 72 /* number of CHARS (bytes*2) per line of bitmap output */
static

View File

@ -29,7 +29,7 @@ enum orientation {
LANDSCAPE_LEFT = 3
};
enum device {LN01, LN03, LA100, PS, PP, LJET, PJET, PJETXL};
enum device {PS, PP, LJET, PJET, PJETXL};
/* Global variables */
extern const char *progname;

View File

@ -1,4 +1,4 @@
.TH XPR 1 "Release 6" "X Version 11"
.TH XPR 1 __xorgversion__
.SH NAME
xpr \- print an X window dump
.SH SYNOPSIS
@ -79,7 +79,7 @@ xpr \- print an X window dump
.I xpr
takes as input a window dump file produced by
.IR xwd(1)
and formats it for output on PostScript printers, the Digital LN03 or LA100,
and formats it for output on PostScript printers,
the IBM PP3812 page printer, the HP LaserJet (or other PCL printers),
or the HP PaintJet. If no file
argument is given, the standard input is used. By default, \fIxpr\fP
@ -99,22 +99,16 @@ Specifies the device on which the file will be printed. Currently supported:
.RS 12
.PD 0
.TP
.B la100
Digital LA100
.TP
.B ljet
\s-1HP\s+1 LaserJet series and other monochrome PCL devices
such as ThinkJet, QuietJet, RuggedWriter, \s-1HP\s+12560 series,
and \s-1HP\s+12930 series printers
.TP
.B ln03
Digital LN03
.TP
.B pjet
HP PaintJet (color mode)
.TP
.B pjetxl
HP HP PaintJet XL Color Graphics Printer (color mode)
HP PaintJet XL Color Graphics Printer (color mode)
.TP
.B pp
IBM PP3812
@ -128,7 +122,7 @@ The default is PostScript.
\fB-device lw\fP (LaserWriter) is equivalent to -device ps and is
provided only for backwards compatibility.
.IP "\fB\-scale\fP \fIscale\fP"
Affects the size of the window on the page. The PostScript, LN03, and HP
Affects the size of the window on the page. The PostScript and HP
printers are able to
translate each bit in a window pixel map into a grid of a specified size.
For example each bit might translate into a 3x3 grid. This would be
@ -216,33 +210,6 @@ This option prints the program version information and exits.
xwd(1), xwud(1), X(__miscmansuffix__)
.SH LIMITATIONS
The current version of \fIxpr\fP can generally print out on the LN03
most X windows that are not larger than two-thirds of the screen.
For example, it will be able to print out a large Emacs window, but
it will usually fail when trying to print out the entire screen. The
LN03 has memory limitations that can cause it to incorrectly print
very large or complex windows. The two most common errors
encountered are ``band too complex'' and ``page memory exceeded.''
In the first case, a window may have a particular six pixel row that
contains too many changes (from black to white to black). This will
cause the printer to drop part of the line and possibly parts of the
rest of the page. The printer will flash the number `1' on its front
panel when this problem occurs. A possible solution to this problem
is to increase the scale of the picture, or to split the picture onto
two or more pages. The second problem, ``page memory exceeded,''
will occur if the picture contains too much black, or if the picture
contains complex half-tones such as the background color of a
display. When this problem occurs the printer will automatically
split the picture into two or more pages. It may flash the number
`5' on its from panel. There is no easy solution to this problem.
It will probably be necessary to either cut and paste, or to rework the
application to produce a less complex picture.
There are several limitations on the LA100 support:
the picture will always be printed in
portrait mode, there is no scaling,
and the aspect ratio will be slightly off.
Support for PostScript output currently cannot handle the \fB-append\fP,
\fB-noff\fP or \fB-split\fP options.
@ -327,12 +294,6 @@ The \fB\-slide\fP option is not supported for LaserJet printers.
The \fB\-split\fP option is not supported for HP printers.
The \fB\-gray\fP option is not supported for HP or IBM printers.
.br
Copyright 1986, Marvin Solomon and the University of Wisconsin.
.br
Copyright 1988, Hewlett Packard Company.
.br
See \fIX(__miscmansuffix__)\fP for a full statement of rights and permissions.
.SH AUTHORS
Michael R. Gretzinger, MIT Project Athena,
Jose Capo, MIT Project Athena (PP3812 support),