diff options
author | Daniel Robbins <drobbins@gentoo.org> | 2002-07-11 06:59:32 +0000 |
---|---|---|
committer | Daniel Robbins <drobbins@gentoo.org> | 2002-07-11 06:59:32 +0000 |
commit | 57b4e8b4124e80b7006970d4e76e167496352c2e (patch) | |
tree | 7df04933d0c199854eb18dea2aaf7bb8952d7090 /app-text | |
parent | removing esp-ghostscript as it's now in "ghostscript" (our default) (diff) | |
download | gentoo-2-57b4e8b4124e80b7006970d4e76e167496352c2e.tar.gz gentoo-2-57b4e8b4124e80b7006970d4e76e167496352c2e.tar.bz2 gentoo-2-57b4e8b4124e80b7006970d4e76e167496352c2e.zip |
removing crufty stuff
Diffstat (limited to 'app-text')
-rw-r--r-- | app-text/ghostscript/files/all-arch.mak | 900 | ||||
-rw-r--r-- | app-text/ghostscript/files/gdevgdi.c | 1412 | ||||
-rw-r--r-- | app-text/ghostscript/files/gs7.05-gdevhl12.c | 741 | ||||
-rw-r--r-- | app-text/ghostscript/files/lxm3200-gentoo.diff | 32 |
4 files changed, 0 insertions, 3085 deletions
diff --git a/app-text/ghostscript/files/all-arch.mak b/app-text/ghostscript/files/all-arch.mak deleted file mode 100644 index 472556badef5..000000000000 --- a/app-text/ghostscript/files/all-arch.mak +++ /dev/null @@ -1,900 +0,0 @@ -# Copyright (C) 1999, 2000 Aladdin Enterprises. All rights reserved. -# -# This file is part of Aladdin Ghostscript. -# -# Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author -# or distributor accepts any responsibility for the consequences of using it, -# or for whether it serves any particular purpose or works at all, unless he -# or she says so in writing. Refer to the Aladdin Ghostscript Free Public -# License (the "License") for full details. -# -# Every copy of Aladdin Ghostscript must include a copy of the License, -# normally in a plain ASCII text file named PUBLIC. The License grants you -# the right to copy, modify and redistribute Aladdin Ghostscript, but only -# under certain conditions described in the License. Among other things, the -# License requires that the copyright notice and this notice be preserved on -# all copies. - -# $Id: all-arch.mak,v 1.2 2000/08/25 15:10:22 achim Exp $ -# -# Author: -# Nelson H. F. Beebe -# Center for Scientific Computing -# University of Utah -# Department of Mathematics, 322 INSCC -# 155 S 1400 E RM 233 -# Salt Lake City, UT 84112-0090 -# USA -# Email: beebe@math.utah.edu, beebe@acm.org, beebe@ieee.org (Internet) -# WWW URL: http://www.math.utah.edu/~beebe -# Telephone: +1 801 581 5254 -# FAX: +1 801 585 1640, +1 801 581 4148 -# -# /usr/local/src/ghostscript/gs6.0/Makefile, Sat Feb 12 09:46:16 2000 -# Edit by Nelson H. F. Beebe <beebe@math.utah.edu> -# Update with settings of STDLIBS for several targets, because gs-6.0 -# added a reference to the POSIX threads library, which is not -# universally available. -# /usr/local/src/ghostscript/gs5.94/Makefile, Sun Oct 3 08:07:02 1999 -# Edit by Nelson H. F. Beebe <beebe@math.utah.edu> -# Major update with rearrangement of target names, and addition of -# -L/usr/local/lib everywhere. -#======================================================================= -# This Makefile is an interface to the UNMODIFIED unix*.mak files for -# building gs, so as to avoid the need for customizing Makefiles for -# multiple architectures with each new release of ghostscript. -# -# Usage: -# make <arch-name> TARGETS='...' -# -# or, for convenience at Utah, -# -# make `hostname` -# -# HINT: for parallel GNU make runs, add -jnnn to TARGETS, e.g. -# TARGETS=-j6. -# WARNING: this does not produce successful builds on at least SGI IRIX 6. -# -# Current target list: -# all -# clean -# mostlyclean -# clobber -# distclean -# maintainer-clean -# init -# install -# install-gnu-readline -# install-binary -# install-binary-gnu-readline -# install-fontmap -# install-pdfsec -# dec-alpha-osf -# dec-alpha-osf-gnu-readline -# dec-mips-ultrix -# hp-parisc-hpux -# hp-parisc-hpux-gnu-readline -# ibm-rs6000-aix -# ibm-rs6000-aix-c89 -# ibm-rs6000-aix-4-1-c89 -# ibm-rs6000-aix-3-2-5-gcc -# ibm-rs6000-aix-gcc -# ibm-rs6000-aix-4.2 -# ibm-rs6000-aix-4.2-gnu-readline -# linux -# linux-gnu-readline -# next-m68K-mach -# next-m68K-mach-gnu-readline -# next-m68K-mach-cc -# sgi-mips-irix5 -# sgi-mips-irix5-gnu-readline -# sgi-mips-irix6.1 -# sgi-mips-irix6.3 -# sgi-mips-irix6.3-gnu-readline -# sgi-mips-irix6.4 -# sgi-mips-irix6.4-gnu-readline -# sun-sparc-solaris -# sun-sparc-solaris-gnu-readline -# sun-sparc-solaris-gcc -# sun-sparc-solaris-opt-gnu-readline -# sun-sparc-solaris-newsprint -# sun-sparc-solaris-pg -# sun-sparc-sunos-gcc -# sun-sparc-sunos-gcc-gnu-readline -# -# Machine-specific targets (for "make `hostname`"): -## XXXXXXXX.YYYYYYYY.utah.edu -## XXXXXXXX.YYYYYYYY.utah.edu -## XXXXXXXX.YYYYYYYY.utah.edu -## XXXXXXXX.YYYYYYYY.utah.edu -## XXXXXXXX.YYYYYYYY.utah.edu -## XXXXXXXX.YYYYYYYY.utah.edu -## XXXXXXXX.YYYYYYYY.utah.edu -## XXXXXXXX.YYYYYYYY.utah.edu -## XXXXXXXX.YYYYYYYY.utah.edu -## XXXXXXXX.YYYYYYYY.utah.edu -## XXXXXXXX.YYYYYYYY.utah.edu -## XXXXXXXX.YYYYYYYY.utah.edu -# -# [29-Apr-1999] -- update for gs-5.82: Add XLIBDIRSALL list for -# install target, and add hostnames as convenience -# targets, duplicating information in the -# ../BUILD-GS.sh script, but allowing easier restarts -# after build failures. Update install-fontmap target -# to reflect new location of installed Fontmap files. -# [20-Mar-1999] -- update for gs-5.73. Alphabetize most definitions. -# Add more comments. Add common macros to eliminate -# duplication. Set the SHARE_* variables to use -# installed versions of support libraries, instead of -# always having to duplicate their source trees as we -# did with older releases. -# [19-Mar-1999] -- change SGI IRIX 6.x targets to use -n32 -mips3, -# since -n32 is the default when no memory model -# is selected -# [09-Feb-1999] -- add install-pdfsec target -# [03-Nov-1998] -- update for gs-5.60 and later -# [10-Aug-1998] -- add ibm-rs6000-aix-3-2-5-gcc and -# ibm-rs6000-aix-4-1-c89 targets -# [04-Aug-1998] -- add linux and ibm-rs6000-aix-c89 target, and -# dependencies on init target so that I do not need -# to remember to create the obj subdirectory manually -# [19-Mar-1998] -- add -32 -mips2 flag to SGI IRIX 6.x targets, so that -# the executables run on every SGI that can run that -# O/S. Otherwise, when building on XXXXXXXX.YYYYYYYY.utah.edu, -# the compiler chooses a default of -mips4, which won't -# run on Indy and R4400 machines. -# [23-Feb-1998] -- add -jnnn hint above, and COMMON_DEVICES below -# [28-Nov-1997] -#======================================================================= - -# Definitions needed from src/*.mak files: -DD = $(GLD) -GLD = $(GLGENDIR)/ -GLGENDIR = ./obj -GLOBJ = ./obj/ -PSD = $(PSGENDIR)/ -PSGENDIR = ./obj - -# Definition(s) for this file: -SRCDIR = /usr/local/src - -# Define local modifications of search paths: -TF = /usr/lib/tex/fonts -GS_LIB_DEFAULT = $$(gsdatadir)/lib:$$(gsdatadir)/fonts:$$(gsdatadir)/examples:$$(gsdir)/fonts:/usr/share/sys/fonts/postscript:$(TF)/lucida:$(TF)/mathtime:$(TF)/postscript/bakoma/pfb:$(TF)/vf - -# Define local paths for install targets: -GS_SHARE_DIR = /usr/share/ghostscript -GS_SRC_DIR = $(SRCDIR)/ghostscript - -# Arguments for make with cc (or other), and gcc: -ARGS = -f src/unixansi.mak $(COMMON_ARGS) - -ARGSGCC = -f src/unix-gcc.mak $(COMMON_ARGS) - -COMMON_ARGS = DEVICE_DEVS_EXTRA='$(DEVICE_DEVS_EXTRA)' \ - GS_LIB_DEFAULT='$(GS_LIB_DEFAULT)' \ - JSRCDIR='$(JSRCDIR)' \ - PNGSRCDIR='$(PNGSRCDIR)' \ - PSRCDIR='$(PNGSRCDIR)' \ - PVERSION=10005 \ - SHARE_LIBPNG='$(SHARE_LIBPNG)' \ - SHARE_ZLIB='$(SHARE_ZLIB)' \ - XCFLAGS='$(XCFLAGS)' \ - ZSRCDIR='$(ZSRCDIR)' \ - $(TARGETS) - -# Additional gcc-specific compilation flags -GCFLAGS = - -# Name of the installed binary executable (it will also be called gs-x.yy): -GS = ngs -GS = gs - -# Here is a list of additional output devices that we need to support at -# the University of Utah Math, Physics, and INSCC installations; -# effective with gs-5.60, Each must have a $(DD) prefix: -DEVICE_DEVS_EXTRA = $(DD)st800.dev $(DD)stcolor.dev - -# [20-Mar-1999] Set FEATURE_DEVS_EXTRA to include gnrdline.dev, to -# support input line editing in gs when compiled with gcc. Addition of -# this module also requires adding EXTRALIBS='-ltermcap' for each system -# below that uses gcc for the build. -FEATURE_DEVS_EXTRA = $(PSD)gnrdline.dev - -GNU_READLINE_ARGS = EXTRALIBS='-ltermcap' \ - FEATURE_DEVS_EXTRA='$(FEATURE_DEVS_EXTRA)' \ - XCFLAGS='-I. -I$(JSRCDIR)' - -# Additions to CFLAGS for all compilers -XCFLAGS = -I/usr/local/include - -# This variable contains a list of all X library locations, for -# use in the install target -XLIBDIRSALL=' \ - -L/usr/X11R6/lib \ - -L/usr/lib/X11 \ - -L/usr/lib/X11R5 \ - -L/usr/openwin/lib \ - -L/usr/lpp/X11/lib/R5 \ - -L/usr/lpp/X11/lib \ - -L/usr/local/$(SGIARCHLIB) \ - -L/usr/local/X11R5/lib \ - -L/usr/local/lib \ - -L/usr/local/lib32 \ -' - -# Compilation flags and load library for SGI IRIX 6.x builds: -SGIARCHFLAGS = -n32 -mips3 -SGIARCHLIB = libn32 - -SGIARCH64FLAGS = -64 -mips3 -SGIARCH64LIB = lib64 - -# [20-Mar-1999]: New from gs-5.73: use png and zlib libraries already -# installed on the system. - -SHARE_LIBPNG = 1 -SHARE_ZLIB = 1 - -# Use of the shared libraries still requires reference to source code in -# these directories: -JSRCDIR = $(SRCDIR)/jpeg/jpeg-6b -PNGSRCDIR = $(SRCDIR)/libpng/libpng-1.0.6 -ZSRCDIR = $(SRCDIR)/zlib/zlib-1.1.3 - -# Use this to provide alternate targets to make, instead of the default -# all. It can also be used to pass additional arguments to child makes, -# e.g., -j12 for 12 parallel jobs with GNU make. -TARGETS = - -#======================================================================= - -BINDIR = /usr/bin - -CHMOD = chmod - -CP = /bin/cp -p -CP = rcp -p - -MV = /bin/mv - -RM = /bin/rm -f - -SHELL = /bin/sh - -#======================================================================= - -all: - $(MAKE) $(ARGS) - -# Convenience targets to make standard targets available -clean mostlyclean clobber distclean maintainer-clean: - $(MAKE) $(ARGS) $@ - -init: - -if test ! -d obj ; then mkdir obj ; fi - -install: install-binary install-fontmap install-pdfsec - -install-no-X11: - $(MAKE) install \ - FEATURE_DEVS_EXTRA= \ - DEVICE_DEVS= \ - SYNC=nosync \ - STDLIBS= \ - XLIBDIRS= \ - XLIBDIRSALL= \ - EXTRALIBS= - -install-gnu-readline: install-binary-gnu-readline install-fontmap install-pdfsec - -# Remove the old gs binary first, so as to preserve the previous -# gs-x.yy version, if any. -install-binary: - -$(RM) $(BINDIR)/$(GS) - @$(MAKE) $(ARGS) install GS=$(GS) XLIBDIRS=$(XLIBDIRSALL) ; \ - d=`pwd` ; \ - d=`basename $$d` ; \ - d=`echo $$d | sed -e s/gs/gs-/` ; \ - $(RM) $(BINDIR)/$$d ; \ - ln $(BINDIR)/$(GS) $(BINDIR)/$$d ; \ - ls -l $(BINDIR)/$(GS) $(BINDIR)/$$d - -install-binary-gnu-readline: - -$(RM) $(BINDIR)/$(GS) - @$(MAKE) $(ARGS) install GS=$(GS) XLIBDIRS=$(XLIBDIRSALL) $(GNU_READLINE_ARGS) ; \ - d=`pwd` ; \ - d=`basename $$d` ; \ - d=`echo $$d | sed -e s/gs/gs-/` ; \ - $(RM) $(BINDIR)/$$d ; \ - ln $(BINDIR)/$(GS) $(BINDIR)/$$d ; \ - ls -l $(BINDIR)/$(GS) $(BINDIR)/$$d - -install-fontmap: - @d=`pwd` ; \ - d=`basename $$d` ; \ - d=`echo $$d | sed -e s/gs//` ; \ - if test -f $(GS_SRC_DIR)/Fontmap.new ; \ - then \ - if test -f $(GS_SHARE_DIR)/$$d/lib/Fontmap.org ; \ - then \ - true ; \ - else \ - mv $(GS_SHARE_DIR)/$$d/lib/Fontmap $(GS_SHARE_DIR)/$$d/lib/Fontmap.org ; \ - fi ; \ - $(CP) $(GS_SRC_DIR)/Fontmap.new $(GS_SHARE_DIR)/$$d/lib/Fontmap ; \ - ls -l $(GS_SHARE_DIR)/$$d/lib/Fontmap* ; \ - fi - -install-pdfsec: - @d=`pwd` ; \ - d=`basename $$d` ; \ - d=`echo $$d | sed -e s/gs//` ; \ - if test -f $(GS_SRC_DIR)/lib/pdf_sec.ps ; \ - then \ - $(MV) $(GS_SHARE_DIR)/$$d/lib/pdf_sec.ps $(GS_SHARE_DIR)/$$d/lib/pdf_sec.ps.org ; \ - $(CP) lib/pdf_sec.ps $(GS_SHARE_DIR)/$$d/lib/pdf_sec.ps ; \ - $(CHMOD) 664 $(GS_SHARE_DIR)/$$d/lib/pdf_sec.ps ; \ - fi - -#======================================================================= -# Architecture-specific targets: -# -# NB: gcc 2.7.x produces bad code in zfont2.c:zregisterencoding(), and possibly -# elsewhere, so we must use native compilers for now. - -# Apple Macintosh PowerPC running Rhapsody 5.5 (a NeXTStep 5 derivative, -# with no X Window System support): -apple-powermac-rhapsody5.5 apple-powerpc-rhapsody5.5: - $(MAKE) $(ARGSGCC) \ - CC='gcc' \ - GCFLAGS=$(GCFLAGS) \ - FEATURE_DEVS_EXTRA= \ - DEVICE_DEVS= \ - SYNC=nosync \ - STDLIBS= \ - XLIBDIRS= \ - XLIBDIRSALL= \ - EXTRALIBS= - @echo "#################################################################" - @echo "# To install this program, in the top-level build directory, do #" - @echo "# make install-no-X11 #" - @echo "#################################################################" - -dec-alpha-osf: init - $(MAKE) $(ARGS) \ - CC='c89 -O4 -Olimit 1500' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/lib -L/usr/lib/X11' - -dec-alpha-osf-gnu-readline: init - $(MAKE) $(ARGS) \ - CC='c89 -O4 -Olimit 1500' \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/lib -L/usr/lib/X11' \ - $(GNU_READLINE_ARGS) - -# NB: Need -Dconst= for gcc 2.7.2 (unless gcc patch in make.doc is installed) -dec-mips-ultrix: init - $(MAKE) $(ARGSGCC) \ - CC='gcc -Dconst= -O3' \ - GCFLAGS=$(GCFLAGS) \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/lib -L/usr/lib/X11' \ - EXTRALIBS='-ltermcap' - -hp-parisc-hpux: init - $(MAKE) $(ARGS) \ - CC='c89 -O -D_HPUX_SOURCE +Onolimit' \ - FEATURE_DEVS_EXTRA= \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/include/X11R5 \ - XLIBDIRS='-L/usr/lib/X11R5 -L/usr/local/lib' \ - $(GLOBJ)gdevupd.o $(GLOBJ)gxclread.o - - $(MAKE) $(ARGS) \ - CC='c89 -O -D_HPUX_SOURCE' \ - FEATURE_DEVS_EXTRA= \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/include/X11R5 \ - XLIBDIRS='-L/usr/lib/X11R5 -L/usr/local/lib' - -hp-parisc-hpux-gnu-readline: init - $(MAKE) $(ARGS) \ - CC='c89 -O -D_HPUX_SOURCE +Onolimit' \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/include/X11R5 \ - XLIBDIRS='-L/usr/local/lib -L/usr/lib/X11R5 -L/usr/local/lib' \ - $(GLOBJ)gdevupd.o $(GLOBJ)gxclread.o - - $(MAKE) $(ARGS) \ - CC='c89 -O -D_HPUX_SOURCE' \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/include/X11R5 \ - XLIBDIRS='-L/usr/local/lib -L/usr/lib/X11R5 -L/usr/local/lib' \ - $(GNU_READLINE_ARGS) - -# NB: gs3.68 executable core dumps with this compiler -ibm-rs6000-aix: init - $(MAKE) $(ARGS) \ - CC='cc -O -D_POSIX_SOURCE' \ - CP='cp -p' \ - INSTALL='/usr/ucb/install -c' \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/lpp/X11/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/lpp/X11/lib/R5 -L/usr/lpp/X11/lib' - -# This works on our local AIX 3.2.5 systems: additional header files -# and libraries are needed, because IBM does not supply the Athena -# widgets in /usr/lpp/X11. -ibm-rs6000-aix-c89: init - $(MAKE) $(ARGS) \ - CC='c89 -O -D_POSIX_SOURCE' \ - CP='cp -p' \ - INSTALL='/usr/ucb/install -c' \ - STDLIBS=-lm \ - XINCLUDE='-I/usr/lpp/X11/include -I/usr/local/X11R5/include' \ - XLIBDIRS='-L/usr/local/lib -L/usr/lpp/X11/lib/R5 -L/usr/lpp/X11/lib -L/usr/local/X11R5/lib' - -ibm-rs6000-aix-4-1-c89: init - $(MAKE) $(ARGS) \ - CC='c89 -O -D_POSIX_SOURCE' \ - CP='cp -p' \ - INSTALL='/usr/ucb/install -c' \ - STDLIBS=-lm \ - XINCLUDE='-I/usr/lpp/X11/include' \ - XLIBDIRS='-L/usr/local/lib -L/usr/lpp/X11/lib/R5 -L/usr/lpp/X11/lib' - -# NB: Need -Dconst= for gcc 2.7.1 (unless gcc patch in make.doc is installed) -ibm-rs6000-aix-3-2-5-gcc: init - $(MAKE) $(ARGSGCC) \ - CC='gcc -Dconst= -O -D_POSIX_SOURCE' \ - CP='cp -p' \ - GCFLAGS=$(GCFLAGS) \ - INSTALL='/usr/ucb/install -c' \ - STDLIBS=-lm \ - XINCLUDE='-I/usr/lpp/X11/include -I/usr/local/X11R5/include'\ - XLIBDIRS='-L/usr/local/lib -L/usr/lpp/X11/lib/R5 -L/usr/lpp/X11/lib -L/usr/local/X11R5/lib' \ - EXTRALIBS='-ltermcap' - -# NB: Need -Dconst= for gcc 2.7.1 (unless gcc patch in make.doc is installed) -ibm-rs6000-aix-gcc: init - $(MAKE) $(ARGSGCC) \ - CC='gcc -Dconst= -O -D_POSIX_SOURCE' \ - CP='cp -p' \ - GCFLAGS=$(GCFLAGS) \ - INSTALL='/usr/ucb/install -c' \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/lpp/X11/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/lpp/X11/lib/R5 -L/usr/lpp/X11/lib' \ - EXTRALIBS='-ltermcap' - -# gp_unix.o must be compiled outside POSIX environment to make -# struct timeval and struct timezone visible -ibm-rs6000-aix-4.2: init - $(MAKE) $(ARGS) \ - CC='cc -O -DMAXMEM=4096' \ - CP='cp -p' \ - FEATURE_DEVS_EXTRA= \ - INSTALL='/usr/ucb/install -c' \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/lpp/X11/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/lpp/X11/lib/R5 -L/usr/lpp/X11/lib' \ - $(GLOBJ)gp_unix.o - - $(MAKE) $(ARGS) \ - CC='cc -O -D_POSIX_SOURCE -DMAXMEM=4096' \ - CP='cp -p' \ - FEATURE_DEVS_EXTRA= \ - INSTALL='/usr/ucb/install -c' \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/lpp/X11/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/lpp/X11/lib/R5 -L/usr/lpp/X11/lib' - -ibm-rs6000-aix-4.2-gnu-readline: init - $(MAKE) $(ARGS) \ - CC='cc -O -DMAXMEM=4096' \ - CP='cp -p' \ - INSTALL='/usr/ucb/install -c' \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/lpp/X11/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/local/lib -L/usr/lpp/X11/lib/R5 -L/usr/lpp/X11/lib' \ - $(GLOBJ)gp_unix.o - - $(MAKE) $(ARGS) \ - CC='cc -O -D_POSIX_SOURCE -DMAXMEM=4096' \ - CP='cp -p' \ - INSTALL='/usr/ucb/install -c' \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/lpp/X11/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/local/lib -L/usr/lpp/X11/lib/R5 -L/usr/lpp/X11/lib' \ - $(GNU_READLINE_ARGS) - -ibm-rs6000-aix-4.3: init - $(MAKE) $(ARGS) \ - CC='cc -O -D_ALL_SOURCE -DMAXMEM=4096 -Dconst=' \ - CP='cp -p' \ - FEATURE_DEVS_EXTRA= \ - INSTALL='/usr/ucb/install -c' \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/lpp/X11/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/lpp/X11/lib/R6 -L/usr/lpp/X11/lib' - -linux: init - $(MAKE) $(ARGSGCC) \ - CC='gcc' \ - GCFLAGS=$(GCFLAGS) \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/X11R6/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/X11R6/lib' \ - EXTRALIBS='-lncurses' - -linux-gnu-readline: init - $(MAKE) $(ARGSGCC) \ - CC='gcc' \ - GCFLAGS=$(GCFLAGS) \ - XINCLUDE=-I/usr/X11R6/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/X11R6/lib' \ - EXTRALIBS='-ltermcap' \ - $(GNU_READLINE_ARGS) - -next-m68K-mach: init - $(MAKE) $(ARGS) \ - CC='gcc -Dconst= -O3 -D_POSIX_SOURCE' \ - FEATURE_DEVS_EXTRA= \ - GCFLAGS=$(GCFLAGS) \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/local/X11R5/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/local/X11R5/lib' \ - INCLUDE=/usr/include/bsd \ - EXTRALIBS='-ltermcap' - -next-m68K-mach-gnu-readline: init - $(MAKE) $(ARGS) \ - CC='gcc -Dconst= -O3 -D_POSIX_SOURCE' \ - GCFLAGS=$(GCFLAGS) \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/local/X11R5/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/local/X11R5/lib' \ - INCLUDE=/usr/include/bsd \ - $(GNU_READLINE_ARGS) - -next-m68K-mach-cc: init - $(MAKE) $(ARGS) \ - CC='cc -Dconst= -O3 -D_POSIX_SOURCE' \ - STDLIBS=-lm \ - XINCLUDE=-I/usr/local/X11R5/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/local/X11R5/lib' \ - INCLUDE=/usr/include/bsd - -# NB: Need the -Dxxx settings to get certain system types defined for -# at least gp_unifs.c and zdevcal.c -sgi-mips-irix5: init - $(MAKE) $(ARGS) \ - CC='cc -D_POSIX_4SOURCE -woff 608' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gdevpdf.o \ - $(GLOBJ)gdevps.o \ - $(GLOBJ)gdevtifs.o \ - $(GLOBJ)gp_unix.o \ - $(GLOBJ)zdevcal.o - - $(MAKE) $(ARGS) \ - CC='cc -ansi -D_POSIX_4SOURCE -woff 608 -Olimit 1100' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gxclread.o - - $(MAKE) $(ARGS) \ - CC='cc -ansi -D_POSIX_4SOURCE -woff 608' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/lib -L/usr/lib/X11' - -sgi-mips-irix5-gnu-readline: init - $(MAKE) $(ARGS) \ - CC='cc -D_POSIX_4SOURCE -woff 608' \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gdevpdf.o \ - $(GLOBJ)gdevps.o \ - $(GLOBJ)gdevtifs.o \ - $(GLOBJ)gp_unix.o \ - $(GLOBJ)zdevcal.o - - $(MAKE) $(ARGS) \ - CC='cc -ansi -D_POSIX_4SOURCE -woff 608 -Olimit 1100' \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gxclread.o - - $(MAKE) $(ARGS) \ - CC='cc -ansi -D_POSIX_4SOURCE -woff 608' \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/lib -L/usr/lib/X11' \ - $(GNU_READLINE_ARGS) - -# NB: Need the -Dxxx settings to get certain system types defined for -# at least gp_unifs.c and zdevcal.c -sgi-mips-irix6.1: init - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -ansi -D_POSIX_4SOURCE -woff 1185,1429' \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/lib -L/usr/lib/X11' - -# -sgi-mips-irix6.3: init - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -D_POSIX_4SOURCE ' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gdevpdf.o \ - $(GLOBJ)gdevps.o \ - $(GLOBJ)gdevtifs.o \ - $(GLOBJ)gp_unix.o \ - $(GLOBJ)zdevcal.o - - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -ansi -D_POSIX_4SOURCE -woff 1185,1429 -Olimit 1100' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gxclread.o - - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -ansi -D_POSIX_4SOURCE -woff 1185,1429' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/$(SGIARCHLIB) -L/usr/local/lib -L/usr/lib/X11' - -sgi-mips-irix6.3-gnu-readline: init - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -D_POSIX_4SOURCE ' \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gdevpdf.o \ - $(GLOBJ)gdevps.o \ - $(GLOBJ)gdevtifs.o \ - $(GLOBJ)gp_unix.o \ - $(GLOBJ)zdevcal.o - - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -ansi -D_POSIX_4SOURCE -woff 1185,1429 -Olimit 1100' \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gxclread.o - - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -ansi -D_POSIX_4SOURCE -woff 1185,1429' \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/$(SGIARCHLIB) -L/usr/local/lib -L/usr/lib/X11' \ - $(GNU_READLINE_ARGS) - - -# [06-Jan-2000] Problems have been reported with SGI MIPSpro compilers -# version 7.x (x <= 3) for at least idict.o and isave.o when those -# files are compiled with optimization. We therefore add a step to -# compile them without optimization. -sgi-mips-irix6.4: init - $(MAKE) $(ARGS) \ - CFLAGS_STANDARD= \ - CC='cc $(SGIARCHFLAGS) -D_POSIX_4SOURCE' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)idict.o \ - $(GLOBJ)isave.o - - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -D_POSIX_4SOURCE' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gdevpdf.o \ - $(GLOBJ)gdevps.o \ - $(GLOBJ)gdevtifs.o \ - $(GLOBJ)gp_unix.o \ - $(GLOBJ)zdevcal.o -# - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -ansi -D_POSIX_4SOURCE -woff 1185,1429 -OPT:Olimit=2500' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gxclread.o - - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -ansi -D_POSIX_4SOURCE -woff 1185,1429' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/$(SGIARCHLIB) -L/usr/local/lib -L/usr/lib/X11' - -sgi-mips-irix6.4-gcc: init - $(MAKE) $(ARGS) \ - CC='gcc -D_POSIX_4SOURCE' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/$(SGIARCHLIB) -L/usr/local/lib -L/usr/lib/X11' - -# [06-Jan-2000] Problems have been reported with SGI MIPSpro compilers -# version 7.x (x <= 3) for at least idict.o and isave.o when those -# files are compiled with optimization. We therefore add a step to -# compile them without optimization. -sgi-mips-irix6.4-gnu-readline: init - $(MAKE) $(ARGS) \ - CFLAGS_STANDARD= \ - CC='cc $(SGIARCHFLAGS) -D_POSIX_4SOURCE' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)idict.o \ - $(GLOBJ)isave.o - - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -D_POSIX_4SOURCE' \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gdevpdf.o \ - $(GLOBJ)gdevps.o \ - $(GLOBJ)gdevtifs.o \ - $(GLOBJ)gp_unix.o \ - $(GLOBJ)zdevcal.o -# - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -ansi -D_POSIX_4SOURCE -woff 1185,1429 -OPT:Olimit=2500' \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gxclread.o - - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCHFLAGS) -ansi -D_POSIX_4SOURCE -woff 1185,1429' \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/$(SGIARCHLIB) -L/usr/local/lib -L/usr/lib/X11' \ - $(GNU_READLINE_ARGS) \ - XCFLAGS='-I. -I$(JSRCDIR) -I/usr/local/include -L/usr/local/lib32 -L/usr/local/lib' - - -# IRIX 6.5 can be treated like 6.4 for ghostscript builds: -sgi-mips-irix6.5: sgi-mips-irix6.4 - -sgi-mips-irix6.5-gnu-readline: sgi-mips-irix6.4-gnu-readline - -sgi-mips-irix6.5-64bit: init - $(MAKE) $(ARGS) \ - CFLAGS_STANDARD= \ - CC='cc $(SGIARCH64FLAGS) -D_POSIX_4SOURCE' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)idict.o \ - $(GLOBJ)isave.o - - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCH64FLAGS) -D_POSIX_4SOURCE' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gdevpdf.o \ - $(GLOBJ)gdevps.o \ - $(GLOBJ)gdevtifs.o \ - $(GLOBJ)gp_unix.o \ - $(GLOBJ)zdevcal.o -# - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCH64FLAGS) -ansi -D_POSIX_4SOURCE -woff 1185,1429 -OPT:Olimit=2500' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/lib/X11 -L/usr/local/lib' \ - $(GLOBJ)gxclread.o - - $(MAKE) $(ARGS) \ - CC='cc $(SGIARCH64FLAGS) -ansi -D_POSIX_4SOURCE -woff 1185,1429' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/include/X11 \ - XLIBDIRS='-L/usr/local/$(SGIARCH64LIB) -L/usr/local/lib -L/usr/lib/X11' - -sun-sparc-solaris: init - $(MAKE) $(ARGS) \ - CC='cc -Xc' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/openwin/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/openwin/lib' - -sun-sparc-solaris-64bit: init - $(MAKE) $(ARGS) \ - CC='cc -Xc -xarch=v9a' \ - FEATURE_DEVS_EXTRA= \ - XINCLUDE=-I/usr/openwin/include \ - XLIBDIRS='-L/usr/openwin/lib/sparcv9 -L/usr/local/lib64' - -sun-sparc-solaris-gnu-readline: init - $(MAKE) $(ARGS) \ - CC='cc -Xc' \ - XINCLUDE=-I/usr/openwin/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/openwin/lib' \ - $(GNU_READLINE_ARGS) - -sun-sparc-solaris-gcc: init - $(MAKE) $(ARGSGCC) \ - CC='gcc' \ - GCFLAGS=$(GCFLAGS) \ - XINCLUDE=-I/usr/openwin/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/openwin/lib' \ - EXTRALIBS='-ltermcap' - -# For ps2pdf FullBook.ps, these optimization options only reduced the time by 3%! -sun-sparc-solaris-opt-gnu-readline: init - $(MAKE) $(ARGS) \ - CC='cc -Xc -xO5 -dalign -xlibmil -xcg92 -xtarget=ultra1/2170' \ - XINCLUDE=-I/usr/openwin/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/openwin/lib' \ - $(GNU_READLINE_ARGS) - -# [21-Dec-1998] Add missing $(DD) prefix to sparc.dev -sun-sparc-solaris-newsprint: init - $(MAKE) $(ARGS) \ - CC='cc -Xc' \ - XINCLUDE=-I/usr/openwin/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/openwin/lib' \ - DEVICE_DEVS2=$(DD)sparc.dev - -sun-sparc-solaris-pg: init - $(MAKE) $(ARGS) \ - CC='cc -Xc -xO5 -dalign -xlibmil -fsimple=2 -fns -xsafe=mem -xtarget=ultra1/170 -xpg' \ - XINCLUDE=-I/usr/openwin/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/openwin/lib -ldl' - -# [21-Dec-1998] Add missing $(DD) prefix to sparc.dev -# [28-Nov-1997] Extra device(s) to be compiled into gs to support -# local needs Neither unixansi.mak nor unix-gcc.mak currently sets -# DEVICE_DEVS2, so we are free to list only our extra ones here: - -# NB: Need -Dconst= for gcc 2.7.1 (unless gcc patch in make.doc is installed) -sun-sparc-sunos-gcc: init - $(MAKE) $(ARGSGCC) \ - CC='gcc -Dconst=' \ - FEATURE_DEVS_EXTRA= \ - GCFLAGS=$(GCFLAGS) \ - XINCLUDE=-I/usr/openwin/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/openwin/lib' \ - DEVICE_DEVS2=$(DD)sparc.dev \ - EXTRALIBS='-ltermcap' - -sun-sparc-sunos-gcc-gnu-readline: init - $(MAKE) $(ARGSGCC) \ - CC='gcc -Dconst=' \ - GCFLAGS=$(GCFLAGS) \ - XINCLUDE=-I/usr/openwin/include \ - XLIBDIRS='-L/usr/local/lib -L/usr/openwin/lib' \ - DEVICE_DEVS2=$(DD)sparc.dev \ - $(GNU_READLINE_ARGS) - -# Convenience targets: build by hostname, using settings from -# /usr/local/src/ghostscript/BUILD-GS.sh - -# [02-Oct-1999]: remove -gnu-readline from these: I still have not -# yet had time to debug the problems it creates interfacing -# to ps2pk et al -GNUREADLINE=-gnu-readline -GNUREADLINE= - -## XXXXXXXX.YYYYYYYY.utah.edu: dec-alpha-osf$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: ibm-rs6000-aix-4.2$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: sgi-mips-irix6.5$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: hp-parisc-hpux$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: sgi-mips-irix6.3$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: next-m68K-mach$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: apple-powerpc-rhapsody5.5$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: apple-powerpc-rhapsody5.5$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: dec-alpha-osf$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: linux$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: linux$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: sun-sparc-sunos-gcc$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: sun-sparc-solaris$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: sun-sparc-solaris$(GNUREADLINE) -## XXXXXXXX.YYYYYYYY.utah.edu: sgi-mips-irix5$(GNUREADLINE) diff --git a/app-text/ghostscript/files/gdevgdi.c b/app-text/ghostscript/files/gdevgdi.c deleted file mode 100644 index 75533d06a25a..000000000000 --- a/app-text/ghostscript/files/gdevgdi.c +++ /dev/null @@ -1,1412 +0,0 @@ -/* - This file is part of GNU Ghostscript. - - GNU Ghostscript is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to - anyone for the consequences of using it or for whether it serves any - particular purpose or works at all, unless he says so in writing. Refer to - the GNU General Public License for full details. - - Everyone is granted permission to copy, modify and redistribute GNU - Ghostscript, but only under the conditions described in the GNU General - Public License. A copy of this license is supposed to have been given to - you along with GNU Ghostscript so you can know your rights and - responsibilities. It should be in a file named COPYING. Among other - things, the copyright notice and this notice must be preserved on all - copies. - - Aladdin Enterprises is not affiliated with the Free Software Foundation or - the GNU Project. GNU Ghostscript, as distributed by Aladdin Enterprises, - does not depend on any other GNU software. -*/ - -/* gdevgdi.c */ -/* SAMSUNG GDI driver for Ghostscript */ -#include "gdevprn.h" -#include "gdevpcl.h" - - -/* - * You may select a default resolution of 300 or 600 DPI - * in the makefile, or an actual resolution - * on the gs command line. - * - * If the preprocessor symbol A4 is defined, the default paper size is - * the European A4 size; otherwise it is the U.S. letter size (8.5"x11"). - * - * To determine the proper "margin" settings for your printer, see the - * file align.ps. - */ - -/* Define the default, maximum resolutions. */ -#ifdef X_DPI -# define X_DPI2 X_DPI -#else -# define X_DPI 300 -# define X_DPI2 600 -#endif -#ifdef Y_DPI -# define Y_DPI2 Y_DPI -#else -# define Y_DPI 300 -# define Y_DPI2 600 -#endif - -#define GDI_FALSE 0 -#define GDI_TRUE 1 -#define GDI_MAX_COUNT 31 -#define GDI_NO_REPEAT_IDX 0x80000000L -#define GDI_DATA_LENGTH 11 -#define GDI_REPEAT_LENGTH 2 -#define GDI_BAND_HEIGHT 128 -#define GDI_MAX_BAND 66 -//#define GDI_BAND_WIDTH 4928 -//#define GDI_BAND_WIDTH_BYTES (((GDI_BAND_WIDTH + 31)/32)*4) - -#define GDI_PRE_COMP 2 -#define GDI_REAL_COMP 0 - -#define GDI_COMP_NONE 0 -#define GDI_COMP_TIFF 3 -#define GDI_COMP_SCANLINE 4 -#define GDI_COMP_MODITIFF 6 -#define GDI_COMP_NOSEND 0x7f - -#define GDI_MARGINS_A4 0.167, 0.167, 0.167, 0.167 -#define GDI_MARGINS_LETTER 0.167, 0.167, 0.167, 0.167 -//#define GDI_MARGINS_A4 0.0, 0.0, 0.0, 0.0 -//#define GDI_MARGINS_LETTER 0.0, 0.0, 0.0, 0.0 - -/* The number of blank lines that make it worthwhile to reposition */ -/* the cursor. */ -#define MIN_SKIP_LINES 7 - -/* We round up the LINE_SIZE to a multiple of a unsigned long for faster scanning. */ -#define W sizeof(word) - -int GDI_BAND_WIDTH[] = {4768, 4928}; - -private int gdi_print_page(P2(gx_device_printer *pdev, FILE *prn_stream)); -private int gdi_open(P1(gx_device *pdev)); -private int gdi_close(P1(gx_device *pdev)); - -/* The device descriptors */ -private dev_proc_open_device(gdi_open); -private dev_proc_close_device(gdi_close); -private dev_proc_print_page(gdi_print_page); - -private gx_device_procs prn_gdi_procs = - prn_params_procs(gdi_open, gdev_prn_output_page, gdi_close, - gdev_prn_get_params, gdev_prn_put_params); - -gx_device_printer far_data gs_gdi_device = - prn_device(prn_gdi_procs, "gdi", - DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, /* paper size (unit : 10/72 inch size) */ - X_DPI2, Y_DPI2, - 0.20, 0.25, 0.25, 0.25, /* margins filled in by gdi_open */ - 1, /* color bit */ - gdi_print_page); - -private FILE *WritePJLHeaderData(gx_device_printer *pdev, FILE *fp); -private FILE *WriteBandHeader(FILE *fp, unsigned int usBandNo, - unsigned char ubCompMode, unsigned int usBandWidth, - unsigned int usBandHeight, unsigned long ulBandSize); -private FILE *WriteTrailerData(FILE *fp); -private unsigned long FrameTiffComp(unsigned char *pubDest, unsigned char *pubSrc, - unsigned int usTotalLines, unsigned int usBytesPerLine, - unsigned char ubMode); -private unsigned int FrameTiff_Comp(unsigned char *lpSrcBuf, unsigned char *lpTgtBuf, - unsigned int nSrcBytes); -private unsigned int PreTiffComp(unsigned char *lpSrcBuf, unsigned int nSrcBytes); -private long bmp2run(unsigned char *out_buf, unsigned char *in_buf, unsigned int sizeY, unsigned int sizeX, unsigned char ubMode); -private long Save6Bytes(unsigned char *out_buf, unsigned short usDy, unsigned short usRl, short sDx, unsigned short usWarp); -private long Save4Bytes(unsigned char *out_buf, unsigned short usDy, unsigned short usRl, short sDx); -private long GetSimpleScan(unsigned char *out_buf, - unsigned char ubSizeMode, - unsigned short *us1Count, - unsigned short *usDy, - unsigned short *usPosX10, - unsigned short *usPosX01, - unsigned short usBytePos, - unsigned char ubCrtByte, - unsigned char ubSize, - unsigned char ubPreBit, - unsigned short usWidth); -private long scan_map (unsigned char *in_buf, unsigned char *out_buf, unsigned short usWidth, unsigned short usHeight, unsigned char ubMode); - -#define ppdev ((gx_device_printer *)pdev) - -/* Open the printer, adjusting the margins if necessary. */ -private int -gdi_open(gx_device *pdev) -{ /* Change the margins if necessary. */ - const float *m = 0; - bool move_origin = true; - - static const float m_a4[4] = { GDI_MARGINS_A4 }; - static const float m_letter[4] = { GDI_MARGINS_LETTER }; - m = (gdev_pcl_paper_size(pdev) == PAPER_SIZE_A4 ? m_a4 : - m_letter); - move_origin = false; - - if ( m != 0 ) - gx_device_set_margins(pdev, m, move_origin); - - return gdev_prn_open(pdev); -} - -/* gdi_close is only here to eject odd numbered pages in duplex mode. */ -private int -gdi_close(gx_device *pdev) -{ if ( ppdev->Duplex_set >= 0 && ppdev->Duplex ) - { gdev_prn_open_printer(pdev, 1); - fputs("\033&l0H", ppdev->file) ; - } - return gdev_prn_close(pdev); -} - -#undef ppdev - -/* ------ Internal routines ------ */ - -/* Samsung SmartGDI series compresses, and it needs a special sequence to */ -/* allow it to specify coordinates at 600 dpi. */ -/* It too needs its coordinate system translated slightly. */ - -private int -gdi_print_page(gx_device_printer *pdev, FILE *prn_stream) -{ - int band_width_bytes; - int band_height; - int code=0, i, j, y, num_rows=0, band_num=0; - int dots_per_inch = (int)pdev->y_pixels_per_inch; - int raster = gx_device_raster((gx_device *)pdev, true); - int real_line_width; - long ul_band_size, ul_comp_size, ul_tiff_size, ul_min_size; - byte *ibp=NULL, *obp=NULL, *tmp=NULL; - byte paper_type=0, compression_type; - - switch (gdev_pcl_paper_size((gx_device*)pdev)) - { - case PAPER_SIZE_A4 : paper_type = 0; - break; - case PAPER_SIZE_LETTER : paper_type = 1; - break; - case PAPER_SIZE_LEGAL : paper_type = 1; - break; - default: - paper_type = 1; - break; - } - if (dots_per_inch == 600) { /* 600dpi */ - band_width_bytes = (GDI_BAND_WIDTH[paper_type]+31)/32*4; - band_height = GDI_BAND_HEIGHT; - } else { /* 300dpi */ - band_width_bytes = (GDI_BAND_WIDTH[paper_type]+31)/32*4/2; - band_height = GDI_BAND_HEIGHT*2; - } - - ul_band_size = band_width_bytes * band_height; - ibp = (byte *)gs_malloc(ul_band_size, 1, "gdi_print_page"); - obp = (byte *)gs_malloc(ul_band_size*13/10, 1, "gdi_print_page"); - tmp = (byte *)gs_malloc(raster, 1, "gdi_print_page"); - - if (!ibp) return_error(gs_error_VMerror); - if (!obp) return_error(gs_error_VMerror); - if (!tmp) return_error(gs_error_VMerror); - - if (ibp ==0 || obp == 0) return_error(gs_error_VMerror); - - /* Header Output */ - prn_stream = WritePJLHeaderData(pdev, prn_stream); - num_rows = dev_print_scan_lines(pdev); - band_num = (num_rows + band_height -1)/band_height; - - if (raster > band_width_bytes) - real_line_width = band_width_bytes; - else - real_line_width = raster; - - /* Real Data Output */ - y = 0; - for (i=0; i< band_num; i++) { - memset(ibp, 0x00, ul_band_size); - memset(obp, 0x00, ul_band_size*13/10); - for (j=0; j<band_height; j++) { - memset(tmp, 0x00, raster); - //code = gdev_prn_copy_scan_lines(pdev, i*band_height+j, - if (y == num_rows) break; - code = gdev_prn_copy_scan_lines(pdev, y++, - (byte*)tmp, raster); - if (code < 0) break; - memcpy(ibp+j*band_width_bytes, tmp, real_line_width); - } - - if ( i>= GDI_MAX_BAND) continue; - - /* Write Band Data - Because of Scanline compression, extract Scanline compression mode */ - //ul_tiff_size = FrameTiffComp(obp, ibp, band_height, band_width_bytes, GDI_PRE_COMP); - //ul_scan_size = (unsigned long)bmp2run(obp, ibp, band_height, band_width_bytes, GDI_PRE_COMP); - //ul_min_size = (ul_scan_size > ul_tiff_size) ? ul_tiff_size : ul_scan_size; - ul_min_size = ul_tiff_size; - compression_type = GDI_COMP_MODITIFF; - //compression_type = (ul_scan_size > ul_tiff_size) ? GDI_COMP_MODITIFF : GDI_COMP_SCANLINE; - switch (compression_type) { - case GDI_COMP_MODITIFF: - ul_comp_size = FrameTiffComp(obp, ibp, band_height, band_width_bytes, GDI_REAL_COMP); - break; - case GDI_COMP_SCANLINE: - ul_comp_size = bmp2run(obp, ibp, band_height, band_width_bytes, GDI_REAL_COMP); - break; - default: - ul_comp_size = FrameTiffComp(obp, ibp, band_height, band_width_bytes, GDI_REAL_COMP); - compression_type = GDI_COMP_MODITIFF; - break; - } - - prn_stream = WriteBandHeader(prn_stream, i, compression_type, (band_width_bytes * 8), - band_height, ul_comp_size); - //fprintf(prn_stream, "[%d] band, size : %d\n", i, ul_tiff_size); - fwrite(obp, ul_comp_size, 1, prn_stream); - } - - /* Trailer Output */ - WriteTrailerData(prn_stream); - gs_free(ibp, ul_band_size, 1, "gdi_line_buffer"); - gs_free(obp, ul_band_size*13/10, 1, "gdi_line_buffer"); - gs_free(tmp, raster, 1, "gdi_line_buffer"); - return code; -} - -private FILE *WritePJLHeaderData(gx_device_printer *pdev, FILE *fp) -{ - unsigned long ulSize; - unsigned char buffer[300]; - int dots_per_inch = (int)pdev->y_pixels_per_inch; - - strcpy(buffer, "\033%-12345X"); - - // Paper Type - strcat(buffer, "@PJL SET PAPERTYPE = NORMAL ON\015\012"); - //Density - strcat(buffer, "@PJL SET DENSITY = 1\015\012"); - // Toner Save - strcat(buffer, "@PJL SET TONERSAVE = OFF\015\012"); - // Enter Language SMART - strcat(buffer, "@PJL ENTER LANGUAGE = SMART\015\012"); - // JobStart - strcat(buffer, "$PJL JOB START\015\012"); - - // Resolution - if (dots_per_inch == 600) - strcat(buffer, "$PJL RESOLUTION = 600\015\012"); - else - strcat(buffer, "$PJL RESOLUTION = 300\015\012"); - - // Copies - strcat(buffer, "$PJL COPIES = 1\015\012"); - // Paper Size - switch (gdev_pcl_paper_size((gx_device*)pdev)) - { - case PAPER_SIZE_A4: - strcat(buffer, "$PJL PAGE A4 AUTO\015\012"); - break; - case PAPER_SIZE_LETTER: - strcat(buffer, "$PJL PAGE LETTER AUTO\015\012"); - break; - case PAPER_SIZE_LEGAL: - strcat(buffer, "$PJL PAGE LEGAL AUTO\015\012"); - break; - default: - strcat(buffer, "$PJL PAGE LETTER AUTO\015\012"); - break; - } - // bitmap start - strcat(buffer, "$PJL BITMAP START\015\012"); - // write buffer to file. - ulSize = strlen(buffer); - fwrite(buffer, 1, ulSize, fp ); - return(fp); -} // WritePJLHeaderData() - - -private FILE *WriteBandHeader -( -FILE *fp, -unsigned int usBandNo, -unsigned char ubCompMode, -unsigned int usBandWidth, -unsigned int usBandHeight, -unsigned long ulBandSize -) -{ - unsigned char ubLeft=0; - unsigned int i = 0; - unsigned char buf[50]; - - memset(buf, 0x00, 50); - - ulBandSize += 8; - - // bandsize - buf[i++] = (unsigned char)((ulBandSize >> 24) & 0xff); - buf[i++] = (unsigned char)((ulBandSize >> 16) & 0xff); - buf[i++] = (unsigned char)((ulBandSize >> 8) & 0xff); - buf[i++] = (unsigned char)(ulBandSize & 0xff); - - // id - buf[i++] = (unsigned char)((usBandNo >> 8) & 0xff); - buf[i++] = (unsigned char)(usBandNo & 0xff); - - // compress mode - buf[i++] = (unsigned char)(ubCompMode & 0xff); - - // ubLeft - buf[i++] = (unsigned char)(ubLeft & 0xff); - - // height - buf[i++] = (unsigned char)((usBandHeight >> 8) & 0xff); - buf[i++] = (unsigned char)(usBandHeight & 0xff); - - // width - buf[i++] = (unsigned char)((usBandWidth >> 8) & 0xff); - buf[i++] = (unsigned char)(usBandWidth & 0xff); - - fwrite(buf, 1, i, fp); - return(fp); -} // end of WriteBandHeader() - -private FILE *WriteTrailerData(FILE *fp) -{ - unsigned long ulSize; - unsigned long buffer[200]; - - memset((char*)buffer, 0x00, 200); - strcpy((char*)buffer, "$PJL PRINT 4\015\012"); - strcat((char*)buffer, "$PJL EOJ\015\012"); - strcat((char*)buffer, "$PJL SYNC\015\012"); - strcat((char*)buffer, "$PJL RELEASE 0 2047\015\012"); - strcat((char*)buffer, "$PJL GARBAGE\015\012"); - strcat((char*)buffer, "\033%-12345X\015\012"); - - ulSize = strlen((char*)buffer); - fwrite(buffer, 1, ulSize, fp); - - return(fp); -} // WriteTrailerData() - -private unsigned long FrameTiffComp(unsigned char *pubDest, - unsigned char *pubSrc, - unsigned int usTotalLines, - unsigned int usBytesPerLine, - unsigned char ubMode) -{ - unsigned char *TgtPtr, *SrcPtr; - unsigned int usLineSize; - unsigned long ulret; - unsigned int i; - - SrcPtr = pubSrc; - TgtPtr = pubDest; - ulret = 0; - - for (i = 0; i < usTotalLines; i++) - { - if (!(ubMode & 0x02)) // - { - usLineSize = FrameTiff_Comp(SrcPtr, TgtPtr, usBytesPerLine); - } - else - { - if(i == 0x253) - { - i = i; - } - usLineSize = PreTiffComp(SrcPtr, usBytesPerLine); - } - SrcPtr += usBytesPerLine; - TgtPtr += usLineSize; - ulret += usLineSize; - } - - if (!(ubMode & 0x02)) // - { - switch ((int)ulret%4) - { - case 1: - *TgtPtr++ = 0x00; - ulret++; - case 2: - *TgtPtr++ = 0x00; - ulret++; - case 3: - *TgtPtr++ = 0x00; - ulret++; - default: - break; - } - } - else - { - switch ((int)ulret%4) - { - case 1: - ulret++; - case 2: - ulret++; - case 3: - ulret++; - default: - break; - } - } - return(ulret); -} // FrameTiffComp() - -private unsigned int FrameTiff_Comp(unsigned char *lpSrcBuf, unsigned char *lpTgtBuf, unsigned int nSrcBytes) -{ - unsigned int usret; - unsigned int usCount, usEndCnt; - unsigned int usControl; - unsigned int usCnt; - unsigned char ubFirst, ubSecond, ubMisCnt; - unsigned char *pubDst, *pubSrc, *pubOrg; - - pubDst = lpTgtBuf; - pubSrc = lpSrcBuf; - usCount = nSrcBytes; - while(1) - { - if(!usCount) - { - break; /* exit while(1) loop */ - } - else if (usCount == 1) - { - *pubDst++ = 0x00; - *pubDst++ = *pubSrc++; - break; - } - - pubOrg = pubSrc; - ubFirst = *pubSrc++; - ubSecond = *pubSrc++; - - if(ubFirst == ubSecond) /* case of data match */ - { - usEndCnt = usCount; - if (usCount > 16384) - { - usEndCnt = 16384; - } - usEndCnt = usCount - 2; - while (usEndCnt--) - { - if (ubFirst != *pubSrc++) - { - pubSrc--; - break; - } - } /* of while */ - - /* Save compressed data */ - usCnt = (unsigned int) (pubSrc - pubOrg); - usCount -= usCnt; - usCnt -=2; - if (usCnt >= 64) - { - /* save control code code 1100 0000 0000 0000 | usCnt */ - usCnt = (~usCnt & 0x3fff) | 0xc000; - *pubDst++ = (unsigned char)((usCnt & 0xff00) >> 8); - *pubDst++ = (unsigned char)(usCnt & 0x00ff); - *pubDst++ = ubFirst; - } - else - { - /* save control code 0100 0000 | (unsigned char)(usCnt) */ - usCnt = (~usCnt & 0x7f); - *pubDst++ = (unsigned char)usCnt; - *pubDst++ = ubFirst; - } - } /* of if (ubFirst == ubSecond) */ - - else /* case of data mismatch */ - { - ubMisCnt = 0; - if (usCount > 2) - { - usEndCnt = usCount; - if (usCount > 16384) - { - usEndCnt = 16384; - } - usEndCnt = usCount - 2; - // usEndCnt = usCount - 2; original - // 19990824 by LSM : for end file while (usEndCnt--) - while (usEndCnt--) - { - /* read next data */ - ubFirst = ubSecond; - ubSecond = *pubSrc++; // read 3rd Data - if (ubFirst == ubSecond) - { - if (usEndCnt <= 1) - { - ubMisCnt = 2; - break; - } - else - { - ubSecond = *pubSrc++; // read 4th Data - usEndCnt--; - if (ubFirst == ubSecond) - { - ubMisCnt = 3; - break; - } - } - } - } /* of while */ - } /* of if (usCount > 2) */ - /* save data */ - usControl = (unsigned int) (pubSrc - pubOrg); - usControl -= (unsigned int) ubMisCnt; - if (usControl > usCount) - { - usCount = usControl; - } - usCount -= usControl; - usCnt = usControl - 1; - if ( usCnt >= 64) - { - /* save control code 1000 0000 0000 0000 | usCnt */ - usCnt = ((usCnt & 0xbfff) | 0x8000); - *pubDst++ = (unsigned char)((usCnt & 0xff00) >> 8); - *pubDst++ = (unsigned char)(usCnt & 0x00ff); - } - else - { - /* save control code 0000 0000 | (BYTE)usCnt */ - /* and invert it */ - *pubDst++ = (unsigned char)(usCnt & 0x003f); - } - pubSrc = pubOrg; - while (usControl--) - { - *pubDst++ = *pubSrc++; - } /* of while */ - } /* of else */ - } /* of while(1) */ - - usret = (unsigned int) (pubDst - lpTgtBuf); - return (usret); -} - -private unsigned int PreTiffComp(unsigned char *lpSrcBuf, unsigned int nSrcBytes) -{ - unsigned int usret =0; - unsigned int usCount, usEndCnt; - unsigned int usControl; - unsigned int usCnt; - unsigned char ubFirst, ubSecond, ubMisCnt; - unsigned char *pubSrc, *pubOrg; - - pubSrc = lpSrcBuf; - usCount = nSrcBytes; - while(1) - { - if(!usCount) - { - break; /* exit while(1) loop */ - } - else if (usCount == 1) - { - usret +=2; - pubSrc++; - break; - } - - pubOrg = pubSrc; - ubFirst = *pubSrc++; - ubSecond = *pubSrc++; - - if(ubFirst == ubSecond) /* case of data match */ - { - usEndCnt = usCount; - if (usCount > 16384) - { - usEndCnt = 16384; - } - usEndCnt = usCount - 2; - while (usEndCnt--) - { - if (ubFirst != *pubSrc++) - { - pubSrc--; - break; - } - } /* of while */ - - /* Save compressed data */ - usCnt = (unsigned int) (pubSrc - pubOrg); - usCount -= usCnt; - usCnt -=2; - if (usCnt >= 64) - { - /* save control code code 1100 0000 0000 0000 | usCnt */ - usret +=3; - } - else - { - /* save control code 0100 0000 | (unsigned char)(usCnt) */ - usret += 2; - } - } /* of if (ubFirst == ubSecond) */ - - else /* case of data mismatch */ - { - ubMisCnt = 0; - if (usCount > 2) - { - usEndCnt = usCount; - if (usCount > 16384) - { - usEndCnt = 16384; - } - // usEndCnt = usCount - 2; - usEndCnt = usCount - 2; - // 19990824 by LSM : for Last file while (usEndCnt--) - while (usEndCnt--) - { - /* read next data */ - ubFirst = ubSecond; - ubSecond = *pubSrc++; // read 3rd Data - if (ubFirst == ubSecond) - { - if (usEndCnt <= 1) - { - ubMisCnt = 2; - break; - } - else - { - ubSecond = *pubSrc++; // read 4th Data - usEndCnt--; // 19990824 by LSM - if (ubFirst == ubSecond) - { - ubMisCnt = 3; - break; - } - } - } - } /* of while */ - } /* of if (usCount > 2) */ - /* save data */ - usControl = (unsigned int) (pubSrc - pubOrg); - usControl -= ubMisCnt; - // 19990824 by LSM : for fixing GPF on Photoshop - if (usControl > usCount) - { - usControl = usCount; - } - usCount -= usControl; - usCnt = usControl - 1; - if ( usCnt >= 64) - { - /* save control code 1000 0000 0000 0000 | usCnt */ - usret += 2; - } - else - { - /* save control code 0000 0000 | (BYTE)usCnt */ - /* and invert it */ - usret++; - } - pubSrc = pubOrg; - while (usControl--) - { - usret++; - pubSrc++; - } /* of while */ - } /* of else */ - } /* of while(1) */ - return (usret); -} - -typedef struct -{ - unsigned char ubDx; - unsigned char ubRl; - unsigned char ubLastBit; -} sc_tbl; - -static sc_tbl gdi_ScanTbl[256] = { -{ 8, 0, 0 }, { 7, 1, 1 }, { 6, 1, 0 }, { 6, 2, 1 }, // 0x00 -{ 5, 1, 0 }, { 0, 0, 1 }, { 5, 2, 0 }, { 5, 3, 1 }, -{ 4, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 4, 2, 0 }, { 0, 0, 1 }, { 4, 3, 0 }, { 4, 4, 1 }, -{ 3, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x10 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 3, 2, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 3, 3, 0 }, { 0, 0, 1 }, { 3, 4, 0 }, { 3, 5, 1 }, -{ 2, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x20 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 2, 2, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x30 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 2, 3, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 2, 4, 0 }, { 0, 0, 1 }, { 2, 5, 0 }, { 2, 6, 1 }, -{ 1, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x40 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x50 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 1, 2, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x60 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 1, 3, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x70 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 1, 4, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 1, 5, 0 }, { 0, 0, 1 }, { 1, 6, 0 }, { 1, 7, 1 }, -{ 0, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x80 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x90 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0xa0 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0xb0 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 2, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0xc0 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0xd0 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 3, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0xe0 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 4, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0xf0 -{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 5, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, -{ 0, 6, 0 }, { 0, 0, 1 }, { 0, 7, 0 }, { 0, 8, 1 }, -}; - -static sc_tbl gdi_ScanTbl4[16] = { -{ 4, 0, 0 }, { 3, 1, 1 }, { 2, 1, 0 }, { 2, 2, 1 }, // 0x00 -{ 1, 1, 0 }, { 0, 0, 1 }, { 1, 2, 0 }, { 1, 3, 1 }, // 0x04 -{ 0, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x08 -{ 0, 2, 0 }, { 0, 0, 1 }, { 0, 3, 0 }, { 0, 4, 1 } // 0x0c -}; - -long SaveScanData( unsigned char *, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short ); -long UpdateScanSize( unsigned char *, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short ); -typedef long (*funcptr)( unsigned char *, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short ); - -funcptr UpdateScanLine[2] = { SaveScanData, UpdateScanSize }; - -private long Save6Bytes(unsigned char *out_buf, unsigned short usDy, unsigned short usRl, short sDx, unsigned short usWarp) -{ - unsigned long ultmp_dat; - long lWarp, lDis; - unsigned short ustmp_dat; - - lWarp = (long)(usWarp << 3); - lDis = ((long)usDy * lWarp) + (long)sDx; - - // 1st, 2nd, 3rd & 4th byte - ultmp_dat = 0xc0000000U; - if (lDis < 0) - { - ultmp_dat |= 0x20000000U; - } - ultmp_dat |= (lDis & 0x1fffffff); - *out_buf++ = (unsigned char)((ultmp_dat & 0xff000000U) >> 24); - *out_buf++ = (unsigned char)((ultmp_dat & 0xff0000) >> 16); - *out_buf++ = (unsigned char)((ultmp_dat & 0xff00) >> 8); - *out_buf++ = (unsigned char)(ultmp_dat & 0xff); - - // 5th & 6th byte - ustmp_dat = 0xc000; - ustmp_dat |= (usRl & 0x3fff); - *out_buf++ = (unsigned char)((ustmp_dat & 0xff00) >> 8); - *out_buf++ = (unsigned char)(ustmp_dat & 0xff); - - return(6); -} // Save6Bytes() - -private long Save4Bytes(unsigned char *out_buf, unsigned short usDy, unsigned short usRl, short sDx) -{ - unsigned short ustmp_dat; - - // 1st & 2nd byte - ustmp_dat = 0x8000; - if (sDx < 0) - { - ustmp_dat |= 0x2000; - } - ustmp_dat |= (sDx & 0x1fff); - *out_buf++ = (unsigned char)((ustmp_dat & 0xff00) >> 8); - *out_buf++ = (unsigned char)(ustmp_dat & 0xff); - - // 3rd & 4th byte - ustmp_dat = 0x8000; - ustmp_dat |= ((usDy & 0x03) << 12); - ustmp_dat |= (usRl & 0xfff); - *out_buf++ = (unsigned char)((ustmp_dat & 0xff00) >> 8); - *out_buf++ = (unsigned char)(ustmp_dat & 0xff); - - return(4); -} // end of Save4Bytes() - -private long Save2Bytes(unsigned char *out_buf, unsigned short usDy, unsigned short usRl, short sDx) -{ - unsigned char ubtmp_dat; - - // 1st byte - ubtmp_dat = 0x00; - if (usDy == 1) - { - ubtmp_dat |= 0x40; - } - ubtmp_dat |= (usRl & 0x3f); - *out_buf++ = ubtmp_dat; - - // 2nd byte - if (sDx < 0) - { - ubtmp_dat = 0x80; - } - else - { - ubtmp_dat = 0x00; - } - ubtmp_dat |= ((unsigned char)sDx & 0x7f); - *out_buf++ = ubtmp_dat; - return(2); -} // end of Save2Bytes() - -long SaveScanData (unsigned char *out_buf, - unsigned short us1Cnt, - unsigned short usDy, - unsigned short usPosX10, - unsigned short usPosX01, - unsigned short usWarp) -{ - short sDisX; - long lRet; - - sDisX = (int)usPosX01 - (int)usPosX10; - - // 48 bit - if ( (usDy > 3) || (us1Cnt > 4095) ) - { - Save6Bytes(out_buf, usDy, us1Cnt, sDisX, usWarp); - lRet = 6; - } - // 32 bit - else if ( (usDy > 1) || (us1Cnt > 63) || (sDisX > 127) || (sDisX < -128) ) - { - Save4Bytes(out_buf, usDy, us1Cnt, sDisX); - lRet = 4; - } - // 16 bit - else - { - Save2Bytes(out_buf, usDy, us1Cnt, sDisX); - lRet = 2; - } - return(lRet); -} // end of SaveScanData() - - -long UpdateScanSize (unsigned char *out_buf, - unsigned short us1Cnt, - unsigned short usDy, - unsigned short usPosX10, - unsigned short usPosX01, - unsigned short usWarp) -{ - short sDisX; - long lRet; - - sDisX = usPosX01 - usPosX10; - - // 48 bit - if ( (usDy > 3) || (us1Cnt > 4095) ) - { - lRet = 6; - } - // 32 bit - else if ( (usDy > 1) || (us1Cnt > 63) || (sDisX > 127) || (sDisX < -128) ) - { - lRet = 4; - } - // 16 bit - else - { - lRet = 2; - } - return(lRet); -} // end of UpdateScanSize() by bglee 19981224 - -private long GetSimpleScan(unsigned char *out_buf, - unsigned char ubSizeMode, - unsigned short *us1Count, - unsigned short *usDy, - unsigned short *usPosX10, - unsigned short *usPosX01, - unsigned short usBytePos, - unsigned char ubCrtByte, - unsigned char ubSize, - unsigned char ubPreBit, - unsigned short usWidth) -{ - long lScanSize; - unsigned char ubDx, ubRl, ubLastBit; - - lScanSize = 0; - if (ubSize == 8) - { - ubDx = gdi_ScanTbl[ubCrtByte].ubDx; - ubRl = gdi_ScanTbl[ubCrtByte].ubRl; - ubLastBit = gdi_ScanTbl[ubCrtByte].ubLastBit; - } - else - { - ubCrtByte &= 0x0f; - ubDx = gdi_ScanTbl4[ubCrtByte].ubDx; - ubRl = gdi_ScanTbl4[ubCrtByte].ubRl; - ubLastBit = gdi_ScanTbl4[ubCrtByte].ubLastBit; - } - - - // 1 X 1 X - if (ubPreBit) - { - // 1 0 1 X - if (ubDx) - { - lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth); - *usPosX10 = usBytePos - *us1Count; - *usPosX01 = usBytePos + ubDx; - *us1Count = ubRl; - *usDy = 0; - // 1 0 1 0 - if (!ubLastBit) - { - // 19990330 by bglee - out_buf = out_buf + lScanSize; - - lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth); - *usPosX10 = *usPosX01 ; - *us1Count = 0; - } - // 1 0 1 1 - } - // 1 1 1 X - else - { - *us1Count += ubRl; - // 1 1 1 0 - if (!ubLastBit) - { - lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth); - *usPosX10 = usBytePos + ubRl - *us1Count; - *us1Count = 0; - *usDy = 0; - } - // 1 1 1 1 - } - } - // 0 X 1 X - else - { - // 0 X 1 X - *usPosX01 = usBytePos + ubDx; - *us1Count += ubRl; - // 0 X 1 0 - if (!ubLastBit) - { - lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth); - *usPosX10 = *usPosX01 + ubRl - *us1Count; - *us1Count = 0; - *usDy = 0; - } - // 0 X 1 1 - } - - return(lScanSize); -} // end of GetSimpleScan() - - -private long scan_map (unsigned char *in_buf, - unsigned char *out_buf, - unsigned short usWidth, - unsigned short usHeight, - unsigned char ubMode) -{ - unsigned int i, j, k; - unsigned char ubPreBit, ubCrtByte;//, ubLastBit; - long lScanSize, lTmp; - long lCrtSize; - unsigned short us1Count; - unsigned short usPosX01, usPosX10; - unsigned short usDy, usBytePos; - unsigned char ubRevMode, ubSizeMode; - unsigned char ubTemp; - - usDy = 0; - usPosX01 = usPosX10 = 0; - lScanSize = 0; - ubRevMode = ubMode & 0x01; - ubSizeMode = (ubMode & 0x02) >> 1; - for (i = 0; i < usHeight; i++) - { - ubPreBit = 0; - us1Count = 0; - for (j = 0; j < usWidth; j++) - { - ubCrtByte = *in_buf++; - if (ubRevMode) - { - ubCrtByte = ~ubCrtByte; - } - - switch (ubCrtByte) - { - case 0x00: - // 1 0 - if (ubPreBit) - { - lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - usPosX10 = (j << 3) - us1Count; /*by pkb*/ - us1Count = 0; - usDy = 0; - } - // 0 0 - break; - - case 0xff: - // 1 1 - if (ubPreBit) - { - us1Count += 8; - } - // 0 1 - else - { - us1Count = 8; - usPosX01 = (j << 3); - } - break; - - default: - // X X 1 X - if (gdi_ScanTbl[ubCrtByte].ubRl) - { - usBytePos = (j << 3); - lTmp = GetSimpleScan(out_buf, ubSizeMode, &us1Count, &usDy, &usPosX10, &usPosX01, usBytePos, ubCrtByte, 8, ubPreBit, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - } - // complex pattern - else - { - for (k = 0; k < 2; k++) - { /*we calculate 4bit*/ - ubTemp = (ubCrtByte >> (4 - (k * 4)) ) & 0x0f; - usBytePos = (j << 3) + (k << 2); - switch (ubTemp) - { - case 0x00: - // 1 0 - if (ubPreBit) - { - lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - usPosX10 = usBytePos - us1Count; - us1Count = 0; - usDy = 0; - } - // 0 0 - break; - - case 0x0f: - // 1 1 - if (ubPreBit) - { - us1Count += 4; - } - // 0 1 - else - { - us1Count = 4; - usPosX01 = (j << 3) + (k << 2); - } - break; - - case 0x05: - // 1 0101 - if (ubPreBit) - { - lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - - usPosX10 = usBytePos - us1Count; - usDy = 0; - } - // 0 0101 - usPosX01 = usBytePos + 1; - lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, 1, usDy, usPosX10, usPosX01, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - - // next - usPosX10 = 0; - usPosX01 = 2; - usDy = 0; - us1Count = 1; - break; - - case 0x09: - // 1 1001 - if (ubPreBit) - { - us1Count++; - } - // 0 1001 - else - { - usPosX01 = usBytePos; - us1Count = 1; - } - lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - - // next - if (ubPreBit) - { - usPosX10 = usBytePos - us1Count + 1; - usPosX01 = usBytePos + 3; - } - else - { - usPosX10 = 0; - usPosX01 = 3; - } - usDy = 0; - us1Count = 1; - break; - - case 0x0a: - // 1 1010 - if (ubPreBit) - { - us1Count++; - } - // 0 1010 - else - { - us1Count = 1; - usPosX01 = usBytePos; - } - lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - - // next - usPosX10 = usBytePos - us1Count + 1; - usPosX01 = usBytePos + 2; - lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, 1, 0, usPosX10, usPosX01, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - // next - usPosX10 = usBytePos + 2; - usDy = 0; - us1Count = 0; - break; - - case 0x0b: - // 1 1011 - if (ubPreBit) - { - us1Count++; - } - // 0 1011 - else - { - us1Count = 1; - usPosX01 = usBytePos; - } - lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - - // next - if (ubPreBit) - { - usPosX10 = usBytePos - us1Count + 1; - usPosX01 = usBytePos + 2; - } - else - { - usPosX10 = 0; - usPosX01 = 2; - } - - usDy = 0; - us1Count = 2; - break; - - case 0x0d: - // 1 1101 - if (ubPreBit) - { - us1Count += 2; - } - // 0 1101 - else - { - us1Count = 2; - usPosX01 = usBytePos; - } - lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - - // next - if (ubPreBit) - { - usPosX10 = usBytePos - us1Count + 2; - usPosX01 = usBytePos + 3; - } - else - { - usPosX10 = 0; - usPosX01 = 3; - } - usDy = 0; - us1Count = 1; - break; - - default: - // X X 1 X - lTmp = GetSimpleScan(out_buf, ubSizeMode, &us1Count, &usDy, &usPosX10, &usPosX01, usBytePos, ubTemp, 4, ubPreBit, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - break; - } // end of switch() - ubPreBit = ubTemp & 0x01; - } // end of k-loop - } - break; - } // end of switch() - - ubPreBit = ubCrtByte & 0x01; - } /*for usWidth */ - - if (us1Count) - { - lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth); - out_buf = out_buf + lTmp; - lScanSize += lTmp; - usPosX10 = (j << 3) - us1Count; - - us1Count = 0; - usDy = 0; - usPosX01 = 0; - } - usDy++; - - // check size over - if ( (i % 5) == 4 ) - { - lCrtSize = (long)((long)usWidth * (long)(i + 1)); - if ( lScanSize >= lCrtSize ) - { - return(-1); - } - } - } /* for usHeight */ - lCrtSize = (long)((long)usWidth * (long)usHeight); - if ( (lScanSize + 4) >= lCrtSize ) - { - lScanSize = -1; - } - return(lScanSize); -} // end of scan_map() - -/***************************************************************** - * H : bmp2run - * I : unsigned char *in_buf - input buffer pointer - * unsigned char *out_buf - output buffer pointer - * unsigned int sizeX - image width by byte - * unsigned int sizeY - image height by scanline - * unsigned char ubMode - bit 0 & 1 - * 0 0 - normal compression - * 0 1 - image reverse - * 1 X - you get scanline table size - * O : unsigned long lScanSize - scanline table size - * P : scanline table compression - ****************************************************************/ -private long bmp2run(unsigned char *out_buf, unsigned char *in_buf, unsigned int sizeY, unsigned int sizeX, unsigned char ubMode) -{ - unsigned char *tmp_buf1, *tmp_buf2; - long scan_size; - - //return(-1); // 19990323 by bglee - request from SM Lee - - tmp_buf1 = in_buf; - tmp_buf2 = out_buf; - scan_size = scan_map(tmp_buf1, tmp_buf2, sizeX, sizeY, ubMode); - if (scan_size == -1) - { - return(-1); - } - - if ( !(ubMode & 0x02) ) // real compression //--- - { - out_buf = tmp_buf2 + scan_size; - *out_buf++ = 0x00; - *out_buf++ = 0x00; - scan_size += 2; - if (scan_size % 4) - { - *out_buf++ = 0x00; - *out_buf++ = 0x00; - scan_size += 2; - } - } - else // pre-compression - { - scan_size += 2; - if (scan_size % 4) - { - scan_size += 2; - } - } - return(scan_size); -} - diff --git a/app-text/ghostscript/files/gs7.05-gdevhl12.c b/app-text/ghostscript/files/gs7.05-gdevhl12.c deleted file mode 100644 index 93f9dcbbf4c4..000000000000 --- a/app-text/ghostscript/files/gs7.05-gdevhl12.c +++ /dev/null @@ -1,741 +0,0 @@ -/* - Contributors: - Created by Marek Michalkiewicz <marekm@amelek.gda.pl> - - THIS SOFTWARE IS NOT COPYRIGHTED - - This source code is offered for use in the public domain. You may - use, modify or distribute it freely. - - This code is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - DISCLAIMED. This includes but is not limited to warranties of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - (Legalese borrowed from the Mingw32 runtime libraries.) - */ - -/*$Id: gs7.05-gdevhl12.c,v 1.1 2002/07/04 03:17:54 g2boojum Exp $ */ -/* gdevhl12.c - Brother HL-1250 driver for Ghostscript */ - -/* - This driver handles the 1200x600 dpi mode, and some settings like - paper source and toner save mode. 600x600 dpi and below is handled - by gdevdljm.c (basically as in the ljet4 device, with minor changes - in initialization and margins, and PCL wrapped in PJL). - - There are two device names made available by this driver, which - differ only in the default (maximum) resolution: - - -sDEVICE=hl1240 - 600x600 dpi, for HL-1030/1240 (uses standard PCL modes 2 and 3) - - -sDEVICE=hl1250 - 1200x600 dpi, for HL-1050/1070/1250/1270N - (uses special compression mode 1027 for 1200x600 dpi, - otherwise modes 2 and 3 as above) - - Tested with a HL-1250, both 1200x600 and 600x600 dpi. Please test - with other models and report results (both problems and success). - Some notes on the other models: - - HL-1070 and HL-1270N - can also print Postscript directly, at maximum 600x600 dpi - (this driver can print 1200x600 dpi using mode 1027). - - HL-1240 - should no longer be limited to 300 dpi - this driver sends - the recommended "@PJL SET RESOLUTION=..." command. PLEASE TEST. - There have been some vague problem reports (wrong margins? not - clear for what paper size, quite possibly Letter, not A4?) with - this printer, if you have it and some Ghostscript hacking skills, - _please_ try to help, fix it and send me a patch - thanks! - - HL-1030 - should no longer be "Paperweight" despite the "for Windows only" - warning :-) - it knows enough PCL to print raster graphics, but - *requires* "@PJL ENTER LANGUAGE=PCL", so it does not work with - the ljet4 driver sending raw PCL. The windows driver uses an - undocumented compression mode 1030, but modes 2 and 3 work too. - PLEASE TEST. - - New models, still need to be tested: - HL-1230 (GDI printer) - HL-1440 (GDI printer) - HL-1450 (PCL6 and PS2 emulation) - HL-1470N (PCL6 and PS2 emulation) - - Additional settings (gs command line options) for this driver: - - -dEconoMode=0...2 - toner save mode: 0 = disabled (default), 1 = 25%, 2 = 50% - - -dPaperType=0...4 - paper type: 0 = plain (default), 1 = thin, 2 = thick, 3 = thicker, - 4 = transparency - - -dSourceTray=0...4 - paper source: 0 = auto (default), 1 = dual, 2 = upper, 3 = lower, - 4 = manual (not all models support the optional lower tray) - - The 1200x600 dpi mode may require a lot of printer memory - the manual - recommends at least 10 MB; for me it seems to work well with 8 MB: 4 MB - standard + 4 MB "finally found some good use for that old PS/2 SIMM" :-). - Even at just 600x600 dpi (normal PCL 5 control codes) print quality is - very good, at 1200x600 dpi it is difficult to see the difference (more - visible on grayscale images). So 600x600 dpi is best for general use. - - The HL-1250 also supports PCL 6 (PCL XL) but - - I don't have the documentation for that - - the pxlmono driver works, but the output looks a bit different - from that generated by the ljet4 or (this) 1200x600 dpi driver - (lines appear very thin - not yet sure if this is a driver bug - or differences in PCL 6 implementation, someone should check on - a HP printer, does tiger.ps printed using the ljet4 and pxlmono - drivers, both at 600x600 dpi, look the same?) - so let's use the good old ljet4 (PCL 5) driver for now. - (PCL 6 seems to offer better compression though.) - - To do: the undocumented mode 1030 may offer better compression - (may help print complex graphics at 600 dpi - the HL-1030/1240 have - only 2 MB of non-expandable RAM, which may not be enough for data - that doesn't compress well). The windows driver uses this mode for - all models, not just HL-1030. Documentation may be available later. - - Many thanks to Richard Thomas <richardt@brother.co.uk> for help - (sending me a HL-1250, documentation, answering my questions). - - Thanks to L. Peter Deutsch <ghost@aladdin.com> for making gdevdjet.c - and gdevdljm.[ch] available under a dual AFPL/GPL license. - */ - -#include "gdevprn.h" -#include "gdevdljm.h" - -#ifdef X_DPI -# define X_DPI2 X_DPI -#else -# define X_DPI 600 -# define X_DPI2 1200 -#endif - -#ifndef Y_DPI -# define Y_DPI 600 -#endif - -typedef enum { - ECONO_OFF = 0, - ECONO_25, - ECONO_50 -} hl1250_econo_t; - -typedef enum { - PTYPE_PLAIN = 0, - PTYPE_THIN, - PTYPE_THICK, - PTYPE_THICK2, - PTYPE_TRANS -} hl1250_paper_t; - -typedef enum { - TRAY_AUTO = 0, - TRAY_DUAL, - TRAY_UPPER, - TRAY_LOWER, - TRAY_MANUAL -} hl1250_tray_t; - -typedef struct gx_device_hl1250_s { - gx_device_common; - gx_prn_device_common; - hl1250_econo_t econo_mode; - hl1250_paper_t paper_type; - hl1250_tray_t source_tray; -} gx_device_hl1250; - -private dev_proc_open_device(hl1250_open); -private dev_proc_close_device(hl1250_close); -private dev_proc_print_page_copies(hl1250_print_page_copies); -private dev_proc_get_params(hl1250_get_params); -private dev_proc_put_params(hl1250_put_params); - -private const gx_device_procs prn_hl1250_procs = -prn_params_procs(hl1250_open, gdev_prn_output_page, hl1250_close, - hl1250_get_params, hl1250_put_params); - -#define hl1250_device_copies(dname, xdpi, ydpi)\ -{ prn_device_std_body_copies(gx_device_hl1250, prn_hl1250_procs,\ - dname,\ - DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,\ - xdpi, ydpi,\ - 0, 0, 0, 0,\ - 1, hl1250_print_page_copies),\ - ECONO_OFF, PTYPE_PLAIN, TRAY_AUTO\ -} - -const gx_device_hl1250 gs_hl1250_device = -hl1250_device_copies("hl1250", X_DPI2, Y_DPI); - -const gx_device_hl1250 gs_hl1240_device = -hl1250_device_copies("hl1240", X_DPI, Y_DPI); - -/* defines for the 1200x600 dpi mode (mode 1027) */ - -/* max number of 16-bit words in one 1200 dpi scan line */ -#define SCAN_WORDS 640 - -/* number of scan lines per band */ -#define BAND_SCANS 64 - -/* max number of 16-bit words in one 64-line band after compression, - limited by 16-bit length field - 7 bytes header + 0xFFF8 bytes data - - note that we may have to lose some data if it can't compress well - (maximum possible uncompressed data length is about 80K). */ -#define MAX_BAND_WORDS 0x7FFC - -/* codes (16-bit words) to send in the 1200x600 dpi data block: */ - -/* vertical compression (copy COUNT words from the previous line) */ -#define HL_VERT(count) (0xE000 | (count)) - -/* 16-bit horizontal compression (repeat the next word COUNT times) */ -#define HL_HOR16(count) (0x8000 | (count)) - -/* 8-bit horiz. compression (repeat DATA byte COUNT*2 times, COUNT < 32) */ -#define HL_HOR8(count, data) (0xC000 | ((count) << 8) | ((data) & 0xFF)) - -/* 4-bit horiz. compression (repeat DATA nibble COUNT*4 times, COUNT < 512) */ -#define HL_HOR4(count, data) (0xA000 | (count) | (((data) & 0x0F) << 9)) - -/* no compression, COUNT words of data follow */ -#define HL_COPY(count) ((count) << 4) - -typedef unsigned short u16; - -/* The printer expects 16-bit data words in big endian order. */ -#if arch_is_big_endian -#define cpu_to_be16(x) (x) -#else -private u16 -cpu_to_be16(u16 x) -{ - return (x >> 8) | (x << 8); -} -#endif - -typedef struct hl1250_state_s { - /* smallest area that contains all black dots of the band */ - /* x = xl..xr-1, y = yt..yb-1, width=xr-xl, height=yb-yt */ - unsigned int xl, xr, yt, yb; - - /* number of words in the output buffer */ - unsigned int out_count; - - /* output buffer for compressed data */ - u16 out_buf[MAX_BAND_WORDS]; - - /* input buffer for one 64-line band */ - u16 in_buf[BAND_SCANS][SCAN_WORDS]; -} hl1250_state_t; - -/* - find the smallest rectangle that contains all black dots of the - band (in other words, the outside of that rectangle is all white) - returns 0 if the band is completely white, else 1 - XXX - it should be faster to scan 32-bit (instead of 16-bit) words - */ -private int -hl1250_check_area(hl1250_state_t * s) -{ - unsigned int x, y, xleft, xright, ytop, ybottom; - int line_not_white, band_not_white; - - band_not_white = 0; - xright = s->xl; - xleft = s->xr; - ybottom = s->yt; - ytop = s->yb; - for (y = s->yt; y < s->yb; y++) { - line_not_white = 0; - for (x = s->xl; x < s->xr; x++) { - if (s->in_buf[y][x]) { - if (xleft > x) - xleft = x; - if (xright <= x) - xright = x + 1; - line_not_white = 1; - } - } - if (line_not_white) { - if (ytop > y) - ytop = y; - if (ybottom <= y) - ybottom = y + 1; - band_not_white = 1; - } - } - if (band_not_white) { - s->xl = xleft; - s->xr = xright; - s->yt = ytop; - s->yb = ybottom; - } else { - s->xr = s->xl; - s->yb = s->yt; - } - return band_not_white; -} - -/* - Compressed data of this band is larger than MAX_BAND_WORDS. - Repeat each line using vertical compression, effectively reducing - resolution to 1200x300 dpi. This shouldn't happen too often. - */ -private void -hl1250_lose_resolution(hl1250_state_t * s) -{ - unsigned int x, y; - u16 data0, data1, mask; - u16 *out; - const u16 *line0; - const u16 *line1; - unsigned int width = s->xr - s->xl; - - out = s->out_buf; - for (y = s->yt; y < s->yb; y += 2) { - line0 = &s->in_buf[y][s->xl]; - line1 = line0; - if (y + 1 < s->yb) - line1 = &s->in_buf[y + 1][s->xl]; - mask = (y & 2) ? 0x5555 : 0xAAAA; - *out++ = cpu_to_be16(HL_COPY(width)); - for (x = 0; x < width; x++) { - data0 = line0[x]; - data1 = line1[x]; - *out++ = (data0 & data1) | (data0 & mask) | (data1 & mask); - } - *out++ = cpu_to_be16(HL_VERT(width)); - } - s->out_count = out - s->out_buf; -} - -/* - Try to compress a single scan line. - Return 1 on success, 0 on failure (data doesn't compress - well enough to fit in MAX_BAND_WORDS words, truncated). - */ -private int -hl1250_compress_line(hl1250_state_t * s, unsigned int y) -{ - unsigned int total_len; /* total data words after compression */ - unsigned int copy_len; /* number of words to copy uncompressed */ - unsigned int hlen, vlen; /* length for hor. and vert. compression */ - unsigned int clen, ulen; /* compressed and uncompressed words */ - u16 data; /* word currently being processed */ - u16 hl_code; /* code to send */ - int x, i; - u16 *out; - unsigned int width = s->xr - s->xl; - const u16 *line = &s->in_buf[y][s->xl]; - const u16 *prev = (y > s->yt ? &s->in_buf[y - 1][s->xl] : NULL); - - out = &s->out_buf[s->out_count]; - x = 0; - copy_len = 0; - total_len = s->out_count; - while (x < width) { - data = line[x]; - - /* how many words (hlen >= 1) to repeat */ - for (i = x + 1; i < width; i++) { - if (line[i] != data) - break; - } - hlen = i - x; - /* if not the first line, try vertical compression */ - vlen = 0; - if (prev) { - for (i = x; i < width; i++) { - if (line[i] != prev[i]) - break; - } - vlen = i - x; - } - /* find the best method to encode the data */ - ulen = hlen; - clen = 1; - if (vlen >= hlen) { - /* vertical compression */ - ulen = vlen; - hl_code = HL_VERT(vlen); - } else if ((data ^ (data >> 8)) & 0xFF) { - /* 16-bit horizontal compression */ - hl_code = HL_HOR16(hlen); - clen = 2; - } else if ((data ^ (data >> 4)) & 0x0F) { - /* 8-bit horizontal compression (if possible) */ - if (hlen < 32) { - hl_code = HL_HOR8(hlen, data); - } else { - hl_code = HL_HOR16(hlen); - clen = 2; - } - } else { - /* 4-bit horizontal compression (if possible) */ - if (hlen < 512) { - hl_code = HL_HOR4(hlen, data); - } else { - hl_code = HL_HOR16(hlen); - clen = 2; - } - } - /* - now see if we should copy the word without compression - (the cost of leaving/re-entering copy mode is one word). - */ - if (ulen < clen + (copy_len > 0)) { - /* yes, copy */ - copy_len += ulen; - } else { - if (copy_len) { - /* first, copy data (if any) */ - total_len += copy_len + 1; - if (total_len > MAX_BAND_WORDS) - goto error_out; - *out++ = cpu_to_be16(HL_COPY(copy_len)); - memcpy(out, &line[x - copy_len], copy_len * sizeof(u16)); - out += copy_len; - copy_len = 0; - } - /* now send the current code */ - total_len += clen; - if (total_len > MAX_BAND_WORDS) - goto error_out; - *out++ = cpu_to_be16(hl_code); - if (clen == 2) { - /* 16-bit compression */ - *out++ = data; - } - } - /* move to the next word to process */ - x += ulen; - } - /* copy anything left at the end */ - if (copy_len) { - total_len += copy_len + 1; - if (total_len > MAX_BAND_WORDS) - goto error_out; - *out++ = cpu_to_be16(HL_COPY(copy_len)); - memcpy(out, &line[width - copy_len], copy_len * sizeof(u16)); - out += copy_len; - } - error_out: - s->out_count = out - s->out_buf; - return (total_len <= MAX_BAND_WORDS); -} - -/* - send a 16-bit big endian value - */ -private void -put_be16(FILE * fp, u16 data) -{ - putc(data >> 8, fp); - putc(data & 0xFF, fp); -} - -/* - prn_stream = data sent to the printer - s->xl,xr,yt,yb,in_buf = band (max 64 lines), coordinates band-relative - band = Y coordinate of the band from top of page - */ -private void -hl1250_compress_band(FILE * prn_stream, hl1250_state_t * s, unsigned int band) -{ - unsigned int y, ytop, ybottom; - - s->out_count = 0; - - if (!hl1250_check_area(s)) - return; - - /* - It seems HL-1250 1200x600 dpi mode has an undocumented feature - - it rounds the X left coordinate of the image up to next 32 dots. - Probably the RISC inside likes 32-bit alignment. No big problem, - we just have to round it down (it's in 16-bit words here). - */ - s->xl &= ~1; - - ytop = s->yt; - ybottom = s->yb; - for (y = ytop; y < ybottom; y++) { - if (hl1250_compress_line(s, y)) - continue; -#if 1 - /* XXX - please report if you ever see this, then change to #if 0 */ - fprintf(stderr, - "hl1250: compression failed (y=%u), doing 1200x300 dpi\n", - band + y); -#endif - hl1250_lose_resolution(s); - break; - } - if (s->out_count) { - fprintf(prn_stream, "\033*b%uW", s->out_count * sizeof(u16) + 9); - put_be16(prn_stream, s->out_count * sizeof(u16) + 7); - put_be16(prn_stream, s->xl * 16); - put_be16(prn_stream, band + ytop); - putc(ybottom - ytop, prn_stream); - put_be16(prn_stream, s->xr - s->xl); - fwrite(s->out_buf, sizeof(u16), s->out_count, prn_stream); - } -} - - -private int -hl1250_print_1200dpi(gx_device_printer * pdev, FILE * prn_stream, - int num_copies, const char *page_init) -{ - int band, lnum; - int code = 0; - hl1250_state_t *s; - int line_size = gdev_prn_raster(pdev); - int num_rows = dev_print_scan_lines(pdev); - int paper_size = gdev_pcl_paper_size((gx_device *) pdev); - - s = (hl1250_state_t *) gs_alloc_byte_array(pdev->memory, 1, sizeof(*s), - "hl1250_print_1200dpi"); - if (!s) - return_error(gs_error_VMerror); - - memset(s, 0, sizeof(*s)); - - if (line_size > sizeof(s->in_buf[0])) - line_size = sizeof(s->in_buf[0]); - - if (pdev->PageCount == 0) { - /* reset, set paper size */ - fprintf(prn_stream, "\033E\033&l%dA", paper_size); - } - fputs("\033&u1200D", prn_stream); - fputs("\033&l0o0l0E", prn_stream); - fputs(page_init, prn_stream); - fprintf(prn_stream, "\033&l%dX", num_copies); - fputs("\033*rB\033*p0x0Y", prn_stream); - - /* set 600dpi (vertical) resolution */ - fputs("\033*t600R", prn_stream); - - /* start raster graphics */ - fputs("\033*r1A", prn_stream); - - /* transfer data in the special 1200x600 dpi format */ - fputs("\033*b1027M", prn_stream); - - for (band = 0; band < num_rows; band += BAND_SCANS) { - int next_band = band + BAND_SCANS; - - if (next_band > num_rows) - next_band = num_rows; - for (lnum = band; lnum < next_band; lnum++) { - code = gdev_prn_copy_scan_lines(pdev, lnum, - (byte *) (s->in_buf[lnum - band]), line_size); - if (code < 0) - goto error_out; - } - s->yt = 0; - s->yb = next_band - band; - s->xl = 0; - s->xr = 635; /* max width */ - hl1250_compress_band(prn_stream, s, band); - } - error_out: - fputs("\033*rB\f", prn_stream); - gs_free_object(pdev->memory, s, "hl1250_print_1200dpi"); - return code; -} - - -private int -hl1250_open(gx_device * pdev) -{ - /* margins: left, bottom, right, top */ - /* XXX - only A4 tested, letter size margins likely need to be tweaked */ - static const float margins_a4_600[4] = {0.05, 0.15, 0.25, 0.15}; - static const float margins_a4_1200[4] = {0.05, 0.2, 0.1, 0.15}; - static const float margins_letter_600[4] = {0.05, 0.15, 0.25, 0.15}; - static const float margins_letter_1200[4] = {0.05, 0.2, 0.1, 0.15}; - - int x_dpi = (int)((gx_device_printer *) pdev)->x_pixels_per_inch; - int paper_size = gdev_pcl_paper_size(pdev); - - if (x_dpi == 1200) { - if (paper_size == PAPER_SIZE_A4) - gx_device_set_margins(pdev, margins_a4_1200, true); - else - gx_device_set_margins(pdev, margins_letter_1200, true); - } else { - if (paper_size == PAPER_SIZE_A4) - gx_device_set_margins(pdev, margins_a4_600, false); - else - gx_device_set_margins(pdev, margins_letter_600, false); - } - return gdev_prn_open(pdev); -} - -#define UEL "\033%-12345X" - -/* XXX - how to get the name of the job (PS file) being printed? */ -#define PJL_JOB_NAME "Ghost" - -private int -hl1250_close(gx_device * pdev) -{ - int code = gdev_prn_open_printer(pdev, 1); - FILE *fp; - - if (code < 0) - return code; - fp = ((gx_device_printer *) pdev)->file; - /* job separation, reset, UEL */ - fputs("\033&l1T\033E", fp); - fputs(UEL, fp); - fprintf(fp, "@PJL EOJ NAME=\"%s\"\r\n", PJL_JOB_NAME); - fputs(UEL, fp); - return gdev_prn_close(pdev); -} - - -private int -hl1250_print_page_copies(gx_device_printer * pdev, FILE * prn_stream, - int num_copies) -{ - int x_dpi = (int)pdev->x_pixels_per_inch; - int y_dpi = (int)pdev->y_pixels_per_inch; - const char *tray_pjl; - const char *tray_pcl; - const gx_device_hl1250 *hl1250 = (gx_device_hl1250 *) pdev; - hl1250_econo_t econo_mode = hl1250->econo_mode; - hl1250_paper_t paper_type = hl1250->paper_type; - hl1250_tray_t source_tray = hl1250->source_tray; - static const char * const onoff[2] = { "OFF", "ON" }; - static const char * const papertypes[5] = - { "REGULAR", "THIN", "THICK", "THICK2", "TRANSPARENCY" }; - - tray_pjl = "AUTO"; - tray_pcl = ""; - switch (source_tray) { - case TRAY_DUAL: - tray_pcl = "\033&l0H"; - break; - case TRAY_UPPER: - tray_pjl = "TRAY1"; - tray_pcl = "\033&l1H"; - break; - case TRAY_LOWER: - tray_pjl = "TRAY2"; - tray_pcl = "\033&l5H"; - break; - case TRAY_MANUAL: - tray_pcl = "\033&l2H"; - break; - default: - } - if (pdev->PageCount == 0) { - /* initialize printer */ - fputs(UEL, prn_stream); - fputs("@PJL \r\n", prn_stream); - fprintf(prn_stream, "@PJL JOB NAME=\"%s\"\r\n", PJL_JOB_NAME); - fprintf(prn_stream, "@PJL SET ECONOMODE=%s\n", onoff[econo_mode != 0]); - if (econo_mode) - fprintf(prn_stream, "@PJL SET ECONOLEVEL=%d\n", 3 - (int)econo_mode); - fprintf(prn_stream, "@PJL SET MEDIATYPE=%s\n", papertypes[paper_type]); - fprintf(prn_stream, "@PJL SET SOURCETRAY=%s\n", tray_pjl); - fprintf(prn_stream, "@PJL SET RESOLUTION=%d\n", y_dpi); - fprintf(prn_stream, "@PJL SET RAS1200MODE=%s\n", onoff[x_dpi == 1200]); - - fputs("@PJL ENTER LANGUAGE=PCL\n", prn_stream); - } - if (x_dpi != 1200) { - char page_init[100]; - - /* We get the printer to translate the coordinate system for us. - It seems the HL-1250 needs a slightly different translation - (-120, 0) compared to the one in the ljet4 driver (-180, 36) - (X, Y coordinates here are specified in 1/720-inch units). */ - - sprintf(page_init, "\033&l-120U\033*r0F\033&u%dD%s", y_dpi, tray_pcl); - return dljet_mono_print_page_copies(pdev, prn_stream, num_copies, - y_dpi, PCL_LJ4_FEATURES, page_init); - } - return hl1250_print_1200dpi(pdev, prn_stream, num_copies, tray_pcl); -} - -private int -hl1250_put_param_int(gs_param_list * plist, gs_param_name pname, - int *pvalue, int minval, int maxval, int ecode) -{ - int code, value; - - code = param_read_int(plist, pname, &value); - switch (code) { - case 0: - if (value < minval || value > maxval) - param_signal_error(plist, pname, gs_error_rangecheck); - *pvalue = value; - return (ecode < 0 ? ecode : 1); - case 1: - return ecode; - default: - return code; - } -} - -private int -hl1250_get_params(gx_device * pdev, gs_param_list * plist) -{ - gx_device_hl1250 *hl1250 = (gx_device_hl1250 *) pdev; - int code, val; - - code = gdev_prn_get_params(pdev, plist); - if (code < 0) - return code; - val = hl1250->econo_mode; - code = param_write_int(plist, "EconoMode", &val); - if (code < 0) - return code; - val = hl1250->paper_type; - code = param_write_int(plist, "PaperType", &val); - if (code < 0) - return code; - val = hl1250->source_tray; - code = param_write_int(plist, "SourceTray", &val); - return code; -} - -private int -hl1250_put_params(gx_device * pdev, gs_param_list * plist) -{ - int code = 0; - gx_device_hl1250 *hl1250 = (gx_device_hl1250 *) pdev; - int econo_mode = hl1250->econo_mode; - int paper_type = hl1250->paper_type; - int source_tray = hl1250->source_tray; - - code = hl1250_put_param_int(plist, "EconoMode", &econo_mode, - ECONO_OFF, ECONO_50, code); - code = hl1250_put_param_int(plist, "PaperType", &paper_type, - PTYPE_PLAIN, PTYPE_TRANS, code); - code = hl1250_put_param_int(plist, "SourceTray", &source_tray, - TRAY_AUTO, TRAY_MANUAL, code); - if (code < 0) - return code; - code = gdev_prn_put_params(pdev, plist); - if (code < 0) - return code; - hl1250->econo_mode = econo_mode; - hl1250->paper_type = paper_type; - hl1250->source_tray = source_tray; - return 0; -} diff --git a/app-text/ghostscript/files/lxm3200-gentoo.diff b/app-text/ghostscript/files/lxm3200-gentoo.diff deleted file mode 100644 index 1a84baaddca2..000000000000 --- a/app-text/ghostscript/files/lxm3200-gentoo.diff +++ /dev/null @@ -1,32 +0,0 @@ -diff -uP --to-file ../ghost/ ghostscript-7.05/src/Makefile.in ../ghost/Makefile.in ---- ghostscript-7.05/src/Makefile.in Sat Apr 20 00:23:09 2002 -+++ ../ghost/Makefile.in Sun May 12 17:09:07 2002 -@@ -360,7 +360,7 @@ - DEVICE_DEVS3=$(DD)deskjet.dev $(DD)djet500.dev $(DD)laserjet.dev $(DD)ljetplus.dev $(DD)ljet2p.dev $(DD)ljet3.dev $(DD)ljet3d.dev $(DD)ljet4.dev $(DD)ljet4d.dev $(DD)lj5mono.dev $(DD)lj5gray.dev - DEVICE_DEVS4=$(DD)cdeskjet.dev $(DD)cdjcolor.dev $(DD)cdjmono.dev $(DD)cdj550.dev $(DD)pj.dev $(DD)pjxl.dev $(DD)pjxl300.dev - DEVICE_DEVS5=$(DD)uniprint.dev @IJSDEVS@ @STPDEVS@ --DEVICE_DEVS6=$(DD)bj10e.dev $(DD)bj200.dev $(DD)bjc600.dev $(DD)bjc800.dev -+DEVICE_DEVS6=$(DD)bj10e.dev $(DD)bj200.dev $(DD)bjc600.dev $(DD)bjc800.dev $(DD)lxm3200.dev - DEVICE_DEVS7=$(DD)faxg3.dev $(DD)faxg32d.dev $(DD)faxg4.dev - DEVICE_DEVS8=$(DD)pcxmono.dev $(DD)pcxgray.dev $(DD)pcx16.dev $(DD)pcx256.dev $(DD)pcx24b.dev $(DD)pcxcmyk.dev - DEVICE_DEVS9=$(DD)pbm.dev $(DD)pbmraw.dev $(DD)pgm.dev $(DD)pgmraw.dev $(DD)pgnm.dev $(DD)pgnmraw.dev $(DD)pnm.dev $(DD)pnmraw.dev $(DD)ppm.dev $(DD)ppmraw.dev $(DD)pkm.dev $(DD)pkmraw.dev $(DD)pksm.dev $(DD)pksmraw.dev -diff -uP --to-file ../ghost/ ghostscript-7.05/src/contrib.mak ../ghost/contrib.mak ---- ghostscript-7.05/src/contrib.mak Fri Feb 22 20:45:55 2002 -+++ ../ghost/contrib.mak Sun May 12 17:10:16 2002 -@@ -652,6 +652,16 @@ - $(GLOBJ)gdevlxm.$(OBJ) : $(GLSRC)gdevlxm.c $(PDEVH) $(gsparams_h) - $(GLCC) $(GLO_)gdevlxm.$(OBJ) $(C_) $(GLSRC)gdevlxm.c - -+### ---------------- Lexmark 3200 device ----------------- ### -+ -+lxm3200_=$(GLOBJ)gdevlx32.$(OBJ) -+ -+$(GLOBJ)gdevlx32.$(OBJ): $(GLSRC)gdevlx32.c $(PDEVH) $(gsparam_h) -+ $(GLCC) $(GLO_)gdevlx32.$(OBJ) $(C_) $(GLSRC)gdevlx32.c -+ -+$(DD)lxm3200.dev: $(lxm3200_) $(DD)page.dev -+ $(SETPDEV) $(DD)lxm3200 $(lxm3200_) -+ - ### ----------------- The Okidata MicroLine 182 device ----------------- ### - ### Note: this driver was contributed by a user: please contact ### - ### Maarten Koning (smeg@bnr.ca) if you have questions. ### |