summaryrefslogtreecommitdiff
path: root/src/cups
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@debian.org>2008-10-26 16:11:41 +0000
committerRoger Leigh <rleigh@debian.org>2008-10-26 16:11:41 +0000
commitdfae5860833782af557deb35e286d7e186fe3cf5 (patch)
treee3b4282ae08e120f78cd0c097f7cb3b570e94da2 /src/cups
parent3b59bb0a607ec27ea60f07d1cd5d1bbb4483c832 (diff)
Imported Upstream version 4.3.99+cvs20050702
Diffstat (limited to 'src/cups')
-rw-r--r--src/cups/Makefile.am141
-rw-r--r--src/cups/Makefile.in1214
-rw-r--r--src/cups/README14
-rw-r--r--src/cups/cups-calibrate.c15
-rw-r--r--src/cups/cups-genppdconfig.in616
-rw-r--r--src/cups/cups-genppdupdate.in539
-rw-r--r--src/cups/epson.c4
-rw-r--r--src/cups/genppd.c1573
-rw-r--r--src/cups/rastertoprinter.c1231
9 files changed, 3794 insertions, 1553 deletions
diff --git a/src/cups/Makefile.am b/src/cups/Makefile.am
index 6b1d861..1448f15 100644
--- a/src/cups/Makefile.am
+++ b/src/cups/Makefile.am
@@ -1,4 +1,4 @@
-## $Id: Makefile.am,v 1.45.2.12 2003/12/24 12:40:47 rlk Exp $
+## $Id: Makefile.am,v 1.81 2005/02/03 22:00:30 rleigh Exp $
## Copyright (C) 2000 Roger Leigh
##
## This program is free software; you can redistribute it and/or modify
@@ -23,12 +23,16 @@ AUTOMAKE_OPTIONS = 1.4 gnu
MAINT_CHARSET = latin1
+include $(top_srcdir)/scripts/global.mk
+
## Variables
+empty=
PACKAGE = cups
bindir = @cups_bindir@
+sbindir = @cups_sbindir@
pkgdatadir = $(cups_conf_datadir)
pkglibdir = $(cups_conf_serverbin)
@@ -36,70 +40,72 @@ pkgsysconfdir = $(cups_conf_serverroot)
cupsexec_backenddir = $(pkglibdir)/backend
cupsexec_filterdir = $(pkglibdir)/filter
-cups_modeldir = $(pkgdatadir)/model
-
-AM_CFLAGS = $(GNUCFLAGS)
-DEFS = @CUPS_CFLAGS@ @DEFS@ -I. -I$(srcdir) -I../.. -DCUPS_DATADIR=\"$(pkgdatadir)\" -DGIMP_PRINT_VERSION=\"$(VERSION)\"
-INCLUDES = @INCLUDES@ $(LIBGIMPPRINT_CFLAGS)
-LIBPRINTUT = $(top_builddir)/lib/libprintut.la
-LIBS = $(INTLLIBS) @LIBS@
-
-if BUILD_GENPPD_STATIC
-STATIC_LDOPTS=-static
+if CUPS_PPDS_AT_TOP_LEVEL
+cups_modeldir = $(pkgdatadir)/model/
+DONT_UNINSTALL_PPDS=true
+else
+cups_modeldir = $(pkgdatadir)/model/gutenprint/@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@/
endif
-## Programs
+LOCAL_CPPFLAGS = $(GUTENPRINT_CFLAGS) $(CUPS_CFLAGS)
-CUPS_BIN = cups-calibrate
-CUPS_BACKEND_BIN = epson canon
-CUPS_FILTER_BIN = rastertoprinter commandtoepson commandtocanon
-CUPS_NOINST_BIN = genppd
-bin_PROGRAMS = @CUPS_BIN@
-cupsexec_backend_PROGRAMS = @CUPS_BACKEND_BIN@
-cupsexec_filter_PROGRAMS = @CUPS_FILTER_BIN@
-noinst_PROGRAMS = @CUPS_NOINST_BIN@
+## Programs
-EXTRA_PROGRAMS = cups-calibrate commandtoepson epson genppd rastertoprinter commandtocanon canon
+if BUILD_CUPS
+bin_PROGRAMS = cups-calibrate
+sbin_PROGRAMS = cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
+sbin_SCRIPTS = cups-genppdconfig.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ cups-genppdupdate.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
+cupsexec_backend_PROGRAMS = epson canon
+cupsexec_filter_PROGRAMS = rastertogutenprint.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ commandtoepson commandtocanon
+endif
-CUPS_LIBS = @CUPS_LIBS@
+if BUILD_GENPPD_STATIC
+STATIC_LDOPTS=-static -export-dynamic
+endif
cups_calibrate_SOURCES = cups-calibrate.c
-cups_calibrate_LDADD = $(LIBPRINTUT) $(LIBM)
+cups_calibrate_LDADD = -lm
commandtoepson_SOURCES = commandtoepson.c
-commandtoepson_LDADD = $(LIBPRINTUT) $(CUPS_LIBS)
+commandtoepson_LDADD = $(CUPS_LIBS)
canon_SOURCES = canon.c
-canon_LDADD = $(LIBPRINTUT) $(CUPS_LIBS)
+canon_LDADD = $(CUPS_LIBS)
epson_SOURCES = epson.c
-epson_LDADD = $(LIBPRINTUT) $(CUPS_LIBS)
+epson_LDADD = $(CUPS_LIBS)
-genppd_SOURCES = genppd.c
-genppd_LDADD = $(LIBPRINTUT) $(CUPS_LIBS) $(LIBGIMPPRINT_LIBS)
-genppd_LDFLAGS= $(STATIC_LDOPTS)
-genppd_DEPENDENCIES = $(LIBGIMPPRINT_LIBS)
+cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES = genppd.c
+cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD = $(CUPS_LIBS) $(GENPPD_LIBS) $(GUTENPRINT_LIBS)
+cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS = $(STATIC_LDOPTS)
-rastertoprinter_SOURCES = rastertoprinter.c
-rastertoprinter_LDADD = $(LIBPRINTUT) $(CUPS_LIBS) $(LIBGIMPPRINT_LIBS)
-rastertoprinter_LDFLAGS= $(STATIC_LDOPTS)
-rastertoprinter_DEPENDENCIES = $(LIBGIMPPRINT_LIBS)
+rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES = rastertoprinter.c
+rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD = $(CUPS_LIBS) $(GUTENPRINT_LIBS)
+rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS = $(STATIC_LDOPTS)
+cups-genppdconfig.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@: $(top_builddir)/config.status cups-genppdconfig.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/cups-genppdconfig
+cups-genppdupdate.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@: $(top_builddir)/config.status cups-genppdupdate.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/cups-genppdupdate
## Data
+if BUILD_CUPS
CUPS_PKG = calibrate.ppm
+endif
+if BUILD_CUPS
CUPS_CONF = command.types
+endif
-pkgdata_DATA = @CUPS_PKG@
-pkgsysconf_DATA = @CUPS_CONF@
+pkgdata_DATA = $(CUPS_PKG)
+pkgsysconf_DATA = $(CUPS_CONF)
-if BUILD_CUPS
-INSTALL_DATA_LOCAL_DEPS = ppd
+if BUILD_CUPS_PPDS
+INSTALL_DATA_LOCAL_DEPS = ppd-stamp
endif
-if BUILD_TRANSLATED_PPDS
+if BUILD_TRANSLATED_CUPS_PPDS
PPD_NLS = $(PPD_NLS_1)
LINGUAS = $(ALL_LINGUAS)
endif
@@ -108,6 +114,9 @@ if USE_NLS
PPD_NLS_1 = ppd-nls
endif
+
+## Rules
+
install-data-local: $(INSTALL_DATA_LOCAL_DEPS)
if test -n "$(INSTALL_DATA_LOCAL_DEPS)" ; then \
$(mkinstalldirs) $(DESTDIR)$(cups_modeldir); \
@@ -124,35 +133,13 @@ install-data-local: $(INSTALL_DATA_LOCAL_DEPS)
fi
uninstall-local: $(INSTALL_DATA_LOCAL_DEPS)
- if test -n "$(INSTALL_DATA_LOCAL_DEPS)" ; then \
- for language in C $(LINGUAS) ; do \
- echo "Removing $$language locale PPD files..." ; \
- for ppdfile in ppd/$$language/* ; do \
- if test -f "$(DESTDIR)$(cups_modeldir)/$$language/`basename $$ppdfile`" ; then \
- $(RM) -f $(DESTDIR)$(cups_modeldir)/$$language/`basename $$ppdfile` ; \
- fi ; \
- done; \
- done \
+# Remove PPDs installed in new PPD location
+ if test -z "DONT_UNINSTALL_PPDS" ; then \
+ if test -n "$(INSTALL_DATA_LOCAL_DEPS)" ; then \
+ $(RM) -fr $(DESTDIR)$(cups_modeldir)/* ; \
+ fi \
fi
-refresh-data-local: ppd
- cd ppd ; \
- files=`find . -name '*.ppd*' -exec basename '{}' \; | sort | uniq` ; \
- for language in . de en es fr it ; do \
- for f in $$files ; do \
- ff="$(DESTDIR)/$(cups_modeldir)/$$language/$$f" ; \
- if [ -f "$$ff" ] ; then \
- echo "Removing $$ff" ; \
- $(RM) "$$ff" ; \
- fi ; \
- if [ -f "$$ff" ] ; then \
- echo "Unable to remove $$ff" 1>&2 ; \
- exit 1 ; \
- fi ; \
- done; \
- done
-
-
install-data-hook:
# Remove unused directories in install tree
-@echo 'Expect a number of "rmdir: Directory not empty" warnings'
@@ -168,16 +155,13 @@ install-data-hook:
-rmdir `dirname $(DESTDIR)$(pkglibdir)`
-rmdir `dirname $(DESTDIR)$(pkgsysconfdir)`
-
-## Rules
-
.PHONY: ppd ppd-stamp-pre ppd-stamp-nonls ppd-stamp-nls ppd-stamp-phony
all-local: $(INSTALL_DATA_LOCAL_DEPS)
ppd: ppd-stamp
-ppd-stamp: genppd
+ppd-stamp: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ $(top_srcdir)/src/main/printers.xml $(top_srcdir)/src/main/papers.xml
$(MAKE) ppd-stamp-phony
touch ppd-stamp
@@ -187,29 +171,25 @@ ppd-stamp-pre:
-$(RM) -r ppd
-mkdir ppd
-ppd-nonls: genppd
+ppd-nonls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
for language in C ; do \
mkdir ppd/$$language ; \
echo "$$language:" ; \
- ./genppd --prefix=ppd/$$language ; \
+ LANGUAGE=$$language ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ -p ppd/$$language ; \
done
-ppd-nls: genppd
+ppd-nls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
wdir=`pwd` ; \
cd $(top_builddir)/po ; \
$(MAKE) ; \
$(MAKE) DESTDIR= prefix=$${wdir}/catalog datadir=$${wdir}/catalog/share install
- for language in $(LINGUAS) ; do \
+ for language in `./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ -L -c \`pwd\`/catalog/share/locale` ; do \
mkdir ppd/$$language ; \
echo "$$language:" ; \
- LANGUAGE=$$language ./genppd --prefix=ppd/$$language --catalog=`pwd`/catalog/share/locale ; \
+ LANGUAGE=$$language ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ -p ppd/$$language -c `pwd`/catalog/share/locale ; \
done
$(RM) -r catalog
-$(LIBGIMPPRINT_LIBS):
- cd ../main ; \
- $(MAKE)
-
dist-hook:
for dir in commands ; do \
if test -d $(srcdir)/$$dir ; then \
@@ -228,7 +208,8 @@ clean-local:
## Clean
-CLEANFILES = $(EXTRA_PROGRAMS) ppd-stamp
+CLEANFILES = ppd-stamp
+DISTCLEANFILES = cups-genppdconfig.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ cups-genppdupdate.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = \
diff --git a/src/cups/Makefile.in b/src/cups/Makefile.in
index edffedf..cba2fe5 100644
--- a/src/cups/Makefile.in
+++ b/src/cups/Makefile.in
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated by automake 1.9.5 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,424 +12,652 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
+@SET_MAKE@
-SHELL = @SHELL@
+# Variables
+
+
+
+SOURCES = $(canon_SOURCES) commandtocanon.c $(commandtoepson_SOURCES) $(cups_calibrate_SOURCES) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES) $(epson_SOURCES) $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-
-DESTDIR =
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = ../..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-host_alias = @host_alias@
+build_triplet = @build@
host_triplet = @host@
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/cups-genppdconfig.in $(srcdir)/cups-genppdupdate.in \
+ $(top_srcdir)/scripts/global.mk COPYING
+@BUILD_CUPS_TRUE@bin_PROGRAMS = cups-calibrate$(EXEEXT)
+@BUILD_CUPS_TRUE@sbin_PROGRAMS = cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT)
+@BUILD_CUPS_TRUE@cupsexec_backend_PROGRAMS = epson$(EXEEXT) \
+@BUILD_CUPS_TRUE@ canon$(EXEEXT)
+@BUILD_CUPS_TRUE@cupsexec_filter_PROGRAMS = rastertogutenprint.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT) \
+@BUILD_CUPS_TRUE@ commandtoepson$(EXEEXT) \
+@BUILD_CUPS_TRUE@ commandtocanon$(EXEEXT)
+subdir = src/cups
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
+ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \
+ $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \
+ $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \
+ $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = cups-genppdconfig cups-genppdupdate
+am__installdirs = "$(DESTDIR)$(bindir)" \
+ "$(DESTDIR)$(cupsexec_backenddir)" \
+ "$(DESTDIR)$(cupsexec_filterdir)" "$(DESTDIR)$(sbindir)" \
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pkgdatadir)" \
+ "$(DESTDIR)$(pkgsysconfdir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+cupsexec_backendPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+cupsexec_filterPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS) $(cupsexec_backend_PROGRAMS) \
+ $(cupsexec_filter_PROGRAMS) $(sbin_PROGRAMS)
+am_canon_OBJECTS = canon.$(OBJEXT)
+canon_OBJECTS = $(am_canon_OBJECTS)
+am__DEPENDENCIES_1 =
+canon_DEPENDENCIES = $(am__DEPENDENCIES_1)
+commandtocanon_SOURCES = commandtocanon.c
+commandtocanon_OBJECTS = commandtocanon.$(OBJEXT)
+commandtocanon_LDADD = $(LDADD)
+am_commandtoepson_OBJECTS = commandtoepson.$(OBJEXT)
+commandtoepson_OBJECTS = $(am_commandtoepson_OBJECTS)
+commandtoepson_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_cups_calibrate_OBJECTS = cups-calibrate.$(OBJEXT)
+cups_calibrate_OBJECTS = $(am_cups_calibrate_OBJECTS)
+cups_calibrate_DEPENDENCIES =
+am_cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS = \
+ genppd.$(OBJEXT)
+cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS = $(am_cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS)
+am__DEPENDENCIES_2 = $(top_builddir)/src/main/libgutenprint.la
+cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_DEPENDENCIES = \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_2)
+am_epson_OBJECTS = epson.$(OBJEXT)
+epson_OBJECTS = $(am_epson_OBJECTS)
+epson_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS = \
+ rastertoprinter.$(OBJEXT)
+rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS = $(am_rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS)
+rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_DEPENDENCIES = \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
+sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(sbin_SCRIPTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(canon_SOURCES) commandtocanon.c $(commandtoepson_SOURCES) \
+ $(cups_calibrate_SOURCES) \
+ $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES) \
+ $(epson_SOURCES) \
+ $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES)
+DIST_SOURCES = $(canon_SOURCES) commandtocanon.c \
+ $(commandtoepson_SOURCES) $(cups_calibrate_SOURCES) \
+ $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES) \
+ $(epson_SOURCES) \
+ $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+pkgdataDATA_INSTALL = $(INSTALL_DATA)
+pkgsysconfDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pkgdata_DATA) $(pkgsysconf_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+pkgdatadir = $(cups_conf_datadir)
+pkglibdir = $(cups_conf_serverbin)
+ACLOCAL = @ACLOCAL@
ALL_LINGUAS = @ALL_LINGUAS@
-AS = @AS@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
-BISON_PROG = @BISON_PROG@
-BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
-CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
+BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@
+BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@
+BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@
+BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@
+BUILD_ESCPUTIL_FALSE = @BUILD_ESCPUTIL_FALSE@
+BUILD_ESCPUTIL_TRUE = @BUILD_ESCPUTIL_TRUE@
+BUILD_FOOMATIC_3_FALSE = @BUILD_FOOMATIC_3_FALSE@
+BUILD_FOOMATIC_3_TRUE = @BUILD_FOOMATIC_3_TRUE@
+BUILD_FOOMATIC_FALSE = @BUILD_FOOMATIC_FALSE@
+BUILD_FOOMATIC_TRUE = @BUILD_FOOMATIC_TRUE@
+BUILD_GENPPD_STATIC_FALSE = @BUILD_GENPPD_STATIC_FALSE@
+BUILD_GENPPD_STATIC_TRUE = @BUILD_GENPPD_STATIC_TRUE@
+BUILD_GHOSTSCRIPT_FALSE = @BUILD_GHOSTSCRIPT_FALSE@
+BUILD_GHOSTSCRIPT_TRUE = @BUILD_GHOSTSCRIPT_TRUE@
+BUILD_GIMP2_FALSE = @BUILD_GIMP2_FALSE@
+BUILD_GIMP2_TRUE = @BUILD_GIMP2_TRUE@
+BUILD_GIMP_FALSE = @BUILD_GIMP_FALSE@
+BUILD_GIMP_TRUE = @BUILD_GIMP_TRUE@
+BUILD_LIBGUTENPRINTUI2_FALSE = @BUILD_LIBGUTENPRINTUI2_FALSE@
+BUILD_LIBGUTENPRINTUI2_TRUE = @BUILD_LIBGUTENPRINTUI2_TRUE@
+BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@
+BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@
+BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@
+BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@
+BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@
+BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@
+BUILD_TEST_FALSE = @BUILD_TEST_FALSE@
+BUILD_TEST_TRUE = @BUILD_TEST_TRUE@
+BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@
+BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@
CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
CONVERT = @CONVERT@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CUPS_CFLAGS = @CUPS_CFLAGS@
CUPS_CONFIG = @CUPS_CONFIG@
-CUPS_INSTALL = @CUPS_INSTALL@
-CUPS_MAN = @CUPS_MAN@
+CUPS_LIBS = @CUPS_LIBS@
+CUPS_PPDS_AT_TOP_LEVEL_FALSE = @CUPS_PPDS_AT_TOP_LEVEL_FALSE@
+CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@
CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@
-DATADIRNAME = @DATADIRNAME@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
DB2HTML = @DB2HTML@
DB2PDF = @DB2PDF@
DB2PS = @DB2PS@
-DLLTOOL = @DLLTOOL@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DIALOG = @DIALOG@
+DOXYGEN = @DOXYGEN@
DVIPDF = @DVIPDF@
DVIPS = @DVIPS@
ECHO = @ECHO@
-ESCPUTIL_BIN = @ESCPUTIL_BIN@
-ESCPUTIL_MAN = @ESCPUTIL_MAN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
-FOOMATIC_3_NOINST_BIN = @FOOMATIC_3_NOINST_BIN@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FIND = @FIND@
FOOMATIC_CONFIGURE = @FOOMATIC_CONFIGURE@
-FOOMATIC_INSTALL = @FOOMATIC_INSTALL@
FOOMATIC_KITLOAD = @FOOMATIC_KITLOAD@
-FOOMATIC_NOINST_BIN = @FOOMATIC_NOINST_BIN@
-FOOMATIC_OLDIDS_NOINST_BIN = @FOOMATIC_OLDIDS_NOINST_BIN@
FOOMATIC_PPDFILE = @FOOMATIC_PPDFILE@
-GENCAT = @GENCAT@
-GIMPPRINT_BINARY_AGE = @GIMPPRINT_BINARY_AGE@
-GIMPPRINT_CFLAGS = @GIMPPRINT_CFLAGS@
-GIMPPRINT_CURRENT_INTERFACE = @GIMPPRINT_CURRENT_INTERFACE@
-GIMPPRINT_DEPLIBS = @GIMPPRINT_DEPLIBS@
-GIMPPRINT_INTERFACE_AGE = @GIMPPRINT_INTERFACE_AGE@
-GIMPPRINT_LIBS = @GIMPPRINT_LIBS@
-GIMPPRINT_MAJOR_VERSION = @GIMPPRINT_MAJOR_VERSION@
-GIMPPRINT_MICRO_VERSION = @GIMPPRINT_MICRO_VERSION@
-GIMPPRINT_MINOR_VERSION = @GIMPPRINT_MINOR_VERSION@
-GIMPPRINT_VERSION = @GIMPPRINT_VERSION@
+GENPPD_LIBS = @GENPPD_LIBS@
+GIMP2_CFLAGS = @GIMP2_CFLAGS@
+GIMP2_LIBS = @GIMP2_LIBS@
GIMPTOOL = @GIMPTOOL@
+GIMPTOOL2_CHECK = @GIMPTOOL2_CHECK@
GIMPTOOL_CHECK = @GIMPTOOL_CHECK@
-GIMP_BIN = @GIMP_BIN@
GIMP_CFLAGS = @GIMP_CFLAGS@
GIMP_CFLAGS_NOUI = @GIMP_CFLAGS_NOUI@
GIMP_DATA_DIR = @GIMP_DATA_DIR@
GIMP_LIBS = @GIMP_LIBS@
GIMP_LIBS_NOUI = @GIMP_LIBS_NOUI@
GIMP_PLUGIN_DIR = @GIMP_PLUGIN_DIR@
-GLIBC21 = @GLIBC21@
-GMOFILES = @GMOFILES@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_CONFIG = @GLIB_CONFIG@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
GMSGFMT = @GMSGFMT@
GNUCFLAGS = @GNUCFLAGS@
-IJS_BIN = @IJS_BIN@
+GTK2_CFLAGS = @GTK2_CFLAGS@
+GTK2_LIBS = @GTK2_LIBS@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_CONFIG = @GTK_CONFIG@
+GTK_LIBS = @GTK_LIBS@
+GUTENPRINTUI2_BINARY_AGE = @GUTENPRINTUI2_BINARY_AGE@
+GUTENPRINTUI2_CFLAGS = @GUTENPRINTUI2_CFLAGS@
+GUTENPRINTUI2_CURRENT_INTERFACE = @GUTENPRINTUI2_CURRENT_INTERFACE@
+GUTENPRINTUI2_INTERFACE_AGE = @GUTENPRINTUI2_INTERFACE_AGE@
+GUTENPRINTUI2_LIBDEPS = @GUTENPRINTUI2_LIBDEPS@
+GUTENPRINTUI2_LIBS = $(top_builddir)/src/gutenprintui2/libgutenprintui2.la
+GUTENPRINTUI2_VERSION = @GUTENPRINTUI2_VERSION@
+GUTENPRINTUI_BINARY_AGE = @GUTENPRINTUI_BINARY_AGE@
+GUTENPRINTUI_CFLAGS = @GUTENPRINTUI_CFLAGS@
+GUTENPRINTUI_CURRENT_INTERFACE = @GUTENPRINTUI_CURRENT_INTERFACE@
+GUTENPRINTUI_INTERFACE_AGE = @GUTENPRINTUI_INTERFACE_AGE@
+GUTENPRINTUI_LIBDEPS = @GUTENPRINTUI_LIBDEPS@
+GUTENPRINTUI_LIBS = $(top_builddir)/src/gutenprintui/libgutenprintui.la
+GUTENPRINTUI_VERSION = @GUTENPRINTUI_VERSION@
+GUTENPRINT_BINARY_AGE = @GUTENPRINT_BINARY_AGE@
+GUTENPRINT_CFLAGS = @GUTENPRINT_CFLAGS@
+GUTENPRINT_CURRENT_INTERFACE = @GUTENPRINT_CURRENT_INTERFACE@
+GUTENPRINT_INTERFACE_AGE = @GUTENPRINT_INTERFACE_AGE@
+GUTENPRINT_LIBDEPS = @GUTENPRINT_LIBDEPS@
+
+# Libraries
+GUTENPRINT_LIBS = $(top_builddir)/src/main/libgutenprint.la
+GUTENPRINT_MAJOR_VERSION = @GUTENPRINT_MAJOR_VERSION@
+GUTENPRINT_MICRO_VERSION = @GUTENPRINT_MICRO_VERSION@
+GUTENPRINT_MINOR_VERSION = @GUTENPRINT_MINOR_VERSION@
+GUTENPRINT_VERSION = @GUTENPRINT_VERSION@
IJS_CFLAGS = @IJS_CFLAGS@
IJS_CONFIG = @IJS_CONFIG@
-IJS_INSTALL = @IJS_INSTALL@
IJS_LIBS = @IJS_LIBS@
-INSTOBJEXT = @INSTOBJEXT@
-INTLBISON = @INTLBISON@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SAMPLES_FALSE = @INSTALL_SAMPLES_FALSE@
+INSTALL_SAMPLES_TRUE = @INSTALL_SAMPLES_TRUE@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTALL_USER_GUIDE_FALSE = @INSTALL_USER_GUIDE_FALSE@
+INSTALL_USER_GUIDE_TRUE = @INSTALL_USER_GUIDE_TRUE@
INTLLIBS = @INTLLIBS@
-INTLOBJS = @INTLOBJS@
-INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
+LDFLAGS = @LDFLAGS@
LEX = @LEX@
-LIBGIMPPRINT_LIBS = @LIBGIMPPRINT_LIBS@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBICONV = @LIBICONV@
-LIBM = @LIBM@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
LIBREADLINE_DEPS = @LIBREADLINE_DEPS@
+LIBS = $(INTLLIBS) @LIBS@
LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LN_S = @LN_S@
LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
-LT_AGE = @LT_AGE@
-LT_CURRENT = @LT_CURRENT@
-LT_RELEASE = @LT_RELEASE@
-LT_REVISION = @LT_REVISION@
MAINT = @MAINT@
MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@
-MAIN_BIN = @MAIN_BIN@
-MAIN_DAT = @MAIN_DAT@
-MAIN_MAN = @MAIN_MAN@
-MAIN_SCR = @MAIN_SCR@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
-OBJDUMP = @OBJDUMP@
+MSGMERGE = @MSGMERGE@
OBJEXT = @OBJEXT@
+PACKAGE = cups
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
+PKG_CONFIG = @PKG_CONFIG@
PLUG_IN_PATH = @PLUG_IN_PATH@
-POFILES = @POFILES@
POSUB = @POSUB@
-PRINT_VASPRINTF = @PRINT_VASPRINTF@
RANLIB = @RANLIB@
RELEASE_DATE = @RELEASE_DATE@
RM = @RM@
-SAMPLE_IMAGES = @SAMPLE_IMAGES@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRIP = @STRIP@
-TESTPATTERN_BIN = @TESTPATTERN_BIN@
-TEST_BIN = @TEST_BIN@
TEXI2HTML = @TEXI2HTML@
-USER_GUIDE = @USER_GUIDE@
-USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
+USE_LEVEL3_PS_FALSE = @USE_LEVEL3_PS_FALSE@
+USE_LEVEL3_PS_TRUE = @USE_LEVEL3_PS_TRUE@
USE_NLS = @USE_NLS@
+USE_NLS_FALSE = @USE_NLS_FALSE@
+USE_NLS_TRUE = @USE_NLS_TRUE@
VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
YACC = @YACC@
-YACC_PROG = @YACC_PROG@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @cups_bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
cups_bindir = @cups_bindir@
cups_conf_datadir = @cups_conf_datadir@
cups_conf_serverbin = @cups_conf_serverbin@
cups_conf_serverroot = @cups_conf_serverroot@
cups_exec_prefix = @cups_exec_prefix@
cups_prefix = @cups_prefix@
+cups_sbindir = @cups_sbindir@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+gimp2_plug_indir = @gimp2_plug_indir@
gimp_plug_indir = @gimp_plug_indir@
-gimpprint_cflags = @gimpprint_cflags@
-gimpprint_libs = @gimpprint_libs@
-
+gutenprint_cflags = @gutenprint_cflags@
+gutenprint_libs = @gutenprint_libs@
+gutenprintui2_cflags = @gutenprintui2_cflags@
+gutenprintui2_libs = @gutenprintui2_libs@
+gutenprintui_cflags = @gutenprintui_cflags@
+gutenprintui_libs = @gutenprintui_libs@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @cups_sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
AUTOMAKE_OPTIONS = 1.4 gnu
-
MAINT_CHARSET = latin1
-
-PACKAGE = cups
-
-bindir = @cups_bindir@
-
-pkgdatadir = $(cups_conf_datadir)
-pkglibdir = $(cups_conf_serverbin)
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(LOCAL_CPPFLAGS) $(GNUCFLAGS)
+empty =
pkgsysconfdir = $(cups_conf_serverroot)
-
cupsexec_backenddir = $(pkglibdir)/backend
cupsexec_filterdir = $(pkglibdir)/filter
-cups_modeldir = $(pkgdatadir)/model
-
-AM_CFLAGS = $(GNUCFLAGS)
-DEFS = @CUPS_CFLAGS@ @DEFS@ -I. -I$(srcdir) -I../.. -DCUPS_DATADIR=\"$(pkgdatadir)\" -DGIMP_PRINT_VERSION=\"$(VERSION)\"
-INCLUDES = @INCLUDES@ $(LIBGIMPPRINT_CFLAGS)
-LIBPRINTUT = $(top_builddir)/lib/libprintut.la
-LIBS = $(INTLLIBS) @LIBS@
-
-@BUILD_GENPPD_STATIC_TRUE@STATIC_LDOPTS = -static
-
-CUPS_BIN = cups-calibrate
-CUPS_BACKEND_BIN = epson canon
-CUPS_FILTER_BIN = rastertoprinter commandtoepson commandtocanon
-CUPS_NOINST_BIN = genppd
-
-bin_PROGRAMS = @CUPS_BIN@
-cupsexec_backend_PROGRAMS = @CUPS_BACKEND_BIN@
-cupsexec_filter_PROGRAMS = @CUPS_FILTER_BIN@
-noinst_PROGRAMS = @CUPS_NOINST_BIN@
-
-EXTRA_PROGRAMS = cups-calibrate commandtoepson epson genppd rastertoprinter commandtocanon canon
-
-CUPS_LIBS = @CUPS_LIBS@
-
+@CUPS_PPDS_AT_TOP_LEVEL_FALSE@cups_modeldir = $(pkgdatadir)/model/gutenprint/@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@/
+@CUPS_PPDS_AT_TOP_LEVEL_TRUE@cups_modeldir = $(pkgdatadir)/model/
+@CUPS_PPDS_AT_TOP_LEVEL_TRUE@DONT_UNINSTALL_PPDS = true
+LOCAL_CPPFLAGS = $(GUTENPRINT_CFLAGS) $(CUPS_CFLAGS)
+@BUILD_CUPS_TRUE@sbin_SCRIPTS = cups-genppdconfig.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ cups-genppdupdate.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
+@BUILD_GENPPD_STATIC_TRUE@STATIC_LDOPTS = -static -export-dynamic
cups_calibrate_SOURCES = cups-calibrate.c
-cups_calibrate_LDADD = $(LIBPRINTUT) $(LIBM)
-
+cups_calibrate_LDADD = -lm
commandtoepson_SOURCES = commandtoepson.c
-commandtoepson_LDADD = $(LIBPRINTUT) $(CUPS_LIBS)
-
+commandtoepson_LDADD = $(CUPS_LIBS)
canon_SOURCES = canon.c
-canon_LDADD = $(LIBPRINTUT) $(CUPS_LIBS)
-
+canon_LDADD = $(CUPS_LIBS)
epson_SOURCES = epson.c
-epson_LDADD = $(LIBPRINTUT) $(CUPS_LIBS)
-
-genppd_SOURCES = genppd.c
-genppd_LDADD = $(LIBPRINTUT) $(CUPS_LIBS) $(LIBGIMPPRINT_LIBS)
-genppd_LDFLAGS = $(STATIC_LDOPTS)
-genppd_DEPENDENCIES = $(LIBGIMPPRINT_LIBS)
-
-rastertoprinter_SOURCES = rastertoprinter.c
-rastertoprinter_LDADD = $(LIBPRINTUT) $(CUPS_LIBS) $(LIBGIMPPRINT_LIBS)
-rastertoprinter_LDFLAGS = $(STATIC_LDOPTS)
-rastertoprinter_DEPENDENCIES = $(LIBGIMPPRINT_LIBS)
-
-CUPS_PKG = calibrate.ppm
-CUPS_CONF = command.types
-
-pkgdata_DATA = @CUPS_PKG@
-pkgsysconf_DATA = @CUPS_CONF@
-
-@BUILD_CUPS_TRUE@INSTALL_DATA_LOCAL_DEPS = ppd
-
-@BUILD_TRANSLATED_PPDS_TRUE@PPD_NLS = $(PPD_NLS_1)
-@BUILD_TRANSLATED_PPDS_TRUE@LINGUAS = $(ALL_LINGUAS)
-
+epson_LDADD = $(CUPS_LIBS)
+cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES = genppd.c
+cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD = $(CUPS_LIBS) $(GENPPD_LIBS) $(GUTENPRINT_LIBS)
+cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS = $(STATIC_LDOPTS)
+rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES = rastertoprinter.c
+rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD = $(CUPS_LIBS) $(GUTENPRINT_LIBS)
+rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS = $(STATIC_LDOPTS)
+@BUILD_CUPS_TRUE@CUPS_PKG = calibrate.ppm
+@BUILD_CUPS_TRUE@CUPS_CONF = command.types
+pkgdata_DATA = $(CUPS_PKG)
+pkgsysconf_DATA = $(CUPS_CONF)
+@BUILD_CUPS_PPDS_TRUE@INSTALL_DATA_LOCAL_DEPS = ppd-stamp
+@BUILD_TRANSLATED_CUPS_PPDS_TRUE@PPD_NLS = $(PPD_NLS_1)
+@BUILD_TRANSLATED_CUPS_PPDS_TRUE@LINGUAS = $(ALL_LINGUAS)
@USE_NLS_TRUE@PPD_NLS_1 = ppd-nls
-
-CLEANFILES = $(EXTRA_PROGRAMS) ppd-stamp
+CLEANFILES = ppd-stamp
+DISTCLEANFILES = cups-genppdconfig.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ cups-genppdupdate.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
MAINTAINERCLEANFILES = Makefile.in
+EXTRA_DIST = \
+ COPYING \
+ README \
+ calibrate.ppm \
+ command.txt \
+ command.types
-EXTRA_DIST = COPYING README calibrate.ppm command.txt command.types
-
-mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs
-CONFIG_HEADER = ../../config.h
-CONFIG_CLEAN_FILES =
-bin_PROGRAMS = @CUPS_BIN@
-cupsexec_backend_PROGRAMS = @CUPS_BACKEND_BIN@
-cupsexec_filter_PROGRAMS = @CUPS_FILTER_BIN@
-noinst_PROGRAMS = @CUPS_NOINST_BIN@
-PROGRAMS = $(bin_PROGRAMS) $(cupsexec_backend_PROGRAMS) \
-$(cupsexec_filter_PROGRAMS) $(noinst_PROGRAMS)
-
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-cups_calibrate_OBJECTS = cups-calibrate.$(OBJEXT)
-cups_calibrate_DEPENDENCIES = $(top_builddir)/lib/libprintut.la
-cups_calibrate_LDFLAGS =
-commandtoepson_OBJECTS = commandtoepson.$(OBJEXT)
-commandtoepson_DEPENDENCIES = $(top_builddir)/lib/libprintut.la
-commandtoepson_LDFLAGS =
-epson_OBJECTS = epson.$(OBJEXT)
-epson_DEPENDENCIES = $(top_builddir)/lib/libprintut.la
-epson_LDFLAGS =
-genppd_OBJECTS = genppd.$(OBJEXT)
-rastertoprinter_OBJECTS = rastertoprinter.$(OBJEXT)
-commandtocanon_SOURCES = commandtocanon.c
-commandtocanon_OBJECTS = commandtocanon.$(OBJEXT)
-commandtocanon_LDADD = $(LDADD)
-commandtocanon_DEPENDENCIES =
-commandtocanon_LDFLAGS =
-canon_OBJECTS = canon.$(OBJEXT)
-canon_DEPENDENCIES = $(top_builddir)/lib/libprintut.la
-canon_LDFLAGS =
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-DATA = $(pkgdata_DATA) $(pkgsysconf_DATA)
-
-DIST_COMMON = README COPYING Makefile.am Makefile.in
-
+all: all-am
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP_ENV = --best
-SOURCES = $(cups_calibrate_SOURCES) $(commandtoepson_SOURCES) $(epson_SOURCES) $(genppd_SOURCES) $(rastertoprinter_SOURCES) commandtocanon.c $(canon_SOURCES)
-OBJECTS = $(cups_calibrate_OBJECTS) $(commandtoepson_OBJECTS) $(epson_OBJECTS) $(genppd_OBJECTS) $(rastertoprinter_OBJECTS) commandtocanon.$(OBJEXT) $(canon_OBJECTS)
-
-all: all-redirect
.SUFFIXES:
-.SUFFIXES: .S .c .lo .o .obj .s
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/cups/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-mostlyclean-binPROGRAMS:
-
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-
-distclean-binPROGRAMS:
-
-maintainer-clean-binPROGRAMS:
-
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/scripts/global.mk $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cups/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/cups/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+cups-genppdconfig: $(top_builddir)/config.status $(srcdir)/cups-genppdconfig.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+cups-genppdupdate: $(top_builddir)/config.status $(srcdir)/cups-genppdupdate.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(bindir)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
- list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
-mostlyclean-cupsexec_backendPROGRAMS:
-
-clean-cupsexec_backendPROGRAMS:
- -test -z "$(cupsexec_backend_PROGRAMS)" || rm -f $(cupsexec_backend_PROGRAMS)
-
-distclean-cupsexec_backendPROGRAMS:
-
-maintainer-clean-cupsexec_backendPROGRAMS:
-
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
install-cupsexec_backendPROGRAMS: $(cupsexec_backend_PROGRAMS)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(cupsexec_backenddir)
+ test -z "$(cupsexec_backenddir)" || $(mkdir_p) "$(DESTDIR)$(cupsexec_backenddir)"
@list='$(cupsexec_backend_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(cupsexec_backenddir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(cupsexec_backenddir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(cupsexec_backendPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(cupsexec_backenddir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(cupsexec_backendPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(cupsexec_backenddir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-cupsexec_backendPROGRAMS:
@$(NORMAL_UNINSTALL)
- list='$(cupsexec_backend_PROGRAMS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(cupsexec_backenddir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ @list='$(cupsexec_backend_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(cupsexec_backenddir)/$$f'"; \
+ rm -f "$(DESTDIR)$(cupsexec_backenddir)/$$f"; \
done
-mostlyclean-cupsexec_filterPROGRAMS:
-
-clean-cupsexec_filterPROGRAMS:
- -test -z "$(cupsexec_filter_PROGRAMS)" || rm -f $(cupsexec_filter_PROGRAMS)
-
-distclean-cupsexec_filterPROGRAMS:
-
-maintainer-clean-cupsexec_filterPROGRAMS:
-
+clean-cupsexec_backendPROGRAMS:
+ @list='$(cupsexec_backend_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
install-cupsexec_filterPROGRAMS: $(cupsexec_filter_PROGRAMS)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(cupsexec_filterdir)
+ test -z "$(cupsexec_filterdir)" || $(mkdir_p) "$(DESTDIR)$(cupsexec_filterdir)"
@list='$(cupsexec_filter_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(cupsexec_filterdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(cupsexec_filterdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(cupsexec_filterPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(cupsexec_filterdir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(cupsexec_filterPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(cupsexec_filterdir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-cupsexec_filterPROGRAMS:
@$(NORMAL_UNINSTALL)
- list='$(cupsexec_filter_PROGRAMS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(cupsexec_filterdir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ @list='$(cupsexec_filter_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(cupsexec_filterdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(cupsexec_filterdir)/$$f"; \
done
-mostlyclean-noinstPROGRAMS:
-
-clean-noinstPROGRAMS:
- -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-
-distclean-noinstPROGRAMS:
-
-maintainer-clean-noinstPROGRAMS:
-
-.c.o:
- $(COMPILE) -c $<
+clean-cupsexec_filterPROGRAMS:
+ @list='$(cupsexec_filter_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
-# FIXME: We should only use cygpath when building on Windows,
-# and only if it is available.
-.c.obj:
- $(COMPILE) -c `cygpath -w $<`
+uninstall-sbinPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(sbindir)/$$f"; \
+ done
-.s.o:
- $(COMPILE) -c $<
+clean-sbinPROGRAMS:
+ @list='$(sbin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+canon$(EXEEXT): $(canon_OBJECTS) $(canon_DEPENDENCIES)
+ @rm -f canon$(EXEEXT)
+ $(LINK) $(canon_LDFLAGS) $(canon_OBJECTS) $(canon_LDADD) $(LIBS)
+commandtocanon$(EXEEXT): $(commandtocanon_OBJECTS) $(commandtocanon_DEPENDENCIES)
+ @rm -f commandtocanon$(EXEEXT)
+ $(LINK) $(commandtocanon_LDFLAGS) $(commandtocanon_OBJECTS) $(commandtocanon_LDADD) $(LIBS)
+commandtoepson$(EXEEXT): $(commandtoepson_OBJECTS) $(commandtoepson_DEPENDENCIES)
+ @rm -f commandtoepson$(EXEEXT)
+ $(LINK) $(commandtoepson_LDFLAGS) $(commandtoepson_OBJECTS) $(commandtoepson_LDADD) $(LIBS)
+cups-calibrate$(EXEEXT): $(cups_calibrate_OBJECTS) $(cups_calibrate_DEPENDENCIES)
+ @rm -f cups-calibrate$(EXEEXT)
+ $(LINK) $(cups_calibrate_LDFLAGS) $(cups_calibrate_OBJECTS) $(cups_calibrate_LDADD) $(LIBS)
+cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT): $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_DEPENDENCIES)
+ @rm -f cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT)
+ $(LINK) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD) $(LIBS)
+epson$(EXEEXT): $(epson_OBJECTS) $(epson_DEPENDENCIES)
+ @rm -f epson$(EXEEXT)
+ $(LINK) $(epson_LDFLAGS) $(epson_OBJECTS) $(epson_LDADD) $(LIBS)
+rastertogutenprint.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT): $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS) $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_DEPENDENCIES)
+ @rm -f rastertogutenprint.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT)
+ $(LINK) $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS) $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS) $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD) $(LIBS)
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
+ @list='$(sbin_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
+ $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \
+ else :; fi; \
+ done
-.S.o:
- $(COMPILE) -c $<
+uninstall-sbinSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(sbin_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(sbindir)/$$f"; \
+ done
mostlyclean-compile:
- -rm -f *.o core *.core
-rm -f *.$(OBJEXT)
-clean-compile:
-
distclean-compile:
-rm -f *.tab.c
-maintainer-clean-compile:
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canon.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commandtocanon.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commandtoepson.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cups-calibrate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epson.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genppd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rastertoprinter.Po@am__quote@
-.c.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
-.s.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-.S.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
@@ -436,241 +666,263 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-
-maintainer-clean-libtool:
-
-cups-calibrate$(EXEEXT): $(cups_calibrate_OBJECTS) $(cups_calibrate_DEPENDENCIES)
- @rm -f cups-calibrate$(EXEEXT)
- $(LINK) $(cups_calibrate_LDFLAGS) $(cups_calibrate_OBJECTS) $(cups_calibrate_LDADD) $(LIBS)
-
-commandtoepson$(EXEEXT): $(commandtoepson_OBJECTS) $(commandtoepson_DEPENDENCIES)
- @rm -f commandtoepson$(EXEEXT)
- $(LINK) $(commandtoepson_LDFLAGS) $(commandtoepson_OBJECTS) $(commandtoepson_LDADD) $(LIBS)
-
-epson$(EXEEXT): $(epson_OBJECTS) $(epson_DEPENDENCIES)
- @rm -f epson$(EXEEXT)
- $(LINK) $(epson_LDFLAGS) $(epson_OBJECTS) $(epson_LDADD) $(LIBS)
-
-genppd$(EXEEXT): $(genppd_OBJECTS) $(genppd_DEPENDENCIES)
- @rm -f genppd$(EXEEXT)
- $(LINK) $(genppd_LDFLAGS) $(genppd_OBJECTS) $(genppd_LDADD) $(LIBS)
-
-rastertoprinter$(EXEEXT): $(rastertoprinter_OBJECTS) $(rastertoprinter_DEPENDENCIES)
- @rm -f rastertoprinter$(EXEEXT)
- $(LINK) $(rastertoprinter_LDFLAGS) $(rastertoprinter_OBJECTS) $(rastertoprinter_LDADD) $(LIBS)
-
-commandtocanon$(EXEEXT): $(commandtocanon_OBJECTS) $(commandtocanon_DEPENDENCIES)
- @rm -f commandtocanon$(EXEEXT)
- $(LINK) $(commandtocanon_LDFLAGS) $(commandtocanon_OBJECTS) $(commandtocanon_LDADD) $(LIBS)
-
-canon$(EXEEXT): $(canon_OBJECTS) $(canon_DEPENDENCIES)
- @rm -f canon$(EXEEXT)
- $(LINK) $(canon_LDFLAGS) $(canon_OBJECTS) $(canon_LDADD) $(LIBS)
-
+ -rm -f libtool
+uninstall-info-am:
install-pkgdataDATA: $(pkgdata_DATA)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
+ test -z "$(pkgdatadir)" || $(mkdir_p) "$(DESTDIR)$(pkgdatadir)"
@list='$(pkgdata_DATA)'; for p in $$list; do \
- if test -f $(srcdir)/$$p; then \
- echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p"; \
- $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p; \
- else if test -f $$p; then \
- echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p"; \
- $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \
- fi; fi; \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
uninstall-pkgdataDATA:
@$(NORMAL_UNINSTALL)
- list='$(pkgdata_DATA)'; for p in $$list; do \
- rm -f $(DESTDIR)$(pkgdatadir)/$$p; \
+ @list='$(pkgdata_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
-
install-pkgsysconfDATA: $(pkgsysconf_DATA)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
+ test -z "$(pkgsysconfdir)" || $(mkdir_p) "$(DESTDIR)$(pkgsysconfdir)"
@list='$(pkgsysconf_DATA)'; for p in $$list; do \
- if test -f $(srcdir)/$$p; then \
- echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgsysconfdir)/$$p"; \
- $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgsysconfdir)/$$p; \
- else if test -f $$p; then \
- echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgsysconfdir)/$$p"; \
- $(INSTALL_DATA) $$p $(DESTDIR)$(pkgsysconfdir)/$$p; \
- fi; fi; \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(pkgsysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgsysconfdir)/$$f'"; \
+ $(pkgsysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgsysconfdir)/$$f"; \
done
uninstall-pkgsysconfDATA:
@$(NORMAL_UNINSTALL)
- list='$(pkgsysconf_DATA)'; for p in $$list; do \
- rm -f $(DESTDIR)$(pkgsysconfdir)/$$p; \
+ @list='$(pkgsysconf_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgsysconfdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgsysconfdir)/$$f"; \
done
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
-mostlyclean-tags:
-
-clean-tags:
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-
-subdir = src/cups
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
+ $(mkdir_p) $(distdir)/../../scripts
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- cp -pr $$/$$file $(distdir)/$$file; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
- $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
-canon.o: canon.c
-commandtocanon.o: commandtocanon.c
-commandtoepson.o: commandtoepson.c
-cups-calibrate.o: cups-calibrate.c
-epson.o: epson.c ../../config.h
-genppd.o: genppd.c ../../config.h ../../include/gimp-print/gimp-print.h \
- ../../include/gimp-print/gimp-print-intl.h \
- ../../lib/libprintut.h ../../lib/xmalloc.h
-rastertoprinter.o: rastertoprinter.c \
- ../../include/gimp-print/gimp-print.h ../../lib/libprintut.h \
- ../../config.h ../../lib/xmalloc.h
-
-info-am:
-info: info-am
-dvi-am:
-dvi: dvi-am
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-install-exec-am: install-binPROGRAMS install-cupsexec_backendPROGRAMS \
- install-cupsexec_filterPROGRAMS
+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) all-local
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cupsexec_backenddir)" "$(DESTDIR)$(cupsexec_filterdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgsysconfdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
install-exec: install-exec-am
-
-install-data-am: install-pkgdataDATA install-pkgsysconfDATA \
- install-data-local
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-data-hook
install-data: install-data-am
+uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
-uninstall-am: uninstall-binPROGRAMS uninstall-cupsexec_backendPROGRAMS \
- uninstall-cupsexec_filterPROGRAMS uninstall-pkgdataDATA \
- uninstall-pkgsysconfDATA uninstall-local
-uninstall: uninstall-am
-all-am: Makefile $(PROGRAMS) $(DATA) all-local
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(cupsexec_backenddir) \
- $(DESTDIR)$(cupsexec_filterdir) $(DESTDIR)$(pkgdatadir) \
- $(DESTDIR)$(pkgsysconfdir)
-
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-mostlyclean-am: mostlyclean-binPROGRAMS \
- mostlyclean-cupsexec_backendPROGRAMS \
- mostlyclean-cupsexec_filterPROGRAMS \
- mostlyclean-noinstPROGRAMS mostlyclean-compile \
- mostlyclean-libtool mostlyclean-tags \
- mostlyclean-generic
+clean: clean-am
-mostlyclean: mostlyclean-am
+clean-am: clean-binPROGRAMS clean-cupsexec_backendPROGRAMS \
+ clean-cupsexec_filterPROGRAMS clean-generic clean-libtool \
+ clean-local clean-sbinPROGRAMS mostlyclean-am
-clean-am: clean-binPROGRAMS clean-cupsexec_backendPROGRAMS \
- clean-cupsexec_filterPROGRAMS clean-noinstPROGRAMS \
- clean-compile clean-libtool clean-tags clean-generic \
- mostlyclean-am clean-local
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
-clean: clean-am
+dvi: dvi-am
-distclean-am: distclean-binPROGRAMS distclean-cupsexec_backendPROGRAMS \
- distclean-cupsexec_filterPROGRAMS \
- distclean-noinstPROGRAMS distclean-compile \
- distclean-libtool distclean-tags distclean-generic \
- clean-am
- -rm -f libtool
+dvi-am:
-distclean: distclean-am
+html: html-am
-maintainer-clean-am: maintainer-clean-binPROGRAMS \
- maintainer-clean-cupsexec_backendPROGRAMS \
- maintainer-clean-cupsexec_filterPROGRAMS \
- maintainer-clean-noinstPROGRAMS \
- maintainer-clean-compile maintainer-clean-libtool \
- maintainer-clean-tags maintainer-clean-generic \
- distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-pkgdataDATA \
+ install-pkgsysconfDATA
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+
+install-exec-am: install-binPROGRAMS install-cupsexec_backendPROGRAMS \
+ install-cupsexec_filterPROGRAMS install-sbinPROGRAMS \
+ install-sbinSCRIPTS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
-.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
-maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
-mostlyclean-cupsexec_backendPROGRAMS distclean-cupsexec_backendPROGRAMS \
-clean-cupsexec_backendPROGRAMS \
-maintainer-clean-cupsexec_backendPROGRAMS \
-uninstall-cupsexec_backendPROGRAMS install-cupsexec_backendPROGRAMS \
-mostlyclean-cupsexec_filterPROGRAMS distclean-cupsexec_filterPROGRAMS \
-clean-cupsexec_filterPROGRAMS maintainer-clean-cupsexec_filterPROGRAMS \
-uninstall-cupsexec_filterPROGRAMS install-cupsexec_filterPROGRAMS \
-mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
-clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile mostlyclean-libtool distclean-libtool \
-clean-libtool maintainer-clean-libtool uninstall-pkgdataDATA \
-install-pkgdataDATA uninstall-pkgsysconfDATA install-pkgsysconfDATA \
-tags mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
-distdir info-am info dvi-am dvi check check-am installcheck-am \
-installcheck install-exec-am install-exec install-data-local \
-install-data-am install-data install-am install uninstall-local \
-uninstall-am uninstall all-local all-redirect all-am all installdirs \
-mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-cupsexec_backendPROGRAMS \
+ uninstall-cupsexec_filterPROGRAMS uninstall-info-am \
+ uninstall-local uninstall-pkgdataDATA uninstall-pkgsysconfDATA \
+ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS
+
+.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \
+ clean-binPROGRAMS clean-cupsexec_backendPROGRAMS \
+ clean-cupsexec_filterPROGRAMS clean-generic clean-libtool \
+ clean-local clean-sbinPROGRAMS ctags dist-hook distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-binPROGRAMS \
+ install-cupsexec_backendPROGRAMS \
+ install-cupsexec_filterPROGRAMS install-data install-data-am \
+ install-data-hook install-data-local install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-pkgdataDATA install-pkgsysconfDATA \
+ install-sbinPROGRAMS install-sbinSCRIPTS install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-cupsexec_backendPROGRAMS \
+ uninstall-cupsexec_filterPROGRAMS uninstall-info-am \
+ uninstall-local uninstall-pkgdataDATA uninstall-pkgsysconfDATA \
+ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS
@SET_MAKE@
+export STP_MODULE_PATH = $(top_builddir)/src/main/.libs:$(top_builddir)/src/main
+export STP_DATA_PATH = $(top_srcdir)/src/main
+
+# Rules
+
+$(top_builddir)/src/main/libgutenprint.la:
+ cd $(top_builddir)/src/main; \
+ $(MAKE)
+
+$(top_builddir)/src/gutenprintui/libgutenprintui.la:
+ cd $(top_builddir)/src/gutenprintui; \
+ $(MAKE)
+
+$(top_builddir)/src/gutenprintui2/libgutenprintui2.la:
+ cd $(top_builddir)/src/gutenprintui2; \
+ $(MAKE)
+
+cups-genppdconfig.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@: $(top_builddir)/config.status cups-genppdconfig.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/cups-genppdconfig
+cups-genppdupdate.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@: $(top_builddir)/config.status cups-genppdupdate.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/cups-genppdupdate
+
install-data-local: $(INSTALL_DATA_LOCAL_DEPS)
if test -n "$(INSTALL_DATA_LOCAL_DEPS)" ; then \
$(mkinstalldirs) $(DESTDIR)$(cups_modeldir); \
@@ -687,34 +939,13 @@ install-data-local: $(INSTALL_DATA_LOCAL_DEPS)
fi
uninstall-local: $(INSTALL_DATA_LOCAL_DEPS)
- if test -n "$(INSTALL_DATA_LOCAL_DEPS)" ; then \
- for language in C $(LINGUAS) ; do \
- echo "Removing $$language locale PPD files..." ; \
- for ppdfile in ppd/$$language/* ; do \
- if test -f "$(DESTDIR)$(cups_modeldir)/$$language/`basename $$ppdfile`" ; then \
- $(RM) -f $(DESTDIR)$(cups_modeldir)/$$language/`basename $$ppdfile` ; \
- fi ; \
- done; \
- done \
+# Remove PPDs installed in new PPD location
+ if test -z "DONT_UNINSTALL_PPDS" ; then \
+ if test -n "$(INSTALL_DATA_LOCAL_DEPS)" ; then \
+ $(RM) -fr $(DESTDIR)$(cups_modeldir)/* ; \
+ fi \
fi
-refresh-data-local: ppd
- cd ppd ; \
- files=`find . -name '*.ppd*' -exec basename '{}' \; | sort | uniq` ; \
- for language in . de en es fr it ; do \
- for f in $$files ; do \
- ff="$(DESTDIR)/$(cups_modeldir)/$$language/$$f" ; \
- if [ -f "$$ff" ] ; then \
- echo "Removing $$ff" ; \
- $(RM) "$$ff" ; \
- fi ; \
- if [ -f "$$ff" ] ; then \
- echo "Unable to remove $$ff" 1>&2 ; \
- exit 1 ; \
- fi ; \
- done; \
- done
-
install-data-hook:
# Remove unused directories in install tree
-@echo 'Expect a number of "rmdir: Directory not empty" warnings'
@@ -736,7 +967,7 @@ all-local: $(INSTALL_DATA_LOCAL_DEPS)
ppd: ppd-stamp
-ppd-stamp: genppd
+ppd-stamp: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ $(top_srcdir)/src/main/printers.xml $(top_srcdir)/src/main/papers.xml
$(MAKE) ppd-stamp-phony
touch ppd-stamp
@@ -746,29 +977,25 @@ ppd-stamp-pre:
-$(RM) -r ppd
-mkdir ppd
-ppd-nonls: genppd
+ppd-nonls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
for language in C ; do \
mkdir ppd/$$language ; \
echo "$$language:" ; \
- ./genppd --prefix=ppd/$$language ; \
+ LANGUAGE=$$language ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ -p ppd/$$language ; \
done
-ppd-nls: genppd
+ppd-nls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@
wdir=`pwd` ; \
cd $(top_builddir)/po ; \
$(MAKE) ; \
$(MAKE) DESTDIR= prefix=$${wdir}/catalog datadir=$${wdir}/catalog/share install
- for language in $(LINGUAS) ; do \
+ for language in `./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ -L -c \`pwd\`/catalog/share/locale` ; do \
mkdir ppd/$$language ; \
echo "$$language:" ; \
- LANGUAGE=$$language ./genppd --prefix=ppd/$$language --catalog=`pwd`/catalog/share/locale ; \
+ LANGUAGE=$$language ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ -p ppd/$$language -c `pwd`/catalog/share/locale ; \
done
$(RM) -r catalog
-$(LIBGIMPPRINT_LIBS):
- cd ../main ; \
- $(MAKE)
-
dist-hook:
for dir in commands ; do \
if test -d $(srcdir)/$$dir ; then \
@@ -783,7 +1010,6 @@ dist-hook:
clean-local:
-$(RM) -r ppd
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/src/cups/README b/src/cups/README
index 812dd6a..5deadb2 100644
--- a/src/cups/README
+++ b/src/cups/README
@@ -1,13 +1,13 @@
-README.txt - 11/21/2001 - CUPS Drivers based on Gimp-Print
+README.txt - 11/21/2001 - CUPS Drivers based on Gutenprint
----------------------------------------------------------
-This file describes the CUPS drivers based on the Gimp-Print project.
+This file describes the CUPS drivers based on the Gutenprint project.
Note: to use these drivers you must have CUPS 1.1.9 or higher. We
recommend use of CUPS 1.1.12 or higher.
All code is Copyright 1997-2001 by Easy Software Products and/or the
-Gimp-Print project and is provided under the terms of the GNU General
+Gutenprint project and is provided under the terms of the GNU General
Public License. The licensing details are provided in the file
"LICENSE.txt".
@@ -15,7 +15,7 @@ Public License. The licensing details are provided in the file
INTRODUCTION
The CUPS drivers contain all of the files needed to support
-photo-quality printing on any printer supported by the Gimp-Print
+photo-quality printing on any printer supported by the Gutenprint
project. You can find out more about the Common UNIX Printing System
("CUPS"), an IPP-based printing system for UNIX/Linux, at:
@@ -51,14 +51,14 @@ your driver until a final profile is produced.
The second is called "genppd" which generates PPD files. These PPD
files are created in several languages. The program reads printer
-driver information from the Gimp-Print driver database and produces a
+driver information from the Gutenprint driver database and produces a
PPD file for each driver. Normally, users do not have to use this
tool directly; it is run automatically in the build process.
WHAT DRIVERS ARE INCLUDED?
-We support all of the Gimp-Print drivers supported by the project. The
+We support all of the Gutenprint drivers supported by the project. The
Canon and EPSON drivers also support simple printer commands to do head
cleaning, test prints, and alignment, as well as an EPSON-specific
backend that provides ink level information to the user.
@@ -91,7 +91,7 @@ WHO DO I CONTACT TO GET HELP?
For support issues, you should contact
gimp-print-devel@sourceforge.net, the developer mailing list for the
-Gimp-Print project in general.
+Gutenprint project in general.
The primary author of this driver is Michael Sweet of Easy Software
Products (mike@easysw.com). Mike is also the main developer for CUPS.
diff --git a/src/cups/cups-calibrate.c b/src/cups/cups-calibrate.c
index bf0c089..20e8f49 100644
--- a/src/cups/cups-calibrate.c
+++ b/src/cups/cups-calibrate.c
@@ -1,5 +1,5 @@
/*
- * "$Id: cups-calibrate.c,v 1.2 2001/08/13 23:59:12 rlk Exp $"
+ * "$Id: cups-calibrate.c,v 1.5 2004/09/17 18:38:10 rleigh Exp $"
*
* Super simple color calibration program for the Common UNIX
* Printing System.
@@ -32,6 +32,9 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -98,14 +101,14 @@ main(int argc,
puts("Copyright 1999-2000 by Easy Software Products, All Rights Reserved.");
puts("");
puts("This program allows you to calibrate the color output of printers");
- puts("using the GIMP-Print CUPS or ESP Print Pro drivers.");
+ puts("using the Gutenprint CUPS or ESP Print Pro drivers.");
puts("");
- puts("Please note that this program ONLY works with the GIMP-Print CUPS or");
- puts("ESP Print Pro drivers. If you are using the GIMP-Print stp driver of");
- puts("GhostScript or the drivers of the GIMP-Print plug-in of GIMP, this");
+ puts("Please note that this program ONLY works with the Gutenprint CUPS or");
+ puts("ESP Print Pro drivers. If you are using the Gimp-Print stp driver of");
+ puts("GhostScript or the drivers of the Print plug-in for the GIMP, this");
puts("calibration will not work.");
puts("");
- puts("These drivers by the text \"CUPS+GIMP-print\" or \"ESP Print Pro\" in");
+ puts("These drivers by the text \"CUPS+Gutenprint\" or \"ESP Print Pro\" in");
puts("the model description displayed by the CUPS web interface, KUPS,");
puts("the ESP Print Pro Printer Manager, or printerdrake.");
puts("");
diff --git a/src/cups/cups-genppdconfig.in b/src/cups/cups-genppdconfig.in
new file mode 100644
index 0000000..869dc96
--- /dev/null
+++ b/src/cups/cups-genppdconfig.in
@@ -0,0 +1,616 @@
+#! @PERL@ -w
+# $Id: cups-genppdconfig.in,v 1.11 2005/05/05 10:36:58 rleigh Exp $
+# A user-friendly dialog-based wrapper for cups-genppd(8).
+# Copyright (C) 2002 Roger Leigh <rleigh@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+use strict;
+use File::Basename;
+use File::Find;
+use File::Temp qw(tempfile unlink0);
+use IO::Handle;
+use Getopt::Std;
+use POSIX;
+use Locale::gettext;
+
+sub init_data();
+sub init_defaults();
+sub main_menu();
+sub display_help;
+sub choose_printers;
+sub choose_languages;
+sub choose_location;
+sub create_ppds;
+sub create_dir($);
+sub dialog_read($$);
+sub dialog_read_list (\%\@$$);
+sub perl_menu ($$$$@);
+sub perl_menu_read_list (\%\@$$);
+sub perl_menu_mult ($$@);
+
+my $DIALOG = "@DIALOG@"; # version of dialog to call
+my $use_dialog = 0; # whether to use dialog
+my $BACKTITLE = "Gutenprint CUPS PPD creation"; # dialog screen title
+my %printers; # master list of printers
+my %languages; # master list of languages
+my @used_printers; # printer PPDs on system
+my @used_languages; # languages used on system
+my @chosen_printers = (); # chosen printers
+my @chosen_languages = (); # chosen languages
+my $version = "@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@";
+my $chosen_location = "@cups_conf_datadir@/model/gutenprint/$version";
+ # chosen PPD prefix
+my $silent = 0; # no dialog
+
+
+# Set chosen_location from command-line.
+our $opt_d;
+our $opt_u;
+getopts('d:u');
+if ($opt_d) {
+ $chosen_location = create_dir($opt_d);
+}
+
+# Initialise everything
+init_data();
+init_defaults();
+
+# Run non-interactively if `-u' was specified.
+if ( $opt_u ) {
+ $silent = 1;
+ create_ppds;
+ exit 0;
+}
+
+# Can we use dialog?
+if (-x $DIALOG) {
+ $use_dialog = 1;
+} else {
+ BEGIN { $Curses::OldCurses = 1; }
+ use Curses;
+ use perlmenu;
+ perl_menu_defaults();
+}
+
+while (my $option = main_menu()) { # Display main menu and run selection
+ if ($option eq "Help") {
+ display_help();
+ } elsif ($option eq "Printers") {
+ choose_printers();
+ } elsif ($option eq "Languages") {
+ choose_languages();
+ } elsif ($option eq "Directory") {
+ choose_location();
+ } elsif ($option eq "Create") {
+ create_ppds();
+ } elsif ($option eq "Exit") {
+ exit 0;
+ } else {
+ die "Invalid menu option: $option";
+ }
+}
+
+exit 0;
+
+
+#
+# init_data() - Populate master printer and language hashes.
+#
+sub init_data() {
+ my $model;
+ my $desc;
+ my $lang;
+# Get printer drivers and descriptions, then store in a hash.
+ open GENPPD, "cups-genppd.$version -M -v |" or die "can't fork cups-genppd.$version: $!";
+ while (<GENPPD>) {
+ ($model, $desc) = /([\w-]+)\W+(.*)/;
+ chomp ($model);
+ chomp ($desc);
+ $printers{$model} = $desc;
+ }
+ close GENPPD or die "can't close cups-genppd.$version pipe: $!";
+# Get available languages, then store in hash.
+ open GENPPD, "cups-genppd.$version -L |" or die "can't fork cups-genppd.$version: $!";
+ while (<GENPPD>) {
+ $lang = $_;
+ chomp ($lang);
+ $languages{$lang} = "(No description)";
+ }
+ $languages{"en"} = "US English";
+ close GENPPD or die "can't close cups-genppd.$version pipe: $!";
+# Set defaults
+ @chosen_languages = ("en");
+}
+
+
+#
+# init_defaults() - Get defaults from PPD files and directories.
+#
+sub init_defaults() {
+ # Find all PPD files that we could regenerate
+ my %found_ppds;
+ if (-d $chosen_location) {
+ find({wanted => \&find_printers}, $chosen_location);
+ foreach (@used_printers) {
+ my $tmp;
+ $tmp = basename($_);
+ chomp ($tmp);
+ $tmp =~ s/(^.*)\.ppd.*/$1/;
+ $found_ppds{$tmp} = "" if $printers{$tmp};
+ }
+ }
+ @chosen_printers = ();
+ foreach (sort keys %found_ppds) {
+ push @chosen_printers, $_;
+ }
+
+ # Find all language directories that could be used
+ my %found_langs;
+ if (-d $chosen_location) {
+ find({wanted => \&find_languages}, $chosen_location);
+ foreach (@used_languages) {
+ my $tmp;
+ $tmp = basename($_);
+ chomp ($tmp);
+ $found_langs{$tmp} = "" if $languages{$tmp};
+ }
+ }
+ @chosen_languages = ();
+ foreach (sort keys %found_langs) {
+ push @chosen_languages, $_;
+ }
+ if (! @chosen_languages) {
+ push @chosen_languages, "en";
+ }
+}
+
+
+#
+# find-*() - callbacks for File::Find::find().
+#
+sub find_printers {
+ my ($dev,$ino,$mode,$nlink,$uid,$gid);
+
+ (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
+ -f _ &&
+ /^.*\.ppd.*\z/s && push @used_printers, $_;
+}
+
+sub find_languages {
+ my ($dev,$ino,$mode,$nlink,$uid,$gid);
+
+ (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
+ -d _ && push @used_languages, $_;
+}
+
+
+# string
+# main_menu() - Display main menu.
+# Return string containing selection.
+#
+sub main_menu() {
+ my $option;
+ my @menu_options;
+ my $menu_desc = << "END";
+Generate Gutenprint PPD files for use with CUPS. This program is a user-friendly interface for cups-genppd(8).
+
+Current PPD directory: $chosen_location
+
+Hint: if the cursor keys cause problems, you may have more luck with +/- and TAB.
+END
+ @menu_options = (
+ [ "Help", "Display help text" ],
+ [ "Directory", "Choose PPD location" ],
+ [ "Printers", "Choose printers" ],
+ [ "Languages", "Choose languages" ],
+ [ "Create", "Create PPDs" ],
+ [ "Exit", "Exit the program" ]
+ );
+ if ($use_dialog) {
+ my $dialog_options;
+ for my $i ( 0 .. $#menu_options) {
+ for my $j ( 0 .. $#{$menu_options[$i]}) {
+ $dialog_options .= "\"$menu_options[$i][$j]\" ";
+ }
+ }
+ while (defined($option = dialog_read("cups-genppdconfig", "--no-cancel --default-item Printers --menu \"$menu_desc\" 20 70 6 $dialog_options"))) {
+ chomp ($option);
+ return $option;
+ }
+ } else {
+ $option = perl_menu(1, "Main menu", "Choose an option.",
+ "Current PPD directory: $chosen_location",
+ @menu_options);
+ return $option;
+ }
+}
+
+
+#
+# display_help() - Display help text.
+#
+sub display_help {
+ my $help_text = <<"END";
+cups-genppdconfig is a program to generate PPD files which enable the
+Gutenprint printer drivers to be used with CUPS, the Common UNIX
+Printing System. A PPD file is a PostScript Printer Description,
+which describes the capabilities of a printer. For each printer model
+that you wish to use, you will have to generate the corresponding PPD
+file.
+
+There are three steps to generating the PPDs:
+
+
+[0. Directory]
+
+The default base directory to create PPD files in is
+@cups_conf_datadir@/model/gutenprint, and this is displayed on the
+main menu. Choose the "Directory" option to change this, but in
+almost every case the default should be used. Don\'t alter the default
+unless you know what you are doing.
+
+
+1. Printers
+
+Choose the "Printers" menu option. The dialog box shows a complete
+list of all the printers supported by Gutenprint. Use the up and down
+cursor keys to move between the printers and SPACE to select the
+models you want. Next, press ENTER to confirm the selections.
+
+If no printers are chosen, then a PPD file will be created for *every*
+model.
+
+
+2. Languages
+
+PPD files can be produced in several languages. Choose the
+"Languages" menu option and, as for the "Printers" menu, select the
+languages that you wish to use and press ENTER to confirm the
+selections.
+
+Since a PPD file can only be translated into one language, selecting
+multiple languages is posible, but of limited usefulness (for each
+printer, a separate PPD file for each language will be produced).
+
+
+3. Save the selections
+
+Choose the "Save" menu option to generate the PPD files you requested.
+The files will be created in the default CUPS data directory
+\$cups_prefix/share/model/gutenprint. Translations will be saved in
+subdirectories named according to the locale/language.
+
+
+Note that unselecting already selected entries in the Printer and
+Language Selection dialogs will *not* remove these from the
+filesystem; it will simply not cause them to be generated when you
+choose "Save". To remove a printer, delete the PPD file from each
+language directory it appears in. To remove a language, delete the
+directory named with the corresponding language code, and all its
+contents.
+
+Once you have finished, choose the "Exit" menu option, to leave the
+program. Note that your selections will be lost, so make sure you
+saved your selections first, if you wanted to keep them.
+END
+ my($HELPFILE, $helpfilename) = tempfile("cups-genppdconfig-helpXXXXXX",
+ UNLINK => 1)
+ or die "can't open temporary help file";
+ print $HELPFILE "$help_text";
+ $HELPFILE->flush();
+ if ($use_dialog) {
+ dialog_read("Help", "--textbox $helpfilename 18 76");
+ } else {
+ &menu_init(0, "Help", 0);
+ open(TEMP,$helpfilename);
+ while (<TEMP>) {
+ s/^(\t+)/' ' x length($1)/e;
+ &expand($_) if /\t/;
+ &menu_item($_,"", -1);
+ }
+ close(TEMP);
+ &menu_display("Help viewer: (RET/u/t) exit (n/p) next/previous page (b) beginning (e) end");
+ }
+ unlink0($HELPFILE, $helpfilename) or die "Error unlinking help file $helpfilename safely: $!";
+ close($HELPFILE) or die "can't close help file $helpfilename: $!";
+ return;
+}
+
+
+#
+# choose_printers() - Select printers from master list.
+# Default none (so create all printers).
+#
+sub choose_printers {
+ my $title = "Printer selection";
+ my $options = "--checklist \"Choose the printer models you wish to use with CUPS.\" 18 54 11";
+ if ($use_dialog) {
+ dialog_read_list(%printers, @chosen_printers, $title, $options);
+ } else {
+ perl_menu_read_list(%printers, @chosen_printers, $title,
+ "Choose the printer models you wish to use with CUPS.");
+ }
+}
+
+
+#
+# choose_languages() - Select languages from master list.
+# Default is US English (en).
+#
+sub choose_languages {
+ my $title = "Language selection";
+ my $options = "--checklist \"Choose the languages you wish to use with CUPS.\" 18 54 11";
+ if ($use_dialog) {
+ dialog_read_list(%languages, @chosen_languages, $title, $options);
+ } else {
+ perl_menu_read_list(%languages, @chosen_languages, $title,
+ "Choose the languages you wish to use with CUPS.");
+ }
+}
+
+
+#
+# choosen_location() - Select PPD prefix directory and create it if
+# not present.
+#
+sub choose_location {
+ my $location;
+ if ($use_dialog) {
+ $location = dialog_read("Location selection",
+ "--inputbox \"Choose a directory to create the PPD files in.\" 8 61 $chosen_location");
+ } else {
+ $location = &menu_getstr(5,12,"Directory:", 1, $chosen_location);
+ }
+ if (!defined($location)) {
+ $location = "";
+ }
+ $chosen_location = create_dir($location); # make sure directory exists
+ init_defaults; # use new location to get default selections
+}
+
+
+#
+# create_dir($dir) - Create named directory.
+# $dir will have excess `/'s pruned.
+#
+sub create_dir ($) {
+ my $location = $_[0];
+ my $dir;
+ my $count = 0;
+ if ($location =~ m/^\//) {
+ $dir = "/";
+ }
+ foreach (split /\//, $location) {
+ if ($_ eq "") {
+ next;
+ }
+ if ($count == 1) {
+ $dir .= "/";
+ }
+ $count = 1;
+ $dir .= $_;
+ if (!-d $dir) # directory does not exist, so create it
+ {
+ mkdir $dir || die "can't create directory \`$dir\': $!";
+ }
+ }
+ return $dir;
+}
+
+
+#
+# create_ppds() - Create PPD files.
+#
+sub create_ppds {
+ create_dir($chosen_location); # make the destination directory
+ my $total = scalar(@chosen_printers);
+ my $printers;
+ my $count;
+ my $language;
+ my $percent;
+ my $file;
+ if (!@chosen_printers) { # calculate total files for guage
+ $total = scalar(keys(%printers));
+ }
+ $total = $total * scalar(@chosen_languages);
+ if (@chosen_printers) { # construct printer list for dialog
+ foreach (@chosen_printers) {
+ $printers .= "$_ ";
+ }
+ } else {
+ $printers = "";
+ }
+ if (! $silent && $use_dialog) {
+ open DIALOG, "| $DIALOG --sleep 2 --backtitle \"$BACKTITLE\" --title \"Creating PPD files\" --guage \"Language: \nPPD files: \" 10 72 0"
+ or die "can't fork dialog: $!";
+ }
+ $count = 0;
+ foreach $language (@chosen_languages) { # loop through languages
+ open GENPPD,
+ "LANGUAGE=$language cups-genppd.$version -v -p $chosen_location/$language $printers 2>&1 |"
+ or die "can't fork cups-genppd: $!";
+ $file = "";
+ while ( defined($file = <GENPPD>)) { # dump genppd stats into guage
+ chomp($file);
+ $count++;
+ $percent = int (($count/$total)*100);
+ if ($percent > 100) {
+ $percent = 100;
+ }
+ if (! $silent && $use_dialog) {
+ print DIALOG "$percent\n";
+ print DIALOG "XXX\nLanguage: $language\nPPD files: $count/$total\n\n$file\nXXX\n";
+ DIALOG->flush();
+ } else {
+ print "$file\n";
+ STDOUT->flush();
+ }
+ }
+ close GENPPD or die "can't close cups-genppd pipe: $!";
+ }
+ if (! $silent && $use_dialog) {
+ print DIALOG "100\nXXX\nLanguage: \nPPD files: $total/$total\n\nCompleted\nXXX\n";
+ close DIALOG or die "can't close dialog pipe";
+ }
+}
+
+
+# scalar
+# dialog($title, $command) - Create a dialog.
+# Returns dialog results.
+sub dialog_read ($$) {
+ my($title, $command) = @_;
+ my $result = ""; # must not be undefined, just empty
+ my $status;
+ my $line;
+ open DIALOG, "$DIALOG --backtitle \"$BACKTITLE\" --title \"$title\" $command 2>&1 |";
+ while (defined($line = <DIALOG>)) {
+ $result .= $line;
+ }
+ close DIALOG or ($! == 0) or die "can't close dialog pipe: $!";
+ if ($? >> 8)
+ {
+ return undef;
+ }
+ return $result;
+}
+
+
+#
+# dialog_read_list(%masterlist
+# @chosenlist
+# $title
+# $dialog) - Construct list dialog, entries from %masterlist,
+# defaults from @chosenlist.
+#
+sub dialog_read_list (\%\@$$) {
+ my $masterlist = $_[0];
+ my $list = $_[1];
+ my $title = $_[2];
+ my $dialogoptions = $_[3];
+ my $tmplist;
+ my $dialoglist = "";
+ my $item;
+ my $selected;
+# Make a list for use with dialog.
+ foreach $item (sort keys %$masterlist) {
+ $selected = "off";
+ foreach (@$list) {
+ if ($item eq $_) {
+ $selected = "on";
+ last;
+ }
+ }
+ $dialoglist .= "$item \"$masterlist->{$item}\" $selected ";
+ }
+ $tmplist = dialog_read("$title", "$dialogoptions $dialoglist");
+ if (defined($tmplist)) {
+ $tmplist =~ s/\"//g;
+ @$list=split(/ /, $tmplist);
+ }
+}
+
+
+# scalar
+# perl_menu($title)
+#
+sub perl_menu ($$$$@) {
+ my ($top, $title, $question, $subtitle, @items) = @_;
+ my $selection;
+ &menu_init(1, "cups-genppdconfig", $top, $title, "$BACKTITLE\n-<$subtitle");
+
+ for my $i ( 0 .. $#items) {
+ &menu_item($items[$i][1], $items[$i][0]);
+ }
+
+ $selection = &menu_display($question);
+ return $selection;
+}
+
+# scalar
+# perl_menu_mult($title, $question, @items)
+#
+sub perl_menu_mult ($$@) {
+ my ($title, $question, @items) = @_;
+ my $selection;
+ &menu_init(1, "cups-genppdconfig", 0, $title, $BACKTITLE);
+
+ for my $i ( 0 .. $#items) {
+ &menu_item($items[$i][1], $items[$i][0], $items[$i][2]);
+ }
+
+ perl_menu_sel_defaults();
+ $selection = &menu_display_mult($question);
+ perl_menu_defaults();
+ if ($selection eq "%UP%" or $selection eq "%NONE%") {
+ return undef;
+ }
+ return $selection;
+}
+
+
+#
+# perl_menu_read_list(%masterlist
+# @chosenlist
+# $title
+# $question
+# - Construct list dialog, entries from %masterlist,
+# defaults from @chosenlist.
+#
+sub perl_menu_read_list (\%\@$$) {
+ my $masterlist = $_[0];
+ my $list = $_[1];
+ my $title = $_[2];
+ my $question = $_[3];
+ my $tmplist;
+ my @menulist = ();
+ my $item;
+ my $selected;
+# Make a list for use with perlmenu.
+ foreach $item (sort keys %$masterlist) {
+ $selected = 0;
+ foreach (@$list) {
+ if ($item eq $_) {
+ $selected = 1;
+ last;
+ }
+ }
+ my $formatstring = sprintf "%-14s - %s", $item, $masterlist->{$item};
+ push @menulist, [ $item, $formatstring, $selected ] ;
+ }
+ $tmplist = perl_menu_mult("$title", "RET=toggle selection (u/t) exit (n/p) next/previous page (b) beginning (e) end", @menulist);
+ if (defined($tmplist)) {
+ $tmplist =~ s/\"//g;
+ @$list=split(/,/, $tmplist);
+ }
+}
+
+
+#
+# perl_menu_defaults - set menu defaults
+#
+sub perl_menu_defaults {
+ &menu_prefs(1, 0, 1, 0, "y", 0, 0);
+}
+
+
+#
+# perl_menu_sel_defaults - set menu defaults for multiple selections
+#
+sub perl_menu_sel_defaults {
+ &menu_prefs(1, 0, 1, 0, "y", 1, 0);
+}
+
diff --git a/src/cups/cups-genppdupdate.in b/src/cups/cups-genppdupdate.in
new file mode 100644
index 0000000..c48723c
--- /dev/null
+++ b/src/cups/cups-genppdupdate.in
@@ -0,0 +1,539 @@
+#! @PERL@ -w
+# $Id: cups-genppdupdate.in,v 1.19 2005/04/30 11:48:26 rleigh Exp $
+# Update CUPS PPDs for Gutenprint queues.
+# Copyright (C) 2002-2003 Roger Leigh (rleigh@debian.org)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+use strict;
+use Getopt::Std;
+use Fcntl qw(:mode);
+use File::Temp qw(:POSIX);
+use File::Copy qw(mv);
+
+sub parse_options ();
+sub update_ppd ($); # Original PPD filename
+sub find_ppd ($$$$); # Gutenprint Filename, driver, language (e.g. en, sv),
+ # region (e.g. GB, DE)
+sub get_default_types (*); # Source PPD FH
+sub get_defaults (*); # Source PPD FH
+sub get_options (*\%); # Source PPD FH, default_types hash ref
+
+our $opt_d; # Debug mode
+our $opt_h; # Help
+our $opt_n; # No action
+our $opt_q; # Quiet mode
+our $opt_s; # Source PPD location
+our $opt_v; # Verbose mode
+
+my $debug = 0;
+my $verbose = 0; # Verbose output
+if ($debug) {
+ $verbose = 1;
+}
+my $quiet = 0; # No output
+my $no_action = 0; # Don't output files
+my $version = "@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@";
+
+my $ppd_dir = "@cups_conf_serverroot@/ppd"; # Location of in-use CUPS PPDs
+my $ppd_root_dir = "@cups_conf_datadir@/model";
+my $ppd_base_dir = "$ppd_root_dir/gutenprint/$version"; # Available PPDs
+my $gzext = ".gz";
+my $updated_ppd_count = 0;
+
+my @ppd_files; # A list of in-use Gutenprint PPD files
+
+# Used to convert a language name to its two letter code
+my %languagemappings = (
+ "chinese" => "cn",
+ "danish" => "da",
+ "dutch" => "nl",
+ "english" => "en",
+ "finnish" => "fi",
+ "french" => "fr",
+ "german" => "de",
+ "greek" => "el",
+ "italian" => "it",
+ "japanese" => "jp",
+ "norwegian" => "no",
+ "polish" => "pl",
+ "portuguese" => "pt",
+ "russian" => "ru",
+ "slovak" => "sk",
+ "spanish" => "es",
+ "swedish" => "sv",
+ "turkish" => "tr"
+);
+
+
+# Check command-line options...
+
+parse_options();
+
+
+# Set a secure umask...
+
+umask 0177;
+
+
+# Find all in-use Gutenprint PPD files...
+
+my @ppdglob = glob("$ppd_dir/*.{ppd,PPD}");
+my $ppdlist = join ' ', @ppdglob;
+if (@ppdglob) {
+ open PPDFILES, "egrep -i -l \"Gutenprint|Gimp-Print\" $ppdlist|" or die "can't grep $ppd_dir/*: $!";
+ while (<PPDFILES>) {
+ chomp;
+ push @ppd_files, $_;
+ }
+ close PPDFILES or ($! == 0) or die "can't close grep pipe: $!";
+}
+
+
+# Exit if there are not files to update...
+
+if (!@ppd_files) {
+ print STDOUT "No Gutenprint PPD files to update.\n";
+ exit (0);
+}
+
+# Update each of the Gutenprint PPDs, where possible...
+
+foreach (@ppd_files) {
+ $updated_ppd_count += update_ppd($_);
+
+}
+
+if (!$quiet || $verbose) {
+ if ($updated_ppd_count > 0) {
+ print STDOUT "Updated $updated_ppd_count PPD files. Restart cupsd for the changes to take effect.\n";
+ exit (0);
+ } else {
+ print STDOUT "Failed to update any PPD files\n";
+ exit (0);
+ }
+}
+
+
+
+sub parse_options () {
+ getopts("dhnqs:v");
+
+ if ($opt_n) {
+ $no_action = 1;
+ }
+ if ($opt_d) {
+ $debug = 1;
+ }
+ if ($opt_s) {
+ if (-d $opt_s) {
+ $ppd_base_dir = "$opt_s";
+ }
+ else {
+ die "$opt_s: invalid directory: $!";
+ }
+ }
+ if ($opt_v) {
+ $verbose = 1;
+ $quiet = 0;
+ }
+ if ($opt_q) {
+ $verbose = 0;
+ $quiet = 1;
+ }
+ if ($opt_h) {
+ print "Usage: $0 [OPTION]...\n";
+ print "Update CUPS+Gutenprint PPD files.\n\n";
+ print " -d Enable debugging\n";
+ print " -h Display this help text\n";
+ print " -n No-action. Don't overwrite any PPD files.\n";
+ print " -q Quiet mode. No messages except errors.\n";
+ print " -s ppd_dir Use ppd_dir as the source PPD directory.\n";
+ print " -v Verbose messages.\n";
+ exit (0);
+ }
+}
+
+
+# Update the named PPD file.
+sub update_ppd ($) {
+ my $ppd_source_filename = $_;
+
+ open ORIG, $_ or die "$_: can't open PPD file: $!";
+ seek (ORIG, 0, 0) or die "can't seek to start of PPD file";
+ if ($debug) {
+ print "Source Filename: $ppd_source_filename\n";
+ }
+ # Get the `PCFileName'; the new source PPD will have the same name.
+ my ($filename) = "";
+ my ($driver) = "";
+ my ($gutenprintdriver) = "";
+ my ($locale) = "";
+ my ($lingo) = "";
+ my ($region) = "";
+ my ($valid) = 0;
+ while (<ORIG>) {
+ if (/\*StpLocale:/) {
+ ($locale) = m/^\*StpLocale:\s\"*(.*)\"$/;
+ $valid = 1;
+ }
+ if (/\*LanguageVersion/) {
+ ($lingo) = m/^\*LanguageVersion:\s*(.*)$/;
+ }
+ if (/^\*StpDriverName:/ ) {
+ ($driver) = m/^\*StpDriverName:\s*\"(.*)\"$/;
+ $valid = 1;
+ }
+ if (/\*%End of / && $driver eq "") {
+ ($driver) = m/^\*%End of\s*(.*).ppd$/;
+ }
+ if (/^\*StpPPDLocation:/ ) {
+ ($filename) = m/^\*StpPPDLocation:\s*\"(.*)\"$/;
+ $valid = 1;
+ }
+ if (/^\*%Gutenprint Filename:/) {
+ $valid = 1;
+ }
+ }
+ if (! $valid) {
+ print STDERR "$ppd_source_filename: this PPD file cannot be upgraded automatically (only files based on Gutenprint 4.3.21 and newer can be)\n";
+ return 0;
+ }
+ if ($debug) {
+ print "Gutenprint Filename: $filename\n";
+ print "Locale: $locale\n";
+ print "Language: $lingo\n";
+ print "Driver: $driver\n";
+ }
+ if ($locale) {
+ # Split into the language and territory.
+ ($locale, $region) = split(/-/, $locale);
+ } else {
+ # Split into the language and territory.
+ ($locale, $region) = split(/-/, $lingo);
+ # Convert language into language code.
+ $locale = $languagemappings{"\L$lingo"};
+ if (!defined($locale)) {
+ $locale = "C"; # Fallback if there isn't one.
+ }
+ }
+ if (! defined($region)) {
+ $region = "";
+ }
+ if ($debug) {
+ print "Locale: $locale\n";
+ print "Region: $region\n";
+ }
+
+ # Search for a PPD matching our criteria...
+
+ my $source = find_ppd($filename, $driver, $locale, $region);
+ if (!defined($source)) {
+ # There wasn't a valid source PPD file, so give up.
+ print STDERR "$ppd_source_filename: no valid candidate for replacement. Skipping\n";
+ print STDERR "$ppd_source_filename: please upgrade this PPD manually\n";
+ return 0;
+ }
+ if ($debug) {
+ print "Candidate PPD: $source\n";
+ }
+
+
+ # Read in the new PPD, decompressing it if needed...
+
+ my $source_data;
+
+ my $suffix = "\\" . $gzext; # Add '\', so m// matches the '.'.
+ if ($source =~ m/.gz$/) { # Decompress input buffer
+ open GZIN, "gunzip -c $source |"
+ or die "$_: can't open for decompression: $!";
+ while (<GZIN>) {
+ $source_data .= $_;
+ }
+ close GZIN;
+ }
+ else {
+ open SOURCE, $source
+ or die "$source: can't open source file: $!";
+ binmode SOURCE;
+ my $source_size = (stat(SOURCE))[7];
+ read (SOURCE, $source_data, $source_size)
+ or die "$source: error reading source: $!";
+ close SOURCE or die "$source: can't close file: $!";
+ }
+
+ # Save new PPD in a temporary file, for processing...
+
+ my($tmpfile, $tmpfilename) = tmpnam();
+ chown(0, 0, $tmpfilename); # root.root
+ chmod(0644, $tmpfilename);
+ unlink $tmpfilename or warn "can't unlink temporary file $tmpfile: $!\n";
+ print $tmpfile $source_data;
+
+
+
+
+ # Extract the default values from the original PPD...
+
+ my %orig_default_types = get_default_types(ORIG);
+ my %new_default_types = get_default_types($tmpfile);
+ my %defaults = get_defaults(ORIG);
+ my %options = get_options($tmpfile, %new_default_types);
+
+
+ # Close original and temporary files...
+
+ close ORIG or die "$_: can't close file: $!";
+ close $tmpfile or die "can't close temporary file $tmpfile: $!";
+
+
+ if ($debug) {
+ print "Original Default Types:\n";
+ foreach (sort keys %orig_default_types) {
+ print " $_: $orig_default_types{$_}\n";
+ }
+ print "New Default Types:\n";
+ foreach (sort keys %new_default_types) {
+ print " $_: $new_default_types{$_}\n";
+ }
+ print "Defaults:\n";
+ foreach (sort keys %defaults) {
+ print " $_: $defaults{$_}\n";
+ }
+ print "Options:\n";
+ foreach (sort keys %options) {
+ print " $_: ";
+ foreach my $opt (@{$options{$_}}) {
+ print "$opt ";
+ }
+ print "\n";
+ }
+
+ }
+
+ # Update source buffer with old defaults...
+
+ # Loop through each default in turn.
+default_loop:
+ foreach (sort keys %defaults) {
+ my $default_option = $_;
+ my $option;
+ ($option = $_) =~ s/Default//; # Strip off `Default'
+ # Check method is valid
+ my $orig_method = $orig_default_types{$option};
+ my $new_method = $new_default_types{$option};
+ if ((!defined($orig_method) || !defined($new_method)) ||
+ $orig_method ne $new_method) {
+ next;
+ }
+ if ($new_method eq "PickOne") {
+ # Check the old setting is valid
+ foreach (@{$options{$option}}) {
+ if ($defaults{$default_option} eq $_) { # Valid option
+ # Set the option in the new PPD
+ $source_data =~ s/\*($default_option).*/*$1:$defaults{$default_option}/m;
+ if ($verbose) {
+ print "$ppd_source_filename: Set *$default_option to $defaults{$default_option}\n";
+ }
+ next default_loop;
+ }
+ }
+ printf STDERR
+ "$ppd_source_filename: Invalid option: *$default_option: $defaults{$default_option}. Skipped.\n";
+ next;
+ }
+ print STDERR
+ "$ppd_source_filename: PPD OpenUI method $new_default_types{$_} not understood. Skipped\n";
+ }
+
+
+ # Write new PPD...
+
+ my $tmpnew = "${ppd_source_filename}.new";
+ if (! open NEWPPD, "> $tmpnew") {
+ warn "Can't open $tmpnew for writing: $!\n";
+ return 0;
+ }
+ chown(0, 0, $tmpnew); # Bad idea to hardcode this...
+ chmod(0644, $tmpnew); # Bad idea to hardcode this...
+ print NEWPPD $source_data;
+ if (! close NEWPPD) {
+ warn "Can't close ${tmpnew}.new for writing: $!\n";
+ unlink $tmpnew;
+ return 0;
+ }
+
+ if (! rename $tmpnew, $ppd_source_filename) {
+ warn "Can't rename $tmpnew to $ppd_source_filename: $!\n";
+ unlink $tmpnew;
+ return 0;
+ }
+
+ if (!$quiet || $verbose) {
+ print STDOUT "Updated $ppd_source_filename using $source\n";
+ }
+ return 1;
+ # All done!
+}
+
+# Find a suitable source PPD file
+sub find_ppd ($$$$) {
+ my($gutenprintfilename, $drivername, $lang, $region) = @_;
+ my $file; # filename to return
+ my ($key) = '^\\*FileVersion:[ ]*"@VERSION@"$';
+ my ($lingo, $suffix, $base, $basedir);
+ my ($current_best_file, $current_best_time);
+ my ($stored_name, $stored_dir);
+ $stored_name = $gutenprintfilename;
+ $stored_name =~ s,.*/([^/]*)(.gz)?$,$1,;
+ $stored_dir = $gutenprintfilename;
+ $stored_dir =~ s,(.*)/([^/]*)$,$1,;
+
+ $current_best_file = "";
+ $current_best_time = 0;
+
+ # All possible candidates, in order of usefulness and gzippedness
+ foreach $lingo ("${lang}_${region}/",
+ "$lang/",
+ "en/",
+ "C/",
+ "") {
+ foreach $suffix (".ppd$gzext",
+ ".ppd") {
+ foreach $base ("${drivername}.$version",
+ "stp-${drivername}.$version",
+ $stored_name,
+ $drivername) {
+ foreach $basedir ($ppd_base_dir,
+ $stored_dir,
+ $ppd_root_dir) {
+ if (! $basedir || ! $base) { next; }
+ my ($fn) = "$basedir/$lingo$base$suffix";
+ if ($debug) {
+ print "Trying $fn for $gutenprintfilename, $lang, $region\n";
+ }
+# Check that it is a regular file, owned by root.root, not writable
+# by other, and is readable by root. i.e. the file is secure.
+ my @sb = stat $fn or next;
+ if (S_ISREG($sb[2]) && ($sb[4] == 0) && ($sb[5] == 0)) {
+# !(S_IWOTH & $sb[2]) && (S_IRUSR & $sb[2])) {
+ # Check that the file is a valid Gutenprint PPD file
+ # of the correct version.
+ my $file_version;
+ if ($fn =~ m/\.gz$/) {
+ $file_version = `gunzip -c $fn | grep '$key'`;
+ } else {
+ $file_version = `cat $fn | grep '$key'`;
+ }
+ if ($file_version ne "") {
+ if ($debug) {
+ print " Format valid: time $sb[9] best $current_best_time prev $current_best_file cur $fn!\n";
+ }
+ if ($sb[9] > $current_best_time) {
+ $current_best_time = $sb[9];
+ $current_best_file = $fn;
+ }
+ } elsif ($debug) {
+ print " Format invalid\n";
+ }
+ }
+ else {
+ $_ = $fn;
+ if (! -d $fn && ! /\/$/) {
+ print STDERR "$fn: not a regular file, or insecure ownership and permissions. Skipped\n";
+ }
+ }
+ }
+ }
+ }
+ }
+ if ($current_best_file) {
+ return $current_best_file;
+ }
+# Yikes! Cannot find a valid PPD file!
+ return undef;
+}
+
+# Return the default options from the given PPD filename
+sub get_default_types(*) {
+ my $fh = $_[0];
+ my %default_types;
+
+ # Read each line of the original PPD file, and store all OpenUI
+ # names and their types in a hash...
+ seek ($fh, 0, 0) or die "can't seek to start of PPD file";
+ while (<$fh>) {
+ if ( m/^\*OpenUI/ ) {
+ chomp;
+ my ($key, $value) = /^\*OpenUI\s\*([[:alnum:]]+).*:\s([[:alnum:]]+)/;
+ if ($key && $value) {
+ $default_types{$key}=$value;
+ }
+ }
+ }
+ return %default_types;
+}
+
+
+# Return the default options from the given PPD filename
+sub get_defaults(*) {
+ my $fh = $_[0];
+ my %defaults;
+
+ # Read each line of the original PPD file, and store all default
+ # names and their values in a hash...
+ seek ($fh, 0, 0) or die "can't seek to start of PPD file";
+ while (<$fh>) {
+ if ( m/^\*Default/ ) {
+ chomp;
+ my($key, $value) = /^\*([[:alnum:]]+):\s*([[:alnum:]]+)/;
+ if ($key && $value) {
+ $defaults{$key}=$value;
+ }
+ }
+ }
+ return %defaults;
+}
+
+
+# Return the available options from the given PPD filename
+sub get_options(*\%) {
+ my $fh = $_[0];
+ my $validopts = $_[1];
+ my %options;
+
+ # For each valid option name, grab each valid option for that name
+ # and store in a hash of arrays...
+
+ foreach (sort keys %$validopts) {
+ my $tmp = $_;
+ my @optionlist;
+
+ seek ($fh, 0, 0) or die "can't seek to start of PPD file";
+ while (<$fh>) {
+ if ( m/^\*$tmp/ ) {
+ chomp;
+ my ($value) = /^\*$tmp\s*([[:alnum:]]+)[\/:]/;
+ if ($value) {
+ push @optionlist, $value;
+ }
+ }
+ }
+ if (@optionlist) {
+ $options{$tmp} = [ @optionlist ];
+ }
+ }
+ return %options;
+}
diff --git a/src/cups/epson.c b/src/cups/epson.c
index d102f3a..434c1ae 100644
--- a/src/cups/epson.c
+++ b/src/cups/epson.c
@@ -1,5 +1,5 @@
/*
- * "$Id: epson.c,v 1.3.2.5 2003/01/25 00:51:41 rlk Exp $"
+ * "$Id: epson.c,v 1.6 2002/12/22 21:03:32 rleigh Exp $"
*
* EPSON backend for the Common UNIX Printing System.
*
@@ -765,5 +765,5 @@ list_devices(void)
/*
- * End of "$Id: epson.c,v 1.3.2.5 2003/01/25 00:51:41 rlk Exp $".
+ * End of "$Id: epson.c,v 1.6 2002/12/22 21:03:32 rleigh Exp $".
*/
diff --git a/src/cups/genppd.c b/src/cups/genppd.c
index 537bb26..f7f6e62 100644
--- a/src/cups/genppd.c
+++ b/src/cups/genppd.c
@@ -1,9 +1,9 @@
/*
- * "$Id: genppd.c,v 1.36.2.15 2004/06/12 20:04:05 rlk Exp $"
+ * "$Id: genppd.c,v 1.107 2005/04/23 00:26:07 rlk Exp $"
*
* PPD file generation program for the CUPS drivers.
*
- * Copyright 1993-2003 by Easy Software Products.
+ * Copyright 1993-2005 by Easy Software Products and Robert Krawitz.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License,
@@ -32,7 +32,12 @@
* main() - Process files on the command-line...
* initialize_stp_options() - Initialize the min/max values for
* each STP numeric option.
- * usage() - Show program usage...
+ * usage() - Show program usage.
+ * help() - Show detailed program usage.
+ * getlangs() - Get available translations.
+ * printlangs() - Show available translations.
+ * printmodels() - Show available printer models.
+ * checkcat() - Check message catalogue exists.
* write_ppd() - Write a PPD file.
*/
@@ -45,6 +50,8 @@
#endif
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <dirent.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
@@ -59,13 +66,8 @@
#include <cups/cups.h>
#include <cups/raster.h>
-#ifdef INCLUDE_GIMP_PRINT_H
-#include INCLUDE_GIMP_PRINT_H
-#else
-#include <gimp-print/gimp-print.h>
-#endif
-#include <gimp-print/gimp-print-intl.h>
-#include "../../lib/libprintut.h"
+#include <gutenprint/gutenprint.h>
+#include <gutenprint/gutenprint-intl.h>
/*
* Note:
@@ -74,19 +76,19 @@
* so we can report Level 3 support by default...
*/
-#ifndef CUPS_PPD_PS_LEVEL
-# define CUPS_PPD_PS_LEVEL 3
-#endif
+int cups_ppd_ps_level = CUPS_PPD_PS_LEVEL;
+static const char *cups_modeldir = CUPS_MODELDIR;
/*
* File handling stuff...
*/
+static const char *ppdext = ".ppd";
#ifdef HAVE_LIBZ
-# define PPDEXT ".ppd.gz"
+static const char *gzext = ".gz";
#else
-# define PPDEXT ".ppd"
+static const char *gzext = "";
# define gzFile FILE *
# define gzopen fopen
# define gzclose fclose
@@ -102,6 +104,7 @@
#define DEFAULT_SIZE "Letter"
/*#define DEFAULT_SIZE "A4"*/
+#define CATALOG "LC_MESSAGES/gutenprint.mo"
typedef struct /**** Media size values ****/
{
@@ -115,56 +118,33 @@ typedef struct /**** Media size values ****/
top; /* Media top margin */
} paper_t;
-
-/*
- * STP option data...
- */
-
-static struct /**** STP numeric options ****/
+const char *special_options[] =
{
- const char *name, /* Name of option */
- *text; /* Human-readable text */
- int low, /* Low value (thousandths) */
- high, /* High value (thousandths) */
- defval, /* Default value */
- step; /* Step (thousandths) */
-} stp_options[] =
-{
- { "stpBrightness", "Brightness" },
- { "stpContrast", "Contrast" },
- { "stpGamma", "Gamma" },
- { "stpDensity", "Density" },
-#ifndef __APPLE__
- { "stpCyan", "Cyan" },
- { "stpMagenta", "Magenta" },
- { "stpYellow", "Yellow" },
- { "stpSaturation", "Saturation" }
-#else
- { "stpSaturation", "Saturation" },
- { "stpCyan", "Cyan" },
- { "stpMagenta", "Magenta" },
- { "stpYellow", "Yellow" }
-#endif /* __APPLE__ */
+ "PageSize",
+ "MediaType",
+ "InputSlot",
+ "Resolution",
+ "OutputOrder",
+ "Quality",
+ "ImageType",
+ "Duplex",
+ NULL
};
-/*
- * Mapping between manufacturer names embedded in the printer name and
- * manufacturer names authorized in the PPD specification.
- * If printers of other manufacturers are added, this table must
- * be extended.
- */
-static struct
+const char *parameter_class_names[] =
{
- const char *manufacturer_embedded_name;
- const char *manufacturer_real_name;
-} stp_manufacturers[] =
+ N_("Printer Features"),
+ N_("Output Control")
+};
+
+const char *parameter_level_names[] =
{
- { "CANON", "Canon" },
- { "EPSON", "Epson" },
- { "HP", "HP" },
- { "LEXMARK", "Lexmark" },
- { "APPLE", "Apple" },
- { NULL, NULL }
+ N_("Common"),
+ N_("Extra 1"),
+ N_("Extra 2"),
+ N_("Extra 3"),
+ N_("Extra 4"),
+ N_("Extra 5")
};
@@ -172,60 +152,96 @@ static struct
* Local functions...
*/
-void initialize_stp_options(void);
void usage(void);
-int write_ppd(const stp_printer_t p, const char *prefix,
- const char *language, int verbose);
-const char *find_manufacturer_from_name(const char *name);
+void help(void);
+char ** getlangs(void);
+static int stpi_scandir (const char *dir,
+ struct dirent ***namelist,
+ int (*sel) (const struct dirent *),
+ int (*cmp) (const void *, const void *));
+int checkcat (const struct dirent *localedir);
+void printlangs(char** langs);
+void printmodels(int verbose);
+int write_ppd(const stp_printer_t *p, const char *prefix,
+ const char *language, int verbose);
+
+/*
+ * Global variables...
+ */
+const char *baselocaledir = PACKAGE_LOCALE_DIR;
+
+static int
+is_special_option(const char *name)
+{
+ int i = 0;
+ while (special_options[i])
+ {
+ if (strcmp(name, special_options[i]) == 0)
+ return 1;
+ i++;
+ }
+ return 0;
+}
+
+static void
+print_group_open(FILE *fp, stp_parameter_class_t p_class,
+ stp_parameter_level_t p_level)
+{
+ /* TRANSLATORS: "Gutenprint" is a proper name, not a description */
+ gzprintf(fp, "*OpenGroup: %s %s %s\n\n", _("Gutenprint"),
+ _(parameter_class_names[p_class]),
+ _(parameter_level_names[p_level]));
+}
+
+static void
+print_group_close(FILE *fp, stp_parameter_class_t p_class,
+ stp_parameter_level_t p_level)
+{
+ gzprintf(fp, "*CloseGroup: %s %s %s\n\n", _("Gutenprint"),
+ _(parameter_class_names[p_class]),
+ _(parameter_level_names[p_level]));
+}
/*
* 'main()' - Process files on the command-line...
*/
-int /* O - Exit status */
-main(int argc, /* I - Number of command-line arguments */
- char *argv[]) /* I - Command-line arguments */
+int /* O - Exit status */
+main(int argc, /* I - Number of command-line arguments */
+ char *argv[]) /* I - Command-line arguments */
{
- int i; /* Looping var */
- int option_index; /* Option index */
- const char *prefix; /* Directory prefix for output */
- const char *language; /* Language */
- const char *catalog = NULL;/* Catalog location */
- stp_printer_t printer; /* Pointer to printer driver */
- int verbose = 0;
- static struct option long_options[] =
- { /* Command-line options */
- /* name, has_arg, flag val */
- {"help", no_argument, 0, (int) 'h'},
- {"verbose", no_argument, 0, (int) 'v'},
- {"quiet", no_argument, 0, (int) 'q'},
- {"catalog", required_argument, 0, (int) 'c'},
- {"prefix", required_argument, 0, (int) 'p'},
- {0, 0, 0, 0}
- };
+ int i; /* Looping var */
+ const char *prefix; /* Directory prefix for output */
+ const char *language = NULL; /* Language */
+ const stp_printer_t *printer; /* Pointer to printer driver */
+ int verbose = 0; /* Verbose messages */
+ char **langs = NULL; /* Available translations */
+ char **models = NULL; /* Models to output, all if NULL */
+ int opt_printlangs = 0; /* Print available translations */
+ int opt_printmodels = 0;/* Print available models */
/*
* Parse command-line args...
*/
- prefix = "ppd";
- language = "C";
-
- initialize_stp_options();
-
- option_index = 0;
+ prefix = CUPS_MODELDIR;
for (;;)
{
- if ((i = getopt_long(argc, argv, "hvqc:p:", long_options,
- &option_index)) == -1)
+ if ((i = getopt(argc, argv, "23hvqc:p:l:LMVd:")) == -1)
break;
switch (i)
{
+ case '2':
+ cups_ppd_ps_level = 2;
+ break;
+ case '3':
+ cups_ppd_ps_level = 3;
+ break;
case 'h':
- usage();
+ help();
break;
case 'v':
verbose = 1;
@@ -234,9 +250,9 @@ main(int argc, /* I - Number of command-line arguments */
verbose = 0;
break;
case 'c':
- catalog = optarg;
+ baselocaledir = optarg;
#ifdef DEBUG
- fprintf (stderr, "DEBUG: catalog: %s\n", catalog);
+ fprintf (stderr, "DEBUG: baselocaledir: %s\n", baselocaledir);
#endif
break;
case 'p':
@@ -245,14 +261,73 @@ main(int argc, /* I - Number of command-line arguments */
fprintf (stderr, "DEBUG: prefix: %s\n", prefix);
#endif
break;
+ case 'l':
+ language = optarg;
+ break;
+ case 'L':
+ opt_printlangs = 1;
+ break;
+ case 'M':
+ opt_printmodels = 1;
+ break;
+ case 'd':
+ cups_modeldir = optarg;
+ break;
+ case 'V':
+ printf("cups-genppd version %s, "
+ "Copyright (c) 1993-2005 by Easy Software Products and Robert Krawitz.\n\n",
+ VERSION);
+ printf("Default CUPS PPD PostScript Level: %d\n", cups_ppd_ps_level);
+ printf("Default PPD location (prefix): %s\n", CUPS_MODELDIR);
+ printf("Default base locale directory: %s\n\n", PACKAGE_LOCALE_DIR);
+ puts("This program is free software; you can redistribute it and/or\n"
+ "modify it under the terms of the GNU General Public License,\n"
+ "version 2, as published by the Free Software Foundation.\n"
+ "\n"
+ "This program is distributed in the hope that it will be useful,\n"
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ "GNU General Public License for more details.\n"
+ "\n"
+ "You should have received a copy of the GNU General Public License\n"
+ "along with this program; if not, please contact Easy Software\n"
+ "Products at:\n"
+ "\n"
+ " Attn: CUPS Licensing Information\n"
+ " Easy Software Products\n"
+ " 44141 Airport View Drive, Suite 204\n"
+ " Hollywood, Maryland 20636-3111 USA\n"
+ "\n"
+ " Voice: (301) 373-9603\n"
+ " EMail: cups-info@cups.org\n"
+ " WWW: http://www.cups.org\n");
+ exit (EXIT_SUCCESS);
+ break;
default:
usage();
+ exit (EXIT_FAILURE);
break;
}
}
+ if (optind < argc) {
+ int n, numargs;
+ numargs = argc-optind;
+ models = stp_malloc((numargs+1) * sizeof(char*));
+ for (n=0; n<numargs; n++)
+ {
+ models[n] = argv[optind+n];
+ }
+ models[numargs] = (char*) NULL;
+
+ n=0;
+ }
+
+#ifdef ENABLE_NLS
+ langs = getlangs();
+#endif
/*
- * Initialise libgimpprint
+ * Initialise libgutenprint
*/
stp_init();
@@ -261,7 +336,21 @@ main(int argc, /* I - Number of command-line arguments */
* Set the language...
*/
+ if (language)
+ {
+ unsetenv("LC_CTYPE");
+ unsetenv("LC_COLLATE");
+ unsetenv("LC_TIME");
+ unsetenv("LC_NUMERIC");
+ unsetenv("LC_MONETARY");
+ unsetenv("LC_MESSAGES");
+ unsetenv("LC_ALL");
+ unsetenv("LANG");
+ setenv("LC_ALL", language, 1);
+ setenv("LANG", language, 1);
+ }
setlocale(LC_ALL, "");
+
#ifdef LC_NUMERIC
setlocale(LC_NUMERIC, "C");
#endif /* LC_NUMERIC */
@@ -270,190 +359,423 @@ main(int argc, /* I - Number of command-line arguments */
* Set up the catalog
*/
- if (catalog)
+#ifdef ENABLE_NLS
+ if (baselocaledir)
{
- if ((bindtextdomain(PACKAGE, catalog)) == NULL)
+ if ((bindtextdomain(PACKAGE, baselocaledir)) == NULL)
{
- fprintf(stderr, "genppd: cannot load message catalog %s: %s\n", catalog,
- strerror(errno));
- exit(1);
+ fprintf(stderr, "cups-genppd: cannot load message catalog %s under %s: %s\n",
+ PACKAGE, baselocaledir, strerror(errno));
+ exit(EXIT_FAILURE);
}
#ifdef DEBUG
- fprintf (stderr, "DEBUG: bound textdomain: %s\n", catalog);
+ fprintf (stderr, "DEBUG: bound textdomain: %s under %s\n",
+ PACKAGE, baselocaledir);
#endif
if ((textdomain(PACKAGE)) == NULL)
{
- fprintf(stderr, "genppd: cannot select message catalog %s: %s\n",
- catalog, strerror(errno));
- exit(1);
+ fprintf(stderr, "cups-genppd: cannot select message catalog %s under %s: %s\n",
+ PACKAGE, baselocaledir, strerror(errno));
+ exit(EXIT_FAILURE);
}
#ifdef DEBUG
fprintf (stderr, "DEBUG: textdomain set: %s\n", PACKAGE);
#endif
}
+#endif
+
+ /*
+ * Print lists
+ */
+
+ if (opt_printlangs)
+ {
+ printlangs(langs);
+ exit (EXIT_SUCCESS);
+ }
+
+ if (opt_printmodels)
+ {
+ printmodels(verbose);
+ exit (EXIT_SUCCESS);
+ }
/*
* Write PPD files...
*/
- for (i = 0; i < stp_known_printers(); i++)
- {
- printer = stp_get_printer_by_index(i);
-
- if (printer && write_ppd(printer, prefix, language, verbose))
- return (1);
- }
+ if (models)
+ {
+ int n;
+ for (n=0; models[n]; n++)
+ {
+ printer = stp_get_printer_by_driver(models[n]);
+ if (!printer)
+ printer = stp_get_printer_by_long_name(models[n]);
+
+ if (printer)
+ {
+ if (write_ppd(printer, prefix, language, verbose))
+ return 1;
+ }
+ else
+ {
+ printf("Driver not found: %s\n", models[n]);
+ return (1);
+ }
+ }
+ stp_free(models);
+ }
+ else
+ {
+ for (i = 0; i < stp_printer_model_count(); i++)
+ {
+ printer = stp_get_printer_by_index(i);
+ if (printer && write_ppd(printer, prefix, language, verbose))
+ return (1);
+ }
+ }
if (!verbose)
- fprintf(stderr, "\n");
+ fprintf(stderr, " done.\n");
+ if (langs)
+ {
+ char **langs_tmp = langs;
+ while (*langs_tmp)
+ {
+ stp_free(*langs_tmp);
+ langs_tmp++;
+ }
+ stp_free(langs);
+ }
return (0);
}
-
/*
- * 'initialize_stp_options()' - Initialize the min/max values for
- * each STP numeric option.
+ * 'usage()' - Show program usage...
*/
void
-initialize_stp_options(void)
+usage(void)
{
- const stp_vars_t lower = stp_minimum_settings();
- const stp_vars_t upper = stp_maximum_settings();
- const stp_vars_t defvars = stp_default_settings();
-
-
- stp_options[0].low = 1000 * stp_get_brightness(lower);
- stp_options[0].high = 1000 * stp_get_brightness(upper);
- stp_options[0].defval = 1000 * stp_get_brightness(defvars);
- stp_options[0].step = 50;
-
- stp_options[1].low = 1000 * stp_get_contrast(lower);
- stp_options[1].high = 1000 * stp_get_contrast(upper);
- stp_options[1].defval = 1000 * stp_get_contrast(defvars);
- stp_options[1].step = 50;
-
- stp_options[2].low = 1000 * stp_get_gamma(lower);
- stp_options[2].high = 1000 * stp_get_gamma(upper);
- stp_options[2].defval = 1000 * stp_get_gamma(defvars);
- stp_options[2].step = 50;
-
- stp_options[3].low = 1000 * stp_get_density(lower);
- stp_options[3].high = 1000 * stp_get_density(upper);
- stp_options[3].defval = 1000 * stp_get_density(defvars);
- stp_options[3].step = 50;
-
-#ifndef __APPLE__
- stp_options[4].low = 1000 * stp_get_cyan(lower);
- stp_options[4].high = 1000 * stp_get_cyan(upper);
- stp_options[4].defval = 1000 * stp_get_cyan(defvars);
- stp_options[4].step = 50;
-
- stp_options[5].low = 1000 * stp_get_magenta(lower);
- stp_options[5].high = 1000 * stp_get_magenta(upper);
- stp_options[5].defval = 1000 * stp_get_magenta(defvars);
- stp_options[5].step = 50;
-
- stp_options[6].low = 1000 * stp_get_yellow(lower);
- stp_options[6].high = 1000 * stp_get_yellow(upper);
- stp_options[6].defval = 1000 * stp_get_yellow(defvars);
- stp_options[6].step = 50;
-
- stp_options[7].low = 1000 * stp_get_saturation(lower);
- stp_options[7].high = 1000 * stp_get_saturation(upper);
- stp_options[7].defval = 1000 * stp_get_saturation(defvars);
- stp_options[7].step = 50;
-#else
- stp_options[4].low = 1000 * stp_get_saturation(lower);
- stp_options[4].high = 1000 * stp_get_saturation(upper);
- stp_options[4].defval = 1000 * stp_get_saturation(defvars);
- stp_options[4].step = 50;
-
- stp_options[5].low = 1000 * stp_get_cyan(lower);
- stp_options[5].high = 1000 * stp_get_cyan(upper);
- stp_options[5].defval = 1000 * stp_get_cyan(defvars);
- stp_options[5].step = 50;
-
- stp_options[6].low = 1000 * stp_get_magenta(lower);
- stp_options[6].high = 1000 * stp_get_magenta(upper);
- stp_options[6].defval = 1000 * stp_get_magenta(defvars);
- stp_options[6].step = 50;
-
- stp_options[7].low = 1000 * stp_get_yellow(lower);
- stp_options[7].high = 1000 * stp_get_yellow(upper);
- stp_options[7].defval = 1000 * stp_get_yellow(defvars);
- stp_options[7].step = 50;
-#endif /* __APPLE__ */
+ puts("Usage: cups-genppd [-c localedir] "
+ "[-l locale] [-p prefix] [-q] [-v] models...\n"
+ " cups-genppd -L [-c localedir]\n"
+ " cups-genppd -M [-v]\n"
+ " cups-genppd -h\n"
+ " cups-genppd -V\n");
}
+void
+help(void)
+{
+ puts("Generate Gutenprint PPD files for use with CUPS\n\n");
+ usage();
+ puts("\nExamples: LANG=de_DE cups-genppd -p ppd -c /usr/share/locale\n"
+ " cups-genppd -L -c /usr/share/locale\n"
+ " cups-genppd -M -v\n\n"
+ "Commands:\n"
+ " -h Show this help message.\n"
+ " -L List available translations (message catalogs).\n"
+ " -M List available printer models.\n"
+ " -V Show version information and defaults.\n"
+ " The default is to output PPDs.\n"
+ "Options:\n"
+ " -c localedir Use localedir as the base directory for locale data.\n"
+ " -l locale Output PPDs translated with messages for locale.\n"
+ " -p prefix Output PPDs in directory prefix.\n"
+ " -d prefix Embed directory prefix in PPD file.\n"
+ " -q Quiet mode.\n"
+ " -v Verbose mode.\n"
+ "models:\n"
+ " A list of printer models, either the driver or quoted full name.\n");
+}
/*
- * 'usage()' - Show program usage...
+ * 'dirent_sort()' - sort directory entries
*/
+static int
+dirent_sort(const void *a,
+ const void *b)
+{
+ return strcoll ((*(const struct dirent *const *) a)->d_name,
+ (*(const struct dirent *const *) b)->d_name);
+}
-void
-usage(void)
+/*
+ * 'getlangs()' - Get a list of available translations
+ */
+
+char **
+getlangs(void)
{
- fputs("Usage: genppd [--help] [--catalog=domain] "
- "[--language=locale] [--prefix=dir]\n", stderr);
+ struct dirent** langdirs;
+ int n;
+ char **langs;
+
+ n = stpi_scandir (baselocaledir, &langdirs, checkcat, dirent_sort);
+ if (n >= 0)
+ {
+ int idx;
+ langs = stp_malloc((n+1) * sizeof(char*));
+ for (idx = 0; idx < n; ++idx)
+ {
+ langs[idx] = (char*) stp_malloc((strlen(langdirs[idx]->d_name)+1) * sizeof(char));
+ strcpy(langs[idx], langdirs[idx]->d_name);
+ free (langdirs[idx]); /* Must use plain free() */
+ }
+ langs[n] = NULL;
+ free (langdirs); /* Must use plain free() */
+ }
+ else
+ return NULL;
- exit(EXIT_FAILURE);
+ return langs;
}
-const char *
-find_manufacturer_from_name(const char *name)
+
+/*
+ * 'printlangs()' - Print list of available translations
+ */
+
+void printlangs(char **langs)
{
- int i = 0;
- while (stp_manufacturers[i].manufacturer_real_name)
+ if (langs)
{
- if (strncasecmp(name, stp_manufacturers[i].manufacturer_embedded_name,
- strlen(stp_manufacturers[i].manufacturer_embedded_name)) == 0)
- return stp_manufacturers[i].manufacturer_real_name;
- i++;
+ int n = 0;
+ while (langs && langs[n])
+ {
+ printf("%s\n", langs[n]);
+ n++;
+ }
+ }
+ exit (EXIT_SUCCESS);
+}
+
+
+/*
+ * 'printmodels' - Print a list of available models
+ */
+
+void printmodels(int verbose)
+{
+ const stp_printer_t *p;
+ int i;
+
+ for (i = 0; i < stp_printer_model_count(); i++)
+ {
+ p = stp_get_printer_by_index(i);
+ if (p &&
+ strcmp(stp_printer_get_family(p), "ps") != 0 &&
+ strcmp(stp_printer_get_family(p), "raw") != 0)
+ {
+ if(verbose)
+ printf("%-20s%s\n", stp_printer_get_driver(p),
+ stp_printer_get_long_name(p));
+ else
+ printf("%s\n", stp_printer_get_driver(p));
+ }
+ }
+ exit (EXIT_SUCCESS);
+}
+
+/* Adapted from GNU libc <dirent.h>
+ These macros extract size information from a `struct dirent *'.
+ They may evaluate their argument multiple times, so it must not
+ have side effects. Each of these may involve a relatively costly
+ call to `strlen' on some systems, so these values should be cached.
+
+ _D_EXACT_NAMLEN (DP) returns the length of DP->d_name, not including
+ its terminating null character.
+
+ _D_ALLOC_NAMLEN (DP) returns a size at least (_D_EXACT_NAMLEN (DP) + 1);
+ that is, the allocation size needed to hold the DP->d_name string.
+ Use this macro when you don't need the exact length, just an upper bound.
+ This macro is less likely to require calling `strlen' than _D_EXACT_NAMLEN.
+ */
+
+#ifdef _DIRENT_HAVE_D_NAMLEN
+# ifndef _D_EXACT_NAMLEN
+# define _D_EXACT_NAMLEN(d) ((d)->d_namlen)
+# endif
+# ifndef _D_ALLOC_NAMLEN
+# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
+# endif
+#else
+# ifndef _D_EXACT_NAMLEN
+# define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name))
+# endif
+# ifndef _D_ALLOC_NAMLEN
+# ifdef _DIRENT_HAVE_D_RECLEN
+# define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0])
+# else
+# define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \
+ _D_EXACT_NAMLEN (d) + 1)
+# endif
+# endif
+#endif
+
+/*
+ * 'stpi_scandir()' - BSD scandir() replacement.
+ */
+
+static int
+stpi_scandir (const char *dir,
+ struct dirent ***namelist,
+ int (*sel) (const struct dirent *),
+ int (*cmp) (const void *, const void *))
+{
+ DIR *dp = opendir (dir);
+ struct dirent **v = NULL;
+ size_t vsize = 0, i;
+ struct dirent *d;
+ int save;
+
+ if (dp == NULL)
+ return -1;
+
+ save = errno;
+ errno = 0;
+
+ i = 0;
+ while ((d = readdir (dp)) != NULL)
+ if (sel == NULL || (*sel) (d))
+ {
+ struct dirent *vnew;
+ size_t dsize;
+
+ /* Ignore errors from sel or readdir */
+ errno = 0;
+
+ if (i == vsize)
+ {
+ struct dirent **new;
+ if (vsize == 0)
+ vsize = 10;
+ else
+ vsize *= 2;
+ new = (struct dirent **) realloc (v, vsize * sizeof (*v));
+ if (new == NULL)
+ break;
+ v = new;
+ }
+
+ dsize = &d->d_name[_D_ALLOC_NAMLEN (d)] - (char *) d;
+ vnew = (struct dirent *) malloc (dsize);
+ if (vnew == NULL)
+ break;
+
+ v[i++] = (struct dirent *) memcpy (vnew, d, dsize);
+ }
+
+ if (errno != 0)
+ {
+ save = errno;
+
+ while (i > 0)
+ free (v[--i]);
+ free (v);
+
+ i = -1;
}
- fprintf(stderr, "Cannot determine manufacturer of %s\n!", name);
- abort();
- return NULL;
+ else
+ {
+ /* Sort the list if we have a comparison function to sort with. */
+ if (cmp != NULL)
+ qsort (v, i, sizeof (*v), cmp);
+
+ *namelist = v;
+ }
+
+ (void) closedir (dp);
+ errno = save;
+
+ return i;
}
+/*
+ * 'checkcat()' - A callback for stpi_scandir() to check
+ * if a message catalogue exists
+ */
+
+int
+checkcat (const struct dirent *localedir)
+{
+ char* catpath;
+ int catlen, status = 0, savederr;
+ struct stat catstat;
+
+ savederr = errno; /* since we are a callback, preserve stpi_scandir() state */
+
+ /* LOCALEDIR / LANG / LC_MESSAGES/CATALOG */
+ /* Add 3, for two '/' separators and '\0' */
+ catlen = strlen(baselocaledir) + strlen(localedir->d_name) + strlen(CATALOG) + 3;
+ catpath = (char*) stp_malloc(catlen * sizeof(char));
+
+ strncpy (catpath, baselocaledir, strlen(baselocaledir));
+ catlen = strlen(baselocaledir);
+ *(catpath+catlen) = '/';
+ catlen++;
+ strncpy (catpath+catlen, localedir->d_name, strlen(localedir->d_name));
+ catlen += strlen(localedir->d_name);
+ *(catpath+catlen) = '/';
+ catlen++;
+ strncpy (catpath+catlen, CATALOG, strlen(CATALOG));
+ catlen += strlen(CATALOG);
+ *(catpath+catlen) = '\0';
+
+ if (!stat (catpath, &catstat))
+ {
+ if (S_ISREG(catstat.st_mode))
+ {
+ status = 1;
+ }
+ }
+
+ stp_free (catpath);
+
+ errno = savederr;
+ return status;
+}
/*
* 'write_ppd()' - Write a PPD file.
*/
int /* O - Exit status */
-write_ppd(const stp_printer_t p, /* I - Printer driver */
+write_ppd(const stp_printer_t *p, /* I - Printer driver */
const char *prefix, /* I - Prefix (directory) for PPD files */
- const char *language,/* I - Language/locale */
+ const char *language,
int verbose)
{
- int i, j; /* Looping vars */
+ int i, j, k, l; /* Looping vars */
gzFile fp; /* File to write to */
char filename[1024]; /* Filename */
- const char *driverptr; /* Pointer into driver name */
- const char *manufacturer; /* Manufacturer name */
int num_opts; /* Number of printer options */
- stp_param_t *opts; /* Printer options */
- const char *defopt; /* Default printer option */
int xdpi, ydpi; /* Resolution info */
- stp_vars_t v; /* Variable info */
+ stp_vars_t *v; /* Variable info */
int width, height, /* Page information */
bottom, left,
top, right;
const char *driver; /* Driver name */
const char *long_name; /* Driver long name */
- stp_vars_t printvars; /* Printer option names */
- int model; /* Driver model number */
- const stp_printfuncs_t *printfuncs; /* Driver functions */
+ const char *manufacturer; /* Manufacturer of printer */
+ const stp_vars_t *printvars; /* Printer option names */
paper_t *the_papers; /* Media sizes */
int cur_opt; /* Current option */
+ struct stat dir; /* prefix dir status */
int variable_sizes; /* Does the driver support variable sizes? */
int min_width, /* Min/max custom size */
min_height,
max_width,
max_height;
-
+ stp_parameter_t desc;
+ stp_parameter_list_t param_list;
+ const stp_param_string_t *opt;
+ int has_quality_parameter = 0;
+ int has_image_type_parameter = 0;
+ int printer_is_color = 0;
/*
* Initialize driver-specific variables...
@@ -461,9 +783,8 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
driver = stp_printer_get_driver(p);
long_name = stp_printer_get_long_name(p);
- printvars = stp_printer_get_printvars(p);
- model = stp_printer_get_model(p);
- printfuncs = stp_printer_get_printfuncs(p);
+ manufacturer = stp_printer_get_manufacturer(p);
+ printvars = stp_printer_get_defaults(p);
the_papers = NULL;
cur_opt = 0;
@@ -471,16 +792,37 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
* Skip the PostScript drivers...
*/
- if (strcmp(driver, "ps") == 0 ||
- strcmp(driver, "ps2") == 0)
+ if (strcmp(stp_printer_get_family(p), "ps") == 0 ||
+ strcmp(stp_printer_get_family(p), "raw") == 0)
return (0);
/*
* Make sure the destination directory exists...
*/
- mkdir(prefix, 0777);
- sprintf(filename, "%s/%s" PPDEXT, prefix, driver);
+
+ if (stat(prefix, &dir) && !S_ISDIR(dir.st_mode))
+ {
+ if (mkdir(prefix, 0777))
+ {
+ printf("cups-genppd: Cannot create directory %s: %s\n",
+ prefix, strerror(errno));
+ exit (EXIT_FAILURE);
+ }
+ }
+
+ /*
+ * The files will be named stp-<driver>.<major>.<minor>.ppd, for
+ * example:
+ *
+ * stp-escp2-ex.5.0.ppd
+ *
+ * or
+ *
+ * stp-escp2-ex.5.0.ppd.gz
+ */
+ snprintf(filename, sizeof(filename) - 1, "%s/stp-%s.%s%s%s",
+ prefix, driver, GUTENPRINT_RELEASE_VERSION, ppdext, gzext);
/*
* Open the PPD file...
@@ -488,7 +830,7 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
if ((fp = gzopen(filename, "wb")) == NULL)
{
- fprintf(stderr, "genppd: Unable to create file \"%s\" - %s.\n",
+ fprintf(stderr, "cups-genppd: Unable to create file \"%s\" - %s.\n",
filename, strerror(errno));
return (2);
}
@@ -497,18 +839,27 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
* Write a standard header...
*/
- manufacturer = find_manufacturer_from_name(long_name);
-
if (verbose)
fprintf(stderr, "Writing %s...\n", filename);
else
fprintf(stderr, ".");
gzputs(fp, "*PPD-Adobe: \"4.3\"\n");
- gzputs(fp, "*%PPD file for CUPS/Gimp-Print.\n");
- gzputs(fp, "*%Copyright 1993-2001 by Easy Software Products, All Rights Reserved.\n");
- gzputs(fp, "*%This PPD file may be freely used and distributed under the terms of\n");
- gzputs(fp, "*%the GNU GPL.\n");
+ gzputs(fp, "*%PPD file for CUPS/Gutenprint.\n");
+ gzputs(fp, "*%Copyright 1993-2005 by Easy Software Products and Robert Krawitz.\n");
+ gzputs(fp, "*%This program is free software; you can redistribute it and/or\n");
+ gzputs(fp, "*%modify it under the terms of the GNU General Public License,\n");
+ gzputs(fp, "*%version 2, as published by the Free Software Foundation.\n");
+ gzputs(fp, "*%\n");
+ gzputs(fp, "*%This program is distributed in the hope that it will be useful, but\n");
+ gzputs(fp, "*%WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n");
+ gzputs(fp, "*%or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n");
+ gzputs(fp, "*%for more details.\n");
+ gzputs(fp, "*%\n");
+ gzputs(fp, "*%You should have received a copy of the GNU General Public License\n");
+ gzputs(fp, "*%along with this program; if not, write to the Free Software\n");
+ gzputs(fp, "*%Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n");
+ gzputs(fp, "*%\n");
gzputs(fp, "*FormatVersion: \"4.3\"\n");
gzputs(fp, "*FileVersion: \"" VERSION "\"\n");
/* Specify language of PPD translation */
@@ -526,10 +877,9 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
* The following code generates a (hopefully unique) 8.3 filename from
* the driver name, and makes the filename all UPPERCASE as well...
*/
-
+
gzprintf(fp, "*PCFileName: \"STP%05d.PPD\"\n",
stp_get_printer_index_by_driver(driver));
-
gzprintf(fp, "*Manufacturer: \"%s\"\n", manufacturer);
/*
@@ -541,6 +891,7 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
gzputs(fp, "*Product: \"(AFPL Ghostscript)\"\n");
gzputs(fp, "*Product: \"(GNU Ghostscript)\"\n");
gzputs(fp, "*Product: \"(ESP Ghostscript)\"\n");
+ gzputs(fp, "*Product: \"(GPL Ghostscript)\"\n");
/*
* The ModelName attribute now provides the long name rather than the
@@ -555,84 +906,128 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
* with commas. Now use a dash instead...
*/
- gzprintf(fp, "*NickName: \"%s - CUPS+Gimp-Print v" VERSION "\"\n",
- long_name);
-#if CUPS_PPD_PS_LEVEL == 2
- gzputs(fp, "*PSVersion: \"(2017.000) 550\"\n");
-#else
- gzputs(fp, "*PSVersion: \"(3010.000) 705\"\n");
-#endif /* CUPS_PPD_PS_LEVEL == 2 */
- gzprintf(fp, "*LanguageLevel: \"%d\"\n", CUPS_PPD_PS_LEVEL);
-
- /* Assume that color printers are inkjets and should have pages reversed */
- if (stp_get_output_type(printvars) == OUTPUT_COLOR)
+ /*
+ * NOTE - code in rastertoprinter looks for this version string.
+ * If this is changed, the corresponding change must be made in
+ * rastertoprinter.c. Look for "ppd->nickname"
+ */
+ gzprintf(fp, "*NickName: \"%s%s%s\"\n",
+ long_name, CUPS_PPD_NICKNAME_STRING, VERSION);
+ if (cups_ppd_ps_level == 2)
+ gzputs(fp, "*PSVersion: \"(2017.000) 550\"\n");
+ else
{
- gzputs(fp, "*ColorDevice: True\n");
- gzputs(fp, "*DefaultColorSpace: RGB\n");
+ gzputs(fp, "*PSVersion: \"(3010.000) 550\"\n");
+ gzputs(fp, "*PSVersion: \"(3010.000) 651\"\n");
+ gzputs(fp, "*PSVersion: \"(3010.000) 652\"\n");
+ gzputs(fp, "*PSVersion: \"(3010.000) 653\"\n");
+ gzputs(fp, "*PSVersion: \"(3010.000) 704\"\n");
+ gzputs(fp, "*PSVersion: \"(3010.000) 705\"\n");
+ gzputs(fp, "*PSVersion: \"(3010.000) 707\"\n");
+ gzputs(fp, "*PSVersion: \"(3010.000) 800\"\n");
+ gzputs(fp, "*PSVersion: \"(3010.000) 815\"\n");
+ gzputs(fp, "*PSVersion: \"(3010.000) 850\"\n");
+ gzputs(fp, "*PSVersion: \"(3010.000) 81501\"\n");
}
- else
+ gzprintf(fp, "*LanguageLevel: \"%d\"\n", cups_ppd_ps_level);
+
+ /* Set Job Mode to "Job" as this enables the Duplex option */
+ v = stp_vars_create_copy(printvars);
+ stp_set_string_parameter(v, "JobMode", "Job");
+
+ /* Assume that color printers are inkjets and should have pages reversed */
+ stp_describe_parameter(v, "PrintingMode", &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
{
- gzputs(fp, "*ColorDevice: False\n");
- gzputs(fp, "*DefaultColorSpace: Gray\n");
+ if (stp_string_list_is_present(desc.bounds.str, "Color"))
+ {
+ printer_is_color = 1;
+ gzputs(fp, "*ColorDevice: True\n");
+ }
+ else
+ {
+ printer_is_color = 0;
+ gzputs(fp, "*ColorDevice: False\n");
+ }
+ if (strcmp(desc.deflt.str, "Color") == 0)
+ gzputs(fp, "*DefaultColorSpace: RGB\n");
+ else
+ gzputs(fp, "*DefaultColorSpace: Gray\n");
}
+ stp_parameter_description_destroy(&desc);
gzputs(fp, "*FileSystem: False\n");
gzputs(fp, "*LandscapeOrientation: Plus90\n");
gzputs(fp, "*TTRasterizer: Type42\n");
- gzputs(fp, "*RequiresPageRegion All: True\n");
gzputs(fp, "*cupsVersion: 1.1\n");
- gzprintf(fp, "*cupsModelNumber: \"%d\"\n", model);
+ gzprintf(fp, "*cupsModelNumber: \"0\"\n");
gzputs(fp, "*cupsManualCopies: True\n");
- gzputs(fp, "*cupsFilter: \"application/vnd.cups-raster 100 rastertoprinter\"\n");
+ gzprintf(fp, "*cupsFilter: \"application/vnd.cups-raster 100 rastertogutenprint.%s\"\n", GUTENPRINT_RELEASE_VERSION);
if (strcasecmp(manufacturer, "EPSON") == 0)
gzputs(fp, "*cupsFilter: \"application/vnd.cups-command 33 commandtoepson\"\n");
gzputs(fp, "\n");
+ gzprintf(fp, "*StpDriverName: \"%s\"\n", driver);
+ gzprintf(fp, "*StpPPDLocation: \"%s%s%s/stp-%s.%s%s%s\"\n",
+ cups_modeldir,
+ cups_modeldir[strlen(cups_modeldir) - 1] == '/' ? "" : "/",
+ language ? language : "C",
+ driver,
+ GUTENPRINT_RELEASE_VERSION,
+ ppdext,
+ gzext);
+ gzprintf(fp, "*StpLocale: \"%s\"\n", language ? language : "C");
/*
* Get the page sizes from the driver...
*/
- v = stp_allocate_copy(printvars);
+ if (printer_is_color)
+ stp_set_string_parameter(v, "PrintingMode", "Color");
+ else
+ stp_set_string_parameter(v, "PrintingMode", "BW");
+ stp_set_string_parameter(v, "ChannelBitDepth", "8");
variable_sizes = 0;
- opts = (*(printfuncs->parameters))(p, NULL, "PageSize", &num_opts);
- defopt = (*(printfuncs->default_parameters))(p, NULL, "PageSize");
- the_papers = malloc(sizeof(paper_t) * num_opts);
+ stp_describe_parameter(v, "PageSize", &desc);
+ num_opts = stp_string_list_count(desc.bounds.str);
+ the_papers = stp_malloc(sizeof(paper_t) * num_opts);
for (i = 0; i < num_opts; i++)
{
- const stp_papersize_t papersize = stp_get_papersize_by_name(opts[i].name);
+ const stp_papersize_t *papersize;
+ opt = stp_string_list_param(desc.bounds.str, i);
+ papersize = stp_get_papersize_by_name(opt->name);
if (!papersize)
{
- printf("Unable to lookup size %s!\n", opts[i].name);
+ printf("Unable to lookup size %s!\n", opt->name);
continue;
}
- if (strcmp(opts[i].name, "Custom") == 0)
+ if (strcmp(opt->name, "Custom") == 0)
{
variable_sizes = 1;
continue;
}
- width = stp_papersize_get_width(papersize);
- height = stp_papersize_get_height(papersize);
+ width = papersize->width;
+ height = papersize->height;
if (width <= 0 || height <= 0)
continue;
- stp_set_media_size(v, opts[i].name);
+ stp_set_string_parameter(v, "PageSize", opt->name);
- (*(printfuncs->media_size))(p, v, &width, &height);
- (*(printfuncs->imageable_area))(p, v, &left, &right, &bottom, &top);
+ stp_get_media_size(v, &width, &height);
+ stp_get_imageable_area(v, &left, &right, &bottom, &top);
- the_papers[cur_opt].name = opts[i].name;
- the_papers[cur_opt].text = opts[i].text;
+ the_papers[cur_opt].name = opt->name;
+ the_papers[cur_opt].text = opt->text;
the_papers[cur_opt].width = width;
the_papers[cur_opt].height = height;
the_papers[cur_opt].left = left;
the_papers[cur_opt].right = right;
- the_papers[cur_opt].bottom = bottom;
- the_papers[cur_opt].top = top;
+ the_papers[cur_opt].bottom = height - bottom;
+ the_papers[cur_opt].top = height - top;
cur_opt++;
}
@@ -646,7 +1041,7 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
gzputs(fp, "*OpenUI *PageSize: PickOne\n");
gzputs(fp, "*OrderDependency: 10 AnySetup *PageSize\n");
- gzprintf(fp, "*DefaultPageSize: %s\n", defopt);
+ gzprintf(fp, "*DefaultPageSize: %s\n", desc.deflt.str);
for (i = 0; i < cur_opt; i ++)
{
gzprintf(fp, "*PageSize %s", the_papers[i].name);
@@ -657,7 +1052,7 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
gzputs(fp, "*OpenUI *PageRegion: PickOne\n");
gzputs(fp, "*OrderDependency: 10 AnySetup *PageRegion\n");
- gzprintf(fp, "*DefaultPageRegion: %s\n", defopt);
+ gzprintf(fp, "*DefaultPageRegion: %s\n", desc.deflt.str);
for (i = 0; i < cur_opt; i ++)
{
gzprintf(fp, "*PageRegion %s", the_papers[i].name);
@@ -666,7 +1061,7 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
}
gzputs(fp, "*CloseUI: *PageRegion\n\n");
- gzprintf(fp, "*DefaultImageableArea: %s\n", defopt);
+ gzprintf(fp, "*DefaultImageableArea: %s\n", desc.deflt.str);
for (i = 0; i < cur_opt; i ++)
{
gzprintf(fp, "*ImageableArea %s", the_papers[i].name);
@@ -676,7 +1071,7 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
}
gzputs(fp, "\n");
- gzprintf(fp, "*DefaultPaperDimension: %s\n", defopt);
+ gzprintf(fp, "*DefaultPaperDimension: %s\n", desc.deflt.str);
for (i = 0; i < cur_opt; i ++)
{
@@ -688,16 +1083,16 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
if (variable_sizes)
{
- (*(printfuncs->limit))(p, v, &max_width, &max_height,
- &min_width, &min_height);
- stp_set_media_size(v, "Custom");
- (*(printfuncs->media_size))(p, v, &width, &height);
- (*(printfuncs->imageable_area))(p, v, &left, &right, &bottom, &top);
+ stp_get_size_limit(v, &max_width, &max_height,
+ &min_width, &min_height);
+ stp_set_string_parameter(v, "PageSize", "Custom");
+ stp_get_media_size(v, &width, &height);
+ stp_get_imageable_area(v, &left, &right, &bottom, &top);
gzprintf(fp, "*MaxMediaWidth: \"%d\"\n", max_width);
gzprintf(fp, "*MaxMediaHeight: \"%d\"\n", max_height);
gzprintf(fp, "*HWMargins: %d %d %d %d\n",
- left, bottom, width - right, height - top);
+ left, height - bottom, width - right, top);
gzputs(fp, "*CustomPageSize True: \"pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice\"\n");
gzprintf(fp, "*ParamCustomPageSize Width: 1 points %d %d\n",
min_width, max_width);
@@ -708,32 +1103,18 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
gzputs(fp, "*ParamCustomPageSize Orientation: 5 int 0 0\n\n");
}
- if (opts)
- {
- for (i = 0; i < num_opts; i++)
- {
- free((void *)opts[i].name);
- free((void *)opts[i].text);
- }
-
- free(opts);
- }
-
+ stp_parameter_description_destroy(&desc);
if (the_papers)
- free(the_papers);
-
-#ifdef __APPLE__
- gzputs(fp, "*OpenGroup: MAIN/Basic settings\n");
-#endif
+ stp_free(the_papers);
/*
* Do we support color?
*/
- gzputs(fp, "*OpenUI *ColorModel: PickOne\n");
+ gzputs(fp, "*OpenUI *ColorModel/Color Model: PickOne\n");
gzputs(fp, "*OrderDependency: 10 AnySetup *ColorModel\n");
- if (stp_get_output_type(printvars) == OUTPUT_COLOR)
+ if (printer_is_color)
gzputs(fp, "*DefaultColorModel: RGB\n");
else
gzputs(fp, "*DefaultColorModel: Gray\n");
@@ -741,100 +1122,176 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
gzprintf(fp, "*ColorModel Gray/Grayscale:\t\"<<"
"/cupsColorSpace %d"
"/cupsColorOrder %d"
- "/cupsBitsPerColor 8>>setpagedevice\"\n",
+ ">>setpagedevice\"\n",
CUPS_CSPACE_W, CUPS_ORDER_CHUNKED);
- gzprintf(fp, "*ColorModel Black/Black & White:\t\"<<"
+ gzprintf(fp, "*ColorModel Black/Inverted Grayscale:\t\"<<"
"/cupsColorSpace %d"
"/cupsColorOrder %d"
- "/cupsBitsPerColor 8>>setpagedevice\"\n",
+ ">>setpagedevice\"\n",
CUPS_CSPACE_K, CUPS_ORDER_CHUNKED);
- if (stp_get_output_type(printvars) == OUTPUT_COLOR)
+ if (printer_is_color)
{
- gzprintf(fp, "*ColorModel RGB/Color:\t\"<<"
+ gzprintf(fp, "*ColorModel RGB/RGB Color:\t\"<<"
"/cupsColorSpace %d"
"/cupsColorOrder %d"
- "/cupsBitsPerColor 8>>setpagedevice\"\n",
+ ">>setpagedevice\"\n",
CUPS_CSPACE_RGB, CUPS_ORDER_CHUNKED);
- gzprintf(fp, "*ColorModel CMYK/Raw CMYK:\t\"<<"
+ gzprintf(fp, "*ColorModel CMY/CMY Color:\t\"<<"
+ "/cupsColorSpace %d"
+ "/cupsColorOrder %d"
+ ">>setpagedevice\"\n",
+ CUPS_CSPACE_CMY, CUPS_ORDER_CHUNKED);
+ gzprintf(fp, "*ColorModel CMYK/CMYK:\t\"<<"
"/cupsColorSpace %d"
"/cupsColorOrder %d"
- "/cupsBitsPerColor 8>>setpagedevice\"\n",
+ ">>setpagedevice\"\n",
CUPS_CSPACE_CMYK, CUPS_ORDER_CHUNKED);
+ gzprintf(fp, "*ColorModel KCMY/KCMY:\t\"<<"
+ "/cupsColorSpace %d"
+ "/cupsColorOrder %d"
+ ">>setpagedevice\"\n",
+ CUPS_CSPACE_KCMY, CUPS_ORDER_CHUNKED);
}
gzputs(fp, "*CloseUI: *ColorModel\n\n");
+ /*
+ * 8 or 16 bit color (16 bit is slower)
+ */
+ gzputs(fp, "*OpenUI *StpColorPrecision/Color Precision: PickOne\n");
+ gzputs(fp, "*OrderDependency: 10 AnySetup *StpColorPrecision\n");
+ gzputs(fp, "*DefaultStpColorPrecision: Normal\n");
+ gzputs(fp, "*StpColorPrecision Normal/Normal:\t\"<<"
+ "/cupsBitsPerColor 8>>setpagedevice\"\n");
+ gzputs(fp, "*StpColorPrecision Best/Best:\t\"<<"
+ "/cupsBitsPerColor 8"
+ "/cupsPreferredBitsPerColor 16>>setpagedevice\"\n");
+ gzputs(fp, "*CloseUI: *StpColorPrecision\n\n");
+
/*
* Media types...
*/
- opts = (*(printfuncs->parameters))(p, NULL, "MediaType", &num_opts);
- defopt = (*(printfuncs->default_parameters))(p, NULL, "MediaType");
+ stp_describe_parameter(v, "MediaType", &desc);
+ num_opts = stp_string_list_count(desc.bounds.str);
if (num_opts > 0)
{
gzprintf(fp, "*OpenUI *MediaType/%s: PickOne\n", _("Media Type"));
gzputs(fp, "*OrderDependency: 10 AnySetup *MediaType\n");
- gzprintf(fp, "*DefaultMediaType: %s\n", defopt);
+ gzprintf(fp, "*DefaultMediaType: %s\n", desc.deflt.str);
for (i = 0; i < num_opts; i ++)
{
+ opt = stp_string_list_param(desc.bounds.str, i);
gzprintf(fp, "*MediaType %s/%s:\t\"<</MediaType(%s)>>setpagedevice\"\n",
- opts[i].name, opts[i].text, opts[i].name);
- free((void *)opts[i].name);
- free((void *)opts[i].text);
+ opt->name, opt->text, opt->name);
}
- free(opts);
-
gzputs(fp, "*CloseUI: *MediaType\n\n");
}
+ stp_parameter_description_destroy(&desc);
/*
* Input slots...
*/
- opts = (*(printfuncs->parameters))(p, NULL, "InputSlot", &num_opts);
- defopt = (*(printfuncs->default_parameters))(p, NULL, "InputSlot");
+ stp_describe_parameter(v, "InputSlot", &desc);
+ num_opts = stp_string_list_count(desc.bounds.str);
if (num_opts > 0)
{
gzprintf(fp, "*OpenUI *InputSlot/%s: PickOne\n", _("Media Source"));
gzputs(fp, "*OrderDependency: 10 AnySetup *InputSlot\n");
- gzprintf(fp, "*DefaultInputSlot: %s\n", defopt);
+ gzprintf(fp, "*DefaultInputSlot: %s\n", desc.deflt.str);
for (i = 0; i < num_opts; i ++)
{
+ opt = stp_string_list_param(desc.bounds.str, i);
gzprintf(fp, "*InputSlot %s/%s:\t\"<</MediaClass(%s)>>setpagedevice\"\n",
- opts[i].name, opts[i].text, opts[i].name);
- free((void *)opts[i].name);
- free((void *)opts[i].text);
+ opt->name, opt->text, opt->name);
}
- free(opts);
-
gzputs(fp, "*CloseUI: *InputSlot\n\n");
}
+ stp_parameter_description_destroy(&desc);
+
+ /*
+ * Quality settings
+ */
+
+ stp_describe_parameter(v, "Quality", &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST && desc.is_active)
+ {
+ stp_clear_string_parameter(v, "Resolution");
+ has_quality_parameter = 1;
+ gzprintf(fp, "*OpenUI *StpQuality/%s: PickOne\n", _(desc.text));
+ gzputs(fp, "*OrderDependency: 5 AnySetup *StpQuality\n");
+ gzprintf(fp, "*DefaultStpQuality: %s\n", desc.deflt.str);
+ num_opts = stp_string_list_count(desc.bounds.str);
+ for (i = 0; i < num_opts; i++)
+ {
+ opt = stp_string_list_param(desc.bounds.str, i);
+ stp_set_string_parameter(v, "Quality", opt->name);
+ stp_describe_resolution(v, &xdpi, &ydpi);
+ if (xdpi == -1 || ydpi == -1)
+ gzprintf(fp, "*StpQuality %s/%s: \"\"\n", opt->name, opt->text);
+ else
+ gzprintf(fp, "*StpQuality %s/%s:\t\"<</HWResolution[%d %d]>>setpagedevice\"\n",
+ opt->name, opt->text, xdpi, ydpi);
+ }
+ gzputs(fp, "*CloseUI: *StpQuality\n\n");
+ }
+ stp_parameter_description_destroy(&desc);
+ stp_clear_string_parameter(v, "Quality");
+
+ /*
+ * Image type
+ */
+
+ stp_describe_parameter(v, "ImageType", &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST && desc.is_active)
+ {
+ has_image_type_parameter = 1;
+ gzprintf(fp, "*OpenUI *StpImageType/%s: PickOne\n", _(desc.text));
+ gzputs(fp, "*OrderDependency: 5 AnySetup *StpImageType\n");
+ gzprintf(fp, "*DefaultStpImageType: %s\n", desc.deflt.str);
+ num_opts = stp_string_list_count(desc.bounds.str);
+ for (i = 0; i < num_opts; i++)
+ {
+ opt = stp_string_list_param(desc.bounds.str, i);
+ gzprintf(fp, "*StpImageType %s/%s: \"\"\n", opt->name, opt->text);
+ }
+ gzputs(fp, "*CloseUI: *StpImageType\n\n");
+ }
+ stp_parameter_description_destroy(&desc);
/*
* Resolutions...
*/
- opts = (*(printfuncs->parameters))(p, NULL, "Resolution", &num_opts);
- defopt = (*(printfuncs->default_parameters))(p, NULL, "Resolution");
+ stp_describe_parameter(v, "Resolution", &desc);
+ num_opts = stp_string_list_count(desc.bounds.str);
gzprintf(fp, "*OpenUI *Resolution/%s: PickOne\n", _("Resolution"));
gzputs(fp, "*OrderDependency: 20 AnySetup *Resolution\n");
- gzprintf(fp, "*DefaultResolution: %s\n", defopt);
+ if (has_quality_parameter)
+ gzprintf(fp, "*DefaultResolution: None\n");
+ else
+ gzprintf(fp, "*DefaultResolution: %s\n", desc.deflt.str);
+ stp_clear_string_parameter(v, "Quality");
+ if (has_quality_parameter)
+ gzprintf(fp, "*Resolution None/%s: \"\"\n", _("Automatic"));
for (i = 0; i < num_opts; i ++)
{
/*
* Strip resolution name to its essentials...
*/
-
- (printfuncs->describe_resolution)(p, opts[i].name, &xdpi, &ydpi);
+ opt = stp_string_list_param(desc.bounds.str, i);
+ stp_set_string_parameter(v, "Resolution", opt->name);
+ stp_describe_resolution(v, &xdpi, &ydpi);
/* This should not happen! */
if (xdpi == -1 || ydpi == -1)
@@ -845,158 +1302,358 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
*/
gzprintf(fp, "*Resolution %s/%s:\t\"<</HWResolution[%d %d]/cupsCompression %d>>setpagedevice\"\n",
- opts[i].name, opts[i].text, xdpi, ydpi, i);
- free((void *)opts[i].name);
- free((void *)opts[i].text);
+ opt->name, opt->text, xdpi, ydpi, i);
}
- free(opts);
+ stp_parameter_description_destroy(&desc);
gzputs(fp, "*CloseUI: *Resolution\n\n");
- /*
- * STP option group...
- */
-
-#ifndef __APPLE__
- gzprintf(fp, "*OpenGroup: STP/%s\n", _("GIMP-print"));
-#endif
-
- /*
- * Image types...
- */
-
- gzprintf(fp, "*OpenUI *stpImageType/%s: PickOne\n", _("Image Type"));
- gzputs(fp, "*OrderDependency: 10 AnySetup *stpImageType\n");
- gzputs(fp, "*DefaultstpImageType: LineArt\n");
-
- gzprintf(fp, "*stpImageType LineArt/%s:\t\"<</cupsRowCount 0>>setpagedevice\"\n",
- _("Line Art"));
- gzprintf(fp, "*stpImageType SolidTone/%s:\t\"<</cupsRowCount 1>>setpagedevice\"\n",
- _("Solid Colors"));
- gzprintf(fp, "*stpImageType Continuous/%s:\t\"<</cupsRowCount 2>>setpagedevice\"\n",
- _("Photograph"));
-
- gzputs(fp, "*CloseUI: *stpImageType\n\n");
-
- /*
- * Dithering algorithms...
- */
-
- gzprintf(fp, "*OpenUI *stpDither/%s: PickOne\n", _("Dither Algorithm"));
- gzputs(fp, "*OrderDependency: 10 AnySetup *stpDither\n");
- gzprintf(fp, "*DefaultstpDither: %s\n", stp_default_dither_algorithm());
-
- for (i = 0; i < stp_dither_algorithm_count(); i ++)
- gzprintf(fp, "*stpDither %s/%s: \"<</cupsRowStep %d>>setpagedevice\"\n",
- stp_dither_algorithm_name(i), stp_dither_algorithm_text(i), i);
-
- gzputs(fp, "*CloseUI: *stpDither\n\n");
-
- /*
- * InkTypes...
- */
+ stp_describe_parameter(v, "OutputOrder", &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
+ {
+ gzputs(fp, "*OpenUI *OutputOrder: PickOne\n");
+ gzputs(fp, "*OrderDependency: 10 AnySetup *OutputOrder\n");
+ gzprintf(fp, "*DefaultOutputOrder: %s\n", desc.deflt.str);
+ gzputs(fp, "*OutputOrder Normal/Normal: \"\"\n");
+ gzputs(fp, "*OutputOrder Reverse/Reverse: \"\"\n");
+ gzputs(fp, "*CloseUI: *OutputOrder\n\n");
+ }
+ stp_parameter_description_destroy(&desc);
- opts = (*(printfuncs->parameters))(p, NULL, "InkType", &num_opts);
- defopt = (*(printfuncs->default_parameters))(p, NULL, "InkType");
+ /*
+ * Duplex
+ * Note that the opt->name strings MUST match those in the printer driver(s)
+ * else the PPD files will not be generated correctly
+ */
- if (num_opts > 0)
+ stp_describe_parameter(v, "Duplex", &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
{
- gzprintf(fp, "*OpenUI *stpInkType/%s: PickOne\n", _("Ink Type"));
- gzputs(fp, "*OrderDependency: 20 AnySetup *stpInkType\n");
- gzprintf(fp, "*DefaultstpInkType: %s\n", defopt);
-
- for (i = 0; i < num_opts; i ++)
+ num_opts = stp_string_list_count(desc.bounds.str);
+ if (num_opts > 0)
{
- /*
- * Write the inktype option...
- */
-
- gzprintf(fp, "*stpInkType %s/%s:\t\"<</OutputType(%s)>>setpagedevice\"\n",
- opts[i].name, opts[i].text, opts[i].name);
- free((void *)opts[i].name);
- free((void *)opts[i].text);
+ gzputs(fp, "*OpenUI *Duplex/Double-Sided Printing: PickOne\n");
+ gzputs(fp, "*OrderDependency: 20 AnySetup *Duplex\n");
+ gzprintf(fp, "*DefaultDuplex: %s\n", desc.deflt.str);
+
+ for (i = 0; i < num_opts; i++)
+ {
+ opt = stp_string_list_param(desc.bounds.str, i);
+ if (strcmp(opt->name, "None") == 0)
+ gzprintf(fp, "*Duplex %s/%s: \"<</Duplex false>>setpagedevice\"\n", opt->name, opt->text);
+ else if (strcmp(opt->name, "DuplexNoTumble") == 0)
+ gzprintf(fp, "*Duplex %s/%s: \"<</Duplex true/Tumble false>>setpagedevice\"\n", opt->name, opt->text);
+ else if (strcmp(opt->name, "DuplexTumble") == 0)
+ gzprintf(fp, "*Duplex %s/%s: \"<</Duplex true/Tumble true>>setpagedevice\"\n", opt->name, opt->text);
+ }
+ gzputs(fp, "*CloseUI: *Duplex\n\n");
}
-
- free(opts);
-
- gzputs(fp, "*CloseUI: *stpInkType\n\n");
}
-
-#ifdef __APPLE__
- gzputs(fp, "*CloseGroup: MAIN\n\n");
- gzputs(fp, "*OpenGroup: STP/Expert adjustments\n");
-#endif /* __APPLE__ */
+ stp_parameter_description_destroy(&desc);
- /*
- * Advanced STP options...
- */
+ param_list = stp_get_parameter_list(v);
- if (stp_get_output_type(printvars) == OUTPUT_COLOR)
-#ifndef __APPLE__
- num_opts = 8;
- else
- num_opts = 4;
-
- for (i = 0; i < num_opts; i ++)
-#else
+ for (j = 0; j <= STP_PARAMETER_CLASS_OUTPUT; j++)
{
- num_opts = 8;
-
- for (i = 0; i < 5; i ++)
-#endif /* __APPLE__ */
+ for (k = 0; k <= STP_PARAMETER_LEVEL_ADVANCED4; k++)
+ {
+ int printed_open_group = 0;
+ size_t param_count = stp_parameter_list_count(param_list);
+ for (l = 0; l < param_count; l++)
+ {
+ int print_close_ui = 1;
+ const stp_parameter_t *lparam =
+ stp_parameter_list_param(param_list, l);
+ if (lparam->p_class != j || lparam->p_level != k ||
+ is_special_option(lparam->name) || lparam->read_only ||
+ (lparam->p_type != STP_PARAMETER_TYPE_STRING_LIST &&
+ lparam->p_type != STP_PARAMETER_TYPE_BOOLEAN &&
+ lparam->p_type != STP_PARAMETER_TYPE_DIMENSION &&
+ lparam->p_type != STP_PARAMETER_TYPE_DOUBLE))
+ continue;
+ stp_describe_parameter(v, lparam->name, &desc);
+ if (desc.is_active)
+ {
+ int printed_default_value = 0;
+ if (!printed_open_group)
+ {
+ print_group_open(fp, j, k);
+ printed_open_group = 1;
+ }
+ gzprintf(fp, "*OpenUI *Stp%s/%s: PickOne\n",
+ desc.name, _(desc.text));
+#if 0
+ gzprintf(fp, "*OrderDependency: %d AnySetup *Stp%s\n",
+ (100 + l + (j * param_count) +
+ (k * STP_PARAMETER_LEVEL_INTERNAL * param_count)),
+ desc.name);
+#endif
+ if (!desc.is_mandatory)
+ gzprintf(fp, "*DefaultStp%s: None\n", desc.name);
+ switch (desc.p_type)
+ {
+ case STP_PARAMETER_TYPE_STRING_LIST:
+ if (desc.is_mandatory)
+ gzprintf(fp, "*DefaultStp%s: %s\n",
+ desc.name, desc.deflt.str);
+ else
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name,
+ "None", _("None"));
+ num_opts = stp_string_list_count(desc.bounds.str);
+ for (i = 0; i < num_opts; i++)
+ {
+ opt = stp_string_list_param(desc.bounds.str, i);
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n",
+ desc.name, opt->name, _(opt->text));
+ }
+ break;
+ case STP_PARAMETER_TYPE_BOOLEAN:
+ if (desc.is_mandatory)
+ gzprintf(fp, "*DefaultStp%s: %s\n", desc.name,
+ desc.deflt.boolean ? "True" : "False");
+ else
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name,
+ "None", _("None"));
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n",
+ desc.name, "False", _("No"));
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n",
+ desc.name, "True", _("Yes"));
+ break;
+ case STP_PARAMETER_TYPE_DOUBLE:
+ if (desc.is_mandatory)
+ {
+ gzprintf(fp, "*DefaultStp%s: None\n", desc.name);
+ }
+ for (i = desc.bounds.dbl.lower * 1000;
+ i <= desc.bounds.dbl.upper * 1000 ; i += 100)
+ {
+ if (desc.deflt.dbl * 1000 == i && desc.is_mandatory)
+ {
+ gzprintf(fp, "*Stp%s None/%.3f: \"\"\n",
+ desc.name, ((double) i) * .001);
+ printed_default_value = 1;
+ }
+ else
+ gzprintf(fp, "*Stp%s %d/%.3f: \"\"\n",
+ desc.name, i, ((double) i) * .001);
+ }
+ if (!desc.is_mandatory)
+ gzprintf(fp, "*Stp%s None/None: \"\"\n",
+ desc.name, desc.deflt.dbl);
+ else if (! printed_default_value)
+ gzprintf(fp, "*Stp%s None/%.3f: \"\"\n",
+ desc.name, desc.deflt.dbl);
+ gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc.name);
+ gzprintf(fp, "*OpenUI *StpFine%s/%s %s: PickOne\n",
+ desc.name, _(desc.text), _("Fine Adjustment"));
+ gzprintf(fp, "*DefaultStpFine%s:None\n", desc.name);
+ gzprintf(fp, "*StpFine%s None/0.000: \"\"\n", desc.name);
+ for (i = 0; i < 100; i += 5)
+ gzprintf(fp, "*StpFine%s %d/%.3f: \"\"\n",
+ desc.name, i, ((double) i) * .001);
+ gzprintf(fp, "*CloseUI: *StpFine%s\n\n", desc.name);
+ print_close_ui = 0;
+
+ break;
+ case STP_PARAMETER_TYPE_DIMENSION:
+ if (desc.is_mandatory)
+ gzprintf(fp, "*DefaultStp%s: %d\n",
+ desc.name, desc.deflt.dimension);
+ else
+ gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name,
+ "None", _("None"));
+ for (i = desc.bounds.dimension.lower;
+ i <= desc.bounds.dimension.upper; i++)
+ {
+ /* FIXME
+ * For now, just use mm; we'll fix it later
+ * for the locale-appropriate setting.
+ * --rlk 20040818
+ */
+ gzprintf(fp, "*Stp%s %d/%.1f mm: \"\"\n",
+ desc.name, i, ((double) i) * 25.4 / 72);
+ }
+ gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc.name);
+ print_close_ui = 0;
+
+ break;
+ default:
+ break;
+ }
+ if (print_close_ui)
+ gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc.name);
+ }
+ stp_parameter_description_destroy(&desc);
+ }
+ if (printed_open_group)
+ print_group_close(fp, j, k);
+ }
+ }
+ if (has_quality_parameter)
{
- gzprintf(fp, "*OpenUI *%s/%s: PickOne\n", stp_options[i].name,
- stp_options[i].text);
- gzprintf(fp, "*Default%s: 1000\n", stp_options[i].name);
- for (j = stp_options[i].low;
- j <= stp_options[i].high;
- j += stp_options[i].step)
- gzprintf(fp, "*%s %d/%.3f: \"\"\n", stp_options[i].name, j, j * 0.001);
- gzprintf(fp, "*CloseUI: *%s\n\n", stp_options[i].name);
+ stp_parameter_t qdesc;
+ const char *tname = NULL;
+ stp_describe_parameter(v, "Quality", &qdesc);
+ if (qdesc.p_type == STP_PARAMETER_TYPE_STRING_LIST &&
+ stp_string_list_count(qdesc.bounds.str) > 1)
+ {
+ for (l = 0; l < stp_string_list_count(qdesc.bounds.str); l++)
+ {
+ opt = stp_string_list_param(qdesc.bounds.str, l);
+ if (opt && strcmp(opt->name, "None") != 0)
+ {
+ tname = opt->name;
+ break;
+ }
+ }
+ }
+ for (l = 0; l < stp_parameter_list_count(param_list); l++)
+ {
+ const stp_parameter_t *lparam =
+ stp_parameter_list_param(param_list, l);
+ if (lparam->p_class > STP_PARAMETER_CLASS_OUTPUT ||
+ lparam->p_level > STP_PARAMETER_LEVEL_ADVANCED4 ||
+ strcmp(lparam->name, "Quality") == 0 ||
+ (lparam->p_type != STP_PARAMETER_TYPE_STRING_LIST &&
+ lparam->p_type != STP_PARAMETER_TYPE_BOOLEAN &&
+ lparam->p_type != STP_PARAMETER_TYPE_DIMENSION &&
+ lparam->p_type != STP_PARAMETER_TYPE_DOUBLE))
+ continue;
+ stp_clear_string_parameter(v, "Quality");
+ stp_describe_parameter(v, lparam->name, &desc);
+ if (desc.is_active)
+ {
+ stp_parameter_description_destroy(&desc);
+ stp_set_string_parameter(v, "Quality", tname);
+ stp_describe_parameter(v, lparam->name, &desc);
+ if (!desc.is_active)
+ {
+ gzprintf(fp, "*UIConstraints: *StpQuality *Stp%s\n",
+ lparam->name);
+ gzprintf(fp, "*UIConstraints: *Stp%s *StpQuality\n\n",
+ lparam->name);
+ if (desc.p_type == STP_PARAMETER_TYPE_DOUBLE)
+ {
+ gzprintf(fp, "*UIConstraints: *StpQuality *StpFine%s\n",
+ lparam->name);
+ gzprintf(fp, "*UIConstraints: *StpFine%s *StpQuality\n\n",
+ lparam->name);
+ }
+ }
+ }
+ stp_clear_string_parameter(v, "Quality");
+ stp_parameter_description_destroy(&desc);
+ }
+ stp_parameter_description_destroy(&qdesc);
}
-
- /*
- * End of STP option group...
- */
-
- gzputs(fp, "*CloseGroup: STP\n\n");
-#ifdef __APPLE__
- gzputs(fp, "*OpenGroup: STPC/Expert color\n");
-
- for (i = 5; i < num_opts; i ++)
- {
- gzprintf(fp, "*OpenUI *%s/%s: PickOne\n", stp_options[i].name,
- stp_options[i].text);
- gzprintf(fp, "*Default%s: 1000\n", stp_options[i].name);
- for (j = stp_options[i].low;
- j <= stp_options[i].high;
- j += stp_options[i].step)
- gzprintf(fp, "*%s %d/%.3f: \"\"\n", stp_options[i].name, j, j * 0.001);
- gzprintf(fp, "*CloseUI: *%s\n", stp_options[i].name);
- }
-
- gzputs(fp, "*CloseGroup: STPC\n\n");
+ if (has_image_type_parameter)
+ {
+ stp_parameter_t qdesc;
+ const char *tname = NULL;
+ stp_describe_parameter(v, "ImageType", &qdesc);
+ if (qdesc.p_type == STP_PARAMETER_TYPE_STRING_LIST &&
+ stp_string_list_count(qdesc.bounds.str) > 1)
+ {
+ for (l = 0; l < stp_string_list_count(qdesc.bounds.str); l++)
+ {
+ opt = stp_string_list_param(qdesc.bounds.str, l);
+ if (opt && strcmp(opt->name, "None") != 0)
+ {
+ tname = opt->name;
+ break;
+ }
+ }
+ }
+ for (l = 0; l < stp_parameter_list_count(param_list); l++)
+ {
+ const stp_parameter_t *lparam =
+ stp_parameter_list_param(param_list, l);
+ if (lparam->p_class > STP_PARAMETER_CLASS_OUTPUT ||
+ lparam->p_level > STP_PARAMETER_LEVEL_ADVANCED4 ||
+ strcmp(lparam->name, "ImageType") == 0 ||
+ (lparam->p_type != STP_PARAMETER_TYPE_STRING_LIST &&
+ lparam->p_type != STP_PARAMETER_TYPE_BOOLEAN &&
+ lparam->p_type != STP_PARAMETER_TYPE_DIMENSION &&
+ lparam->p_type != STP_PARAMETER_TYPE_DOUBLE))
+ continue;
+ stp_clear_string_parameter(v, "ImageType");
+ stp_describe_parameter(v, lparam->name, &desc);
+ if (desc.is_active)
+ {
+ stp_parameter_description_destroy(&desc);
+ stp_set_string_parameter(v, "ImageType", tname);
+ stp_describe_parameter(v, lparam->name, &desc);
+ if (!desc.is_active)
+ {
+ gzprintf(fp, "*UIConstraints: *StpImageType *Stp%s\n",
+ lparam->name);
+ gzprintf(fp, "*UIConstraints: *Stp%s *StpImageType\n\n",
+ lparam->name);
+ if (desc.p_type == STP_PARAMETER_TYPE_DOUBLE)
+ {
+ gzprintf(fp, "*UIConstraints: *StpImageType *StpFine%s\n",
+ lparam->name);
+ gzprintf(fp, "*UIConstraints: *StpFine%s *StpImageType\n\n",
+ lparam->name);
+ }
+ }
+ }
+ stp_clear_string_parameter(v, "ImageType");
+ stp_parameter_description_destroy(&desc);
+ }
+ stp_parameter_description_destroy(&qdesc);
}
- else
+ if (printer_is_color)
{
- num_opts = 4;
-
- for (i = 0; i < num_opts; i ++)
- {
- gzprintf(fp, "*OpenUI *%s/%s: PickOne\n", stp_options[i].name,
- stp_options[i].text);
- gzprintf(fp, "*Default%s: 1000\n", stp_options[i].name);
- for (j = stp_options[i].low;
- j <= stp_options[i].high;
- j += stp_options[i].step)
- gzprintf(fp, "*%s %d/%.3f: \"\"\n", stp_options[i].name, j, j * 0.001);
- gzprintf(fp, "*CloseUI: *%s\n", stp_options[i].name);
- }
-
- gzputs(fp, "*CloseGroup: STP\n\n");
+ for (l = 0; l < stp_parameter_list_count(param_list); l++)
+ {
+ const stp_parameter_t *lparam =
+ stp_parameter_list_param(param_list, l);
+ if (lparam->p_class > STP_PARAMETER_CLASS_OUTPUT ||
+ lparam->p_level > STP_PARAMETER_LEVEL_ADVANCED4 ||
+ strcmp(lparam->name, "Quality") == 0 ||
+ is_special_option(lparam->name) ||
+ (lparam->p_type != STP_PARAMETER_TYPE_STRING_LIST &&
+ lparam->p_type != STP_PARAMETER_TYPE_BOOLEAN &&
+ lparam->p_type != STP_PARAMETER_TYPE_DIMENSION &&
+ lparam->p_type != STP_PARAMETER_TYPE_DOUBLE))
+ continue;
+ stp_set_string_parameter(v, "PrintingMode", "Color");
+ stp_describe_parameter(v, lparam->name, &desc);
+ if (desc.is_active)
+ {
+ stp_parameter_description_destroy(&desc);
+ stp_set_string_parameter(v, "PrintingMode", "BW");
+ stp_describe_parameter(v, lparam->name, &desc);
+ if (!desc.is_active)
+ {
+ gzprintf(fp, "*UIConstraints: *ColorModel Gray *Stp%s\n",
+ lparam->name);
+ gzprintf(fp, "*UIConstraints: *ColorModel Black *Stp%s\n",
+ lparam->name);
+ gzprintf(fp, "*UIConstraints: *Stp%s *ColorModel Gray\n",
+ lparam->name);
+ gzprintf(fp, "*UIConstraints: *Stp%s *ColorModel Black\n\n",
+ lparam->name);
+ if (desc.p_type == STP_PARAMETER_TYPE_DOUBLE)
+ {
+ gzprintf(fp, "*UIConstraints: *ColorModel Gray *StpFine%s\n",
+ lparam->name);
+ gzprintf(fp, "*UIConstraints: *ColorModel Black *StpFine%s\n",
+ lparam->name);
+ gzprintf(fp, "*UIConstraints: *StpFine%s *ColorModel Gray\n",
+ lparam->name);
+ gzprintf(fp, "*UIConstraints: *StpFine%s *ColorModel Black\n\n",
+ lparam->name);
+ }
+ }
+ }
+ stp_parameter_description_destroy(&desc);
+ }
+ stp_set_string_parameter(v, "PrintingMode", "Color");
}
-#endif /* __APPLE__ */
+ stp_parameter_list_destroy(param_list);
/*
* Fonts...
@@ -1039,14 +1696,18 @@ write_ppd(const stp_printer_t p, /* I - Printer driver */
gzputs(fp, "*Font ZapfChancery-MediumItalic: Standard \"(001.007S)\" Standard ROM\n");
gzputs(fp, "*Font ZapfDingbats: Special \"(001.004S)\" Standard ROM\n");
- gzprintf(fp, "\n*%%End of %s.ppd\n", driver);
+ gzprintf(fp, "\n*%%End of stp-%s.%s%s\n",
+ driver,
+ GUTENPRINT_RELEASE_VERSION,
+ ppdext);
gzclose(fp);
- stp_free_vars(v);
+ stp_vars_destroy(v);
return (0);
}
+
/*
- * End of "$Id: genppd.c,v 1.36.2.15 2004/06/12 20:04:05 rlk Exp $".
+ * End of "$Id: genppd.c,v 1.107 2005/04/23 00:26:07 rlk Exp $".
*/
diff --git a/src/cups/rastertoprinter.c b/src/cups/rastertoprinter.c
index c88a0be..b9da368 100644
--- a/src/cups/rastertoprinter.c
+++ b/src/cups/rastertoprinter.c
@@ -1,7 +1,7 @@
/*
- * "$Id: rastertoprinter.c,v 1.19.4.15 2004/03/26 03:29:39 rlk Exp $"
+ * "$Id: rastertoprinter.c,v 1.96 2005/04/23 00:26:07 rlk Exp $"
*
- * GIMP-print based raster filter for the Common UNIX Printing System.
+ * Gutenprint based raster filter for the Common UNIX Printing System.
*
* Copyright 1993-2003 by Easy Software Products.
*
@@ -32,16 +32,11 @@
* main() - Main entry and processing of driver.
* cups_writefunc() - Write data to a file...
* cancel_job() - Cancel the current job...
- * Image_bpp() - Return the bytes-per-pixel of an image.
* Image_get_appname() - Get the application we are running.
* Image_get_row() - Get one row of the image.
* Image_height() - Return the height of an image.
* Image_init() - Initialize an image.
- * Image_note_progress() - Notify the user of our progress.
- * Image_progress_conclude() - Close the progress display.
- * Image_progress_init() - Initialize progress display.
- * Image_rotate_ccw() - Rotate the image counter-clockwise
- * (unsupported).
+ * Image_conclude() - Close the progress display.
* Image_width() - Return the width of an image.
*/
@@ -49,6 +44,9 @@
* Include necessary headers...
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <cups/cups.h>
#include <cups/ppd.h>
#include <cups/raster.h>
@@ -57,15 +55,11 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
+#include <sys/times.h>
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
-#ifdef INCLUDE_GIMP_PRINT_H
-#include INCLUDE_GIMP_PRINT_H
-#else
-#include <gimp-print/gimp-print.h>
-#endif
-#include "../../lib/libprintut.h"
+#include <gutenprint/gutenprint.h>
/* Solaris with gcc has problems because gcc's limits.h doesn't #define */
/* this */
@@ -88,49 +82,480 @@ typedef struct
int top;
int width;
int height;
+ int adjusted_width;
+ int adjusted_height;
+ int last_percent;
cups_page_header_t header; /* Page header from file */
} cups_image_t;
static void cups_writefunc(void *file, const char *buf, size_t bytes);
+static void cups_errfunc(void *file, const char *buf, size_t bytes);
static void cancel_job(int sig);
static const char *Image_get_appname(stp_image_t *image);
-static void Image_progress_conclude(stp_image_t *image);
-static void Image_note_progress(stp_image_t *image,
- double current, double total);
-static void Image_progress_init(stp_image_t *image);
static stp_image_status_t Image_get_row(stp_image_t *image,
- unsigned char *data, int row);
+ unsigned char *data,
+ size_t byte_limit, int row);
static int Image_height(stp_image_t *image);
static int Image_width(stp_image_t *image);
-static int Image_bpp(stp_image_t *image);
-static void Image_rotate_180(stp_image_t *image);
-static void Image_rotate_cw(stp_image_t *image);
-static void Image_rotate_ccw(stp_image_t *image);
+static void Image_conclude(stp_image_t *image);
static void Image_init(stp_image_t *image);
static stp_image_t theImage =
{
Image_init,
NULL, /* reset */
- NULL, /* transpose */
- NULL, /* hflip */
- NULL, /* vflip */
- NULL, /* crop */
- Image_rotate_ccw,
- Image_rotate_cw,
- Image_rotate_180,
- Image_bpp,
Image_width,
Image_height,
Image_get_row,
Image_get_appname,
- Image_progress_init,
- Image_note_progress,
- Image_progress_conclude,
+ Image_conclude,
NULL
};
-static volatile stp_image_status_t Image_status;
+static volatile stp_image_status_t Image_status = STP_IMAGE_STATUS_OK;
+static double total_bytes_printed = 0;
+static int print_messages_as_errors = 0;
+
+static void
+set_string_parameter(stp_vars_t *v, const char *name, const char *val)
+{
+ fprintf(stderr, "DEBUG: Gutenprint set string %s to %s\n", name, val);
+ stp_set_string_parameter(v, name, val);
+}
+
+
+static void
+set_special_parameter(stp_vars_t *v, const char *name, int choice)
+{
+ stp_parameter_t desc;
+ stp_describe_parameter(v, name, &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
+ {
+ if (choice >= stp_string_list_count(desc.bounds.str))
+ fprintf(stderr, "ERROR: Gutenprint unable to set %s!\n", name);
+ else
+ {
+ stp_set_string_parameter
+ (v, name, stp_string_list_param(desc.bounds.str, choice)->name);
+ fprintf(stderr, "DEBUG: Gutenprint set special parameter %s to choice %d (%s)\n",
+ name, choice,
+ stp_string_list_param(desc.bounds.str, choice)->name);
+ }
+ }
+ else
+ fprintf(stderr, "DEBUG: Gutenprint unable to set special %s: not a string\n",
+ name);
+ stp_parameter_description_destroy(&desc);
+}
+
+static void
+print_debug_block(const stp_vars_t *v, const cups_image_t *cups)
+{
+ stp_parameter_list_t params;
+ int nparams;
+ int i;
+ fprintf(stderr, "DEBUG: Gutenprint StartPage...\n");
+ fprintf(stderr, "DEBUG: Gutenprint MediaClass = \"%s\"\n", cups->header.MediaClass);
+ fprintf(stderr, "DEBUG: Gutenprint MediaColor = \"%s\"\n", cups->header.MediaColor);
+ fprintf(stderr, "DEBUG: Gutenprint MediaType = \"%s\"\n", cups->header.MediaType);
+ fprintf(stderr, "DEBUG: Gutenprint OutputType = \"%s\"\n", cups->header.OutputType);
+
+ fprintf(stderr, "DEBUG: Gutenprint AdvanceDistance = %d\n", cups->header.AdvanceDistance);
+ fprintf(stderr, "DEBUG: Gutenprint AdvanceMedia = %d\n", cups->header.AdvanceMedia);
+ fprintf(stderr, "DEBUG: Gutenprint Collate = %d\n", cups->header.Collate);
+ fprintf(stderr, "DEBUG: Gutenprint CutMedia = %d\n", cups->header.CutMedia);
+ fprintf(stderr, "DEBUG: Gutenprint Duplex = %d\n", cups->header.Duplex);
+ fprintf(stderr, "DEBUG: Gutenprint HWResolution = [ %d %d ]\n", cups->header.HWResolution[0],
+ cups->header.HWResolution[1]);
+ fprintf(stderr, "DEBUG: Gutenprint ImagingBoundingBox = [ %d %d %d %d ]\n",
+ cups->header.ImagingBoundingBox[0], cups->header.ImagingBoundingBox[1],
+ cups->header.ImagingBoundingBox[2], cups->header.ImagingBoundingBox[3]);
+ fprintf(stderr, "DEBUG: Gutenprint InsertSheet = %d\n", cups->header.InsertSheet);
+ fprintf(stderr, "DEBUG: Gutenprint Jog = %d\n", cups->header.Jog);
+ fprintf(stderr, "DEBUG: Gutenprint LeadingEdge = %d\n", cups->header.LeadingEdge);
+ fprintf(stderr, "DEBUG: Gutenprint Margins = [ %d %d ]\n", cups->header.Margins[0],
+ cups->header.Margins[1]);
+ fprintf(stderr, "DEBUG: Gutenprint ManualFeed = %d\n", cups->header.ManualFeed);
+ fprintf(stderr, "DEBUG: Gutenprint MediaPosition = %d\n", cups->header.MediaPosition);
+ fprintf(stderr, "DEBUG: Gutenprint MediaWeight = %d\n", cups->header.MediaWeight);
+ fprintf(stderr, "DEBUG: Gutenprint MirrorPrint = %d\n", cups->header.MirrorPrint);
+ fprintf(stderr, "DEBUG: Gutenprint NegativePrint = %d\n", cups->header.NegativePrint);
+ fprintf(stderr, "DEBUG: Gutenprint NumCopies = %d\n", cups->header.NumCopies);
+ fprintf(stderr, "DEBUG: Gutenprint Orientation = %d\n", cups->header.Orientation);
+ fprintf(stderr, "DEBUG: Gutenprint OutputFaceUp = %d\n", cups->header.OutputFaceUp);
+ fprintf(stderr, "DEBUG: Gutenprint PageSize = [ %d %d ]\n", cups->header.PageSize[0],
+ cups->header.PageSize[1]);
+ fprintf(stderr, "DEBUG: Gutenprint Separations = %d\n", cups->header.Separations);
+ fprintf(stderr, "DEBUG: Gutenprint TraySwitch = %d\n", cups->header.TraySwitch);
+ fprintf(stderr, "DEBUG: Gutenprint Tumble = %d\n", cups->header.Tumble);
+ fprintf(stderr, "DEBUG: Gutenprint cupsWidth = %d\n", cups->header.cupsWidth);
+ fprintf(stderr, "DEBUG: Gutenprint cupsHeight = %d\n", cups->header.cupsHeight);
+ fprintf(stderr, "DEBUG: Gutenprint cups->width = %d\n", cups->width);
+ fprintf(stderr, "DEBUG: Gutenprint cups->height = %d\n", cups->height);
+ fprintf(stderr, "DEBUG: Gutenprint cups->adjusted_width = %d\n", cups->adjusted_width);
+ fprintf(stderr, "DEBUG: Gutenprint cups->adjusted_height = %d\n", cups->adjusted_height);
+ fprintf(stderr, "DEBUG: Gutenprint cupsMediaType = %d\n", cups->header.cupsMediaType);
+ fprintf(stderr, "DEBUG: Gutenprint cupsBitsPerColor = %d\n", cups->header.cupsBitsPerColor);
+ fprintf(stderr, "DEBUG: Gutenprint cupsBitsPerPixel = %d\n", cups->header.cupsBitsPerPixel);
+ fprintf(stderr, "DEBUG: Gutenprint cupsBytesPerLine = %d\n", cups->header.cupsBytesPerLine);
+ fprintf(stderr, "DEBUG: Gutenprint cupsColorOrder = %d\n", cups->header.cupsColorOrder);
+ fprintf(stderr, "DEBUG: Gutenprint cupsColorSpace = %d\n", cups->header.cupsColorSpace);
+ fprintf(stderr, "DEBUG: Gutenprint cupsCompression = %d\n", cups->header.cupsCompression);
+ fprintf(stderr, "DEBUG: Gutenprint cupsRowCount = %d\n", cups->header.cupsRowCount);
+ fprintf(stderr, "DEBUG: Gutenprint cupsRowFeed = %d\n", cups->header.cupsRowFeed);
+ fprintf(stderr, "DEBUG: Gutenprint cupsRowStep = %d\n", cups->header.cupsRowStep);
+ fprintf(stderr, "DEBUG: Gutenprint stp_get_driver(v) |%s|\n", stp_get_driver(v));
+ fprintf(stderr, "DEBUG: Gutenprint stp_get_left(v) |%d|\n", stp_get_left(v));
+ fprintf(stderr, "DEBUG: Gutenprint stp_get_top(v) |%d|\n", stp_get_top(v));
+ fprintf(stderr, "DEBUG: Gutenprint stp_get_page_width(v) |%d|\n", stp_get_page_width(v));
+ fprintf(stderr, "DEBUG: Gutenprint stp_get_page_height(v) |%d|\n", stp_get_page_height(v));
+ params = stp_get_parameter_list(v);
+ nparams = stp_parameter_list_count(params);
+ for (i = 0; i < nparams; i++)
+ {
+ const stp_parameter_t *p = stp_parameter_list_param(params, i);
+ switch (p->p_type)
+ {
+ case STP_PARAMETER_TYPE_STRING_LIST:
+ fprintf(stderr, "DEBUG: Gutenprint stp_get_string %s(v) |%s| %d\n",
+ p->name, stp_get_string_parameter(v, p->name) ?
+ stp_get_string_parameter(v, p->name) : "NULL",
+ stp_get_string_parameter_active(v, p->name));
+ break;
+ case STP_PARAMETER_TYPE_DOUBLE:
+ fprintf(stderr, "DEBUG: Gutenprint stp_get_float %s(v) |%.3f| %d\n",
+ p->name, stp_get_float_parameter(v, p->name),
+ stp_get_float_parameter_active(v, p->name));
+ break;
+ case STP_PARAMETER_TYPE_DIMENSION:
+ fprintf(stderr, "DEBUG: Gutenprint stp_get_dimension %s(v) |%d| %d\n",
+ p->name, stp_get_dimension_parameter(v, p->name),
+ stp_get_dimension_parameter_active(v, p->name));
+ break;
+ case STP_PARAMETER_TYPE_INT:
+ fprintf(stderr, "DEBUG: Gutenprint stp_get_int %s(v) |%d| %d\n",
+ p->name, stp_get_int_parameter(v, p->name),
+ stp_get_int_parameter_active(v, p->name));
+ break;
+ case STP_PARAMETER_TYPE_BOOLEAN:
+ fprintf(stderr, "DEBUG: Gutenprint stp_get_boolean %s(v) |%d| %d\n",
+ p->name, stp_get_boolean_parameter(v, p->name),
+ stp_get_boolean_parameter_active(v, p->name));
+ break;
+ /*
+ * We don't handle raw, curve, or filename arguments.
+ */
+ default:
+ break;
+ }
+ }
+ stp_parameter_list_destroy(params);
+}
+
+static int
+printer_supports_bw(const stp_vars_t *v)
+{
+ stp_parameter_t desc;
+ int status = 0;
+ stp_describe_parameter(v, "PrintingMode", &desc);
+ if (stp_string_list_is_present(desc.bounds.str, "BW"))
+ status = 1;
+ stp_parameter_description_destroy(&desc);
+ return status;
+}
+
+static void
+validate_options(stp_vars_t *v, cups_image_t *cups)
+{
+ stp_parameter_list_t params = stp_get_parameter_list(v);
+ int nparams = stp_parameter_list_count(params);
+ int i;
+ for (i = 0; i < nparams; i++)
+ {
+ const stp_parameter_t *param = stp_parameter_list_param(params, i);
+ stp_parameter_t desc;
+ stp_describe_parameter(v, param->name, &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
+ {
+ if (!stp_string_list_is_present
+ (desc.bounds.str, stp_get_string_parameter(v, desc.name)))
+ {
+ fprintf(stderr, "DEBUG: Gutenprint clearing string %s (%s)\n",
+ desc.name, stp_get_string_parameter(v, desc.name));
+ stp_clear_string_parameter(v, desc.name);
+ if (desc.is_mandatory)
+ {
+ fprintf(stderr, "DEBUG: Gutenprint setting default string %s to %s\n",
+ desc.name, desc.deflt.str);
+ stp_set_string_parameter(v, desc.name, desc.deflt.str);
+ if (strcmp(desc.name, "PageSize") == 0)
+ {
+ const stp_papersize_t *ps =
+ stp_get_papersize_by_name(desc.deflt.str);
+ if (ps->width > 0)
+ {
+ fprintf(stderr, "DEBUG: Gutenprint setting page width to %d\n",
+ ps->width);
+ if (ps->width < stp_get_page_width(v))
+ stp_set_page_width(v, ps->width);
+ }
+ if (ps->height > 0)
+ {
+ fprintf(stderr, "DEBUG: Gutenprint setting page height to %d\n",
+ ps->height);
+ if (ps->height < stp_get_page_height(v))
+ stp_set_page_height(v, ps->height);
+ }
+ }
+ }
+ }
+ }
+ stp_parameter_description_destroy(&desc);
+ }
+ stp_parameter_list_destroy(params);
+}
+
+static stp_vars_t *
+initialize_page(cups_image_t *cups, const stp_vars_t *default_settings)
+{
+ const stp_papersize_t *size; /* Paper size */
+ stp_vars_t *v = stp_vars_create_copy(default_settings);
+
+ stp_set_page_width(v, cups->header.PageSize[0]);
+ stp_set_page_height(v, cups->header.PageSize[1]);
+ stp_set_outfunc(v, cups_writefunc);
+ stp_set_errfunc(v, cups_errfunc);
+ stp_set_outdata(v, stdout);
+ stp_set_errdata(v, stderr);
+
+ if (cups->header.cupsBitsPerColor == 16)
+ set_string_parameter(v, "ChannelBitDepth", "16");
+ else
+ set_string_parameter(v, "ChannelBitDepth", "8");
+ switch (cups->header.cupsColorSpace)
+ {
+ case CUPS_CSPACE_W :
+ /* Olympus photo printers don't support black & white ink! */
+ if (printer_supports_bw(v))
+ set_string_parameter(v, "PrintingMode", "BW");
+ set_string_parameter(v, "InputImageType", "Whitescale");
+ break;
+ case CUPS_CSPACE_K :
+ /* Olympus photo printers don't support black & white ink! */
+ if (printer_supports_bw(v))
+ set_string_parameter(v, "PrintingMode", "BW");
+ set_string_parameter(v, "InputImageType", "Grayscale");
+ break;
+ case CUPS_CSPACE_RGB :
+ set_string_parameter(v, "PrintingMode", "Color");
+ set_string_parameter(v, "InputImageType", "RGB");
+ break;
+ case CUPS_CSPACE_CMY :
+ set_string_parameter(v, "PrintingMode", "Color");
+ set_string_parameter(v, "InputImageType", "CMY");
+ break;
+ case CUPS_CSPACE_CMYK :
+ set_string_parameter(v, "PrintingMode", "Color");
+ set_string_parameter(v, "InputImageType", "CMYK");
+ break;
+ case CUPS_CSPACE_KCMY :
+ set_string_parameter(v, "PrintingMode", "Color");
+ set_string_parameter(v, "InputImageType", "KCMY");
+ break;
+ default :
+ fprintf(stderr, "ERROR: Gutenprint Bad colorspace %d!\n",
+ cups->header.cupsColorSpace);
+ break;
+ }
+
+ if (cups->header.cupsCompression >= 0)
+ set_special_parameter(v, "Resolution", cups->header.cupsCompression);
+
+ if (cups->header.MediaClass && strlen(cups->header.MediaClass) > 0)
+ set_string_parameter(v, "InputSlot", cups->header.MediaClass);
+
+ if (cups->header.MediaType && strlen(cups->header.MediaType) > 0)
+ set_string_parameter(v, "MediaType", cups->header.MediaType);
+
+ fprintf(stderr, "DEBUG: Gutenprint PageSize = %dx%d\n", cups->header.PageSize[0],
+ cups->header.PageSize[1]);
+
+ if ((size = stp_get_papersize_by_size(cups->header.PageSize[1],
+ cups->header.PageSize[0])) != NULL)
+ set_string_parameter(v, "PageSize", size->name);
+ else
+ fprintf(stderr, "DEBUG: Gutenprint Unable to get media size for (%d, %d)\n",
+ cups->header.PageSize[1], cups->header.PageSize[0]);
+
+ /*
+ * Duplex
+ * Note that the names MUST match those in the printer driver(s)
+ */
+
+ if (cups->header.Duplex != 0)
+ {
+ if (cups->header.Tumble != 0)
+ set_string_parameter(v, "Duplex", "DuplexTumble");
+ else
+ set_string_parameter(v, "Duplex", "DuplexNoTumble");
+ }
+
+ set_string_parameter(v, "JobMode", "Job");
+ validate_options(v, cups);
+ stp_get_media_size(v, &(cups->width), &(cups->height));
+ stp_get_imageable_area(v, &(cups->left), &(cups->right),
+ &(cups->bottom), &(cups->top));
+ fprintf(stderr, "DEBUG: Gutenprint limits w %d l %d r %d h %d t %d b %d\n",
+ cups->width, cups->left, cups->right, cups->height, cups->top, cups->bottom);
+ stp_set_width(v, cups->right - cups->left);
+ stp_set_height(v, cups->bottom - cups->top);
+ stp_set_left(v, cups->left);
+ stp_set_top(v, cups->top);
+ cups->right = cups->width - cups->right;
+ cups->width = cups->width - cups->left - cups->right;
+ cups->width = cups->header.HWResolution[0] * cups->width / 72;
+ cups->left = cups->header.HWResolution[0] * cups->left / 72;
+ cups->right = cups->header.HWResolution[0] * cups->right / 72;
+ cups->adjusted_width = cups->width;
+ if (cups->adjusted_width > cups->header.cupsWidth)
+ cups->adjusted_width = cups->header.cupsWidth;
+
+ cups->bottom = cups->height - cups->bottom;
+ cups->height = cups->height - cups->top - cups->bottom;
+ cups->height = cups->header.HWResolution[1] * cups->height / 72;
+ cups->top = cups->header.HWResolution[1] * cups->top / 72;
+ cups->bottom = cups->header.HWResolution[1] * cups->bottom / 72;
+ cups->adjusted_height = cups->height;
+ if (cups->adjusted_height > cups->header.cupsHeight)
+ cups->adjusted_height = cups->header.cupsHeight;
+ fprintf(stderr, "DEBUG: Gutenprint CUPS settings w %d %d l %d r %d h %d %d t %d b %d\n",
+ cups->width, cups->adjusted_width, cups->left, cups->right,
+ cups->height, cups->adjusted_height, cups->top, cups->bottom);
+
+ return v;
+}
+
+static void
+purge_excess_data(cups_image_t *cups)
+{
+ char *buffer = stp_malloc(cups->header.cupsBytesPerLine);
+ if (buffer)
+ {
+ fprintf(stderr, "DEBUG: Gutenprint purging %d rows\n",
+ cups->header.cupsHeight - cups->row);
+ while (cups->row < cups->header.cupsHeight)
+ {
+ cupsRasterReadPixels(cups->ras, (unsigned char *)buffer,
+ cups->header.cupsBytesPerLine);
+ cups->row ++;
+ }
+ }
+ stp_free(buffer);
+}
+
+static void
+set_all_options(stp_vars_t *v, cups_option_t *options, int num_options,
+ ppd_file_t *ppd)
+{
+ stp_parameter_list_t params = stp_get_parameter_list(v);
+ int nparams = stp_parameter_list_count(params);
+ int i;
+ for (i = 0; i < nparams; i++)
+ {
+ const stp_parameter_t *param = stp_parameter_list_param(params, i);
+ stp_parameter_t desc;
+ char *ppd_option_name = stp_malloc(strlen(param->name) + 8); /* StpFineFOO\0 */
+
+ const char *val; /* CUPS option value */
+ ppd_option_t *ppd_option;
+ stp_describe_parameter(v, param->name, &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_DOUBLE)
+ {
+ sprintf(ppd_option_name, "Stp%s", desc.name);
+ val = cupsGetOption(ppd_option_name, num_options, options);
+ if (!val)
+ {
+ ppd_option = ppdFindOption(ppd, ppd_option_name);
+ if (ppd_option)
+ val = ppd_option->defchoice;
+ }
+ if (val && strlen(val) > 0 && strcmp(val, "None") != 0)
+ {
+ double coarse_val = atof(val) * 0.001;
+ double fine_val = 0;
+ sprintf(ppd_option_name, "StpFine%s", desc.name);
+ val = cupsGetOption(ppd_option_name, num_options, options);
+ if (!val)
+ {
+ ppd_option = ppdFindOption(ppd, ppd_option_name);
+ if (ppd_option)
+ val = ppd_option->defchoice;
+ }
+ if (val && strlen(val) > 0 && strcmp(val, "None") != 0)
+ fine_val = atof(val) * 0.001;
+ fprintf(stderr, "DEBUG: Gutenprint set float %s to %f + %f\n",
+ desc.name, coarse_val, fine_val);
+ fine_val += coarse_val;
+ if (fine_val > desc.bounds.dbl.upper)
+ fine_val = desc.bounds.dbl.upper;
+ stp_set_float_parameter(v, desc.name, fine_val);
+ }
+ }
+ else
+ {
+ sprintf(ppd_option_name, "Stp%s", desc.name);
+ val = cupsGetOption(ppd_option_name, num_options, options);
+ if (!val)
+ {
+ ppd_option = ppdFindOption(ppd, ppd_option_name);
+ if (ppd_option)
+ val = ppd_option->defchoice;
+ }
+ if (val && ((strlen(val) > 0 && strcmp(val, "None") != 0) ||
+ (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)))
+ {
+ switch (desc.p_type)
+ {
+ case STP_PARAMETER_TYPE_STRING_LIST:
+ fprintf(stderr, "DEBUG: Gutenprint set string %s to %s\n",
+ desc.name, val);
+ set_string_parameter(v, desc.name, val);
+ break;
+ case STP_PARAMETER_TYPE_INT:
+ fprintf(stderr, "DEBUG: Gutenprint set int %s to %s\n",
+ desc.name, val);
+ stp_set_int_parameter(v, desc.name, atoi(val));
+ break;
+ case STP_PARAMETER_TYPE_DIMENSION:
+ fprintf(stderr, "DEBUG: Gutenprint set dimension %s to %s\n",
+ desc.name, val);
+ stp_set_dimension_parameter(v, desc.name, atoi(val));
+ break;
+ case STP_PARAMETER_TYPE_BOOLEAN:
+ fprintf(stderr, "DEBUG: Gutenprint set bool %s to %s\n",
+ desc.name, val);
+ stp_set_boolean_parameter
+ (v, desc.name, strcmp(val, "True") == 0 ? 1 : 0);
+ break;
+ case STP_PARAMETER_TYPE_CURVE: /* figure this out later... */
+ case STP_PARAMETER_TYPE_FILE: /* Probably not, security hole */
+ case STP_PARAMETER_TYPE_RAW: /* figure this out later, too */
+ fprintf(stderr, "DEBUG: Gutenprint ignoring option %s %s type %d\n",
+ desc.name, val, desc.p_type);
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ fprintf(stderr, "DEBUG: Gutenprint NOT setting %s to %s\n",
+ desc.name, val);
+ }
+ stp_parameter_description_destroy(&desc);
+ stp_free(ppd_option_name);
+ }
+ stp_parameter_list_destroy(params);
+}
/*
* 'main()' - Main entry and processing of driver.
@@ -144,37 +569,35 @@ main(int argc, /* I - Number of command-line arguments */
cups_image_t cups; /* CUPS image */
const char *ppdfile; /* PPD environment variable */
ppd_file_t *ppd; /* PPD file */
- ppd_option_t *option; /* PPD option */
- stp_printer_t printer; /* Printer driver */
- stp_vars_t v; /* Printer driver variables */
- stp_papersize_t size; /* Paper size */
- char *buffer; /* Overflow buffer */
+ const stp_printer_t *printer; /* Printer driver */
int num_options; /* Number of CUPS options */
cups_option_t *options; /* CUPS options */
- const char *val; /* CUPS option value */
- int num_res; /* Number of printer resolutions */
- stp_param_t *res; /* Printer resolutions */
- float stp_gamma, /* STP options */
- stp_brightness,
- stp_cyan,
- stp_magenta,
- stp_yellow,
- stp_contrast,
- stp_saturation,
- stp_density;
-
+ stp_vars_t *v = NULL;
+ stp_vars_t *default_settings;
+ int initialized_job = 0;
+ const char *version_id;
+ const char *release_version_id;
+ struct tms tms;
+ clock_t clk;
+ long clocks_per_sec;
+ struct timeval t1, t2;
+ struct timezone tz;
/*
- * Initialise libgimpprint
+ * Initialise libgutenprint
*/
theImage.rep = &cups;
+ (void) gettimeofday(&t1, &tz);
stp_init();
-
+ version_id = stp_get_version();
+ release_version_id = stp_get_release_version();
+ default_settings = stp_vars_create();
/*
* Check for valid arguments...
*/
+ fprintf(stderr, "DEBUG: Gutenprint %s Starting\n", version_id);
if (argc < 6 || argc > 7)
{
@@ -183,36 +606,73 @@ main(int argc, /* I - Number of command-line arguments */
* and return.
*/
- fputs("ERROR: rastertoprinter job-id user title copies options [file]\n", stderr);
+ fputs("ERROR: Gutenprint rastertoprinter job-id user title copies options [file]\n", stderr);
return (1);
}
- Image_status = STP_IMAGE_OK;
-
/*
* Get the PPD file...
*/
if ((ppdfile = getenv("PPD")) == NULL)
{
- fputs("ERROR: Fatal error: PPD environment variable not set!\n", stderr);
+ fputs("ERROR: Gutenprint Fatal error: PPD environment variable not set!\n", stderr);
return (1);
}
+ fprintf(stderr, "DEBUG: Gutenprint using PPD file %s\n", ppdfile);
if ((ppd = ppdOpenFile(ppdfile)) == NULL)
{
- fprintf(stderr, "ERROR: Fatal error: Unable to load PPD file \"%s\"!\n",
+ fprintf(stderr, "ERROR: Gutenprint Fatal error: Unable to load PPD file \"%s\"!\n",
ppdfile);
return (1);
}
if (ppd->modelname == NULL)
{
- fprintf(stderr, "ERROR: Fatal error: No ModelName attribute in PPD file \"%s\"!\n",
+ fprintf(stderr, "ERROR: Gutenprint Fatal error: No ModelName attribute in PPD file \"%s\"!\n",
+ ppdfile);
+ ppdClose(ppd);
+ return (1);
+ }
+
+ if (ppd->nickname == NULL)
+ {
+ fprintf(stderr, "ERROR: Gutenprint Fatal error: No NickName attribute in PPD file \"%s\"!\n",
+ ppdfile);
+ ppdClose(ppd);
+ return (1);
+ }
+ else if (strlen(ppd->nickname) <
+ strlen(ppd->modelname) + strlen(CUPS_PPD_NICKNAME_STRING) + 3)
+ {
+ fprintf(stderr, "ERROR: Gutenprint Fatal error: Corrupted NickName attribute in PPD file \"%s\"!\n",
ppdfile);
ppdClose(ppd);
return (1);
}
+ else if (strcmp(ppd->nickname + strlen(ppd->modelname) +
+ strlen(CUPS_PPD_NICKNAME_STRING), version_id) != 0)
+ {
+ fprintf(stderr, "ERROR: Gutenprint: The version of Gutenprint software installed (%s) does not match the PPD file (%s).\n",
+ version_id,
+ ppd->nickname+strlen(ppd->modelname)+strlen(CUPS_PPD_NICKNAME_STRING));
+ fprintf(stderr, "ERROR: Gutenprint: If you have upgraded your version of Gutenprint\n");
+ fprintf(stderr, "ERROR: Gutenprint: recently, you must reinstall all printer queues.\n");
+ fprintf(stderr, "ERROR: Gutenprint: If the previous installed version of Gutenprint\n");
+ fprintf(stderr, "ERROR: Gutenprint: was 4.3.19 or higher, you can use the `cups-genppdupdate.%s'\n", release_version_id);
+ fprintf(stderr, "ERROR: Gutenprint: program to do this; if the previous installed version\n");
+ fprintf(stderr, "ERROR: Gutenprint: was older, you can use the Modify Printer command via\n");
+ fprintf(stderr, "ERROR: Gutenprint: the CUPS web interface: http://localhost:631/printers.\n");
+ /*
+ * Repeat the first line of the message so that CUPS will display it
+ */
+ fprintf(stderr, "ERROR: Gutenprint: The version of Gutenprint software installed (%s) does not match the PPD file (%s).\n",
+ version_id,
+ ppd->nickname+strlen(ppd->modelname)+strlen(CUPS_PPD_NICKNAME_STRING));
+ ppdClose(ppd);
+ return 1;
+ }
/*
* Get the STP options, if any...
@@ -220,83 +680,33 @@ main(int argc, /* I - Number of command-line arguments */
num_options = cupsParseOptions(argv[5], 0, &options);
- if ((val = cupsGetOption("stpGamma", num_options, options)) != NULL)
- stp_gamma = atof(val) * 0.001;
- else if ((option = ppdFindOption(ppd, "stpGamma")) != NULL)
- stp_gamma = atof(option->defchoice) * 0.001;
- else
- stp_gamma = 1.0;
-
- if ((val = cupsGetOption("stpBrightness", num_options, options)) != NULL)
- stp_brightness = atof(val) * 0.001;
- else if ((option = ppdFindOption(ppd, "stpBrightness")) != NULL)
- stp_brightness = atof(option->defchoice) * 0.001;
- else
- stp_brightness = 1.0;
-
- if ((val = cupsGetOption("stpCyan", num_options, options)) != NULL)
- stp_cyan = atof(val) * 0.001;
- else if ((option = ppdFindOption(ppd, "stpCyan")) != NULL)
- stp_cyan = atof(option->defchoice) * 0.001;
- else
- stp_cyan = 1.0;
-
- if ((val = cupsGetOption("stpMagenta", num_options, options)) != NULL)
- stp_magenta = atof(val) * 0.001;
- else if ((option = ppdFindOption(ppd, "stpMagenta")) != NULL)
- stp_magenta = atof(option->defchoice) * 0.001;
- else
- stp_magenta = 1.0;
-
- if ((val = cupsGetOption("stpYellow", num_options, options)) != NULL)
- stp_yellow = atof(val) * 0.001;
- else if ((option = ppdFindOption(ppd, "stpYellow")) != NULL)
- stp_yellow = atof(option->defchoice) * 0.001;
- else
- stp_yellow = 1.0;
-
- if ((val = cupsGetOption("stpContrast", num_options, options)) != NULL)
- stp_contrast = atof(val) * 0.001;
- else if ((option = ppdFindOption(ppd, "stpContrast")) != NULL)
- stp_contrast = atof(option->defchoice) * 0.001;
- else
- stp_contrast = 1.0;
-
- if ((val = cupsGetOption("stpSaturation", num_options, options)) != NULL)
- stp_saturation = atof(val) * 0.001;
- else if ((option = ppdFindOption(ppd, "stpSaturation")) != NULL)
- stp_saturation = atof(option->defchoice) * 0.001;
- else
- stp_saturation = 1.0;
+ fprintf(stderr, "DEBUG: Gutenprint CUPS option count is %d (%d bytes)\n",
+ num_options, strlen(argv[5]));
- if ((val = cupsGetOption("stpDensity", num_options, options)) != NULL)
- stp_density = atof(val) * 0.001;
- else if ((option = ppdFindOption(ppd, "stpDensity")) != NULL)
- stp_density = atof(option->defchoice) * 0.001;
- else
- stp_density = 1.0;
+ if (num_options > 0)
+ {
+ int i;
+ for (i = 0; i < num_options; i++)
+ fprintf(stderr, "DEBUG: Gutenprint CUPS option %d %s = %s\n",
+ i, options[i].name, options[i].value);
+ }
/*
* Figure out which driver to use...
*/
- if ((printer = stp_get_printer_by_long_name(ppd->modelname)) == NULL)
- if ((printer = stp_get_printer_by_driver(ppd->modelname)) == NULL)
+ printer = stp_get_printer_by_driver(ppd->modelname);
+ if (!printer)
+ printer = stp_get_printer_by_long_name(ppd->modelname);
+
+ if (printer == NULL)
{
- fprintf(stderr, "ERROR: Fatal error: Unable to find driver named \"%s\"!\n",
+ fprintf(stderr, "ERROR: Gutenprint Fatal error: Unable to find driver named \"%s\"!\n",
ppd->modelname);
ppdClose(ppd);
return (1);
}
-
- ppdClose(ppd);
-
- /*
- * Get the resolution options...
- */
-
- res = stp_printer_get_printfuncs(printer)->parameters(printer, NULL,
- "Resolution", &num_res);
+ fprintf(stderr, "DEBUG: Gutenprint driver %s\n", ppd->modelname);
/*
* Open the page stream...
@@ -306,32 +716,22 @@ main(int argc, /* I - Number of command-line arguments */
{
if ((fd = open(argv[6], O_RDONLY)) == -1)
{
- perror("ERROR: Unable to open raster file - ");
+ perror("ERROR: Gutenprint Unable to open raster file - ");
sleep(1);
return (1);
}
}
else
fd = 0;
+ fprintf(stderr, "DEBUG: Gutenprint using fd %d\n", fd);
- cups.ras = cupsRasterOpen(fd, CUPS_RASTER_READ);
-
- /*
- * Setup default print variables...
- */
-
- v = stp_allocate_copy(stp_printer_get_printvars(printer));
+ stp_set_printer_defaults(default_settings, printer);
+ stp_set_float_parameter(default_settings, "AppGamma", 1.0);
+ set_all_options(default_settings, options, num_options, ppd);
+ stp_merge_printvars(default_settings, stp_printer_get_defaults(printer));
+ ppdClose(ppd);
- stp_set_scaling(v, 0); /* No scaling */
- stp_set_cmap(v, NULL);
- stp_set_left(v, 0);
- stp_set_top(v, 0);
- stp_set_orientation(v, ORIENT_PORTRAIT);
- stp_set_outfunc(v, cups_writefunc);
- stp_set_errfunc(v, cups_writefunc);
- stp_set_outdata(v, stdout);
- stp_set_errdata(v, stderr);
- stp_set_job_mode(v, STP_JOB_MODE_JOB);
+ cups.ras = cupsRasterOpen(fd, CUPS_RASTER_READ);
/*
* Process pages as needed...
@@ -339,244 +739,108 @@ main(int argc, /* I - Number of command-line arguments */
cups.page = 0;
+ fprintf(stderr, "DEBUG: Gutenprint about to start printing loop.\n");
+ /*
+ * Read the first page header, which we need in order to set up
+ * the page.
+ */
+ signal(SIGTERM, cancel_job);
while (cupsRasterReadHeader(cups.ras, &cups.header))
- {
- /*
- * Update the current page...
- */
-
- cups.row = 0;
-
- fprintf(stderr, "PAGE: %d 1\n", cups.page + 1);
- /* use 1-based page logging */
-
- /*
- * Debugging info...
- */
-
- fprintf(stderr, "DEBUG: StartPage...\n");
- fprintf(stderr, "DEBUG: MediaClass = \"%s\"\n", cups.header.MediaClass);
- fprintf(stderr, "DEBUG: MediaColor = \"%s\"\n", cups.header.MediaColor);
- fprintf(stderr, "DEBUG: MediaType = \"%s\"\n", cups.header.MediaType);
- fprintf(stderr, "DEBUG: OutputType = \"%s\"\n", cups.header.OutputType);
-
- fprintf(stderr, "DEBUG: AdvanceDistance = %d\n", cups.header.AdvanceDistance);
- fprintf(stderr, "DEBUG: AdvanceMedia = %d\n", cups.header.AdvanceMedia);
- fprintf(stderr, "DEBUG: Collate = %d\n", cups.header.Collate);
- fprintf(stderr, "DEBUG: CutMedia = %d\n", cups.header.CutMedia);
- fprintf(stderr, "DEBUG: Duplex = %d\n", cups.header.Duplex);
- fprintf(stderr, "DEBUG: HWResolution = [ %d %d ]\n", cups.header.HWResolution[0],
- cups.header.HWResolution[1]);
- fprintf(stderr, "DEBUG: ImagingBoundingBox = [ %d %d %d %d ]\n",
- cups.header.ImagingBoundingBox[0], cups.header.ImagingBoundingBox[1],
- cups.header.ImagingBoundingBox[2], cups.header.ImagingBoundingBox[3]);
- fprintf(stderr, "DEBUG: InsertSheet = %d\n", cups.header.InsertSheet);
- fprintf(stderr, "DEBUG: Jog = %d\n", cups.header.Jog);
- fprintf(stderr, "DEBUG: LeadingEdge = %d\n", cups.header.LeadingEdge);
- fprintf(stderr, "DEBUG: Margins = [ %d %d ]\n", cups.header.Margins[0],
- cups.header.Margins[1]);
- fprintf(stderr, "DEBUG: ManualFeed = %d\n", cups.header.ManualFeed);
- fprintf(stderr, "DEBUG: MediaPosition = %d\n", cups.header.MediaPosition);
- fprintf(stderr, "DEBUG: MediaWeight = %d\n", cups.header.MediaWeight);
- fprintf(stderr, "DEBUG: MirrorPrint = %d\n", cups.header.MirrorPrint);
- fprintf(stderr, "DEBUG: NegativePrint = %d\n", cups.header.NegativePrint);
- fprintf(stderr, "DEBUG: NumCopies = %d\n", cups.header.NumCopies);
- fprintf(stderr, "DEBUG: Orientation = %d\n", cups.header.Orientation);
- fprintf(stderr, "DEBUG: OutputFaceUp = %d\n", cups.header.OutputFaceUp);
- fprintf(stderr, "DEBUG: PageSize = [ %d %d ]\n", cups.header.PageSize[0],
- cups.header.PageSize[1]);
- fprintf(stderr, "DEBUG: Separations = %d\n", cups.header.Separations);
- fprintf(stderr, "DEBUG: TraySwitch = %d\n", cups.header.TraySwitch);
- fprintf(stderr, "DEBUG: Tumble = %d\n", cups.header.Tumble);
- fprintf(stderr, "DEBUG: cupsWidth = %d\n", cups.header.cupsWidth);
- fprintf(stderr, "DEBUG: cupsHeight = %d\n", cups.header.cupsHeight);
- fprintf(stderr, "DEBUG: cupsMediaType = %d\n", cups.header.cupsMediaType);
- fprintf(stderr, "DEBUG: cupsBitsPerColor = %d\n", cups.header.cupsBitsPerColor);
- fprintf(stderr, "DEBUG: cupsBitsPerPixel = %d\n", cups.header.cupsBitsPerPixel);
- fprintf(stderr, "DEBUG: cupsBytesPerLine = %d\n", cups.header.cupsBytesPerLine);
- fprintf(stderr, "DEBUG: cupsColorOrder = %d\n", cups.header.cupsColorOrder);
- fprintf(stderr, "DEBUG: cupsColorSpace = %d\n", cups.header.cupsColorSpace);
- fprintf(stderr, "DEBUG: cupsCompression = %d\n", cups.header.cupsCompression);
- fprintf(stderr, "DEBUG: cupsRowCount = %d\n", cups.header.cupsRowCount);
- fprintf(stderr, "DEBUG: cupsRowFeed = %d\n", cups.header.cupsRowFeed);
- fprintf(stderr, "DEBUG: cupsRowStep = %d\n", cups.header.cupsRowStep);
-
- /*
- * Setup printer driver variables...
- */
-
- stp_set_page_width(v, cups.header.PageSize[0]);
- stp_set_page_height(v, cups.header.PageSize[1]);
- stp_set_image_type(v, cups.header.cupsRowCount);
-
- switch (cups.header.cupsColorSpace)
{
- case CUPS_CSPACE_W :
- stp_set_output_type(v, OUTPUT_GRAY);
- break;
- case CUPS_CSPACE_K :
- stp_set_output_type(v, OUTPUT_MONOCHROME);
- break;
- case CUPS_CSPACE_RGB :
- stp_set_output_type(v, OUTPUT_COLOR);
- break;
- case CUPS_CSPACE_CMYK :
- stp_set_output_type(v, OUTPUT_RAW_CMYK);
- break;
- default :
- fprintf(stderr, "ERROR: Bad colorspace %d!",
- cups.header.cupsColorSpace);
- break;
- }
+ /*
+ * We don't know how many pages we're going to print, and
+ * we need to call stp_end_job at the completion of the job.
+ * Therefore, we need to keep v in scope after the termination
+ * of the loop to permit calling stp_end_job then. Therefore,
+ * we have to free the previous page's stp_vars_t at the start
+ * of the loop.
+ */
+ if (v)
+ stp_vars_destroy(v);
+
+ /*
+ * Setup printer driver variables...
+ */
+ v = initialize_page(&cups, default_settings);
+ stp_set_int_parameter(v, "PageNumber", cups.page);
+ cups.row = 0;
+ fprintf(stderr, "DEBUG: Gutenprint printing page %d\n", cups.page + 1);
+ fprintf(stderr, "PAGE: %d 1\n", cups.page + 1);
+ print_debug_block(v, &cups);
+ print_messages_as_errors = 1;
+ if (!stp_verify(v))
+ {
+ fprintf(stderr, "ERROR: Gutenprint: options failed to verify.\n");
+ fprintf(stderr, "ERROR: Gutenprint: Make sure that you are using ESP Ghostscript rather\n");
+ fprintf(stderr, "ERROR: Gutenprint: than GNU or AFPL Ghostscript with CUPS.\n");
+ fprintf(stderr, "ERROR: Gutenprint: If this is not the cause, set LogLevel to debug2 to identify the problem.\n");
+ goto cups_abort;
+ }
- if (cups.header.cupsRowStep >= stp_dither_algorithm_count())
- fprintf(stderr, "ERROR: Unable to set dither algorithm!\n");
- else
- stp_set_dither_algorithm(v,
- stp_dither_algorithm_name(cups.header.cupsRowStep));
-
- if (cups.header.MediaClass && strlen(cups.header.MediaClass) > 0)
- stp_set_media_source(v, cups.header.MediaClass);
- if (cups.header.MediaType && strlen(cups.header.MediaType) > 0)
- stp_set_media_type(v, cups.header.MediaType);
- if (cups.header.OutputType && strlen(cups.header.OutputType) > 0)
- stp_set_ink_type(v, cups.header.OutputType);
-
- fprintf(stderr, "DEBUG: PageSize = %dx%d\n", cups.header.PageSize[0],
- cups.header.PageSize[1]);
-
- if ((size = stp_get_papersize_by_size(cups.header.PageSize[1],
- cups.header.PageSize[0])) != NULL)
- stp_set_media_size(v, stp_papersize_get_name(size));
- else
- fprintf(stderr, "ERROR: Unable to get media size!\n");
-
- if (cups.header.cupsCompression >= num_res)
- fprintf(stderr, "ERROR: Unable to set printer resolution!\n");
- else
- stp_set_resolution(v, res[cups.header.cupsCompression].name);
-
- stp_set_app_gamma(v, 1.0);
- stp_set_brightness(v, stp_brightness);
- stp_set_contrast(v, stp_contrast);
- stp_set_cyan(v, stp_cyan);
- stp_set_magenta(v, stp_magenta);
- stp_set_yellow(v, stp_yellow);
- stp_set_saturation(v, stp_saturation);
- stp_set_density(v, stp_density);
- stp_set_gamma(v, stp_gamma);
- stp_merge_printvars(v, stp_printer_get_printvars(printer));
-
- fprintf(stderr, "DEBUG: stp_get_output_to(v) |%s|\n", stp_get_output_to(v));
- fprintf(stderr, "DEBUG: stp_get_driver(v) |%s|\n", stp_get_driver(v));
- fprintf(stderr, "DEBUG: stp_get_ppd_file(v) |%s|\n", stp_get_ppd_file(v));
- fprintf(stderr, "DEBUG: stp_get_resolution(v) |%s|\n", stp_get_resolution(v));
- fprintf(stderr, "DEBUG: stp_get_media_size(v) |%s|\n", stp_get_media_size(v));
- fprintf(stderr, "DEBUG: stp_get_media_type(v) |%s|\n", stp_get_media_type(v));
- fprintf(stderr, "DEBUG: stp_get_media_source(v) |%s|\n", stp_get_media_source(v));
- fprintf(stderr, "DEBUG: stp_get_ink_type(v) |%s|\n", stp_get_ink_type(v));
- fprintf(stderr, "DEBUG: stp_get_dither_algorithm(v) |%s|\n", stp_get_dither_algorithm(v));
- fprintf(stderr, "DEBUG: stp_get_output_type(v) |%d|\n", stp_get_output_type(v));
- fprintf(stderr, "DEBUG: stp_get_orientation(v) |%d|\n", stp_get_orientation(v));
- fprintf(stderr, "DEBUG: stp_get_left(v) |%d|\n", stp_get_left(v));
- fprintf(stderr, "DEBUG: stp_get_top(v) |%d|\n", stp_get_top(v));
- fprintf(stderr, "DEBUG: stp_get_image_type(v) |%d|\n", stp_get_image_type(v));
- fprintf(stderr, "DEBUG: stp_get_unit(v) |%d|\n", stp_get_unit(v));
- fprintf(stderr, "DEBUG: stp_get_page_width(v) |%d|\n", stp_get_page_width(v));
- fprintf(stderr, "DEBUG: stp_get_page_height(v) |%d|\n", stp_get_page_height(v));
- fprintf(stderr, "DEBUG: stp_get_input_color_model(v) |%d|\n", stp_get_input_color_model(v));
- fprintf(stderr, "DEBUG: stp_get_output_color_model(v) |%d|\n", stp_get_output_color_model(v));
- fprintf(stderr, "DEBUG: stp_get_brightness(v) |%.3f|\n", stp_get_brightness(v));
- fprintf(stderr, "DEBUG: stp_get_scaling(v) |%.3f|\n", stp_get_scaling(v));
- fprintf(stderr, "DEBUG: stp_get_gamma(v) |%.3f|\n", stp_get_gamma(v));
- fprintf(stderr, "DEBUG: stp_get_contrast(v) |%.3f|\n", stp_get_contrast(v));
- fprintf(stderr, "DEBUG: stp_get_cyan(v) |%.3f|\n", stp_get_cyan(v));
- fprintf(stderr, "DEBUG: stp_get_magenta(v) |%.3f|\n", stp_get_magenta(v));
- fprintf(stderr, "DEBUG: stp_get_yellow(v) |%.3f|\n", stp_get_yellow(v));
- fprintf(stderr, "DEBUG: stp_get_saturation(v) |%.3f|\n", stp_get_saturation(v));
- fprintf(stderr, "DEBUG: stp_get_density(v) |%.3f|\n", stp_get_density(v));
- fprintf(stderr, "DEBUG: stp_get_app_gamma(v) |%.3f|\n", stp_get_app_gamma(v));
-
- stp_set_page_number(v, cups.page);
-
- (*stp_printer_get_printfuncs(printer)->media_size)
- (printer, v, &(cups.width), &(cups.height));
- (*stp_printer_get_printfuncs(printer)->imageable_area)
- (printer, v, &(cups.left), &(cups.right), &(cups.bottom), &(cups.top));
- fprintf(stderr, "DEBUG: GIMP-PRINT %d %d %d %d %d %d\n",
- cups.width, cups.left, cups.right, cups.height, cups.top, cups.bottom);
- cups.right = cups.width - cups.right;
- cups.width = cups.width - cups.left - cups.right;
- cups.width = cups.header.HWResolution[0] * cups.width / 72;
- cups.left = cups.header.HWResolution[0] * cups.left / 72;
- cups.right = cups.header.HWResolution[0] * cups.right / 72;
-
- cups.top = cups.height - cups.top;
- cups.height = cups.height - cups.top - cups.bottom;
- cups.height = cups.header.HWResolution[1] * cups.height / 72;
- cups.top = cups.header.HWResolution[1] * cups.top / 72;
- cups.bottom = cups.header.HWResolution[1] * cups.bottom / 72;
- fprintf(stderr, "DEBUG: GIMP-PRINT %d %d %d %d %d %d\n",
- cups.width, cups.left, cups.right, cups.height, cups.top, cups.bottom);
+ if (!initialized_job)
+ {
+ stp_start_job(v, &theImage);
+ initialized_job = 1;
+ }
- /*
- * Print the page...
- */
+ if (!stp_print(v, &theImage))
+ {
+ fprintf(stderr, "ERROR: Gutenprint failed to print, set LogLevel to debug2 to identify why\n");
+ goto cups_abort;
+ }
+ print_messages_as_errors = 0;
- if (stp_printer_get_printfuncs(printer)->verify(printer, v))
- {
- signal(SIGTERM, cancel_job);
- if (cups.page == 0)
- stp_printer_get_printfuncs(printer)->start_job(printer, &theImage, v);
- stp_printer_get_printfuncs(printer)->print(printer, &theImage, v);
fflush(stdout);
- }
- else
- fputs("ERROR: Invalid printer settings!\n", stderr);
- /*
- * Purge any remaining bitmap data...
- */
-
- if (cups.row < cups.header.cupsHeight)
+ /*
+ * Purge any remaining bitmap data...
+ */
+ if (cups.row < cups.header.cupsHeight)
+ purge_excess_data(&cups);
+ cups.page ++;
+ }
+ if (v)
{
- if ((buffer = xmalloc(cups.header.cupsBytesPerLine)) == NULL)
- break;
-
- while (cups.row < cups.header.cupsHeight)
- {
- cupsRasterReadPixels(cups.ras, (unsigned char *)buffer,
- cups.header.cupsBytesPerLine);
- cups.row ++;
- }
+ fprintf(stderr, "DEBUG: Gutenprint ending job\n");
+ stp_end_job(v, &theImage);
+ stp_vars_destroy(v);
}
- cups.page ++;
- }
-
- if (cups.page > 0)
- stp_printer_get_printfuncs(printer)->end_job(printer, &theImage, v);
-
- stp_free_vars(v);
-
- /*
- * Close the raster stream...
- */
-
cupsRasterClose(cups.ras);
+ clk = times(&tms);
+ (void) gettimeofday(&t2, &tz);
+ clocks_per_sec = sysconf(_SC_CLK_TCK);
+ fprintf(stderr, "DEBUG: Gutenprint printed total %.0f bytes\n",
+ total_bytes_printed);
+ fprintf(stderr, "DEBUG: Gutenprint used %.3f seconds user, %.3f seconds system, %.3f seconds elapsed\n",
+ (double) tms.tms_utime / clocks_per_sec,
+ (double) tms.tms_stime / clocks_per_sec,
+ (double) (t2.tv_sec - t1.tv_sec) +
+ ((double) (t2.tv_usec - t1.tv_usec)) / 1000000.0);
+ fputs("INFO: Gutenprint Ready to print.\n", stderr);
if (fd != 0)
close(fd);
-
- /*
- * If no pages were printed, send an error message...
- */
-
- if (cups.page == 0)
- fputs("ERROR: No pages found!\n", stderr);
- else
- fputs("INFO: Ready to print.\n", stderr);
-
- return (cups.page == 0);
+ return 0;
+
+cups_abort:
+ clk = times(&tms);
+ (void) gettimeofday(&t2, &tz);
+ clocks_per_sec = sysconf(_SC_CLK_TCK);
+ fprintf(stderr, "DEBUG: Gutenprint printed total %.0f bytes\n",
+ total_bytes_printed);
+ fprintf(stderr, "DEBUG: Gutenprint used %.3f seconds user, %.3f seconds system, %.3f seconds elapsed\n",
+ (double) tms.tms_utime / clocks_per_sec,
+ (double) tms.tms_stime / clocks_per_sec,
+ (double) (t2.tv_sec - t1.tv_sec) +
+ ((double) (t2.tv_usec - t1.tv_usec)) / 1000000.0);
+ fputs("ERROR: Gutenprint No pages found!\n", stderr);
+ fputs("ERROR: Gutenprint Invalid printer settings!\n", stderr);
+ stp_end_job(v, &theImage);
+ stp_vars_destroy(v);
+ cupsRasterClose(cups.ras);
+ if (fd != 0)
+ close(fd);
+ return 1;
}
@@ -588,9 +852,32 @@ static void
cups_writefunc(void *file, const char *buf, size_t bytes)
{
FILE *prn = (FILE *)file;
+ total_bytes_printed += bytes;
fwrite(buf, 1, bytes, prn);
}
+static void
+cups_errfunc(void *file, const char *buf, size_t bytes)
+{
+ size_t next_nl = 0;
+ size_t where = 0;
+ FILE *prn = (FILE *)file;
+ while (where < bytes)
+ {
+ if (print_messages_as_errors)
+ fputs("ERROR: Gutenprint: ", prn);
+ else
+ fputs("DEBUG: Gutenprint internal: ", prn);
+ while (next_nl < bytes)
+ {
+ if (buf[next_nl++] == '\n')
+ break;
+ }
+ fwrite(buf + where, 1, next_nl - where, prn);
+ where = next_nl;
+ }
+}
+
/*
* 'cancel_job()' - Cancel the current job...
@@ -600,41 +887,9 @@ void
cancel_job(int sig) /* I - Signal */
{
(void)sig;
-
- Image_status = STP_IMAGE_ABORT;
-}
-
-
-/*
- * 'Image_bpp()' - Return the bytes-per-pixel of an image.
- */
-
-static int /* O - Bytes per pixel */
-Image_bpp(stp_image_t *image) /* I - Image */
-{
- cups_image_t *cups; /* CUPS image */
-
-
- if ((cups = (cups_image_t *)(image->rep)) == NULL)
- return (0);
-
- /*
- * For now, we only support RGB and grayscale input from the
- * raster filters.
- */
-
- switch (cups->header.cupsColorSpace)
- {
- default :
- return (1);
- case CUPS_CSPACE_RGB :
- return (3);
- case CUPS_CSPACE_CMYK :
- return (4);
- }
+ Image_status = STP_IMAGE_STATUS_ABORT;
}
-
/*
* 'Image_get_appname()' - Get the application we are running.
*/
@@ -644,7 +899,7 @@ Image_get_appname(stp_image_t *image) /* I - Image */
{
(void)image;
- return ("CUPS 1.1.x driver based on GIMP-print");
+ return ("CUPS 1.1.x driver based on Gutenprint");
}
@@ -670,50 +925,68 @@ throwaway_data(int amount, cups_image_t *cups)
stp_image_status_t
Image_get_row(stp_image_t *image, /* I - Image */
unsigned char *data, /* O - Row */
+ size_t byte_limit, /* I - how many bytes in data */
int row) /* I - Row number (unused) */
{
cups_image_t *cups; /* CUPS image */
int i; /* Looping var */
int bytes_per_line;
int margin;
- unsigned char *orig = data;
- static int warned = 0;
-
+ stp_image_status_t tmp_image_status = Image_status;
+ unsigned char *orig = data; /* Temporary pointer */
+ static int warned = 0; /* Error warning printed? */
+ int new_percent;
if ((cups = (cups_image_t *)(image->rep)) == NULL)
- return STP_IMAGE_ABORT;
- bytes_per_line = cups->width * cups->header.cupsBitsPerPixel / CHAR_BIT;
+ {
+ fprintf(stderr, "ERROR: Gutenprint image is null! Please report this bug to gimp-print-devel@lists.sourceforge.net\n");
+ return STP_IMAGE_STATUS_ABORT;
+ }
+ bytes_per_line =
+ ((cups->adjusted_width * cups->header.cupsBitsPerPixel) + CHAR_BIT - 1) /
+ CHAR_BIT;
margin = cups->header.cupsBytesPerLine - bytes_per_line;
if (cups->row < cups->header.cupsHeight)
{
- fprintf(stderr, "DEBUG: GIMP-PRINT reading %d %d\n",
+ fprintf(stderr, "DEBUG2: Gutenprint reading %d %d\n",
bytes_per_line, cups->row);
- cupsRasterReadPixels(cups->ras, data, bytes_per_line);
- cups->row ++;
- fprintf(stderr, "DEBUG: GIMP-PRINT tossing right %d\n", margin);
- if (margin)
- throwaway_data(margin, cups);
-
- /*
- * Invert black data for monochrome output...
- */
-
- if (cups->header.cupsColorSpace == CUPS_CSPACE_K)
- for (i = bytes_per_line; i > 0; i --, data ++)
- *data = ((1 << CHAR_BIT) - 1) - *data;
+ while (cups->row <= row && cups->row < cups->header.cupsHeight)
+ {
+ cupsRasterReadPixels(cups->ras, data, bytes_per_line);
+ cups->row ++;
+ if (margin > 0)
+ {
+ fprintf(stderr, "DEBUG2: Gutenprint tossing right %d\n", margin);
+ throwaway_data(margin, cups);
+ }
+ }
}
else
{
- if (cups->header.cupsColorSpace == CUPS_CSPACE_CMYK)
- memset(data, 0, bytes_per_line);
- else
- memset(data, ((1 << CHAR_BIT) - 1), bytes_per_line);
+ switch (cups->header.cupsColorSpace)
+ {
+ case CUPS_CSPACE_K:
+ case CUPS_CSPACE_CMYK:
+ case CUPS_CSPACE_KCMY:
+ case CUPS_CSPACE_CMY:
+ memset(data, 0, bytes_per_line);
+ break;
+ case CUPS_CSPACE_RGB:
+ case CUPS_CSPACE_W:
+ memset(data, ((1 << CHAR_BIT) - 1), bytes_per_line);
+ break;
+ default:
+ fprintf(stderr, "ERROR: Gutenprint Unknown colorspace %d!\n",
+ cups->header.cupsColorSpace);
+ return STP_IMAGE_STATUS_ABORT;
+ }
}
/*
* This exists to print non-ADSC input which has messed up the job
- * input, such as that generated by psnup.
+ * input, such as that generated by psnup. The output is barely
+ * legible, but it's better than the garbage output otherwise.
*/
data = orig;
if (cups->header.cupsBitsPerPixel == 1)
@@ -721,11 +994,11 @@ Image_get_row(stp_image_t *image, /* I - Image */
if (warned == 0)
{
fprintf(stderr,
- "WARNING: GIMP-PRINT detected broken job options. "
+ "WARNING: Gutenprint detected broken job options. "
"Output quality is degraded. Are you using psnup or non-ADSC PostScript?\n");
warned = 1;
}
- for (i = cups->width - 1; i >= 0; i--)
+ for (i = cups->adjusted_width - 1; i >= 0; i--)
{
if ( (data[i/8] >> (7 - i%8)) &0x1)
data[i]=255;
@@ -734,7 +1007,17 @@ Image_get_row(stp_image_t *image, /* I - Image */
}
}
- return Image_status;
+ new_percent = (int) (100.0 * cups->row / cups->header.cupsHeight);
+ if (new_percent > cups->last_percent)
+ {
+ fprintf(stderr, "INFO: Gutenprint Printing page %d, %d%%\n",
+ cups->page + 1, new_percent);
+ cups->last_percent = new_percent;
+ }
+
+ if (tmp_image_status != STP_IMAGE_STATUS_OK)
+ fprintf(stderr, "DEBUG: Gutenprint image status %d\n", tmp_image_status);
+ return tmp_image_status;
}
@@ -751,8 +1034,8 @@ Image_height(stp_image_t *image) /* I - Image */
if ((cups = (cups_image_t *)(image->rep)) == NULL)
return (0);
- fprintf(stderr, "DEBUG: GIMP-PRINT: Image_height %d\n", cups->height);
- return (cups->height);
+ fprintf(stderr, "DEBUG: Gutenprint: Image_height %d\n", cups->adjusted_height);
+ return (cups->adjusted_height);
}
@@ -763,55 +1046,22 @@ Image_height(stp_image_t *image) /* I - Image */
static void
Image_init(stp_image_t *image) /* I - Image */
{
- (void)image;
-}
-
-
-/*
- * 'Image_note_progress()' - Notify the user of our progress.
- */
-
-void
-Image_note_progress(stp_image_t *image, /* I - Image */
- double current, /* I - Current progress */
- double total) /* I - Maximum progress */
-{
cups_image_t *cups; /* CUPS image */
-
if ((cups = (cups_image_t *)(image->rep)) == NULL)
return;
+ cups->last_percent = 0;
- fprintf(stderr, "INFO: Printing page %d, %.0f%%\n",
- cups->page +1, 100.0 * current / total);
- /* cups->page + 1 because users expect 1-based counting */
-}
-
-
-/*
- * 'Image_progress_conclude()' - Close the progress display.
- */
-
-static void
-Image_progress_conclude(stp_image_t *image) /* I - Image */
-{
- cups_image_t *cups; /* CUPS image */
-
-
- if ((cups = (cups_image_t *)(image->rep)) == NULL)
- return;
-
- fprintf(stderr, "INFO: Finished page %d...\n", cups->page + 1);
+ fprintf(stderr, "INFO: Starting page %d...\n", cups->page + 1);
/* cups->page + 1 because users expect 1-based counting */
}
-
/*
- * 'Image_progress_init()' - Initialize progress display.
+ * 'Image_progress_conclude()' - Close the progress display.
*/
static void
-Image_progress_init(stp_image_t *image)/* I - Image */
+Image_conclude(stp_image_t *image) /* I - Image */
{
cups_image_t *cups; /* CUPS image */
@@ -819,44 +1069,9 @@ Image_progress_init(stp_image_t *image)/* I - Image */
if ((cups = (cups_image_t *)(image->rep)) == NULL)
return;
- fprintf(stderr, "INFO: Starting page %d...\n", cups->page + 1);
- /* cups->page + 1 because users expect 1-based counting */
+ fprintf(stderr, "INFO: Gutenprint Finished page %d...\n", cups->page + 1);
}
-
-/*
- * 'Image_rotate_180()' - Rotate the image 180 degrees (unsupported).
- */
-
-static void
-Image_rotate_180(stp_image_t *image) /* I - Image */
-{
- (void)image;
-}
-
-
-/*
- * 'Image_rotate_ccw()' - Rotate the image counter-clockwise (unsupported).
- */
-
-static void
-Image_rotate_ccw(stp_image_t *image) /* I - Image */
-{
- (void)image;
-}
-
-
-/*
- * 'Image_rotate_cw()' - Rotate the image clockwise (unsupported).
- */
-
-static void
-Image_rotate_cw(stp_image_t *image) /* I - Image */
-{
- (void)image;
-}
-
-
/*
* 'Image_width()' - Return the width of an image.
*/
@@ -870,11 +1085,11 @@ Image_width(stp_image_t *image) /* I - Image */
if ((cups = (cups_image_t *)(image->rep)) == NULL)
return (0);
- fprintf(stderr, "DEBUG: GIMP-PRINT: Image_width %d\n", cups->width);
- return (cups->width);
+ fprintf(stderr, "DEBUG: Gutenprint: Image_width %d\n", cups->adjusted_width);
+ return (cups->adjusted_width);
}
/*
- * End of "$Id: rastertoprinter.c,v 1.19.4.15 2004/03/26 03:29:39 rlk Exp $".
+ * End of "$Id: rastertoprinter.c,v 1.96 2005/04/23 00:26:07 rlk Exp $".
*/