[gs-cvs] rev 7912 - in trunk/gs/contrib: . chp2200 cups eplaser
epson740 japanese japanese/doc lips4 lxm3200-tweaked
md2k_md5k opvp pcl3 pcl3/doc pcl3/eprn pcl3/lib pcl3/ppd
pcl3/ps pcl3/src uniprint
till at ghostscript.com
till at ghostscript.com
Tue May 8 09:52:42 PDT 2007
Author: till
Date: 2007-05-08 09:52:11 -0700 (Tue, 08 May 2007)
New Revision: 7912
Added:
trunk/gs/contrib/chp2200/
trunk/gs/contrib/chp2200/AUTHORS
trunk/gs/contrib/chp2200/COPYING
trunk/gs/contrib/chp2200/INSTALL
trunk/gs/contrib/contrib.mak
trunk/gs/contrib/cups/
trunk/gs/contrib/cups/cups.mak
trunk/gs/contrib/cups/gdevcups.c
trunk/gs/contrib/cups/pstopxl
trunk/gs/contrib/cups/pstopxl.in
trunk/gs/contrib/cups/pstoraster
trunk/gs/contrib/cups/pstoraster.convs
trunk/gs/contrib/cups/pstoraster.in
trunk/gs/contrib/cups/pxlcolor.ppd
trunk/gs/contrib/cups/pxlmono.ppd
trunk/gs/contrib/defs.h
trunk/gs/contrib/eplaser/
trunk/gs/contrib/eplaser/gdevescv.c
trunk/gs/contrib/eplaser/gdevescv.h
trunk/gs/contrib/epson740/
trunk/gs/contrib/epson740/README
trunk/gs/contrib/epson740/printerdb_rh5.2
trunk/gs/contrib/epson740/printerdb_rh6.0
trunk/gs/contrib/epson740/ps-to-printer.fpi_rh5.2
trunk/gs/contrib/epson740/upp-HowTo-to-be
trunk/gs/contrib/gdevbjc_.c
trunk/gs/contrib/gdevbjc_.h
trunk/gs/contrib/gdevbjca.c
trunk/gs/contrib/gdevcd8.c
trunk/gs/contrib/gdevcd8.h
trunk/gs/contrib/gdevdj9.c
trunk/gs/contrib/gdevgdi.c
trunk/gs/contrib/gdevhl12.c
trunk/gs/contrib/gdevln03.c
trunk/gs/contrib/gdevlx32.c
trunk/gs/contrib/gdevlx50.c
trunk/gs/contrib/gdevlx7.c
trunk/gs/contrib/gdevmd2k.c
trunk/gs/contrib/gdevop4w.c
trunk/gs/contrib/gdevxes.c
trunk/gs/contrib/gomni.c
trunk/gs/contrib/japanese/
trunk/gs/contrib/japanese/dmp_init.ps
trunk/gs/contrib/japanese/dmp_site.ps
trunk/gs/contrib/japanese/doc/
trunk/gs/contrib/japanese/doc/Gdevlips.htm
trunk/gs/contrib/japanese/doc/README.gs550j
trunk/gs/contrib/japanese/doc/cdj880.txt
trunk/gs/contrib/japanese/doc/dj505j.txt
trunk/gs/contrib/japanese/doc/djgpp.txt
trunk/gs/contrib/japanese/doc/gdev10v.txt
trunk/gs/contrib/japanese/doc/gdevalps.txt
trunk/gs/contrib/japanese/doc/gdevcd8.txt
trunk/gs/contrib/japanese/doc/gdevdmpr.txt
trunk/gs/contrib/japanese/doc/gdevfmlbp.txt
trunk/gs/contrib/japanese/doc/gdevj100.txt
trunk/gs/contrib/japanese/doc/gdevlbp3.txt
trunk/gs/contrib/japanese/doc/gdevmag.txt
trunk/gs/contrib/japanese/doc/gdevmd2k.txt
trunk/gs/contrib/japanese/doc/gdevmjc.txt
trunk/gs/contrib/japanese/doc/gdevml6.txt
trunk/gs/contrib/japanese/doc/gdevp201.txt
trunk/gs/contrib/japanese/doc/gs261j.euc
trunk/gs/contrib/japanese/doc/gs261j.txt
trunk/gs/contrib/japanese/dviprlib.c
trunk/gs/contrib/japanese/dviprlib.h
trunk/gs/contrib/japanese/escp_24.src
trunk/gs/contrib/japanese/gdev10v.c
trunk/gs/contrib/japanese/gdevalps.c
trunk/gs/contrib/japanese/gdevdmpr.c
trunk/gs/contrib/japanese/gdevespg.c
trunk/gs/contrib/japanese/gdevfmlbp.c
trunk/gs/contrib/japanese/gdevfmpr.c
trunk/gs/contrib/japanese/gdevj100.c
trunk/gs/contrib/japanese/gdevlbp3.c
trunk/gs/contrib/japanese/gdevmag.c
trunk/gs/contrib/japanese/gdevmjc.c
trunk/gs/contrib/japanese/gdevmjc.h
trunk/gs/contrib/japanese/gdevml6.c
trunk/gs/contrib/japanese/gdevnpdl.c
trunk/gs/contrib/japanese/gdevp201.c
trunk/gs/contrib/japanese/gdevrpdl.c
trunk/gs/contrib/lips4/
trunk/gs/contrib/lips4/gdevl4r.c
trunk/gs/contrib/lips4/gdevl4v.c
trunk/gs/contrib/lips4/gdevl4v.c.orig
trunk/gs/contrib/lips4/gdevlips.c
trunk/gs/contrib/lips4/gdevlips.h
trunk/gs/contrib/lips4/gdevlprn.c
trunk/gs/contrib/lips4/gdevlprn.h
trunk/gs/contrib/lxm3200-tweaked/
trunk/gs/contrib/lxm3200-tweaked/LICENSE
trunk/gs/contrib/lxm3200-tweaked/README
trunk/gs/contrib/lxm3200-tweaked/RELEASE_NOTES
trunk/gs/contrib/lxm3200-tweaked/Z12-Z31-QuickSetup
trunk/gs/contrib/md2k_md5k/
trunk/gs/contrib/md2k_md5k/README.jis
trunk/gs/contrib/opvp/
trunk/gs/contrib/opvp/gdevopvp.c
trunk/gs/contrib/opvp/opvp_common.h
trunk/gs/contrib/opvp/opvp_media.def
trunk/gs/contrib/pcl3/
trunk/gs/contrib/pcl3/BUGS
trunk/gs/contrib/pcl3/LGPL
trunk/gs/contrib/pcl3/NEWS
trunk/gs/contrib/pcl3/README
trunk/gs/contrib/pcl3/doc/
trunk/gs/contrib/pcl3/doc/gs-mods.txt
trunk/gs/contrib/pcl3/doc/gs-pcl3.1
trunk/gs/contrib/pcl3/doc/gs-pcl3.html
trunk/gs/contrib/pcl3/doc/gs-pcl3.ref
trunk/gs/contrib/pcl3/doc/how-to-report.txt
trunk/gs/contrib/pcl3/doc/notes.bbl
trunk/gs/contrib/pcl3/doc/notes.tex
trunk/gs/contrib/pcl3/doc/pcl3opts.1
trunk/gs/contrib/pcl3/doc/pcl3opts.html
trunk/gs/contrib/pcl3/doc/pcl3opts.ref
trunk/gs/contrib/pcl3/doc/reports.txt
trunk/gs/contrib/pcl3/eprn/
trunk/gs/contrib/pcl3/eprn/eprnfs.c
trunk/gs/contrib/pcl3/eprn/eprnparm.c
trunk/gs/contrib/pcl3/eprn/eprnrend.c
trunk/gs/contrib/pcl3/eprn/eprnrend.c.orig
trunk/gs/contrib/pcl3/eprn/gdeveprn.c
trunk/gs/contrib/pcl3/eprn/gdeveprn.h
trunk/gs/contrib/pcl3/eprn/mediasize.c
trunk/gs/contrib/pcl3/eprn/mediasize.h
trunk/gs/contrib/pcl3/eprn/pagecount.c
trunk/gs/contrib/pcl3/eprn/pagecount.h
trunk/gs/contrib/pcl3/lib/
trunk/gs/contrib/pcl3/lib/cups-pcl3
trunk/gs/contrib/pcl3/lib/example.mcf
trunk/gs/contrib/pcl3/lib/if-pcl3
trunk/gs/contrib/pcl3/pcl3.tar.sig
trunk/gs/contrib/pcl3/ppd/
trunk/gs/contrib/pcl3/ppd/README
trunk/gs/contrib/pcl3/ppd/catppd
trunk/gs/contrib/pcl3/ppd/fonts.ppd
trunk/gs/contrib/pcl3/ppd/gs-5.50.ppd
trunk/gs/contrib/pcl3/ppd/gs-6.01.ppd
trunk/gs/contrib/pcl3/ppd/gs-6.50.ppd
trunk/gs/contrib/pcl3/ppd/gs-6.51.ppd
trunk/gs/contrib/pcl3/ppd/gs-7.00.ppd
trunk/gs/contrib/pcl3/ppd/gs-common.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-common.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj1120c.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj3xx.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj400.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj500.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj500c.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj510.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj540.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj550c.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj600.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj660c.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj680c.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdj8xxc.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-hpdjportable.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-unspec.ppd
trunk/gs/contrib/pcl3/ppd/gs-pcl3-unspecold.ppd
trunk/gs/contrib/pcl3/ps/
trunk/gs/contrib/pcl3/ps/calign.ps
trunk/gs/contrib/pcl3/ps/dumppdd.ps
trunk/gs/contrib/pcl3/ps/levels-test.ps
trunk/gs/contrib/pcl3/ps/margins-A4.ps
trunk/gs/contrib/pcl3/ps/margins-A4Rotated.ps
trunk/gs/contrib/pcl3/ps/margins-Env10Rotated.ps
trunk/gs/contrib/pcl3/ps/margins-EnvDLRotated.ps
trunk/gs/contrib/pcl3/ps/margins-Letter.ps
trunk/gs/contrib/pcl3/ps/margins-LetterRotated.ps
trunk/gs/contrib/pcl3/src/
trunk/gs/contrib/pcl3/src/contrib.mak-5.50.add
trunk/gs/contrib/pcl3/src/contrib.mak-6.01.add
trunk/gs/contrib/pcl3/src/contrib.mak-6.50.add
trunk/gs/contrib/pcl3/src/contrib.mak-6.51.add
trunk/gs/contrib/pcl3/src/contrib.mak-7.00.add
trunk/gs/contrib/pcl3/src/gdevpcl3.c
trunk/gs/contrib/pcl3/src/pcl3opts-de.msg
trunk/gs/contrib/pcl3/src/pcl3opts-en.msg
trunk/gs/contrib/pcl3/src/pcl3opts.c
trunk/gs/contrib/pcl3/src/pclcap.c
trunk/gs/contrib/pcl3/src/pclcap.h
trunk/gs/contrib/pcl3/src/pclcomp.c
trunk/gs/contrib/pcl3/src/pclgen.c
trunk/gs/contrib/pcl3/src/pclgen.h
trunk/gs/contrib/pcl3/src/pclscan.c
trunk/gs/contrib/pcl3/src/pclscan.h
trunk/gs/contrib/pcl3/src/pclsize.c
trunk/gs/contrib/pcl3/src/pclsize.h
trunk/gs/contrib/pcl3/src/zmedia2.c-5.50.diff
trunk/gs/contrib/pcl3/src/zmedia2.c-6.01.diff
trunk/gs/contrib/pcl3/src/zmedia2.c-6.50.diff
trunk/gs/contrib/pcl3/src/zmedia2.c-6.51.diff
trunk/gs/contrib/pcl3/src/zmedia2.c-7.00.diff
trunk/gs/contrib/uniprint/
trunk/gs/contrib/uniprint/PM760p.upp
trunk/gs/contrib/uniprint/PM760pl.upp
trunk/gs/contrib/uniprint/PM820p.upp
trunk/gs/contrib/uniprint/PM820pl.upp
trunk/gs/contrib/uniprint/Stc670p.upp
trunk/gs/contrib/uniprint/Stc670pl.upp
trunk/gs/contrib/uniprint/Stc680p.upp
trunk/gs/contrib/uniprint/Stc680pl.upp
trunk/gs/contrib/uniprint/Stc740p.upp
trunk/gs/contrib/uniprint/Stc740pl.upp
trunk/gs/contrib/uniprint/Stc760p.upp
trunk/gs/contrib/uniprint/Stc760pl.upp
trunk/gs/contrib/uniprint/Stc777p.upp
trunk/gs/contrib/uniprint/Stc777pl.upp
trunk/gs/contrib/uniprint/Stp720p.upp
trunk/gs/contrib/uniprint/Stp720pl.upp
trunk/gs/contrib/uniprint/Stp870p.upp
trunk/gs/contrib/uniprint/Stp870pl.upp
trunk/gs/contrib/uniprint/bjc6000a1.upp
trunk/gs/contrib/uniprint/bjc6000b1.upp
trunk/gs/contrib/uniprint/s400a1.upp
trunk/gs/contrib/uniprint/s400b1.upp
trunk/gs/contrib/uniprint/sharp.upp
trunk/gs/contrib/uniprint/sipixa6.upp
trunk/gs/contrib/uniprint/stc740ih.upp
Log:
All third-party built-in and Uniprint drivers listed in the OpenPrinting database
DETAILS:
To avoid the users or the distribution package maintainers to patch
Ghostscript for getting support for a certain printer model this patch
contains all known (by OpenPrinting) built-in and Uniprint printer
drivers. So compiling Ghostscript with all these drivers gives a
complete Ghostscript without need of recompilation for adding support
for a printer.
Also the OpenPrinting Vector ("opvp", "oprp") and CUPS Raster output
("cups") are included, to have all the three current interfaces (the
third is the already included IJS) for modular drivers as required by
the upcoming LSB 3.2.
Notes:
Built-in printer drivers for Ghostscript are obsolete. Do not write
any new built-in drivers for Ghostscript. Use the interfaces IJS, CUPS
Raster, or OpenPrinting Vector for your new printer
drivers. Volunteers for moving these third-party drivers into
OpenPrinting Vector modules are welcome.
Do not compile the contrib/ directory for commercial-licensed
distribution of Ghostscript, the licenses of many of these drivers do
not allow this.
EXPECTED DIFFERENCES:
None.
Added: trunk/gs/contrib/chp2200/AUTHORS
===================================================================
--- trunk/gs/contrib/chp2200/AUTHORS 2007-05-08 16:33:45 UTC (rev 7911)
+++ trunk/gs/contrib/chp2200/AUTHORS 2007-05-08 16:52:11 UTC (rev 7912)
@@ -0,0 +1 @@
+Siow-Kiat Tan <siow-kiat_tan at hp.com>
Added: trunk/gs/contrib/chp2200/COPYING
===================================================================
--- trunk/gs/contrib/chp2200/COPYING 2007-05-08 16:33:45 UTC (rev 7911)
+++ trunk/gs/contrib/chp2200/COPYING 2007-05-08 16:52:11 UTC (rev 7912)
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Added: trunk/gs/contrib/chp2200/INSTALL
===================================================================
--- trunk/gs/contrib/chp2200/INSTALL 2007-05-08 16:33:45 UTC (rev 7911)
+++ trunk/gs/contrib/chp2200/INSTALL 2007-05-08 16:52:11 UTC (rev 7912)
@@ -0,0 +1,104 @@
+Ghostscript driver for HP Business Inkjet 2200
+
+=============================================================================
+Building the source code
+=============================================================================
+The source code for the HP 2200 Ghostscript driver consists of 3 files
+(gs-hp2200.tar.gz).
+ 1. gdevcd8.c
+ 2. contrib.mak
+ 3. unix-gcc.mak
+
+Follow these steps to build Ghostscript 6.01 in Linux:
+1. Download and install the Ghostscript 6.01 source code
+ (http://www.cs.wisc.edu/~ghost/aladdin/get601.html) according to the
+ official instructions shown on the Ghostscript home page. To build for
+ the Linux platform, you will need the Unix & VMS sources:
+ a. Ghostscript-6.01-1.src.rpm
+ b. Ghostscript-fonts-6.0-2.src.rpm
+
+2. Copy the HP 2200 Ghostscript driver source files (gdevcd8.c, contrib.mak
+ and unix-gcc.mak) into the Ghostscript source directory, overwriting the
+ original versions.
+
+3. Build Ghostscript.
+
+Here is a summary of the steps to build Ghostscript 6.01 in Linux:
+ # cd /usr/local/src
+ # tar zxvf /tmp/ghostscript-6.01.tar.gz
+ # cd gs6.01
+ # tar zxvf /tmp/ghostscript-6.01jpeg.tar.gz
+ # tar zxvf /tmp/ghostscript-6.01libpng.tar.gz
+ # tar zxvf /tmp/ghostscript-6.01zlib.tar.gz
+ # mv jpeg-6b jpeg
+ # mv libpng-1.0.5 libpng
+ # mv zlib-1.1.3 zlib
+ # cd src
+ # cp /tmp/gdevcd8.c ./
+ # cp /tmp/contrib.mak ./
+ # cp /tmp/unix-gcc.mak ./
+ # cd ..
+ # ln -s /usr/X11R6 /usr/X11 (needed by some Linux distributions)
+ # make -f src/unix-gcc.mak
+
+When the build completes, the binary output is:
+ /usr/local/src/gs6.01/bin/gs
+
+=============================================================================
+Installation
+=============================================================================
+1. Download and install Ghostscript 6.01
+ (http://www.cs.wisc.edu/~ghost/aladdin/get601.html) according to the
+ official instructions shown on the Ghostscript home page.
+ a. Ghostscript-6.01-1.i386.rpm
+ b. Ghostscript-fonts-6.0-2.noarch.rpm
+
+2. Copy the HP 2200 Ghostscript binary (gs) and overwrite the original
+ Ghostscript 6.01 executable:
+ # type gs
+ gs is /usr/bin/gs
+ # cd /usr/bin/gs
+ # cp gs gs.backup
+ # cp /usr/local/src/gs6.01/bin/gs .
+ cp: overwrite `./gs'? y
+
+3. Run printtool and add a print queue, e.g. lp0
+ a. In the Configure Filter dialog box, select
+ "HP DeskJet 850/855/870/1100 series".
+ b. In the Paper Size list box, choose the desired paper size,
+ e.g. Letter
+ c. In the Extra GS options edit box:
+ specify "-sDEVICE=chp2200"
+ d. Enable the checkboxes: "Send EOF after job to eject page" and "Fix
+ stair-stepping text".
+
+=============================================================================
+Using the driver
+=============================================================================
+Selecting paper size:
+Run printtool and edit the lp0 printer queue. In the Paper Size list box,
+choose the desired size.
+
+Selecting paper type:
+Run printtool and edit the lp0 printer queue. In the Extra GS options edit
+box, specify:
+ "-dPapertype=x"
+Possible values of x are:
+ 0=Plain Paper (*default), 1=Bond paper, 2=special paper, 3=photo paper,
+ 4=transparency
+
+Selecting print quality:
+Run printtool and edit the lp0 printer queue. In the Extra GS options edit
+box, specify:
+ "-dQuality=x"
+Possible values of x are:
+ -1=Draft, 0=Normal (*default), 1=Best
+
+Printing from an application:
+From the application, select File -> Print. In the Print Command field,
+specify:
+ "lpr -Plp0"
+
+Printing a file from a console window:
+ # gs -q -sDEVICE=chp2200 -dNOPAUSE -dSAFER -dBATCH -sOutputFile=- test.ps |lpr
+
Added: trunk/gs/contrib/contrib.mak
===================================================================
--- trunk/gs/contrib/contrib.mak 2007-05-08 16:33:45 UTC (rev 7911)
+++ trunk/gs/contrib/contrib.mak 2007-05-08 16:52:11 UTC (rev 7912)
@@ -0,0 +1,1095 @@
+# $Id: contrib.mak,v 1.28 2002/10/16 23:26:33 giles Exp $
+
+# Makefile for device drivers which are not in the original GPL GhostScript
+# distributiion
+
+# 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.
+#
+
+# Define the name of this makefile.
+CONTRIB_MAK=$(CONTRIBDIR)$(D)contrib.mak
+CONTRIBSRC=$(CONTRIBDIR)$(D)
+
+###### --------------------------- Catalog -------------------------- ######
+
+# The following drivers are user-contributed, and maintained (if at all) by
+# users. Please report problems in these drivers to their authors, whose
+# e-mail addresses appear below: do not report them to mailing lists or
+# mailboxes for general Ghostscript problems.
+
+# Displays:
+#
+# None currently
+#
+# Printers:
+#
+# bj10v Canon BubbleJet BJ10v/BJ15v (japanese)
+# bj10vh Canon BubbleJet BJ10v/BJ15v/BJ35v (japanese)
+# bjc880j Canon Color BubbleJet BJC-880J (japanese)
+# bjccolor Canon BJC-250, BJC-250ex, BJC-1000, ... Floyd-Steinberg
+# dithering
+# bjccmyk Canon BJC-250, BJC-250ex, BJC-1000, ... GhostScript
+# standard dithering
+# bjcgray Canon BJC-250, BJC-250ex, BJC-1000, ... Grayscale mode
+# bjcmono Canon BJC-250, BJC-250ex, BJC-1000, ... Monochrome mode
+# cdj1600 HP DeskJet 1600
+# cdj670 HP DeskJet 670
+# cdj850 HP DeskJet 850
+# cdj880 HP DeskJet 880
+# cdj890 HP DeskJet 890
+# cdj970 HP DeskJet 970
+# chp2200 HP Business Inkjet 2200
+# dl2100 DEC DL2100
+# dmprt dot matrix printer driver for Ghostscript (it can use
+# dviprt printer config files, japanese)
+# escpage Epson ESC/Page driver for Ghostscript (japanese)
+# fmpr Fujitsu FMPR (japanese)
+# fmlbp Fujitsu FMLBP2xx Page Printer (japanese)
+# gdi Samsung's old driver for their SmartGDI laser printers:
+# ML-4500, ML-2xx, ML-1xxx, ML-5080, ML-6040, ... and
+# Lexmark E210, same as "samsunggdi"
+# hl1240 Brother HL-1240 and compatible 600-dpi PCL-5 printers
+# hl1250 Brother HL-1250 and compatible 1200x600-dpi PCL-5 printers
+# hpdj1120c HP DeskJet 1120 ("pcl3" driver)
+# hpdj310 HP DeskJet 310 ("pcl3" driver)
+# hpdj320 HP DeskJet 320 ("pcl3" driver)
+# hpdj340 HP DeskJet 340 ("pcl3" driver)
+# hpdj400 HP DeskJet 400 ("pcl3" driver)
+# hpdj500 HP DeskJet 500 ("pcl3" driver)
+# hpdj500c HP DeskJet 500c ("pcl3" driver)
+# hpdj510 HP DeskJet 510 ("pcl3" driver)
+# hpdj520 HP DeskJet 520 ("pcl3" driver)
+# hpdj540 HP DeskJet 540 ("pcl3" driver)
+# hpdj550c HP DeskJet 550c ("pcl3" driver)
+# hpdj560c HP DeskJet 560c ("pcl3" driver)
+# hpdj600 HP DeskJet 600 ("pcl3" driver)
+# hpdj660c HP DeskJet 660c ("pcl3" driver)
+# hpdj670c HP DeskJet 670c ("pcl3" driver)
+# hpdj680c HP DeskJet 680c ("pcl3" driver)
+# hpdj690c HP DeskJet 690c ("pcl3" driver)
+# hpdj850c HP DeskJet 850c ("pcl3" driver)
+# hpdj855c HP DeskJet 855c ("pcl3" driver)
+# hpdj870c HP DeskJet 870c ("pcl3" driver)
+# hpdj890c HP DeskJet 890c ("pcl3" driver)
+# hpdjplus HP DeskJet Plus ("pcl3" driver)
+# hpdjportable HP DeskJet Portable ("pcl3" driver)
+# jj100 Star JJ-100 (japanese)
+# la50 DEC LA50
+# la70 DEC LA70
+# la75 DEC LA75
+# la75plus DEC LA75+
+# lbp310 Canon LBP-310 (japanese)
+# lbp320 Canon LBP-320 Pro/LBP-350 (japanese)
+# lex2050 Lexmark 2050
+# lex3200 Lexmark 3200
+# lex5700 Lexmark 5700
+# lex7000 Lexmark 7000, Lexmark IJ900, Compaq A900, Z51
+# lips2p Canon LIPS-II+ (japanese)
+# lips4v Canon LIPS IV vector mode driver
+# lips4 Canon LIPS IV raster mode driver
+# ln03 DEC LN03
+# lx5000 Lexmark 5000
+# lxm3200 Lexmark 3200, Z31, Z12
+# md1xMono Alps MD-1000/1300/1500 (monochrome mode, japanese)
+# md2k Alps MD-2000/2010/4000/1000/1300/1500
+# md50Mono Alps MD-5000, Oki DP-5000 (monochrome mode, japanese)
+# md50Eco Alps MD-5000, Oki DP-5000 (economy mode, japanese)
+# md5k Alps MD-5000, Oki DP-5000
+# mj500c Epson Stylus Color IIs, 200, 1500 (japanese)
+# mj700v2c Epson Stylus, Epson MachJet (japanese)
+# mj6000c Epson Stylus Color 400, 800, 1520 (japanese)
+# mj8000c Epson Stylus Color 3000 (japanese)
+# ml600 Okidata Microline 600CL/620CL (japanese)
+# npdl NEC MultiWriter, PC-PR1000/2000 (japanese)
+# oki4w Okidata OkiPage 4w+
+# opvp Gluecode for Vector Driver API
+# pcl3 PCL-3(+) printers: Many, especially older HP inkjets,
+# non-HP inkjets as Sharp AJ, Xerox DocuPrint, ...
+# pr1000 NEC PC-PR 1000 (japanese)
+# pr1000_4 NEC PC-PR 1000/4 (japanese)
+# pr150 NEC PC-PR 150 (japanese)
+# pr201 NEC PC-PR 201 (japanese)
+# rpdl Ricoh RPDL I/II/III/IV drver for Ghostscript (japanese)
+# samsunggdi Samsung's old driver for their SmartGDI laser printers:
+# ML-4500, ML-2xx, ML-1xxx, ML-5080, ML-6040, ... and
+# Lexmark E210, same as "gdi"
+# xes Xerox XES (2700, 3700, 4045, etc.)
+#
+# Fax systems:
+#
+# None currently
+#
+# Other raster file formats and devices:
+#
+# mag16 MAG file format (from Red Hat's japanese driver pack)
+# mag256 MAG file format (from Red Hat's japanese driver pack)
+#
+# Special features
+#
+# uniprint/: Some additional .upp files
+#
+
+# If you add drivers, it would be nice if you kept each list
+# in alphabetical order.
+
+###### ----------------------- End of catalog ----------------------- ######
+
+### ----------------- The BJC-210/240/250/250ex/265/1000 ---------------- ###
+
+###
+### For questions about the driver, mailto://szaszg@hu.inter.net
+### http://bjc250gs.sourceforge.net
+###
+
+bjc_h=$(CONTRIBSRC)gdevbjc_.h
+
+bjc_=$(GLOBJ)gdevbjc_.$(OBJ) $(GLOBJ)gdevbjca.$(OBJ)
+
+$(GLOBJ)gdevbjc_.$(OBJ) : $(CONTRIBSRC)gdevbjc_.c $(PDEVH) $(bjc_h)
+ $(GLCC) $(GLO_)gdevbjc_.$(OBJ) $(C_) $(CONTRIBSRC)gdevbjc_.c
+
+$(GLOBJ)gdevbjca.$(OBJ) : $(CONTRIBSRC)gdevbjca.c $(PDEVH) $(bjc_h)
+ $(GLCC) $(GLO_)gdevbjca.$(OBJ) $(C_) $(CONTRIBSRC)gdevbjca.c
+
+$(DD)bjcmono.dev : $(bjc_) $(DD)page.dev
+ $(SETPDEV) $(DD)bjcmono $(bjc_)
+
+$(DD)bjcgray.dev : $(bjc_) $(DD)page.dev
+ $(SETPDEV) $(DD)bjcgray $(bjc_)
+
+$(DD)bjccmyk.dev : $(bjc_) $(DD)page.dev
+ $(SETPDEV) $(DD)bjccmyk $(bjc_)
+
+$(DD)bjccolor.dev : $(bjc_) $(DD)page.dev
+ $(SETPDEV) $(DD)bjccolor $(bjc_)
+
+
+### -------------- cdj850 - HP 850c Driver under development ------------- ###
+
+cdeskjet8_=$(GLOBJ)gdevcd8.$(OBJ) $(HPPCL)
+
+# Author: Uli Wortmann (uliw at erdw.ethz.ch), Martin Gerbershagen (ger at ulm.temic.de)
+# Printer: HP 670
+$(DD)cdj670.dev : $(cdeskjet8_) $(DD)page.dev
+ $(SETPDEV2) $(DD)cdj670 $(cdeskjet8_)
+
+# Author: Uli Wortmann (uliw at erdw.ethz.ch)
+# Printer: HP 850
+$(DD)cdj850.dev : $(cdeskjet8_) $(DD)page.dev
+ $(SETPDEV2) $(DD)cdj850 $(cdeskjet8_)
+
+# Author: Uli Wortmann (uliw at erdw.ethz.ch), Martin Gerbershagen (ger at ulm.temic.de)
+# Printer: HP 890
+$(DD)cdj890.dev : $(cdeskjet8_) $(DD)page.dev
+ $(SETPDEV2) $(DD)cdj890 $(cdeskjet8_)
+
+# Author: Uli Wortmann (uliw at erdw.ethz.ch), Martin Gerbershagen (ger at ulm.temic.de)
+# Printer: HP 1600
+$(DD)cdj1600.dev : $(cdeskjet8_) $(DD)page.dev
+ $(SETPDEV2) $(DD)cdj1600 $(cdeskjet8_)
+
+$(GLOBJ)gdevcd8.$(OBJ) : $(CONTRIBSRC)gdevcd8.c $(PDEVH) $(math__h)\
+ $(gsparam_h) $(gxlum_h) $(gdevpcl_h)
+ $(GLCC) $(GLO_)gdevcd8.$(OBJ) $(C_) $(CONTRIBSRC)gdevcd8.c
+
+
+### -------------- cdj880 - HP 880c Driver under development ------------- ###
+### Since this driver is in the development phase it is not distributed ###
+### with Ghostscript, but is available from ###
+### http://www.proaxis.com/~mgelhaus/linux/software/hp880c/hp880c.html ###
+
+### NOTE: Depends on the presence of the cdj850 section above. ###
+
+# Author: Matthew Gelhaus (mgelhaus at proaxis.com)
+# Printer: HP 880c
+$(DD)cdj880.dev : $(cdeskjet8_) $(DD)page.dev
+ $(SETPDEV2) $(DD)cdj880 $(cdeskjet8_)
+
+
+### ------------- cdj970 - HP 970Cxi Driver under development ------------- ###
+
+cdeskjet9_=$(GLOBJ)gdevdj9.$(OBJ) $(HPPCL)
+
+# Author: Rene Harsch (rene at harsch.net)
+# Printer: HP 970Cxi
+$(DD)cdj970.dev : $(cdeskjet9_) $(DD)page.dev
+ $(SETPDEV2) $(DD)cdj970 $(cdeskjet9_)
+
+$(GLOBJ)gdevdj9.$(OBJ) : $(CONTRIBSRC)gdevdj9.c $(PDEVH) $(math__h) $(string__h)\
+ $(gsparam_h) $(gxlum_h) $(gdevpcl_h)
+ $(GLCC) $(GLO_)gdevdj9.$(OBJ) $(C_) $(CONTRIBSRC)gdevdj9.c
+
+
+### -------------- chp2200 - HP Business Inkjet 2200 ------------- ###
+
+### NOTE: Depends on the presence of the cdj850 section.
+
+$(DD)chp2200.dev : $(cdeskjet8_) $(DD)page.dev
+ $(SETPDEV2) $(DD)chp2200 $(cdeskjet8_)
+
+
+### ---------------- The Samsung SmartGDI laser printer devices --------- ###
+### Note : this driver is used by Samsung SmartGDI compatible printers. ###
+###
+
+GDIMONO=$(GLOBJ)gdevgdi.$(OBJ) $(HPPCL)
+
+$(DD)gdi.dev: $(GDIMONO) $(DD)page.dev
+ $(SETPDEV) $(DD)gdi $(GDIMONO)
+
+$(DD)samsunggdi.dev: $(GDIMONO) $(DD)page.dev
+ $(SETPDEV) $(DD)samsunggdi $(GDIMONO)
+
+$(GLOBJ)gdevgdi.$(OBJ): $(CONTRIBSRC)gdevgdi.c $(PDEVH) $(gdevpcl_h)
+ $(GLCC) $(GLO_)gdevgdi.$(OBJ) $(C_) $(CONTRIBSRC)gdevgdi.c
+
+
+### ---------------- The Brother HL-1240/HL-1250 printers --------------- ###
+### These printers are ljet4-compatible, plus support for source tray ###
+### selection and special 1200x600 dpi mode. ###
+
+hl1250_=$(GLOBJ)gdevhl12.$(OBJ) $(HPDLJM)
+$(DD)hl1250.dev : $(hl1250_) $(DD)page.dev
+ $(SETPDEV) $(DD)hl1250 $(hl1250_)
+
+$(DD)hl1240.dev : $(hl1250_) $(DD)page.dev
+ $(SETPDEV) $(DD)hl1240 $(hl1250_)
+
+# Author: Marek Michalkiewicz <marekm at linux.org.pl>
+# Printer: Brother HL-1250 (may work with some other models too)
+$(GLOBJ)gdevhl12.$(OBJ) : $(CONTRIBSRC)gdevhl12.c $(PDEVH) $(gdevdljm_h)
+ $(GLCC) $(GLO_)gdevhl12.$(OBJ) $(C_) $(CONTRIBSRC)gdevhl12.c
+
+
+### -------- The DEC LN03/DL2100/LA50/LA70/LA75 printer devices -------- ###
+
+ln03_=$(GLOBJ)gdevln03.$(OBJ)
+
+# Author: Ulrich Mueller (ulm at vsnhd1.cern.ch)
+# Printer: DEC LN03
+$(DD)ln03.dev : $(ln03_) $(DD)page.dev
+ $(SETPDEV) $(DD)ln03 $(ln03_)
+
+# Author: Nick Brown (nick.brown at coe.int)
+# Printer: DEClaser 2100
+$(DD)dl2100.dev : $(ln03_) $(DD)page.dev
+ $(SETPDEV) $(DD)dl2100 $(ln03_)
+
+# Author: Ian MacPhedran (macphed at dvinci.USask.CA)
+# Printer: DEC LA50
+$(DD)la50.dev : $(ln03_) $(DD)page.dev
+ $(SETPDEV) $(DD)la50 $(ln03_)
+
+# Author: Bruce Lowekamp (lowekamp at csugrad.cs.vt.edu)
+# Printer: DEC LA70
+$(DD)la70.dev : $(ln03_) $(DD)page.dev
+ $(SETPDEV) $(DD)la70 $(ln03_)
+
+# Author: Ian MacPhedran (macphed at dvinci.USask.CA)
+# Printer: DEC LA75
+$(DD)la75.dev : $(ln03_) $(DD)page.dev
+ $(SETPDEV) $(DD)la75 $(ln03_)
+
+# Author: Andre' Beck (Andre_Beck at IRS.Inf.TU-Dresden.de)
+# Printer: DEC LA75plus
+$(DD)la75plus.dev : $(ln03_) $(DD)page.dev
+ $(SETPDEV) $(DD)la75plus $(ln03_)
+
+$(GLOBJ)gdevln03.$(OBJ) : $(CONTRIBSRC)gdevln03.c $(PDEVH)
+ $(GLCC) $(GLO_)gdevln03.$(OBJ) $(C_) $(CONTRIBSRC)gdevln03.c
+
+
+### -------------------------- EPSON Page/Color -------------------------- ###
+###
+###
+
+ESCV_DIR=$(CONTRIBSRC)eplaser
+ESCV_SRC=$(ESCV_DIR)$(D)
+escv_opts=-DGS_VERSION_MAJOR=$(GS_VERSION_MAJOR)
+
+escv_=$(GLOBJ)gdevescv.$(OBJ)
+
+$(GLOBJ)gdevescv.$(OBJ): $(ESCV_SRC)gdevescv.c $(ESCV_SRC)gdevescv.h $(PDEVH)
+ $(GLCC) -DA4 $(GLO_)gdevescv.$(OBJ) $(C_) $(escv_opts) $(ESCV_SRC)gdevescv.c
+
+$(DD)alc1900.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)alc1900 $(escv_)
+
+$(DD)alc2000.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)alc2000 $(escv_)
+
+$(DD)alc4000.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)alc4000 $(escv_)
+
+$(DD)alc4100.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)alc4100 $(escv_)
+
+$(DD)alc8500.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)alc8500 $(escv_)
+
+$(DD)alc8600.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)alc8600 $(escv_)
+
+$(DD)alc9100.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)alc9100 $(escv_)
+
+$(DD)lp3000c.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp3000c $(escv_)
+
+$(DD)lp8000c.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8000c $(escv_)
+
+$(DD)lp8200c.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8200c $(escv_)
+
+$(DD)lp8300c.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8300c $(escv_)
+
+$(DD)lp8500c.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8500c $(escv_)
+
+$(DD)lp8800c.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8800c $(escv_)
+
+$(DD)lp9000c.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp9000c $(escv_)
+
+$(DD)lp9200c.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp9200c $(escv_)
+
+$(DD)lp9500c.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp9500c $(escv_)
+
+$(DD)lp9800c.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp9800c $(escv_)
+
+$(DD)lps6500.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lps6500 $(escv_)
+
+$(DD)epl2050.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)epl2050 $(escv_)
+
+$(DD)epl2050p.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)epl2050p $(escv_)
+
+$(DD)epl2120.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)epl2120 $(escv_)
+
+$(DD)epl2500.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)epl2500 $(escv_)
+
+$(DD)epl2750.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)epl2750 $(escv_)
+
+$(DD)epl5800.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)epl5800 $(escv_)
+
+$(DD)epl5900.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)epl5900 $(escv_)
+
+$(DD)epl6100.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)epl6100 $(escv_)
+
+$(DD)epl6200.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)epl6200 $(escv_)
+
+$(DD)lp1800.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp1800 $(escv_)
+
+$(DD)lp1900.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp1900 $(escv_)
+
+$(DD)lp2200.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp2200 $(escv_)
+
+$(DD)lp2400.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp2400 $(escv_)
+
+$(DD)lp2500.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp2500 $(escv_)
+
+$(DD)lp7500.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp7500 $(escv_)
+
+$(DD)lp7700.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp7700 $(escv_)
+
+$(DD)lp7900.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp7900 $(escv_)
+
+$(DD)lp8100.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8100 $(escv_)
+
+$(DD)lp8300f.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8300f $(escv_)
+
+$(DD)lp8400f.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8400f $(escv_)
+
+$(DD)lp8600.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8600 $(escv_)
+
+$(DD)lp8600f.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8600f $(escv_)
+
+$(DD)lp8700.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8700 $(escv_)
+
+$(DD)lp8900.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp8900 $(escv_)
+
+$(DD)lp9000b.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp9000b $(escv_)
+
+$(DD)lp9100.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp9100 $(escv_)
+
+$(DD)lp9200b.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp9200b $(escv_)
+
+$(DD)lp9300.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp9300 $(escv_)
+
+$(DD)lp9400.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp9400 $(escv_)
+
+$(DD)lp9600.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp9600 $(escv_)
+
+$(DD)lp9600s.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp9600s $(escv_)
+
+$(DD)lps4500.dev: $(escv_) $(DD)page.dev
+ $(SETPDEV) $(DD)lps4500 $(escv_)
+
+
+# ------ The Lexmark 5700 and 7000 devices ------ #
+
+lex7000_=$(GLOBJ)gdevlx7.$(OBJ)
+$(DD)lex7000.dev: $(lex7000_) $(DD)page.dev
+ $(SETPDEV) $(DD)lex7000 $(lex7000_)
+
+lex5700_=$(GLOBJ)gdevlx7.$(OBJ)
+$(DD)lex5700.dev: $(lex5700_) $(DD)page.dev
+ $(SETPDEV) $(DD)lex5700 $(lex5700_)
+
+lex3200_=$(GLOBJ)gdevlx7.$(OBJ)
+$(DD)lex3200.dev: $(lex3200_) $(DD)page.dev
+ $(SETPDEV) $(DD)lex3200 $(lex3200_)
+
+lex2050_=$(GLOBJ)gdevlx7.$(OBJ)
+$(DD)lex2050.dev: $(lex2050_) $(DD)page.dev
+ $(SETPDEV) $(DD)lex2050 $(lex2050_)
+
+$(GLOBJ)gdevlx7.$(OBJ): $(CONTRIBSRC)gdevlx7.c $(PDEVH)
+ $(GLCC) $(GLO_)gdevlx7.$(OBJ) $(C_) $(CONTRIBSRC)gdevlx7.c
+
+
+### ----------------- LexMark 5000 printer ----------------------------- ###
+### Note: this driver was contributed by users. Please contact: ###
+### Peter B. West <p.west at uq.net.au> ###
+
+lx5000_=$(GLOBJ)gdevlx50.$(OBJ)
+$(DD)lx5000.dev: $(lx5000_)
+ $(SETPDEV) $(DD)lx5000 $(lx5000_)
+
+$(GLOBJ)gdevlx50.$(OBJ): $(CONTRIBSRC)gdevlx50.c $(PDEVH)
+ $(GLCC) $(GLO_)gdevlx50.$(OBJ) $(C_) $(CONTRIBSRC)gdevlx50.c
+
+
+### ----------- Lexmark 3200 device ------------ ###
+
+lxm3200_=$(GLOBJ)gdevlx32.$(OBJ)
+
+$(GLOBJ)gdevlx32.$(OBJ): $(CONTRIBSRC)gdevlx32.c $(PDEVH) $(gsparam_h)
+ $(GLCC) $(GLO_)gdevlx32.$(OBJ) $(C_) $(CONTRIBSRC)gdevlx32.c
+
+$(DD)lxm3200.dev: $(lxm3200_) $(DD)page.dev
+ $(SETPDEV) $(DD)lxm3200 $(lxm3200_)
+
+
+### -------------- The Canon LIPS IV laser printer device -------------- ###
+### ###
+LIPS_DIR=$(CONTRIBSRC)lips4
+LIPS_SRC=$(LIPS_DIR)$(D)
+LIPS_OPT=-DGS_VERSION_MAJOR=$(GS_VERSION_MAJOR) $(I_) $(LIPS_SRC)
+
+$(GLOBJ)gdevlprn.$(OBJ): $(LIPS_SRC)gdevlprn.c $(LIPS_SRC)gdevlprn.h\
+ $(gdevprn_h) $(PDEVH)
+ $(GLCC) $(GLO_)gdevlprn.$(OBJ) $(LIPS_OPT) $(C_) $(LIPS_SRC)gdevlprn.c
+
+lipsr_=$(GLOBJ)gdevl4r.$(OBJ) $(GLOBJ)gdevlips.$(OBJ) $(GLOBJ)gdevlprn.$(OBJ)
+
+$(GLOBJ)gdevl4r.$(OBJ): $(LIPS_SRC)gdevl4r.c $(LIPS_SRC)gdevlips.h $(PDEVH)
+ $(GLCC) -DA4 $(GLO_)gdevl4r.$(OBJ) $(LIPS_OPT) $(C_)\
+ $(LIPS_SRC)gdevl4r.c
+
+$(GLOBJ)gdevlips.$(OBJ): $(LIPS_SRC)gdevlips.c
+ $(GLCC) $(GLO_)gdevlips.$(OBJ) $(LIPS_OPT) $(C_) $(LIPS_SRC)gdevlips.c
+
+$(DD)lips4.dev: $(lipsr_) $(DD)page.dev
+ $(SETPDEV) $(DD)lips4 $(lipsr_)
+
+lipsv_=$(GLOBJ)gdevl4v.$(OBJ) $(GLOBJ)gdevlips.$(OBJ)
+
+$(DD)lips4v.dev: $(ECHOGS_XE) $(lipsv_) $(DD)vector.dev
+ $(SETDEV) $(DD)lips4v $(lipsv_)
+ $(ADDMOD) $(DD)lips4v -include $(GLD)vector
+
+$(GLOBJ)gdevl4v.$(OBJ): $(LIPS_SRC)gdevl4v.c $(LIPS_SRC)gdevlips.h $(GDEV)\
+ $(math__h) $(gscspace_h) $(gsutil_h) $(gsparam_h) $(gsmatrix_h) $(gdevvec_h)\
+ $(ghost_h) $(gzstate_h) $(igstate_h)
+ $(GLCC) -DA4 $(GLO_)gdevl4v.$(OBJ) $(LIPS_OPT) $(C_)\
+ $(LIPS_SRC)gdevl4v.c
+
+### --------------- Some extra devices: lips2p, bjc880j ---------------- ###
+
+$(DD)lips2p.dev: $(lipsr_) $(DD)page.dev
+ $(SETPDEV) $(DD)lips2p $(lipsr_)
+
+$(DD)bjc880j.dev: $(lipsr_) $(DD)page.dev
+ $(SETPDEV) $(DD)bjc880j $(lipsr_)
+
+
+### ------------ ALPS MD series printer devices ------------ ###
+
+md2k_=$(GLOBJ)gdevmd2k.$(OBJ)
+
+$(DD)md2k.dev: $(md2k_) $(DD)page.dev
+ $(SETPDEV) $(DD)md2k $(md2k_)
+
+$(DD)md5k.dev: $(md2k_) $(DD)page.dev
+ $(SETPDEV) $(DD)md5k $(md2k_)
+
+$(GLOBJ)gdevmd2k.$(OBJ): $(CONTRIBSRC)gdevmd2k.c $(PDEVH) $(gsparam_h)
+ $(GLCC) $(GLO_)gdevmd2k.$(OBJ) $(C_) $(CONTRIBSRC)gdevmd2k.c
+
+
+###--------------- IBM Omni Driver Framework --------------------------###
+
+epclr_h1=$(CONTRIBSRC)defs.h
+
+$(DD)omni.dev : $(GLOBJ)gomni.$(OBJ) $(DD)page.dev
+ $(SETPDEV) $(DD)omni $(GLOBJ)gomni.$(OBJ)
+
+$(GLOBJ)gomni.$(OBJ) : $(CONTRIBSRC)gomni.c $(epclr_h1) $(PDEVH)
+ $(GLCC) $(GLO_)gomni.$(OBJ) $(C_) $(CONTRIBSRC)gomni.c
+
+### ----------------- The Okidata OkiPage 4w+ device ------------------- ###
+
+oki4w_=$(GLOBJ)gdevop4w.$(OBJ)
+$(DD)oki4w.dev : $(oki4w_) $(DD)page.dev
+ $(SETPDEV) $(DD)oki4w $(oki4w_)
+
+# Author: Ivan Schreter (ivan at shadow.sk)
+# Printer: Okidata OkiPage 4w+
+$(GLOBJ)gdevop4w.$(OBJ) : $(CONTRIBSRC)gdevop4w.c $(PDEVH)
+ $(GLCC) $(GLO_)gdevop4w.$(OBJ) $(C_) $(CONTRIBSRC)gdevop4w.c
+
+
+### ---------------- OpenPrinting Vector Printer Driver ---------------- ###
+### ###
+OPVP_DIR=$(CONTRIBSRC)opvp
+OPVP_SRC=$(OPVP_DIR)$(D)
+OPVP_OPT=-DGS_VERSION_MAJOR=$(GS_VERSION_MAJOR)
+
+opvp_=$(GLOBJ)gdevopvp.$(OBJ)
+
+$(GLOBJ)gdevopvp.$(OBJ) : $(OPVP_SRC)gdevopvp.c $(OPVP_SRC)opvp_common.h\
+ $(PDEVH)
+ $(GLCC) $(GLO_)gdevopvp.$(OBJ) $(OPVP_OPT) $(C_) $(OPVP_SRC)gdevopvp.c
+
+$(DD)opvp.dev : $(opvp_) $(DD)page.dev
+ $(SETPDEV) $(DD)opvp $(opvp_)
+
+$(DD)oprp.dev : $(opvp_) $(DD)page.dev
+ $(SETPDEV) $(DD)oprp $(opvp_)
+
+
+### Driver "pcl3" for various PCL-3+ printers #################################
+#
+# Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
+# Germany, e-mail: Martin.Lottermoser at t-online.de.
+#
+# Read the file README in the pcl3 distribution for general installation
+# instructions. If you don't have a distribution, visit
+# http://home.t-online.de/home/Martin.Lottermoser/pcl3.html.
+#
+# If you are including both, hpdj and pcl3, in the compilation, you should
+# disable the rules for pclcomp.$(OBJ) and pagecount.$(OBJ) in the hpdj
+# section. The versions of these files contained in the pcl3 distribution are
+# binary compatible with what hpdj 2.6 expects.
+#
+# You can add compilation options to the variable "pcl3_options" below.
+#
+# NDEBUG
+# Define this to remove certain runtime checks from the code which might
+# then become slightly faster. Don't define this for pcl3 beta releases
+# or ghostscript test releases.
+#
+# PCL3_MEDIA_FILE
+# Define this to be a C string containing the absolute path name of a
+# media configuration file if you want the "unspec" subdevice to use this
+# file instead of its default HP DeskJet 850C/855C/870C/890C media
+# configuration. An example definition for UNIX systems is:
+#
+# pcl3_options=-DPCL3_MEDIA_FILE='"$(gsdatadir)/pcl3.mcf"'
+#
+# A detailed description of the meaning and the syntax of this file can
+# be found in the reference page gs-pcl3(1). Briefly, it tells the
+# driver which media sizes your printer supports and how. You can
+# override this at run time with the option "-sMediaConfigurationFile".
+#
+# The variable "eprn_fs_options" is intended for optimization options used only
+# when compiling eprnfs.c. Choose the combination producing the fastest code.
+# You should leave this variable empty unless (a) you definitely know which
+# options produce the fastest code from eprnfs.c, and (b) ghostscript does not
+# use the same options anyway.
+#
+# You should also look at the section below containing the rules for the *.dev
+# files in order to find out which values you can add to the DEVICE_DEVS*
+# variables in the platform-specific make file. You should always add at least
+# the "pcl3" device but you may add others; the latter are shortcuts to the
+# subdevices of pcl3.
+#
+#
+# Remarks for Microsoft Windows
+# =============================
+# When compiling on Microsoft Windows and unless you are using Cygwin, you must
+# define the preprocessor symbol "EPRN_NO_PAGECOUNTFILE" and either remove the
+# dependency of pcl3 on pagecount.obj or replace pagecount.c with an empty
+# file.
+#
+###############################################################################
+
+# Compilation options
+pcl3_options=
+eprn_fs_options=
+
+# Version of the pcl3 rules: $Revision: 1.29 $.
+
+#==============================================================================
+
+# eprn rules
+# This is the part you need if you are developing another eprn-based driver.
+
+# Complete set of compilation options
+eprn_opts=-DGS_REVISION=$(GS_REVISION) $(pcl3_options)
+
+# Directory with eprn's source code as seen from the gs directory. The name
+# does not include a trailing path separator.
+eprn_dir=$(CONTRIBSRC)pcl3$(D)eprn
+# Same as above but with a separator
+eprn_src=$(eprn_dir)$(D)
+
+# List of all eprn object files
+eprn_=$(GLOBJ)gdeveprn.$(OBJ) $(GLOBJ)pagecount.$(OBJ) \
+ $(GLOBJ)mediasize.$(OBJ) $(GLOBJ)eprnparm.$(OBJ) $(GLOBJ)eprnrend.$(OBJ) \
+ $(GLOBJ)eprnfs.$(OBJ)
+
+# List of eprn headers needed when gdeveprn.h is included:
+eprn_headers=$(eprn_src)mediasize.h $(eprn_src)gdeveprn.h
+
+#------------------------------------------------------------------------------
+
+# Rules for individual files
+
+$(GLOBJ)mediasize.$(OBJ): $(eprn_src)mediasize.c $(eprn_src)mediasize.h
+ $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)mediasize.c
+
+$(GLOBJ)gdeveprn.$(OBJ): $(eprn_src)gdeveprn.c $(eprn_headers) \
+ $(eprn_src)pagecount.h
+ $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)gdeveprn.c
+
+$(GLOBJ)eprnparm.$(OBJ): $(eprn_src)eprnparm.c $(eprn_headers)
+ $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnparm.c
+
+$(GLOBJ)eprnrend.$(OBJ): $(eprn_src)eprnrend.c $(eprn_headers)
+ $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)eprnrend.c
+
+$(GLOBJ)eprnfs.$(OBJ): $(eprn_src)eprnfs.c $(eprn_headers)
+ $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_fs_options) \
+ $(eprn_src)eprnfs.c
+
+# File also used by hpdj:
+$(GLOBJ)pagecount.$(OBJ): $(eprn_src)pagecount.c $(eprn_src)pagecount.h
+ $(GLCC) $(C_) $(O_)$@ $(eprn_opts) $(eprn_src)pagecount.c
+
+#==============================================================================
+
+# pcl3 rules
+
+# Complete set of compilation options
+pcl3_opts=-DGS_REVISION=$(GS_REVISION) -I$(eprn_dir) $(pcl3_options)
+
+# Root directory of pcl3 distribution as seen from the gs directory. The
+# variable includes a trailing path separator.
+pcl3_root=$(CONTRIBSRC)pcl3$(D)
+
+# Directory with pcl3's source code (name includes a trailing path separator)
+pcl3_src=$(pcl3_root)src$(D)
+
+# Headers used by most pcl3 files
+pcl3_headers=$(eprn_headers) \
+ $(pcl3_src)pclgen.h $(pcl3_src)pclcap.h $(pcl3_src)pclsize.h
+
+# List of all object files needed for pcl3
+pcl3_=$(eprn_) $(GLOBJ)gdevpcl3.$(OBJ) $(GLOBJ)pclcap.$(OBJ) \
+ $(GLOBJ)pclgen.$(OBJ) $(GLOBJ)pclcomp.$(OBJ) $(GLOBJ)pclsize.$(OBJ)
+
+#------------------------------------------------------------------------------
+
+# Rules for individual files
+
+$(GLOBJ)pclgen.$(OBJ): $(pcl3_src)pclgen.c $(pcl3_src)pclgen.h
+ $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclgen.c
+
+$(GLOBJ)pclsize.$(OBJ): $(pcl3_src)pclsize.c $(eprn_src)mediasize.h \
+ $(pcl3_src)pclsize.h $(pcl3_src)pclgen.h
+ $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclsize.c
+
+$(GLOBJ)pclcap.$(OBJ): $(pcl3_src)pclcap.c $(pcl3_headers)
+ $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcap.c
+
+$(GLOBJ)gdevpcl3.$(OBJ): $(pcl3_src)gdevpcl3.c $(pcl3_headers)
+ $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)gdevpcl3.c
+
+# File also used by hpdj:
+$(GLOBJ)pclcomp.$(OBJ): $(pcl3_src)pclcomp.c $(pcl3_src)pclgen.h
+ $(GLCC) $(C_) $(O_)$@ $(pcl3_opts) $(pcl3_src)pclcomp.c
+
+#------------------------------------------------------------------------------
+
+# Device rules. The targets here (e.g., "$(DD)pcl3.dev") are the values you
+# can add to the DEVICE_DEVS* variables in the platform-specific make file.
+
+# The generic pcl3 device with selectable subdevices
+$(DD)pcl3.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)pcl3 $(pcl3_)
+
+# Fixed devices for specific printers
+$(DD)hpdjplus.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdjplus $(pcl3_)
+$(DD)hpdjportable.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdjportable $(pcl3_)
+$(DD)hpdj310.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj310 $(pcl3_)
+$(DD)hpdj320.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj320 $(pcl3_)
+$(DD)hpdj340.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj340 $(pcl3_)
+$(DD)hpdj400.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj400 $(pcl3_)
+$(DD)hpdj500.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj500 $(pcl3_)
+$(DD)hpdj500c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj500c $(pcl3_)
+$(DD)hpdj510.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj510 $(pcl3_)
+$(DD)hpdj520.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj520 $(pcl3_)
+$(DD)hpdj540.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj540 $(pcl3_)
+$(DD)hpdj550c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj550c $(pcl3_)
+$(DD)hpdj560c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj560c $(pcl3_)
+$(DD)hpdj600.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj600 $(pcl3_)
+$(DD)hpdj660c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj660c $(pcl3_)
+$(DD)hpdj670c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj670c $(pcl3_)
+$(DD)hpdj680c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj680c $(pcl3_)
+$(DD)hpdj690c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj690c $(pcl3_)
+$(DD)hpdj850c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj850c $(pcl3_)
+$(DD)hpdj855c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj855c $(pcl3_)
+$(DD)hpdj870c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj870c $(pcl3_)
+$(DD)hpdj890c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj890c $(pcl3_)
+$(DD)hpdj1120c.dev: $(pcl3_) $(DD)page.dev
+ $(SETPDEV) $(DD)hpdj1120c $(pcl3_)
+
+#------------------------------------------------------------------------------
+
+# The pcl3opts command.
+# This is deliberately not included in the normal compilation because (a) the
+# rule is unlikely to work and (b) the code is unlikely to compile on any but
+# UNIX systems.
+
+pcl3opts: $(BINDIR)$(D)pcl3opts$(XE)
+pcl3opts_=$(pcl3_src)pcl3opts.c $(pcl3_src)pclscan.c $(eprn_src)mediasize.c \
+ $(pcl3_src)pclsize.c
+
+$(BINDIR)$(D)pcl3opts$(XE): $(pcl3opts_)
+ $(CC_) -o $@ -I$(eprn_src) $(pcl3opts_)
+ gencat $(GLOBJ)pcl3opts-en.cat $(pcl3_src)pcl3opts-en.msg
+ #gencat $(GLOBJ)pcl3opts-de.cat $(pcl3_src)pcl3opts-de.msg
+
+#------------------------------------------------------------------------------
+
+# Installation rules (work only for UNIX). Note that the PostScript examples
+# and the PPD files are not copied.
+pcl3-install:
+ for f in gs-pcl3 pcl3opts; do \
+ $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.1 $(install_prefix)$(man1dir)/$$f.$(man1ext) \
+ || exit 1; \
+ $(INSTALL_DATA) $(pcl3_root)doc$(D)$$f.html $(install_prefix)$(docdir) || exit 1; done
+ $(INSTALL_PROGRAM) $(BINDIR)$(D)pcl3opts$(XE) $(install_prefix)$(bindir)
+
+
+### ----------------- The Xerox XES printer device --------------------- ###
+
+xes_=$(GLOBJ)gdevxes.$(OBJ)
+$(DD)xes.dev : $(xes_) $(DD)page.dev
+ $(SETPDEV) $(DD)xes $(xes_)
+
+# Author: Peter Flass (flass at lbdrscs.bitnet)
+# Printer: Xerox XES (2700, 3700, 4045, etc.)
+$(GLOBJ)gdevxes.$(OBJ) : $(CONTRIBSRC)gdevxes.c $(PDEVH)
+ $(GLCC) $(GLO_)gdevxes.$(OBJ) $(C_) $(CONTRIBSRC)gdevxes.c
+
+#########################################################################
+### --------------------Japanese printer addons --------------------- ###
+#########################################################################
+
+JAPDIR=$(CONTRIBSRC)japanese
+JAPSRC=$(JAPDIR)$(D)
+
+### ----------------- The NEC PC-PR201 printer device ----------------- ###
+
+pr201_=$(GLOBJ)gdevp201.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
+
+$(DD)pr201.dev: $(pr201_)
+ $(SETPDEV) $(DD)pr201 $(pr201_)
+
+$(DD)pr150.dev: $(pr201_)
+ $(SETPDEV) $(DD)pr150 $(pr201_)
+
+$(DD)pr1000.dev: $(pr201_)
+ $(SETPDEV) $(DD)pr1000 $(pr201_)
+
+$(DD)pr1000_4.dev: $(pr201_)
+ $(SETPDEV) $(DD)pr1000_4 $(pr201_)
+
+$(GLO_)gdevp201.$(OBJ): $(JAPSRC)gdevp201.c $(PDEVH)
+ $(GLCC) $(GLO_)gdevp201.$(OBJ) $(C_) $(JAPSRC)gdevp201.c
+
+### ----------------- The Star JJ-100 printer device ----------------- ###
+
+jj100_=$(GLOBJ)gdevj100.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
+
+$(DD)jj100.dev: $(jj100_)
+ $(SETPDEV) $(DD)jj100 $(jj100_)
+
+$(GLOBJ)gdevj100.$(OBJ): $(JAPSRC)gdevj100.c $(PDEVH)
+ $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevj100.c
+
+### ----------------- The Canon BubbleJet BJ10v device ----------------- ###
+
+bj10v_=$(GLOBJ)gdev10v.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
+
+$(DD)bj10v.dev: $(bj10v_)
+ $(SETPDEV) $(DD)bj10v $(bj10v_)
+
+$(DD)bj10vh.dev: $(bj10v_)
+ $(SETPDEV) $(DD)bj10vh $(bj10v_)
+
+# Uncomment the following line if you are using MS-DOS on PC9801 series.
+
+$(GLOBJ)gdev10v.$(OBJ): $(JAPSRC)gdev10v.c $(PDEVH)
+ $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdev10v.c
+# $(GLCC) -DPC9801 $(O_)$@ $(C_) $(JAPSRC)gdev10v.c
+
+
+### ------------------------- MAG file formats ------------------------- ###
+
+maguro_=$(GLOBJ)gdevmag.$(OBJ) $(GLOBJ)gdevpccm.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
+$(GLOBJ)gdevmag.$(OBJ): $(JAPSRC)gdevmag.c $(PDEVH)
+ $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevmag.c
+
+$(DD)mag16.dev: $(maguro_)
+ $(SETDEV) $(DD)mag16 $(maguro_)
+
+$(DD)mag256.dev: $(maguro_)
+ $(SETDEV) $(DD)mag256 $(maguro_)
+
+### ---------------- Dot matrix printer device ---------------- ###
+dmprt_=$(GLOBJ)gdevdmpr.$(OBJ) $(GLOBJ)dviprlib.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
+
+$(DD)dmprt.dev: $(dmprt_) $(DD)page.dev
+ $(SETDEV) $(DD)dmprt $(dmprt_)
+ $(ADDMOD) $(DD)dmprt -ps dmp_init
+
+$(GLOBJ)gdevdmpr.$(OBJ): $(JAPSRC)gdevdmpr.c $(JAPSRC)dviprlib.h $(PDEVH)
+ $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevdmpr.c
+
+$(GLOBJ)dviprlib.$(OBJ): $(JAPSRC)dviprlib.c $(JAPSRC)dviprlib.h
+ $(GLCC) $(O_)$@ $(C_) $(JAPSRC)dviprlib.c
+
+extra-dmprt-install:
+ $(INSTALL_DATA) $(JAPSRC)dmp_init.ps $(install_prefix)$(gsdatadir)$(D)lib || exit 1
+ $(INSTALL_DATA) $(JAPSRC)dmp_site.ps $(install_prefix)$(gsdatadir)$(D)lib || exit 1
+ $(INSTALL_DATA) $(JAPSRC)escp_24.src $(install_prefix)$(gsdatadir)$(D)lib || exit 1
+
+
+
+##
+## EPSON MachJet driver
+##
+
+mj700v2c_=$(GLOBJ)gdevmjc.$(OBJ) $(HPPCL)
+
+$(GLOBJ)gdevmjc.$(OBJ): $(JAPSRC)gdevmjc.c $(JAPSRC)gdevmjc.h $(PDEVH) $(gdevpcl_h)
+ $(GLCC) -DA4 $(GLO_)gdevmjc.$(OBJ) $(C_) $(JAPSRC)gdevmjc.c
+
+$(DD)mj700v2c.dev: $(mj700v2c_) $(DD)page.dev
+ $(SETPDEV) $(DD)mj700v2c $(mj700v2c_)
+
+$(DD)mj500c.dev: $(mj700v2c_) $(DD)page.dev
+ $(SETPDEV) $(DD)mj500c $(mj700v2c_)
+
+$(DD)mj6000c.dev: $(mj700v2c_) $(DD)page.dev
+ $(SETPDEV) $(DD)mj6000c $(mj700v2c_)
+
+$(DD)mj8000c.dev: $(mj700v2c_) $(DD)page.dev
+ $(SETPDEV) $(DD)mj8000c $(mj700v2c_)
+
+### ----------------- The Fujitsu FMPR printer device ----------------- ###
+
+fmpr_=$(GLOBJ)gdevfmpr.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
+
+$(DD)fmpr.dev: $(fmpr_) $(DD)page.dev
+ $(SETPDEV) $(DD)fmpr $(fmpr_)
+
+$(GLOBJ)gdevfmpr.$(OBJ): $(JAPSRC)gdevfmpr.c $(PDEVH)
+ $(GLCC) $(GLO_)gdevfmpr.$(OBJ) $(C_) $(JAPSRC)gdevfmpr.c
+
+### --------------- The Fujitsu FMLBP-2xx printer device --------------- ###
+
+fmlbp_=$(GLOBJ)gdevfmlbp.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
+
+$(DD)fmlbp.dev: $(fmlbp_) $(DD)page.dev
+ $(SETPDEV) $(DD)fmlbp $(fmlbp_)
+
+$(GLOBJ)gdevfmlbp.$(OBJ): $(JAPSRC)gdevfmlbp.c $(PDEVH)
+ $(GLCC) -DFMLBP_NOADJUST_MARGIN $(O_)$@ $(C_) $(JAPSRC)gdevfmlbp.c
+
+### ------ The OKI MICROLINE620CL (IPL) printer device ------- ###
+#
+# by N.Tagawa
+#
+# $Id: gdevml6.mak,v 1.2 1998/03/16 13:32:33 tagawa Exp $
+#
+
+ml6_=$(GLOBJ)gdevml6.$(OBJ) $(GLOBJ)gdevprn.$(OBJ)
+
+$(DD)ml600.dev: $(ml6_) $(DD)page.dev
+ $(SETPDEV) $(DD)ml600 $(ml6_)
+
+$(GLOBJ)gdevml6.$(OBJ): $(JAPSRC)gdevml6.c $(PDEVH)
+ $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevml6.c
+
+
+#----------------------------------------------------------------------#
+
+lbp3x0_=$(GLOBJ)gdevlbp3.$(OBJ)
+
+$(DD)lbp310.dev:$(lbp3x0_) $(DD)page.dev
+ $(SETPDEV) $(DD)lbp310 $(lbp3x0_)
+
+$(DD)lbp320.dev:$(lbp3x0_) $(DD)page.dev
+ $(SETPDEV) $(DD)lbp320 $(lbp3x0_)
+
+$(GLOBJ)gdevlbp3.$(OBJ): $(JAPSRC)gdevlbp3.c $(PDEVH)
+ $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevlbp3.c
+
+### --- The NEC NPDL language printer device ------ ###
+
+npdl_=$(GLOBJ)gdevnpdl.$(OBJ) $(GLOBJ)gdevlprn.$(OBJ)
+
+$(GLOBJ)gdevnpdl.$(OBJ): $(JAPSRC)gdevnpdl.c $(LIPS_SRC)gdevlprn.h $(PDEVH)
+ $(GLCC) -DA4 $(GLO_)gdevnpdl.$(OBJ) $(LIPS_OPT) $(C_) $(JAPSRC)gdevnpdl.c
+
+$(DD)npdl.dev: $(npdl_) $(DD)page.dev
+ $(SETPDEV) $(DD)npdl $(npdl_)
+
+### ------- EPSON ESC/Page printer device ----------------- ###
+
+escpage_=$(GLOBJ)gdevespg.$(OBJ) $(GLOBJ)gdevlprn.$(OBJ) $(GLOBJ)gdevlips.$(OBJ)
+
+$(GLOBJ)gdevespg.$(OBJ): $(JAPSRC)gdevespg.c $(LIPS_SRC)gdevlprn.h $(PDEVH)
+ $(GLCC) -DA4 $(GLO_)gdevespg.$(OBJ) $(LIPS_OPT) $(C_) $(JAPSRC)gdevespg.c
+
+$(DD)escpage.dev: $(escpage_) $(DD)page.dev
+ $(SETPDEV) $(DD)escpage $(escpage_)
+
+$(DD)lp2000.dev: $(escpage_) $(DD)page.dev
+ $(SETPDEV) $(DD)lp2000 $(escpage_)
+
+### --- The RICOH RPDL language printer device ------ ###
+
+rpdl_=$(GLOBJ)gdevrpdl.$(OBJ) $(GLOBJ)gdevlprn.$(OBJ)
+$(GLOBJ)gdevrpdl.$(OBJ): $(JAPSRC)gdevrpdl.c $(LIPS_SRC)gdevlprn.h $(PDEVH)
+ $(GLCC) $(GLO_)gdevrpdl.$(OBJ) $(LIPS_OPT) $(C_) $(JAPSRC)gdevrpdl.c
+
+$(DD)rpdl.dev: $(rpdl_) $(DD)page.dev
+ $(SETPDEV) $(DD)rpdl $(rpdl_)
+
+### ---------- RICOH RPDL IV(600dpi) printer devices ---------- ###
+#rpdl_=$(GLOBJ)gdevrpdl.$(OBJ)
+#$(GLOBJ)gdevrpdl.$(OBJ) : $(JAPSRC)gdevrpdl.c
+# $(GLCC) $(GLO_)gdevrpdl.$(OBJ) $(C_) $(JAPSRC)gdevrpdl.c
+#
+#$(DD)nx100f.dev: $(rpdl_) $(DD)page.dev
+# $(SETPDEV2) $(DD)nx100f $(rpdl_)
+#
+#$(DD)nx100v.dev: $(rpdl_) $(DD)page.dev
+# $(SETPDEV2) $(DD)nx100v $(rpdl_)
+
+### ------------ The ALPS Micro Dry printer devices ------------ ###
+
+alps_=$(GLOBJ)gdevalps.$(OBJ)
+
+$(DD)md50Mono.dev: $(alps_) $(DD)page.dev
+ $(SETPDEV) $(DD)md50Mono $(alps_)
+
+$(DD)md50Eco.dev: $(alps_) $(DD)page.dev
+ $(SETPDEV) $(DD)md50Eco $(alps_)
+
+$(DD)md1xMono.dev: $(alps_) $(DD)page.dev
+ $(SETPDEV) $(DD)md1xMono $(alps_)
+
+$(GLOBJ)gdevalps.$(OBJ): $(JAPSRC)gdevalps.c $(PDEVH)
+ $(GLCC) $(O_)$@ $(C_) $(JAPSRC)gdevalps.c
+
+#########################################################################
+#########################################################################
+
+### ----------------- Additional .upp files ---------------- ###
+
+extra-upp-install:
+ for f in $(CONTRIBSRC)uniprint$(D)*.upp; do \
+ $(INSTALL_DATA) $$f $(install_prefix)$(gsdatadir)$(D)lib || exit 1; \
+ done
+
+### ------------ Build/Install special features ------------ ###
+
+install-contrib-extras: extra-dmprt-install extra-upp-install
Added: trunk/gs/contrib/cups/cups.mak
===================================================================
--- trunk/gs/contrib/cups/cups.mak 2007-05-08 16:33:45 UTC (rev 7911)
+++ trunk/gs/contrib/cups/cups.mak 2007-05-08 16:52:11 UTC (rev 7912)
@@ -0,0 +1,53 @@
+#
+# "$Id: cups.mak,v 1.1.2.4 2003/07/20 22:54:43 mike Exp $"
+#
+# CUPS driver makefile for Ghostscript.
+#
+# Copyright 2001-2005 by Easy Software Products.
+#
+# 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.
+#
+
+### ----------------- CUPS Ghostscript Driver ---------------------- ###
+
+cups_= $(GLOBJ)gdevcups.$(OBJ)
+
+CUPSSERVER= $(install_prefix)`cups-config --serverbin`
+CUPSCONFIG= $(install_prefix)`cups-config --serverroot`
+CUPSDATA= $(install_prefix)`cups-config --datadir`
+
+$(DD)cups.dev: $(cups_) $(GLD)page.dev
+ $(ADDMOD) $(DD)cups -lib cupsimage -lib cups
+ $(SETPDEV2) $(DD)cups $(cups_)
+
+$(GLOBJ)gdevcups.$(OBJ): contrib/cups/gdevcups.c $(PDEVH)
+ $(GLCC) $(GLO_)gdevcups.$(OBJ) $(C_) contrib/cups/gdevcups.c
+
+install: install-cups
+
+install-cups:
+ -mkdir -p $(CUPSSERVER)/filter
+ $(INSTALL_PROGRAM) contrib/cups/pstoraster $(CUPSSERVER)/filter
+ $(INSTALL_PROGRAM) contrib/cups/pstopxl $(CUPSSERVER)/filter
+ -mkdir -p $(CUPSCONFIG)
+ $(INSTALL_DATA) contrib/cups/pstoraster.convs $(CUPSCONFIG)
+ -mkdir -p $(CUPSDATA)/model
+ $(INSTALL_DATA) contrib/cups/pxlcolor.ppd $(CUPSDATA)/model
+ $(INSTALL_DATA) contrib/cups/pxlmono.ppd $(CUPSDATA)/model
+
+
+#
+# End of "$Id: cups.mak,v 1.1.2.4 2003/07/20 22:54:43 mike Exp $".
+#
Added: trunk/gs/contrib/cups/gdevcups.c
===================================================================
--- trunk/gs/contrib/cups/gdevcups.c 2007-05-08 16:33:45 UTC (rev 7911)
+++ trunk/gs/contrib/cups/gdevcups.c 2007-05-08 16:52:11 UTC (rev 7912)
@@ -0,0 +1,4726 @@
+/*
+ * "$Id: gdevcups.c,v 1.43.2.23 2004/06/29 13:15:10 mike Exp $"
+ *
+ * GNU Ghostscript raster output driver for the Common UNIX Printing
+ * System (CUPS).
+ *
+ * Copyright 1993-2006 by Easy Software Products.
+ *
+ * These coded instructions, statements, and computer programs are the
+ * property of Easy Software Products and are protected by Federal
+ * copyright law. Distribution and use rights are outlined in the file
+ * "LICENSE.txt" which should have been included with this file. If this
+ * file is missing or damaged please contact Easy Software Products
+ * at:
+ *
+ * Attn: CUPS Licensing Information
+ * Easy Software Products
+ * 44141 Airport View Drive, Suite 204
+ * Hollywood, Maryland 20636 USA
+ *
+ * Voice: (301) 373-9600
+ * EMail: cups-info at cups.org
+ * WWW: http://www.cups.org/
+ *
+ * This code and any derivative of it may be used and distributed
+ * freely under the terms of the GNU General Public License when
+ * used with GNU Ghostscript or its derivatives. Use of the code
+ * (or any derivative of it) with software other than GNU
+ * GhostScript (or its derivatives) is governed by the CUPS license
+ * agreement.
+ *
+ * Contents:
+ *
+ * cups_close() - Close the output file.
+ * cups_decode_color() - Decode a color value.
+ * cups_encode_color() - Encode a color value.
+ * cups_get_color_mapping_procs()
+ * - Get the list of color mapping procedures.
+ * cups_get_matrix() - Generate the default page matrix.
+ * cups_get_params() - Get pagedevice parameters.
+ * cups_get_space_params() - Get space parameters from the RIP_CACHE env var.
+ * cups_map_cielab() - Map CIE Lab transformation...
+ * cups_map_cmyk() - Map a CMYK color value to device colors.
+ * cups_map_gray() - Map a grayscale value to device colors.
+ * cups_map_rgb() - Map a RGB color value to device colors.
+ * cups_map_cmyk_color() - Map a CMYK color to a color index.
+ * cups_map_color_rgb() - Map a color index to an RGB color.
+ * cups_map_rgb_color() - Map an RGB color to a color index. We map the
+ * RGB color to the output colorspace & bits (we
+ * figure out the format when we output a page).
+ * cups_open() - Open the output file and initialize things.
+ * cups_print_pages() - Send one or more pages to the output file.
+ * cups_put_params() - Set pagedevice parameters.
+ * cups_set_color_info() - Set the color information structure based on
+ * the required output.
+ * cups_sync_output() - Keep the user informed of our status...
+ * cups_print_chunked() - Print a page of chunked pixels.
+ * cups_print_banded() - Print a page of banded pixels.
+ * cups_print_planar() - Print a page of planar pixels.
+ */
+
+/*
+ * Include necessary headers...
+ */
+
+#include "std.h" /* to stop stdlib.h redefining types */
+#include "gdevprn.h"
+#include "gsparam.h"
+#include "gsexit.h"
+#include "arch.h"
+
+#include <stdlib.h>
+#include <ctype.h>
+#include <cups/raster.h>
+#include <cups/ppd.h>
+#include <math.h>
+
+#undef private
+#define private
+
+
+/*
+ * Check if we are compiling against CUPS 1.2. If so, enable
+ * certain extended attributes and use a different page header
+ * structure and write function...
+ */
+
+#ifdef CUPS_RASTER_SYNCv1
+# define cups_page_header_t cups_page_header2_t
+# define cupsRasterWriteHeader cupsRasterWriteHeader2
+#else
+/* The RGBW colorspace is not defined until CUPS 1.2... */
+# define CUPS_CSPACE_RGBW 17
+#endif /* CUPS_RASTER_SYNCv1 */
+
+
+/*
+ * Newer versions of Ghostscript don't provide gs_exit() function anymore.
+ * It has been renamed to gs_to_exit()...
+ */
+
+#ifdef dev_t_proc_encode_color
+# define gs_exit gs_to_exit
+#endif /* dev_t_proc_encode_color */
+
+
+/*
+ * CIE XYZ color constants...
+ */
+
+#define D65_X (0.412453 + 0.357580 + 0.180423)
+#define D65_Y (0.212671 + 0.715160 + 0.072169)
+#define D65_Z (0.019334 + 0.119193 + 0.950227)
+
+
+/*
+ * Size of a tile in pixels...
+ */
+
+#define CUPS_TILE_SIZE 256
+
+
+/*
+ * Size of profile LUTs...
+ */
+
+#ifdef dev_t_proc_encode_color
+# define CUPS_MAX_VALUE frac_1
+#else
+# define CUPS_MAX_VALUE gx_max_color_value
+#endif /* dev_t_proc_encode_color */
+
+
+/*
+ * Macros...
+ */
+
+#define x_dpi (pdev->HWResolution[0])
+#define y_dpi (pdev->HWResolution[1])
+#define cups ((gx_device_cups *)pdev)
+
+/*
+ * Macros from <macros.h>; we can't include <macros.h> because it also
+ * defines DEBUG, one of our flags to insert various debugging code.
+ */
+
+#ifndef max
+# define max(a,b) ((a)<(b) ? (b) : (a))
+#endif /* !max */
+
+#ifndef min
+# define min(a,b) ((a)>(b) ? (b) : (a))
+#endif /* !min */
+
+#ifndef abs
+# define abs(x) ((x)>=0 ? (x) : -(x))
+#endif /* !abs */
+
+
+/*
+ * Procedures
+ */
+
+private dev_proc_close_device(cups_close);
+private dev_proc_get_initial_matrix(cups_get_matrix);
+private int cups_get_params(gx_device *, gs_param_list *);
+private dev_proc_open_device(cups_open);
+private int cups_print_pages(gx_device_printer *, FILE *, int);
+private int cups_put_params(gx_device *, gs_param_list *);
+private void cups_set_color_info(gx_device *);
+private dev_proc_sync_output(cups_sync_output);
+private prn_dev_proc_get_space_params(cups_get_space_params);
+
+#ifdef dev_t_proc_encode_color
+private cm_map_proc_gray(cups_map_gray);
+private cm_map_proc_rgb(cups_map_rgb);
+private cm_map_proc_cmyk(cups_map_cmyk);
+private dev_proc_decode_color(cups_decode_color);
+private dev_proc_encode_color(cups_encode_color);
+private dev_proc_get_color_mapping_procs(cups_get_color_mapping_procs);
+
+static const gx_cm_color_map_procs cups_color_mapping_procs =
+{
+ cups_map_gray,
+ cups_map_rgb,
+ cups_map_cmyk
+};
+#else
+private dev_proc_map_cmyk_color(cups_map_cmyk_color);
+private dev_proc_map_color_rgb(cups_map_color_rgb);
+private dev_proc_map_rgb_color(cups_map_rgb_color);
+#endif /* dev_t_proc_encode_color */
+
+
+/*
+ * The device descriptors...
+ */
+
+typedef struct gx_device_cups_s
+{
+ gx_device_common; /* Standard GhostScript device stuff */
+ gx_prn_device_common; /* Standard printer device stuff */
+ int page; /* Page number */
+ cups_raster_t *stream; /* Raster stream */
+ cups_page_header_t header; /* PostScript page device info */
+ int landscape; /* Non-zero if this is landscape */
+} gx_device_cups;
+
+private gx_device_procs cups_procs =
+{
+ cups_open,
+ cups_get_matrix,
+ cups_sync_output,
+ gdev_prn_output_page,
+ cups_close,
+#ifdef dev_t_proc_encode_color
+ NULL, /* map_rgb_color */
+ NULL, /* map_color_rgb */
+#else
+ cups_map_rgb_color,
+ cups_map_color_rgb,
+#endif /* dev_t_proc_encode_color */
+ NULL, /* fill_rectangle */
+ NULL, /* tile_rectangle */
+ NULL, /* copy_mono */
+ NULL, /* copy_color */
+ NULL, /* draw_line */
+ gx_default_get_bits,
+ cups_get_params,
+ cups_put_params,
+#ifdef dev_t_proc_encode_color
+ NULL, /* map_cmyk_color */
+#else
+ cups_map_cmyk_color,
+#endif /* dev_t_proc_encode_color */
+ NULL, /* get_xfont_procs */
+ NULL, /* get_xfont_device */
+ NULL, /* map_rgb_alpha_color */
+ gx_page_device_get_page_device,
+ NULL, /* get_alpha_bits */
+ NULL, /* copy_alpha */
+ NULL, /* get_band */
+ NULL, /* copy_rop */
+ NULL, /* fill_path */
+ NULL, /* stroke_path */
+ NULL, /* fill_mask */
+ NULL, /* fill_trapezoid */
+ NULL, /* fill_parallelogram */
+ NULL, /* fill_triangle */
+ NULL, /* draw_thin_line */
+ NULL, /* begin_image */
+ NULL, /* image_data */
+ NULL, /* end_image */
+ NULL, /* strip_tile_rectangle */
+ NULL /* strip_copy_rop */
+#ifdef dev_t_proc_encode_color
+ ,
+ NULL, /* get_clipping_box */
+ NULL, /* begin_typed_image */
+ NULL, /* get_bits_rectangle */
+ NULL, /* map_color_rgb_alpha */
+ NULL, /* create_compositor */
+ NULL, /* get_hardware_params */
+ NULL, /* text_begin */
+ NULL, /* finish_copydevice */
+ NULL, /* begin_transparency_group */
+ NULL, /* end_transparency_group */
+ NULL, /* begin_transparency_mask */
+ NULL, /* end_transparency_mask */
+ NULL, /* discard_transparency_layer */
+ cups_get_color_mapping_procs,
+ NULL, /* get_color_comp_index */
+ cups_encode_color,
+ cups_decode_color
+#endif /* dev_t_proc_encode_color */
+};
+
+#define prn_device_body_copies(dtype, procs, dname, w10, h10, xdpi, ydpi, lo, to, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_pages)\
+ std_device_full_body_type(dtype, &procs, dname, &st_device_printer,\
+ (int)((long)(w10) * (xdpi) / 10),\
+ (int)((long)(h10) * (ydpi) / 10),\
+ xdpi, ydpi,\
+ ncomp, depth, mg, mc, dg, dc,\
+ -(lo) * (xdpi), -(to) * (ydpi),\
+ (lm) * 72.0, (bm) * 72.0,\
+ (rm) * 72.0, (tm) * 72.0\
+ ),\
+ prn_device_body_copies_rest_(print_pages)
+
+gx_device_cups gs_cups_device =
+{
+ prn_device_body_copies(gx_device_cups,/* type */
+ cups_procs, /* procedures */
+ "cups", /* device name */
+ 85, /* initial width */
+ 110, /* initial height */
+ 100, /* initial x resolution */
+ 100, /* initial y resolution */
+ 0, /* initial left offset */
+ 0, /* initial top offset */
+ 0, /* initial left margin */
+ 0, /* initial bottom margin */
+ 0, /* initial right margin */
+ 0, /* initial top margin */
+ 1, /* number of color components */
+ 1, /* number of color bits */
+ 1, /* maximum gray value */
+ 0, /* maximum color value */
+ 2, /* number of gray values */
+ 0, /* number of color values */
+ cups_print_pages),
+ /* print procedure */
+ 0, /* page */
+ NULL, /* stream */
+ { /* header */
+ "", /* MediaClass */
+ "", /* MediaColor */
+ "", /* MediaType */
+ "", /* OutputType */
+ 0, /* AdvanceDistance */
+ CUPS_ADVANCE_NONE, /* AdvanceMedia */
+ CUPS_FALSE, /* Collate */
+ CUPS_CUT_NONE, /* CutMedia */
+ CUPS_FALSE, /* Duplex */
+ { 100, 100 }, /* HWResolution */
+ { 0, 0, 612, 792 }, /* ImagingBoundingBox */
+ CUPS_FALSE, /* InsertSheet */
+ CUPS_JOG_NONE, /* Jog */
+ CUPS_EDGE_TOP, /* LeadingEdge */
+ { 0, 0 }, /* Margins */
+ CUPS_FALSE, /* ManualFeed */
+ 0, /* MediaPosition */
+ 0, /* MediaWeight */
+ CUPS_FALSE, /* MirrorPrint */
+ CUPS_FALSE, /* NegativePrint */
+ 1, /* NumCopies */
+ CUPS_ORIENT_0, /* Orientation */
+ CUPS_FALSE, /* OutputFaceUp */
+ { 612, 792 }, /* PageSize */
+ CUPS_FALSE, /* Separations */
+ CUPS_FALSE, /* TraySwitch */
+ CUPS_FALSE, /* Tumble */
+ 850, /* cupsWidth */
+ 1100, /* cupsHeight */
+ 0, /* cupsMediaType */
+ 1, /* cupsBitsPerColor */
+ 1, /* cupsBitsPerPixel */
+ 107, /* cupsBytesPerLine */
+ CUPS_ORDER_CHUNKED, /* cupsColorOrder */
+ CUPS_CSPACE_K, /* cupsColorSpace */
+ 0, /* cupsCompression */
+ 0, /* cupsRowCount */
+ 0, /* cupsRowFeed */
+ 0 /* cupsRowStep */
+ }
+};
+
+/*
+ * Globals...
+ */
+
+#ifdef GX_COLOR_INDEX_TYPE
+static gx_color_value cupsDecodeLUT[65536];
+ /* Output color to RGB value LUT */
+#else
+static gx_color_value cupsDecodeLUT[256];
+ /* Output color to RGB value LUT */
+#endif /* GX_COLOR_INDEX_TYPE */
+static unsigned short cupsEncodeLUT[gx_max_color_value + 1];
+ /* RGB value to output color LUT */
+
+static ppd_file_t *cupsPPD = 0; /* PPD file for this device */
+static char *cupsProfile = NULL;
+ /* Current simple color profile string */
+static int cupsHaveProfile = 0;
+ /* Has a color profile been defined? */
+static int cupsMatrix[3][3][CUPS_MAX_VALUE + 1];
+ /* Color transform matrix LUT */
+static int cupsDensity[CUPS_MAX_VALUE + 1];
+ /* Density LUT */
+static unsigned char cupsRevLower1[16] =
+ { /* Lower 1-bit reversal table */
+ 0x00, 0x08, 0x04, 0x0c, 0x02, 0x0a, 0x06, 0x0e,
+ 0x01, 0x09, 0x05, 0x0d, 0x03, 0x0b, 0x07, 0x0f
+ },
+ cupsRevUpper1[16] =
+ { /* Upper 1-bit reversal table */
+ 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
+ 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0
+ },
+ cupsRevLower2[16] =
+ { /* Lower 2-bit reversal table */
+ 0x00, 0x04, 0x08, 0x0c, 0x01, 0x05, 0x09, 0x0d,
+ 0x02, 0x06, 0x0a, 0x0e, 0x03, 0x07, 0x0b, 0x0f
+ },
+ cupsRevUpper2[16] =
+ { /* Upper 2-bit reversal table */
+ 0x00, 0x40, 0x80, 0xc0, 0x10, 0x50, 0x90, 0xd0,
+ 0x20, 0x60, 0xa0, 0xe0, 0x30, 0x70, 0xb0, 0xf0
+ };
+
+
+/*
+ * Local functions...
+ */
+
+static double cups_map_cielab(double, double);
+static void cups_print_chunked(gx_device_printer *, unsigned char *,
+ unsigned char *, int);
+static void cups_print_banded(gx_device_printer *, unsigned char *,
+ unsigned char *, int);
+static void cups_print_planar(gx_device_printer *, unsigned char *,
+ unsigned char *, int);
+
+/*static void cups_set_margins(gx_device *);*/
+
+
+/*
+ * 'cups_close()' - Close the output file.
+ */
+
+private int
+cups_close(gx_device *pdev) /* I - Device info */
+{
+ fprintf(stderr, "DEBUG2: cups_close(%p)\n", pdev);
+
+ if (cups->stream != NULL)
+ {
+ cupsRasterClose(cups->stream);
+ cups->stream = NULL;
+ }
+
+#if 0 /* Can't do this here because put_params() might close the device */
+ if (cupsPPD != NULL)
+ {
+ ppdClose(cupsPPD);
+ cupsPPD = NULL;
+ }
+
+ if (cupsProfile != NULL)
+ {
+ free(cupsProfile);
+ cupsProfile = NULL;
+ }
+#endif /* 0 */
+
+ return (gdev_prn_close(pdev));
+}
+
+
+#ifdef dev_t_proc_encode_color
+/*
+ * 'cups_decode_color()' - Decode a color value.
+ */
+
+private int /* O - Status (0 = OK) */
+cups_decode_color(gx_device *pdev, /* I - Device info */
+ gx_color_index ci, /* I - Color index */
+ gx_color_value *cv) /* O - Colors */
+{
+ int i; /* Looping var */
+ int shift; /* Bits to shift */
+ int mask; /* Bits to mask */
+
+
+ if (cups->header.cupsColorSpace == CUPS_CSPACE_KCMYcm &&
+ cups->header.cupsBitsPerColor == 1)
+ {
+ /*
+ * KCMYcm data is represented internally by Ghostscript as CMYK...
+ */
+
+ cv[0] = (ci & 0x20) ? frac_1 : frac_0;
+ cv[1] = (ci & 0x12) ? frac_1 : frac_0;
+ cv[2] = (ci & 0x09) ? frac_1 : frac_0;
+ cv[3] = (ci & 0x04) ? frac_1 : frac_0;
+ }
+ else
+ {
+ shift = cups->header.cupsBitsPerColor;
+ mask = (1 << shift) - 1;
+
+ for (i = cups->color_info.num_components - 1; i > 0; i --, ci >>= shift)
+ cv[i] = cupsDecodeLUT[ci & mask];
+
+ cv[0] = cupsDecodeLUT[ci & mask];
+ }
+
+ return (0);
+}
+
+
+/*
+ * 'cups_encode_color()' - Encode a color value.
+ */
+
+private gx_color_index /* O - Color index */
+cups_encode_color(gx_device *pdev,
+ /* I - Device info */
+ const gx_color_value *cv)
+ /* I - Colors */
+{
+ int i; /* Looping var */
+ gx_color_index ci; /* Color index */
+ int shift; /* Bits to shift */
+
+
+ /*
+ * Encode the color index...
+ */
+
+ shift = cups->header.cupsBitsPerColor;
+
+ for (ci = cupsEncodeLUT[cv[0]], i = 1;
+ i < cups->color_info.num_components;
+ i ++)
+ ci = (ci << shift) | cupsEncodeLUT[cv[i]];
+
+#ifdef DEBUG
+ fprintf(stderr, "DEBUG2: cv[0]=%d -> %llx\n", cv[0], ci);
+#endif /* DEBUG */
+
+ /*
+ * Handle 6-color output...
+ */
+
+ if (cups->header.cupsColorSpace == CUPS_CSPACE_KCMYcm &&
+ cups->header.cupsBitsPerColor == 1)
+ {
+ /*
+ * Welcome to hackville, where we map CMYK data to the
+ * light inks in draft mode... Map blue to light magenta and
+ * cyan and green to light cyan and yellow...
+ */
+
+ ci <<= 2; /* Leave room for light inks */
+
+ if (ci == 0x18) /* Blue */
+ ci = 0x11; /* == cyan + light magenta */
+ else if (ci == 0x14) /* Green */
+ ci = 0x06; /* == light cyan + yellow */
+ }
+
+ /*
+ * Range check the return value...
+ */
+
+ if (ci == gx_no_color_index)
+ ci --;
+
+ /*
+ * Return the color index...
+ */
+
+ return (ci);
+}
+
+
+/*
+ * 'cups_get_color_mapping_procs()' - Get the list of color mapping procedures.
+ */
+
+private const gx_cm_color_map_procs * /* O - List of device procedures */
+cups_get_color_mapping_procs(const gx_device *pdev)
+ /* I - Device info */
+{
+ return (&cups_color_mapping_procs);
+}
+#endif /* dev_t_proc_encode_color */
+
+
+/*
+ * 'cups_get_matrix()' - Generate the default page matrix.
+ */
+
+private void
+cups_get_matrix(gx_device *pdev, /* I - Device info */
+ gs_matrix *pmat) /* O - Physical transform matrix */
+{
+ fprintf(stderr, "DEBUG2: cups_get_matrix(%p, %p)\n", pdev, pmat);
+
+ /*
+ * Set the raster width and height...
+ */
+
+ cups->header.cupsWidth = cups->width;
+ cups->header.cupsHeight = cups->height;
+
+ /*
+ * Set the transform matrix...
+ */
+
+ fprintf(stderr, "DEBUG: cups->header.Duplex = %d\n", cups->header.Duplex);
+ fprintf(stderr, "DEBUG: cups->page = %d\n", cups->page);
+
+ if (cupsPPD)
+ {
+ fprintf(stderr, "DEBUG: cupsPPD = %p\n", cupsPPD);
+ fprintf(stderr, "DEBUG: cupsPPD->flip_duplex = %d\n", cupsPPD->flip_duplex);
+ }
+
+ if (cups->landscape)
+ {
+ /*
+ * Do landscape orientation...
+ */
+
+ if (cups->header.Duplex && !cups->header.Tumble &&
+ cupsPPD && cupsPPD->flip_duplex && !(cups->page & 1))
+ {
+ pmat->xx = 0.0;
+ pmat->xy = (float)cups->header.HWResolution[0] / 72.0;
+ pmat->yx = -(float)cups->header.HWResolution[1] / 72.0;
+ pmat->yy = 0.0;
+ pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[2] / 72.0;
+ pmat->ty = (float)cups->header.HWResolution[1] *
+ ((float)cups->header.PageSize[0] - pdev->HWMargins[3]) / 72.0;
+ }
+ else
+ {
+ pmat->xx = 0.0;
+ pmat->xy = (float)cups->header.HWResolution[0] / 72.0;
+ pmat->yx = (float)cups->header.HWResolution[1] / 72.0;
+ pmat->yy = 0.0;
+ pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[0] / 72.0;
+ pmat->ty = -(float)cups->header.HWResolution[1] * pdev->HWMargins[1] / 72.0;
+ }
+ }
+ else if (cups->header.Duplex && !cups->header.Tumble &&
+ cupsPPD && cupsPPD->flip_duplex && !(cups->page & 1))
+ {
+ pmat->xx = (float)cups->header.HWResolution[0] / 72.0;
+ pmat->xy = 0.0;
+ pmat->yx = 0.0;
+ pmat->yy = (float)cups->header.HWResolution[1] / 72.0;
+ pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[2] / 72.0;
+ pmat->ty = -(float)cups->header.HWResolution[1] * pdev->HWMargins[3] / 72.0;
+ }
+ else
+ {
+ pmat->xx = (float)cups->header.HWResolution[0] / 72.0;
+ pmat->xy = 0.0;
+ pmat->yx = 0.0;
+ pmat->yy = -(float)cups->header.HWResolution[1] / 72.0;
+ pmat->tx = -(float)cups->header.HWResolution[0] * pdev->HWMargins[0] / 72.0;
+ pmat->ty = (float)cups->header.HWResolution[1] *
+ ((float)cups->header.PageSize[1] - pdev->HWMargins[3]) / 72.0;
+ }
+
+#ifdef CUPS_RASTER_SYNCv1
+ if (cups->header.cupsBorderlessScalingFactor > 1.0)
+ {
+ pmat->xx *= cups->header.cupsBorderlessScalingFactor;
+ pmat->xy *= cups->header.cupsBorderlessScalingFactor;
+ pmat->yx *= cups->header.cupsBorderlessScalingFactor;
+ pmat->yy *= cups->header.cupsBorderlessScalingFactor;
+ pmat->tx *= cups->header.cupsBorderlessScalingFactor;
+ pmat->ty *= cups->header.cupsBorderlessScalingFactor;
+ }
+#endif /* CUPS_RASTER_SYNCv1 */
+
+ fprintf(stderr, "DEBUG: width = %d, height = %d\n", cups->width,
+ cups->height);
+ fprintf(stderr, "DEBUG: PageSize = [ %d %d ], HWResolution = [ %d %d ]\n",
+ cups->header.PageSize[0], cups->header.PageSize[1],
+ cups->header.HWResolution[0], cups->header.HWResolution[1]);
+ fprintf(stderr, "DEBUG: HWMargins = [ %.3f %.3f %.3f %.3f ]\n",
+ pdev->HWMargins[0], pdev->HWMargins[1], pdev->HWMargins[2],
+ pdev->HWMargins[3]);
+ fprintf(stderr, "DEBUG: matrix = [ %.3f %.3f %.3f %.3f %.3f %.3f ]\n",
+ pmat->xx, pmat->xy, pmat->yx, pmat->yy, pmat->tx, pmat->ty);
+}
+
+
+/*
+ * 'cups_get_params()' - Get pagedevice parameters.
+ */
+
+private int /* O - Error status */
+cups_get_params(gx_device *pdev, /* I - Device info */
+ gs_param_list *plist) /* I - Parameter list */
+{
+#ifdef CUPS_RASTER_SYNCv1
+ int i; /* Looping var */
+ char name[255]; /* Attribute name */
+#endif /* CUPS_RASTER_SYNCv1 */
+ int code; /* Return code */
+ gs_param_string s; /* Temporary string value */
+ bool b; /* Temporary boolean value */
+
+
+ fprintf(stderr, "DEBUG2: cups_get_params(%p, %p)\n", pdev, plist);
+
+ /*
+ * First process the "standard" page device parameters...
+ */
+
+ fputs("DEBUG2: before gdev_prn_get_params()\n", stderr);
+
+ if ((code = gdev_prn_get_params(pdev, plist)) < 0)
+ return (code);
+
+ fputs("DEBUG2: after gdev_prn_get_params()\n", stderr);
+
+ /*
+ * Then write the CUPS parameters...
+ */
+
+ param_string_from_string(s, cups->header.MediaClass);
+ if ((code = param_write_string(plist, "MediaClass", &s)) < 0)
+ return (code);
+
+ param_string_from_string(s, cups->header.MediaColor);
+ if ((code = param_write_string(plist, "MediaColor", &s)) < 0)
+ return (code);
+
+ param_string_from_string(s, cups->header.MediaType);
+ if ((code = param_write_string(plist, "MediaType", &s)) < 0)
+ return (code);
+
+ param_string_from_string(s, cups->header.OutputType);
+ if ((code = param_write_string(plist, "OutputType", &s)) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "AdvanceDistance",
+ (int *)&(cups->header.AdvanceDistance))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "AdvanceMedia",
+ (int *)&(cups->header.AdvanceMedia))) < 0)
+ return (code);
+
+ b = cups->header.Collate;
+ if ((code = param_write_bool(plist, "Collate", &b)) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "CutMedia",
+ (int *)&(cups->header.CutMedia))) < 0)
+ return (code);
+
+ b = cups->header.InsertSheet;
+ if ((code = param_write_bool(plist, "InsertSheet", &b)) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "Jog",
+ (int *)&(cups->header.Jog))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "LeadingEdge",
+ (int *)&(cups->header.LeadingEdge))) < 0)
+ return (code);
+
+ b = cups->header.ManualFeed;
+ if ((code = param_write_bool(plist, "ManualFeed", &b)) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "MediaPosition",
+ (int *)&(cups->header.MediaPosition))) < 0)
+ return (code);
+
+ b = cups->header.MirrorPrint;
+ if ((code = param_write_bool(plist, "MirrorPrint", &b)) < 0)
+ return (code);
+
+ b = cups->header.NegativePrint;
+ if ((code = param_write_bool(plist, "NegativePrint", &b)) < 0)
+ return (code);
+
+ b = cups->header.OutputFaceUp;
+ if ((code = param_write_bool(plist, "OutputFaceUp", &b)) < 0)
+ return (code);
+
+ b = cups->header.Separations;
+ if ((code = param_write_bool(plist, "Separations", &b)) < 0)
+ return (code);
+
+ b = cups->header.TraySwitch;
+ if ((code = param_write_bool(plist, "TraySwitch", &b)) < 0)
+ return (code);
+
+ b = cups->header.Tumble;
+ if ((code = param_write_bool(plist, "Tumble", &b)) < 0)
+ return (code);
+
+#if 0 /* Don't include read-only parameters... */
+ if ((code = param_write_int(plist, "cupsWidth",
+ (int *)&(cups->header.cupsWidth))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "cupsHeight",
+ (int *)&(cups->header.cupsHeight))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "cupsBitsPerPixel",
+ (int *)&(cups->header.cupsBitsPerPixel))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "cupsBytesPerLine",
+ (int *)&(cups->header.cupsBytesPerLine))) < 0)
+ return (code);
+#endif /* 0 */
+
+ if ((code = param_write_int(plist, "cupsMediaType",
+ (int *)&(cups->header.cupsMediaType))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "cupsBitsPerColor",
+ (int *)&(cups->header.cupsBitsPerColor))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "cupsColorOrder",
+ (int *)&(cups->header.cupsColorOrder))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "cupsColorSpace",
+ (int *)&(cups->header.cupsColorSpace))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "cupsCompression",
+ (int *)&(cups->header.cupsCompression))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "cupsRowCount",
+ (int *)&(cups->header.cupsRowCount))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "cupsRowFeed",
+ (int *)&(cups->header.cupsRowFeed))) < 0)
+ return (code);
+
+ if ((code = param_write_int(plist, "cupsRowStep",
+ (int *)&(cups->header.cupsRowStep))) < 0)
+ return (code);
+
+#ifdef CUPS_RASTER_SYNCv1
+ if ((code = param_write_int(plist, "cupsNumColors",
+ (int *)&(cups->header.cupsNumColors))) < 0)
+ return (code);
+
+ if ((code = param_write_float(plist, "cupsBorderlessScalingFactor",
+ &(cups->header.cupsBorderlessScalingFactor))) < 0)
+ return (code);
+
+ for (i = 0; i < 16; i ++)
+ {
+ sprintf(name, "cupsInteger%d", i);
+ if ((code = param_write_int(plist, name,
+ (int *)(cups->header.cupsInteger + i))) < 0)
+ return (code);
+ }
+
+ for (i = 0; i < 16; i ++)
+ {
+ sprintf(name, "cupsReal%d", i);
+ if ((code = param_write_float(plist, name,
+ cups->header.cupsReal + i)) < 0)
+ return (code);
+ }
+
+ for (i = 0; i < 16; i ++)
+ {
+ sprintf(name, "cupsReal%d", i);
+ param_string_from_string(s, cups->header.cupsString[i]);
+ if ((code = param_write_string(plist, name, &s)) < 0)
+ return (code);
+ }
+
+ param_string_from_string(s, cups->header.cupsMarkerType);
+ if ((code = param_write_string(plist, "cupsMarkerType", &s)) < 0)
+ return (code);
+
+ param_string_from_string(s, cups->header.cupsRenderingIntent);
+ if ((code = param_write_string(plist, "cupsRenderingIntent", &s)) < 0)
+ return (code);
+
+ param_string_from_string(s, cups->header.cupsPageSizeName);
+ if ((code = param_write_string(plist, "cupsPageSizeName", &s)) < 0)
+ return (code);
+#endif /* CUPS_RASTER_SYNCv1 */
+
+ fputs("DEBUG2: Leaving cups_get_params()\n", stderr);
+
+ return (0);
+}
+
+
+/*
+ * 'cups_get_space_params()' - Get space parameters from the RIP_CACHE env var.
+ */
+
+void
+cups_get_space_params(const gx_device_printer *pdev,
+ /* I - Printer device */
+ gdev_prn_space_params *space_params)
+ /* O - Space parameters */
+{
+ float cache_size; /* Size of tile cache in bytes */
+ char *cache_env, /* Cache size environment variable */
+ cache_units[255]; /* Cache size units */
+
+
+ fprintf(stderr, "DEBUG2: cups_get_space_params(%p, %p)\n", pdev, space_params);
+
+ if ((cache_env = getenv("RIP_MAX_CACHE")) != NULL)
+ {
+ switch (sscanf(cache_env, "%f%254s", &cache_size, cache_units))
+ {
+ case 0 :
+ cache_size = 8 * 1024 * 1024;
+ break;
+ case 1 :
+ cache_size *= 4 * CUPS_TILE_SIZE * CUPS_TILE_SIZE;
+ break;
+ case 2 :
+ if (tolower(cache_units[0]) == 'g')
+ cache_size *= 1024 * 1024 * 1024;
+ else if (tolower(cache_units[0]) == 'm')
+ cache_size *= 1024 * 1024;
+ else if (tolower(cache_units[0]) == 'k')
+ cache_size *= 1024;
+ else if (tolower(cache_units[0]) == 't')
+ cache_size *= 4 * CUPS_TILE_SIZE * CUPS_TILE_SIZE;
+ break;
+ }
+ }
+ else
+ cache_size = 8 * 1024 * 1024;
+
+ fprintf(stderr, "DEBUG: cache_size = %.0f\n", cache_size);
+
+ space_params->MaxBitmap = (int)cache_size;
+ space_params->BufferSpace = (int)cache_size / 10;
+}
+
+
+/*
+ * 'cups_map_cielab()' - Map CIE Lab transformation...
+ */
+
+static double /* O - Adjusted color value */
+cups_map_cielab(double x, /* I - Raw color value */
+ double xn) /* I - Whitepoint color value */
+{
+ double x_xn; /* Fraction of whitepoint */
+
+
+ x_xn = x / xn;
+
+ if (x_xn > 0.008856)
+ return (cbrt(x_xn));
+ else
+ return (7.787 * x_xn + 16.0 / 116.0);
+}
+
+
+#ifdef dev_t_proc_encode_color
+/*
+ * 'cups_map_cmyk()' - Map a CMYK color value to device colors.
+ */
+
+private void
+cups_map_cmyk(gx_device *pdev, /* I - Device info */
+ frac c, /* I - Cyan value */
+ frac m, /* I - Magenta value */
+ frac y, /* I - Yellow value */
+ frac k, /* I - Black value */
+ frac *out) /* O - Device colors */
+{
+ int c0, c1, c2; /* Temporary color values */
+ float rr, rg, rb, /* Real RGB colors */
+ ciex, ciey, ciez, /* CIE XYZ colors */
+ ciey_yn, /* Normalized luminance */
+ ciel, ciea, cieb; /* CIE Lab colors */
+
+
+#ifdef DEBUG
+ fprintf(stderr, "DEBUG2: cups_map_cmyk(%p, %d, %d, %d, %d, %p)\n",
+ pdev, c, m, y, k, out);
+#endif /* DEBUG */
+
+ /*
+ * Convert the CMYK color to the destination colorspace...
+ */
+
+ switch (cups->header.cupsColorSpace)
+ {
+ case CUPS_CSPACE_W :
+ c0 = frac_1 - (c * 31 + m * 61 + y * 8) / 100 - k;
+
+ if (c0 < 0)
+ out[0] = 0;
+ else if (c0 > frac_1)
+ out[0] = (frac)cupsDensity[frac_1];
+ else
+ out[0] = (frac)cupsDensity[c0];
+ break;
+
+ case CUPS_CSPACE_RGBA :
+ out[3] = frac_1;
+
+ case CUPS_CSPACE_RGB :
+ c0 = frac_1 - c - k;
+ c1 = frac_1 - m - k;
+ c2 = frac_1 - y - k;
+
+ if (c0 < 0)
+ out[0] = 0;
+ else if (c0 > frac_1)
+ out[0] = (frac)cupsDensity[frac_1];
+ else
+ out[0] = (frac)cupsDensity[c0];
+
+ if (c1 < 0)
+ out[1] = 0;
+ else if (c1 > frac_1)
+ out[1] = (frac)cupsDensity[frac_1];
+ else
+ out[1] = (frac)cupsDensity[c1];
+
+ if (c2 < 0)
+ out[2] = 0;
+ else if (c2 > frac_1)
+ out[2] = (frac)cupsDensity[frac_1];
+ else
+ out[2] = (frac)cupsDensity[c2];
+ break;
+
+ default :
+ case CUPS_CSPACE_K :
+ c0 = (c * 31 + m * 61 + y * 8) / 100 + k;
+
+ if (c0 < 0)
+ out[0] = 0;
+ else if (c0 > frac_1)
+ out[0] = (frac)cupsDensity[frac_1];
+ else
+ out[0] = (frac)cupsDensity[c0];
+ break;
+
+ case CUPS_CSPACE_CMY :
+ c0 = c + k;
+ c1 = m + k;
+ c2 = y + k;
+
+ if (c0 < 0)
+ out[0] = 0;
+ else if (c0 > frac_1)
+ out[0] = (frac)cupsDensity[frac_1];
+ else
+ out[0] = (frac)cupsDensity[c0];
+
+ if (c1 < 0)
+ out[1] = 0;
+ else if (c1 > frac_1)
+ out[1] = (frac)cupsDensity[frac_1];
+ else
+ out[1] = (frac)cupsDensity[c1];
+
+ if (c2 < 0)
+ out[2] = 0;
+ else if (c2 > frac_1)
+ out[2] = (frac)cupsDensity[frac_1];
+ else
+ out[2] = (frac)cupsDensity[c2];
+ break;
+
+ case CUPS_CSPACE_YMC :
+ c0 = y + k;
+ c1 = m + k;
+ c2 = c + k;
+
+ if (c0 < 0)
+ out[0] = 0;
+ else if (c0 > frac_1)
+ out[0] = (frac)cupsDensity[frac_1];
+ else
+ out[0] = (frac)cupsDensity[c0];
+
+ if (c1 < 0)
+ out[1] = 0;
+ else if (c1 > frac_1)
+ out[1] = (frac)cupsDensity[frac_1];
+ else
+ out[1] = (frac)cupsDensity[c1];
+
+ if (c2 < 0)
+ out[2] = 0;
+ else if (c2 > frac_1)
+ out[2] = (frac)cupsDensity[frac_1];
+ else
+ out[2] = (frac)cupsDensity[c2];
+ break;
+
+ case CUPS_CSPACE_RGBW :
+ c = frac_1 - c;
+ m = frac_1 - m;
+ y = frac_1 - y;
+ k = frac_1 - k;
+ case CUPS_CSPACE_CMYK :
+ if (c < 0)
+ out[0] = 0;
+ else if (c > frac_1)
+ out[0] = (frac)cupsDensity[frac_1];
+ else
+ out[0] = (frac)cupsDensity[c];
+
+ if (m < 0)
+ out[1] = 0;
+ else if (m > frac_1)
+ out[1] = (frac)cupsDensity[frac_1];
+ else
+ out[1] = (frac)cupsDensity[m];
+
+ if (y < 0)
+ out[2] = 0;
+ else if (y > frac_1)
+ out[2] = (frac)cupsDensity[frac_1];
+ else
+ out[2] = (frac)cupsDensity[y];
+
+ if (k < 0)
+ out[3] = 0;
+ else if (k > frac_1)
+ out[3] = (frac)cupsDensity[frac_1];
+ else
+ out[3] = (frac)cupsDensity[k];
+ break;
+
+ case CUPS_CSPACE_YMCK :
+ case CUPS_CSPACE_GMCK :
+ case CUPS_CSPACE_GMCS :
+ if (y < 0)
+ out[0] = 0;
+ else if (y > frac_1)
+ out[0] = (frac)cupsDensity[frac_1];
+ else
+ out[0] = (frac)cupsDensity[y];
+
+ if (m < 0)
+ out[1] = 0;
+ else if (m > frac_1)
+ out[1] = (frac)cupsDensity[frac_1];
+ else
+ out[1] = (frac)cupsDensity[m];
+
+ if (c < 0)
+ out[2] = 0;
+ else if (c > frac_1)
+ out[2] = (frac)cupsDensity[frac_1];
+ else
+ out[2] = (frac)cupsDensity[c];
+
+ if (k < 0)
+ out[3] = 0;
+ else if (k > frac_1)
+ out[3] = (frac)cupsDensity[frac_1];
+ else
+ out[3] = (frac)cupsDensity[k];
+ break;
+
+ case CUPS_CSPACE_KCMYcm :
+ case CUPS_CSPACE_KCMY :
+ if (k < 0)
+ out[0] = 0;
+ else if (k > frac_1)
+ out[0] = (frac)cupsDensity[frac_1];
+ else
+ out[0] = (frac)cupsDensity[k];
+
+ if (c < 0)
+ out[1] = 0;
+ else if (c > frac_1)
+ out[1] = (frac)cupsDensity[frac_1];
+ else
+ out[1] = (frac)cupsDensity[c];
+
+ if (m < 0)
+ out[2] = 0;
+ else if (m > frac_1)
+ out[2] = (frac)cupsDensity[frac_1];
+ else
+ out[2] = (frac)cupsDensity[m];
+
+ if (y < 0)
+ out[3] = 0;
+ else if (y > frac_1)
+ out[3] = (frac)cupsDensity[frac_1];
+ else
+ out[3] = (frac)cupsDensity[y];
+ break;
+
+# ifdef CUPS_RASTER_HAVE_COLORIMETRIC
+ case CUPS_CSPACE_CIEXYZ :
+ case CUPS_CSPACE_CIELab :
+ case CUPS_CSPACE_ICC1 :
+ case CUPS_CSPACE_ICC2 :
+ case CUPS_CSPACE_ICC3 :
+ case CUPS_CSPACE_ICC4 :
+ case CUPS_CSPACE_ICC5 :
+ case CUPS_CSPACE_ICC6 :
+ case CUPS_CSPACE_ICC7 :
+ case CUPS_CSPACE_ICC8 :
+ case CUPS_CSPACE_ICC9 :
+ case CUPS_CSPACE_ICCA :
+ case CUPS_CSPACE_ICCB :
+ case CUPS_CSPACE_ICCC :
+ case CUPS_CSPACE_ICCD :
+ case CUPS_CSPACE_ICCE :
+ case CUPS_CSPACE_ICCF :
+ /*
+ * Convert CMYK to sRGB...
+ */
+
+ c0 = frac_1 - c - k;
+ c1 = frac_1 - m - k;
+ c2 = frac_1 - y - k;
+
+ if (c0 < 0)
+ c0 = 0;
+
+ if (c1 < 0)
+ c1 = 0;
+
+ if (c2 < 0)
+ c2 = 0;
+
+ /*
+ * Convert sRGB to linear RGB...
+ */
+
+ rr = pow(((double)c0 / (double)frac_1 + 0.055) / 1.055, 2.4);
+ rg = pow(((double)c1 / (double)frac_1 + 0.055) / 1.055, 2.4);
+ rb = pow(((double)c2 / (double)frac_1 + 0.055) / 1.055, 2.4);
+
+ /*
+ * Convert to CIE XYZ...
+ */
+
+ ciex = 0.412453 * rr + 0.357580 * rg + 0.180423 * rb;
+ ciey = 0.212671 * rr + 0.715160 * rg + 0.072169 * rb;
+ ciez = 0.019334 * rr + 0.119193 * rg + 0.950227 * rb;
+
+ if (cups->header.cupsColorSpace == CUPS_CSPACE_CIEXYZ)
+ {
+ /*
+ * Convert to an integer XYZ color value...
+ */
+
+ if (cups->header.cupsBitsPerColor == 8)
+ {
+ if (ciex <= 0.0f)
+ c0 = 0;
+ else if (ciex < 1.1)
+ c0 = (int)(ciex * 231.8181 + 0.5);
+ else
+ c0 = 255;
+
+ if (ciey <= 0.0f)
+ c1 = 0;
+ else if (ciey < 1.1)
+ c1 = (int)(ciey * 231.8181 + 0.5);
+ else
+ c1 = 255;
+
+ if (ciez <= 0.0f)
+ c2 = 0;
+ else if (ciez < 1.1)
+ c2 = (int)(ciez * 231.8181 + 0.5);
+ else
+ c2 = 255;
+ }
+ else
+ {
+ if (ciex <= 0.0f)
+ c0 = 0;
+ else if (ciex < 1.1)
+ c0 = (int)(ciex * 59577.2727 + 0.5);
+ else
+ c0 = 65535;
+
+ if (ciey <= 0.0f)
+ c1 = 0;
+ else if (ciey < 1.1)
+ c1 = (int)(ciey * 59577.2727 + 0.5);
+ else
+ c1 = 65535;
+
+ if (ciez <= 0.0f)
+ c2 = 0;
+ else if (ciez < 1.1)
+ c2 = (int)(ciez * 59577.2727 + 0.5);
+ else
+ c2 = 65535;
+ }
+ }
+ else
+ {
+ /*
+ * Convert CIE XYZ to Lab...
+ */
+
+ ciey_yn = ciey / D65_Y;
+
+ if (ciey_yn > 0.008856)
+ ciel = 116 * cbrt(ciey_yn) - 16;
+ else
+ ciel = 903.3 * ciey_yn;
+
+ ciea = 500 * (cups_map_cielab(ciex, D65_X) -
+ cups_map_cielab(ciey, D65_Y));
+ cieb = 200 * (cups_map_cielab(ciey, D65_Y) -
+ cups_map_cielab(ciez, D65_Z));
+
+ if (cups->header.cupsBitsPerColor == 8)
+ {
+ /*
+ * Scale the L value and bias the a and b values by 128
+ * so that all values are in the range of 0 to 255.
+ */
+
+ ciel = ciel * 2.55 + 0.5;
+ ciea += 128.5;
+ cieb += 128.5;
+
+ if (ciel <= 0.0)
+ c0 = 0;
+ else if (ciel < 255.0)
+ c0 = (int)ciel;
+ else
+ c0 = 255;
+
+ if (ciea <= 0.0)
+ c1 = 0;
+ else if (ciea < 255.0)
+ c1 = (int)ciea;
+ else
+ c1 = 255;
+
+ if (cieb <= 0.0)
+ c2 = 0;
+ else if (cieb < 255.0)
+ c2 = (int)cieb;
+ else
+ c2 = 255;
+ }
+ else
+ {
+ /*
+ * Scale the L value and bias the a and b values by 128 so that all
+ * numbers are from 0 to 65535.
+ */
+
+ ciel = ciel * 655.35 + 0.5;
+ ciea = (ciea + 128.0) * 256.0 + 0.5;
+ cieb = (cieb + 128.0) * 256.0 + 0.5;
+
+ /*
+ * Output 16-bit values...
+ */
+
+ if (ciel <= 0.0)
+ c0 = 0;
+ else if (ciel < 65535.0)
+ c0 = (int)ciel;
+ else
+ c0 = 65535;
+
+ if (ciea <= 0.0)
+ c1 = 0;
+ else if (ciea < 65535.0)
+ c1 = (int)ciea;
+ else
+ c1 = 65535;
+
+ if (cieb <= 0.0)
+ c2 = 0;
+ else if (cieb < 65535.0)
+ c2 = (int)cieb;
+ else
+ c2 = 65535;
+ }
+ }
+
+ out[0] = cupsDecodeLUT[c0];
+ out[1] = cupsDecodeLUT[c1];
+ out[2] = cupsDecodeLUT[c2];
+ break;
+# endif /* CUPS_RASTER_HAVE_COLORIMETRIC */
+ }
+
+#ifdef DEBUG
+ switch (cups->color_info.num_components)
+ {
+ default :
+ case 1 :
+ fprintf(stderr, "DEBUG2: \\=== COLOR %d\n", out[0]);
+ break;
+
+ case 3 :
+ fprintf(stderr, "DEBUG2: \\=== COLOR %d, %d, %d\n",
+ out[0], out[1], out[2]);
+ break;
+
+ case 4 :
+ fprintf(stderr, "DEBUG2: \\=== COLOR %d, %d, %d, %d\n",
+ out[0], out[1], out[2], out[3]);
+ break;
+ }
+#endif /* DEBUG */
+}
+
+
+/*
+ * 'cups_map_gray()' - Map a grayscale value to device colors.
+ */
+
+private void
+cups_map_gray(gx_device *pdev, /* I - Device info */
+ frac g, /* I - Grayscale value */
+ frac *out) /* O - Device colors */
+{
+#ifdef DEBUG2
+ fprintf(stderr, "DEBUG2: cups_map_gray(%p, %d, %p)\n",
+ pdev, g, out);
+#endif /* DEBUG2 */
+
+ /*
+ * Just use the CMYK mapper...
+ */
+
+ cups_map_cmyk(pdev, 0, 0, 0, frac_1 - g, out);
+}
+
+
+/*
+ * 'cups_map_rgb()' - Map a RGB color value to device colors.
+ */
+
+private void
+cups_map_rgb(gx_device *pdev,
+ /* I - Device info */
+ const gs_imager_state *pis,/* I - Device state */
+ frac r, /* I - Red value */
+ frac g, /* I - Green value */
+ frac b, /* I - Blue value */
+ frac *out)/* O - Device colors */
+{
+ frac c, m, y, k; /* CMYK values */
+ frac mk; /* Maximum K value */
+ int tc, tm, ty; /* Temporary color values */
+
+
+#ifdef DEBUG
+ fprintf(stderr, "DEBUG2: cups_map_rgb(%p, %p, %d, %d, %d, %p)\n",
+ pdev, pis, r, g, b, out);
+#endif /* DEBUG */
+
+ /*
+ * Compute CMYK values...
+ */
+
+ c = frac_1 - r;
+ m = frac_1 - g;
+ y = frac_1 - b;
+ k = min(c, min(m, y));
+
+ if ((mk = max(c, max(m, y))) > k)
+ k = (int)((float)k * (float)k * (float)k / ((float)mk * (float)mk));
+
+ c -= k;
+ m -= k;
+ y -= k;
+
+ /*
+ * Do color correction as needed...
+ */
+
+ if (cupsHaveProfile)
+ {
+ /*
+ * Color correct CMY...
+ */
+
+ tc = cupsMatrix[0][0][c] +
+ cupsMatrix[0][1][m] +
+ cupsMatrix[0][2][y];
+ tm = cupsMatrix[1][0][c] +
+ cupsMatrix[1][1][m] +
+ cupsMatrix[1][2][y];
+ ty = cupsMatrix[2][0][c] +
+ cupsMatrix[2][1][m] +
+ cupsMatrix[2][2][y];
+
+ if (tc < 0)
+ c = 0;
+ else if (tc > frac_1)
+ c = frac_1;
+ else
+ c = (frac)tc;
+
+ if (tm < 0)
+ m = 0;
+ else if (tm > frac_1)
+ m = frac_1;
+ else
+ m = (frac)tm;
+
+ if (ty < 0)
+ y = 0;
+ else if (ty > frac_1)
+ y = frac_1;
+ else
+ y = (frac)ty;
+ }
+
+ /*
+ * Use the CMYK mapping function to produce the device colors...
+ */
+
+ cups_map_cmyk(pdev, c, m, y, k, out);
+}
+#else
+/*
+ * 'cups_map_cmyk_color()' - Map a CMYK color to a color index.
+ *
+ * This function is only called when a 4 or 6 color colorspace is
+ * selected for output. CMYK colors are *not* corrected but *are*
+ * density adjusted.
+ */
+
+private gx_color_index /* O - Color index */
+cups_map_cmyk_color(gx_device *pdev,
+ /* I - Device info */
+ gx_color_value c, /* I - Cyan value */
+ gx_color_value m, /* I - Magenta value */
+ gx_color_value y, /* I - Yellow value */
+ gx_color_value k) /* I - Black value */
+{
+ gx_color_index i; /* Temporary index */
+ gx_color_value ic, im, iy, ik; /* Integral CMYK values */
+
+
+#ifdef DEBUG
+ fprintf(stderr, "DEBUG2: cups_map_cmyk_color(%p, %d, %d, %d, %d)\n", pdev,
+ c, m, y, k);
+#endif /* DEBUG */
+
+ /*
+ * Setup the color info data as needed...
+ */
+
+ if (pdev->color_info.num_components == 0)
+ cups_set_color_info(pdev);
+
+ /*
+ * Density correct...
+ */
+
+ if (cupsHaveProfile)
+ {
+ c = cupsDensity[c];
+ m = cupsDensity[m];
+ y = cupsDensity[y];
+ k = cupsDensity[k];
+ }
+
+ ic = cupsEncodeLUT[c];
+ im = cupsEncodeLUT[m];
+ iy = cupsEncodeLUT[y];
+ ik = cupsEncodeLUT[k];
+
+ /*
+ * Convert the CMYK color to a color index...
+ */
+
+ switch (cups->header.cupsColorSpace)
+ {
+ default :
+ switch (cups->header.cupsBitsPerColor)
+ {
+ default :
+ i = (((((ic << 1) | im) << 1) | iy) << 1) | ik;
+ break;
+ case 2 :
+ i = (((((ic << 2) | im) << 2) | iy) << 2) | ik;
+ break;
+ case 4 :
+ i = (((((ic << 4) | im) << 4) | iy) << 4) | ik;
+ break;
+ case 8 :
+ i = (((((ic << 8) | im) << 8) | iy) << 8) | ik;
+ break;
+#ifdef GX_COLOR_INDEX_TYPE
+ case 16 :
+ i = (((((ic << 16) | im) << 16) | iy) << 16) | ik;
+ break;
+#endif /* GX_COLOR_INDEX_TYPE */
+ }
+ break;
+
+ case CUPS_CSPACE_YMCK :
+ case CUPS_CSPACE_GMCK :
+ case CUPS_CSPACE_GMCS :
+ switch (cups->header.cupsBitsPerColor)
+ {
+ default :
+ i = (((((iy << 1) | im) << 1) | ic) << 1) | ik;
+ break;
+ case 2 :
+ i = (((((iy << 2) | im) << 2) | ic) << 2) | ik;
+ break;
+ case 4 :
+ i = (((((iy << 4) | im) << 4) | ic) << 4) | ik;
+ break;
+ case 8 :
+ i = (((((iy << 8) | im) << 8) | ic) << 8) | ik;
+ break;
+#ifdef GX_COLOR_INDEX_TYPE
+ case 16 :
+ i = (((((iy << 16) | im) << 16) | ic) << 16) | ik;
+ break;
+#endif /* GX_COLOR_INDEX_TYPE */
+ }
+ break;
+
+ case CUPS_CSPACE_KCMYcm :
+ if (cups->header.cupsBitsPerColor == 1)
+ {
+ if (ik)
+ i = 32;
+ else
+ i = 0;
+
+ if (ic && im)
+ i |= 17;
+ else if (ic && iy)
+ i |= 6;
+ else if (im && iy)
+ i |= 12;
+ else if (ic)
+ i |= 16;
+ else if (im)
+ i |= 8;
+ else if (iy)
+ i |= 4;
+ break;
+ }
+
+ case CUPS_CSPACE_KCMY :
+ switch (cups->header.cupsBitsPerColor)
+ {
+ default :
+ i = (((((ik << 1) | ic) << 1) | im) << 1) | iy;
+ break;
+ case 2 :
+ i = (((((ik << 2) | ic) << 2) | im) << 2) | iy;
+ break;
+ case 4 :
+ i = (((((ik << 4) | ic) << 4) | im) << 4) | iy;
+ break;
+ case 8 :
+ i = (((((ik << 8) | ic) << 8) | im) << 8) | iy;
+ break;
+#ifdef GX_COLOR_INDEX_TYPE
+ case 16 :
+ i = (((((ik << 16) | ic) << 16) | im) << 16) | iy;
+ break;
+#endif /* GX_COLOR_INDEX_TYPE */
+ }
+ break;
+ }
+
+#ifdef DEBUG
+ fprintf(stderr, "DEBUG2: CMYK (%d,%d,%d,%d) -> CMYK %08x (%d,%d,%d,%d)\n",
+ c, m, y, k, (unsigned)i, ic, im, iy, ik);
+#endif /* DEBUG */
+
+ /*
+ * Make sure we don't get a CMYK color of 255, 255, 255, 255...
+ */
+
+ if (i == gx_no_color_index)
+ i --;
+
+ return (i);
+}
+
+
+/*
+ * 'cups_map_color_rgb()' - Map a color index to an RGB color.
+ */
+
+private int
+cups_map_color_rgb(gx_device *pdev,/* I - Device info */
+ gx_color_index color,/* I - Color index */
+ gx_color_value prgb[3])
+ /* O - RGB values */
+{
+ unsigned char c0, c1, c2, c3; /* Color index components */
+ gx_color_value k, divk; /* Black & divisor */
+
+
+#ifdef DEBUG
+ fprintf(stderr, "DEBUG2: cups_map_color_rgb(%p, %d, %p)\n", pdev,
+ (unsigned)color, prgb);
+#endif /* DEBUG */
+
+ /*
+ * Setup the color info data as needed...
+ */
+
+ if (pdev->color_info.num_components == 0)
+ cups_set_color_info(pdev);
+
+#ifdef DEBUG
+ fprintf(stderr, "DEBUG2: COLOR %08x = ", (unsigned)color);
+#endif /* DEBUG */
+
+ /*
+ * Extract the color components from the color index...
+ */
+
+ switch (cups->header.cupsBitsPerColor)
+ {
+ default :
+ c3 = color & 1;
+ color >>= 1;
+ c2 = color & 1;
+ color >>= 1;
+ c1 = color & 1;
+ color >>= 1;
+ c0 = color;
+ break;
+ case 2 :
+ c3 = color & 3;
+ color >>= 2;
+ c2 = color & 3;
+ color >>= 2;
+ c1 = color & 3;
+ color >>= 2;
+ c0 = color;
+ break;
+ case 4 :
+ c3 = color & 15;
+ color >>= 4;
+ c2 = color & 15;
+ color >>= 4;
+ c1 = color & 15;
+ color >>= 4;
+ c0 = color;
+ break;
+ case 8 :
+ c3 = color & 255;
+ color >>= 8;
+ c2 = color & 255;
+ color >>= 8;
+ c1 = color & 255;
+ color >>= 8;
+ c0 = color;
+ break;
+#ifdef GX_COLOR_INDEX_TYPE
+ case 16 :
+ c3 = color & 0xffff;
+ color >>= 16;
+ c2 = color & 0xffff;
+ color >>= 16;
+ c1 = color & 0xffff;
+ color >>= 16;
+ c0 = color;
+ break;
+#endif /* GX_COLOR_INDEX_TYPE */
+ }
+
+ /*
+ * Convert the color components to RGB...
+ */
+
+ switch (cups->header.cupsColorSpace)
+ {
+ case CUPS_CSPACE_K :
+ case CUPS_CSPACE_WHITE :
+ case CUPS_CSPACE_GOLD :
+ case CUPS_CSPACE_SILVER :
+ prgb[0] =
+ prgb[1] =
+ prgb[2] = cupsDecodeLUT[c3];
+ break;
+
+ case CUPS_CSPACE_W :
+ prgb[0] =
+ prgb[1] =
+ prgb[2] = cupsDecodeLUT[c3];
+ break;
+
+ case CUPS_CSPACE_RGB :
+ prgb[0] = cupsDecodeLUT[c1];
+ prgb[1] = cupsDecodeLUT[c2];
+ prgb[2] = cupsDecodeLUT[c3];
+ break;
+
+ case CUPS_CSPACE_RGBA :
+ prgb[0] = cupsDecodeLUT[c0];
+ prgb[1] = cupsDecodeLUT[c1];
+ prgb[2] = cupsDecodeLUT[c2];
+ break;
+
+ case CUPS_CSPACE_CMY :
+ prgb[0] = cupsDecodeLUT[c1];
+ prgb[1] = cupsDecodeLUT[c2];
+ prgb[2] = cupsDecodeLUT[c3];
+ break;
+
+ case CUPS_CSPACE_YMC :
+ prgb[0] = cupsDecodeLUT[c3];
+ prgb[1] = cupsDecodeLUT[c2];
+ prgb[2] = cupsDecodeLUT[c1];
+ break;
+
+ case CUPS_CSPACE_KCMY :
+ case CUPS_CSPACE_KCMYcm :
+ k = cupsDecodeLUT[c0];
+ divk = gx_max_color_value - k;
+ if (divk == 0)
+ {
+ prgb[0] = 0;
+ prgb[1] = 0;
+ prgb[2] = 0;
+ }
+ else
+ {
+ prgb[0] = gx_max_color_value + divk -
+ gx_max_color_value * c1 / divk;
+ prgb[1] = gx_max_color_value + divk -
+ gx_max_color_value * c2 / divk;
+ prgb[2] = gx_max_color_value + divk -
+ gx_max_color_value * c3 / divk;
+ }
+ break;
+
+ case CUPS_CSPACE_RGBW :
+ /*
+ * cupsDecodeLUT actually maps to RGBW, not CMYK...
+ */
+
+ k = cupsDecodeLUT[c3];
+ c = cupsDecodeLUT[c0] + k;
+ m = cupsDecodeLUT[c1] + k;
+ y = cupsDecodeLUT[c2] + k;
+
+ if (c > gx_max_color_value)
+ prgb[0] = gx_max_color_value;
+ else
+ prgb[0] = c;
+
+ if (m > gx_max_color_value)
+ prgb[1] = gx_max_color_value;
+ else
+ prgb[1] = m;
+
+ if (y > gx_max_color_value)
+ prgb[2] = gx_max_color_value;
+ else
+ prgb[2] = y;
+ break;
+
+ case CUPS_CSPACE_CMYK :
+ k = cupsDecodeLUT[c3];
+ divk = gx_max_co