Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37568139
en ru br
ALT Linux repos
S:0.4-alt1.qa1
5.0: 0.4-alt1
4.1: 0.4-alt1
4.0: 0.4-alt1

Other repositories
Upstream:0.3b

Group :: Publishing
RPM: c2050

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

c2050-0.4/000075500000000000000000000000001071405126400121045ustar00rootroot00000000000000c2050-0.4/COPYING000064400000000000000000000431141071405126400131420ustar00rootroot00000000000000		    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

Appendix: 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) 19yy <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) 19yy 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.
c2050-0.4/Lexmark-2050-c2050mono.ppd000064400000000000000000000146611071405126400162300ustar00rootroot00000000000000*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
*% script, consult http://www.linuxprinting.org/cups-doc.html
*%
*% CUPS-O-MATIC generated this PPD file. It is for use with the CUPS
*% printing system and the "cupsomatic" backend filter script. These
*% two files work together to support the use of arbitrary free
*% software drivers with CUPS, replete with basic support for
*% driver-provided options.
*%
*% You may save this file as `Lexmark-2050-c2050.ppd'
*% adapted for the c2050 -mono driver by Roland Lezuo (c) 2003
*%
*FormatVersion: "4.3"
*FileVersion: "1.1"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "COM.PPD"
*Manufacturer: "Lexmark"
*Product: "2050"
*cupsVersion: 1.0
*cupsManualCopies: True
*cupsModelNumber: 2
*cupsFilter: "application/vnd.cups-postscript 0 cupsomatic"
*ModelName: "2050"
*ShortNickName: "2050"
*NickName: "Lexmark 2050, Foomatic + c2050mono"
*PSVersion: "(3010.000) 550"
*LanguageLevel: "3"
*ColorDevice: True
*DefaultColorSpace: RGB
*FileSystem: False
*Throughput: "1"
*LandscapeOrientation: Plus90
*VariablePaperSize: False
*TTRasterizer: Type42
*pnpManufacturer: "Lexmark"
*pnpModel: "Lexmark Color Jetprinter 2050"
*pnpCmd: "LEXWPS"


*% This is fake. I have no information on how to
*% set the pagesize for this driver in the datbase. To
*% prevent PPD users from blowing up, we must provide a
*% default pagesize value.
*OpenUI *PageSize/Media Size: PickOne
*OrderDependency: 10 AnySetup *PageSize
*DefaultPageSize: A4
*PageSize Letter/Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
*PageSize Legal/Legal: "<</PageSize[612 1008]/ImagingBBox null>>setpagedevice"
*PageSize A4/A4: "<</PageSize[595 842]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageSize



*% Generic boilerplate PPD stuff babbling about paper dimensions and
*% the usual Postscript fonts offered by Ghostscript. Contributions
*% to spice this up are welcome!

*DefaultImageableArea: A4
*ImageableArea Letter: "8.60 39.60 603.40 766.49"
*ImageableArea Legal: "8.60 39.60 603.40 982.49"
*ImageableArea A4: "8.60 39.60 586.40 816.49"

*% Generic PaperDimension; evidently there wasn't a normal PageSize argument

*DefaultPaperDimension: A4
*PaperDimension Letter: "612 792"
*PaperDimension Legal: "612 1008"
*PaperDimension A4: "595 842"


*DefaultFont: Courier
*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
*Font Bookman-Light: Standard "(001.004S)" Standard ROM
*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
*Font Courier: Standard "(002.004S)" Standard ROM
*Font Courier-Bold: Standard "(002.004S)" Standard ROM
*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
*Font Helvetica: Standard "(001.006S)" Standard ROM
*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
*Font Symbol: Special "(001.007S)" Special ROM
*Font Times-Bold: Standard "(001.007S)" Standard ROM
*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
*Font Times-Italic: Standard "(001.007S)" Standard ROM
*Font Times-Roman: Standard "(001.007S)" Standard ROM
*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
*Font ZapfDingbats: Special "(001.004S)" Standard ROM

*% What follows is a dumped representation of the internal Perl data
*% structure representing one entry in the Linux Printing Database.
*% This is used by the backend filter to deal with the options.
*%
*% COMDATA #$VAR1 = {
*% COMDATA # 'pnp_cmd' => 'LEXWPS',
*% COMDATA # 'type' => 'F',
*% COMDATA # 'pjl' => '0',
*% COMDATA # 'pnp_mfg' => 'Lexmark',
*% COMDATA # 'args_byname' => {
*% COMDATA # 'DitherPPI' => {
*% COMDATA # 'required' => 1,
*% COMDATA # 'name' => 'DitherPPI',
*% COMDATA # 'style' => 'C',
*% COMDATA # 'type' => 'int',
*% COMDATA # 'comment' => 'Dithering Pixels Per Inch',
*% COMDATA # 'min' => 25,
*% COMDATA # 'proto' => ' -dDITHERPPI=%s',
*% COMDATA # 'default' => 150,
*% COMDATA # 'idx' => 85,
*% COMDATA # 'constraint' => {
*% COMDATA # 'p' => '0',
*% COMDATA # 'model' => undef,
*% COMDATA # 'd' => 1,
*% COMDATA # 'gs_driver' => 'c2050',
*% COMDATA # 'this' => 1,
*% COMDATA # 'arg_type' => 'int',
*% COMDATA # 'arg_defval' => 150,
*% COMDATA # 'make' => undef,
*% COMDATA # 'arg_idx' => 85
*% COMDATA # },
*% COMDATA # 'max' => 300,
*% COMDATA # 'spot' => 'A',
*% COMDATA # 'order' => 100
*% COMDATA # }
*% COMDATA # },
*% COMDATA # 'ascii' => '0',
*% COMDATA # 'pnp_des' => undef,
*% COMDATA # 'pnp_mdl' => 'Lexmark Color Jetprinter 2050',
*% COMDATA # 'maxspot' => 'A',
*% COMDATA # 'driver' => 'c2050',
*% COMDATA # 'id' => 59392,
*% COMDATA # 'args' => [
*% COMDATA # {}
*% COMDATA # ],
*% COMDATA # 'model' => 2050,
*% COMDATA # 'url' => 'http://www.prato.linux.it/~mnencia/lexmark2050',
*% COMDATA # 'comment' => 'Marco Nenciarini\'s Lexmark 2050 driver. It runs the thing at 300dpi in color.',
*% COMDATA # 'timestamp' => 982832485,
*% COMDATA # 'cmd' => 'gs -q -sDEVICE=bitcmyk -r300%A -dNOPAUSE -dSAFER -dBATCH -sOutputFile=- - | c2050 -mono',
*% COMDATA # 'ct' => 1,
*% COMDATA # 'make' => 'Lexmark',
*% COMDATA # 'color' => 1
*% COMDATA #};
*% COMDATA #$VAR1->{'args'}[0] = $VAR1->{'args_byname'}{'DitherPPI'};

c2050-0.4/Makefile000064400000000000000000000014151071405126400135450ustar00rootroot00000000000000#
# makefile - simple makefile for the Lexmark 2050 color driver
#
# Copyright 1999, Christian Kornblum
#
#

# Important compiler and linker options
CC=gcc
LD=gcc
CFLAGS=-g -O2
LDFLAGS=-g -O2

# Required libraries
LDLIBS=

# Source files and modules
SRC=c2050.c
SHAREDHEADER=
MOD=$(SRC:.c=.o)

# Standard production rule
.c.o:
$(CC) $(CFLAGS) -c $<

# make all
all: c2050

# linking the modules
c2050: $(MOD)
$(LD) $(LDFLAGS) $(LDLIBS) -o $@ $(MOD)

# dependencies, here a shared header
$(SRC): $(SHAREDHEADER)

# clear up the mess to start over
clean:
rm -f *.o *~ core c2050

#install the driver
install: all
cp c2050 /usr/bin
chmod a+x /usr/bin/c2050
cp ps2lexmark /usr/bin
chmod a+x /usr/bin/ps2lexmark
cp ps2monolexmark /usr/bin
chmod a+x /usr/bin/ps2monolexmark
c2050-0.4/README000064400000000000000000000060651071405126400127730ustar00rootroot00000000000000Lexmark 2050 Color Jetprinter Linux Driver

The Lexmark 2050 is a fine printer: two seperate cartridges, up to 600dpi, full
color printing capabilities and cheap. At least it was cheap, as you cannot buy
it any longer. But if you already have one and want to use it with Linux, here
the right driver can be found.
Unfortunately, Lexmark decided to design the 2050 as a Windows GDI printer. The
protocol is proprietary, so there is not any documentation available.
Fortunately, as it is a very simple protocol, it has not been an unsolvable
problem to reverse engineer it by printing to a file using the Windows driver.

The protocol uses a short initialization sequence to set up the printer and
load a page. After that, bit patterns with their own header are sent to the
printer, usually followed by a sequence to transport the paper to the next
vertical position. The bit patterns have one bit for each pen in the cartridge.
The bits are in the reverse order of the pens in one column of the sweep; the
uppermost pen last, then up to the last pen, after that the next column.Certain
bytes in the header set the horizontal start position and the number of columns
to print. A checksum, the complete number of bytes for one sweep including the
header, has to be present in the header to make the printer accept the data.

Color printing is nonetheless a difficult issue. As there are three colors in
the color cartridge, there is only a third of the pens available for each
color. There is also a gap inbetween two colors and magenta is disaligned
as to the other colors. Yet all three colors are printed in one sweep, so there
have to be some arithmetics.
Optimization of white spaces is also handled by this driver by reducing the
sweeps to their minimum width and transporting vertically over completely empty
lines in just one sequence.

The driver filters GhostScript output to the Lexmark protocol. The input format
is bitcmyk. The driver simply reads the standard input, converts it and then
sends the data to the standard output. This has been successfully tested with
GhostScript 5.10, which is included in Debian 2.2.

-------------------------------------------------------------------------------

INSTALLING DRIVER

After you have downloaded the tarball with the sourcecode, you have to extract
its contents into a directory of your choice by typing

tar zxvf c2050-0.1.tar.gz

Then you have to compile the code to get the binary for your system. This is
done simply by typing

make

If you are root (you should be root while installing new software in most cases
anyway) you can now copy the binary to its destination, which is /usr/bin/c2070
by typing

make install

-------------------------------------------------------------------------------

EXAMPLES

To print Ghostscript example tiger.ps type (/dev/lp0 may be writable by the
current user):

gs -q -sDEVICE=bitcmyk \
-r300 \
-dDITHERPPI=150 \
-dNOPAUSE \
-dSAFER \
-dBATCH \
-sOutputFile=\|c2050 \
/usr/doc/gs/examples/tiger.ps > /dev/lp0

or use ps2lexmark script:

ps2lexmark < /usr/doc/gs/examples/tiger.ps > /dev/lp0

c2050-0.4/c2050.c000064400000000000000000000305651071405126400130120ustar00rootroot00000000000000/*
* Project: CMYK Color Driver for the Lexmark 2050 Color Jetprinter
* in 300dpi mode.
*
* Author: Marco Nenciarini
*
* Version: 0.1, 27.09.2000
*
* License: GPL (GNU Public License)
*
* MonoFlag by Roland Lezuo for sweet Julia (c) 2003 under the GPL
*
*/

#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* head alignment (values must be >= 0)*/
#define COL_O_OFFSET 4
#define BLK_O_OFFSET 0
#define COL_V_OFFSET 0
#define BLK_V_OFFSET 4

/* various constants */
#define MAX_LINES 600
#define PAGE_WIDTH 2420
#define PAGE_HEIGHT 3408
#define GS_PAGE_WIDTH 2480
#define GS_PAGE_HEIGHT 3507
#define BLACK_PENS 48
#define COLOR_PENS 16
#define COLOR_GAP 4
#define MAGENTA_OFFSET 16
#define BYTES_PER_COLUMN 6
#define BYTES_PER_HEADER 26
#define LEFT_MARGIN 10
#define UPPER_MARGIN 100
#define COLOR_BUFFERS 6
/* the ghostscript color identifiers */
#define BLACK 0x10
#define CYAN 0x80
#define MAGENTA 0x40
#define YELLOW 0x20

/* dirty hack, mono_flag */
static int c2050_mono_flag = 0;


/* the structure for the pixmaps */
struct tSweepBuffer {
int bytepos;
int bitpos;
int bufpos; /* this is used for the colors! */
int unprinted; /* does this buffer contain data? */
char *buffer;
};

/*
* This writes a number of zeros to a string.
*/
void ClearBuffer(char *data, int bytes)
{
register i;
for(i = 0; i < bytes; data[i++] = 0);
} /* ClearBuffer */

/*
* Initialize a sweep buffer
*/
SweepBuffer_Init (struct tSweepBuffer *SweepBuffer, int bytesize)
{
SweepBuffer->bytepos = 0;
SweepBuffer->bitpos = 0;
SweepBuffer->bufpos = 0;
SweepBuffer->unprinted = 0;
SweepBuffer->buffer = (char *) malloc(bytesize);
ClearBuffer(SweepBuffer->buffer, bytesize);
} /* SweepBuffer_Init */

/*
* This puts an unterminated amount of any chars to "out". The first
* byte of the "string" has to give the correct number of the following bytes.
*/
void fPutLString (FILE *out, char *data) {
int i;
for (i = 1; i <= data[0]; putc(data[i++], out));
} /* fPutLString */

/*
* This moves the paper by a defined number of lines (600lpi!).
*/
void LexMove(FILE *out, long int pixel)
{
char command[] = {5,0x1b,0x2a,0x03,0x00,0x00};
command[5] = (char) pixel;
command[4] = (char) (pixel >> 8);
fPutLString(out, command);
} /* LexMove */

/*
* This initializes the printer and sets the upper margin.
*/
void LexInit(FILE *out)
{
char command[] = {12, 0x1B,0x2A,0x80,0x1B,0x2A,0x07,
0x73,0x30,0x1B,0x2A,0x07,0x63};
fPutLString(out, command);
LexMove(out, UPPER_MARGIN);
} /* LexInit */

/*
* This tells the printer to throw out his current page.
*/
void LexEOP(FILE *out)
{
char command[] = {4, 0x1B,0x2A,0x07,0x65};
fPutLString(out, command);
}

/*
* This confusing bit of code removes empty columns from the printbuffer.
* It returns the byte of the buffer where the important data starts and
* changes all referencered arguments accordingly.
*/
int ReduceBytes(char *buffer, int bytespercolumn,
int *leftmargin, int *breite, int *bytesize) {
register int redleft = 0;
register int redright = 0;
int bstart = 0;
while ((buffer[redleft] == 0) && (redleft < *bytesize)) redleft++;
while ((buffer[*bytesize - 1 - redright] == 0) &&
(redright < *bytesize)) redright++;
*breite -= redleft / bytespercolumn + redright / bytespercolumn;
*leftmargin += redleft / bytespercolumn;
bstart = redleft - (redleft % bytespercolumn);
if (bstart < 0) bstart = 0;

return bstart;
} /* ReduceBytes */

/*
* This sends a complete sweep to the printer. Black or color, no difference.
*/
void PrintSweep(char *buffer, char *header, int bytesize, int width, int leftmargin, FILE *out)
{
int bstart;
register i;
/* Remove zeros and set a margin instead. Faster Printing. */
bstart = ReduceBytes(buffer, BYTES_PER_COLUMN, &leftmargin,
&width, &bytesize);

/* Calculate the number of bytes for the checksum */
bytesize = BYTES_PER_HEADER + BYTES_PER_COLUMN * width;
header[4] = (char) bytesize;
header[3] = (char) (bytesize >> 8);

/* The number of columns */
header[12] = (char) width;
header[11] = (char) (width >> 8);

/* The left margin */
header[14] = (char) leftmargin;
header[13] = (char) (leftmargin >> 8);

if (width > 0) { /* do not print empty sweeps */
for(i=0; i<BYTES_PER_HEADER; i++) putc(header[i], out);
for(i=0; i<(bytesize);i++) putc(buffer[i+bstart], out);
}
} /* PrintSweep */

/*
* This finds out if there is anything but zeros in a string
*/
int LineSum(char line[], int length)
{
register i = 0;
while (i < length)
if(line[i++] != 0) return 1;
return 0;
} /* LineSum */

/*
* This is the main printing routine. Wicked and insane. Nonetheless working.
*/
void LexPrint(FILE *in, FILE *out) {
char line[GS_PAGE_WIDTH / 2];
int done_page, cur_height = 0, page_height = 0, numpages = 0;
char lex_blkhd[BYTES_PER_HEADER] = {0x1b,0x2a,0x04,0xff,0xff,0x00,0x01,
0x00,0x01,0x06,0x31,0xff,0xff,0xff,0xff,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,
0x33,0x34,0x35};
char lex_colhd[BYTES_PER_HEADER] = {0x1b,0x2a,0x04,0xff,0xff,0x00,0x01,
0x00,0x00,0x06,0x31,0xff,0xff,0xff,0xff,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,
0x33,0x34,0x35};
long blkbytesize, colbytesize;
register int i=0;
struct tSweepBuffer blkbuffer, colbuffer[COLOR_BUFFERS];
int CurrentColBuffer = 0;
int blkwidth, colwidth;
int empty_lines, skipcolors;
char nibble;
int yellowcounter = 0;

/* The printer may not be able to print every GhostScript pixel */
if (GS_PAGE_WIDTH <= PAGE_WIDTH) blkwidth = GS_PAGE_WIDTH;
else blkwidth = PAGE_WIDTH;

colwidth = blkwidth + MAGENTA_OFFSET;

/* Calculating the size for the buffers */
blkbytesize = BYTES_PER_COLUMN * blkwidth;
colbytesize = BYTES_PER_COLUMN * colwidth;

/* As long as we get input... */
while((line[0] = getc(in)) != EOF)
{

/* Get memory and clear it. */
SweepBuffer_Init(&blkbuffer, blkbytesize);
for (i=0; i<COLOR_BUFFERS; i++) {
SweepBuffer_Init(&colbuffer[i], colbytesize);
colbuffer[i].bufpos = i;
}

/* Initialize the printer, load a page */
LexInit(out);

/* Reset all variables */
done_page = 0;
page_height = 0;
cur_height = COL_V_OFFSET;
empty_lines = 0;
skipcolors = 0;
yellowcounter = BLK_V_OFFSET;
CurrentColBuffer = 0;

/* ... we do the pages. */
while(!done_page)
{

/* Read a CMYK line (GS -sDEVICE=bitcmyk) from the input */
if (page_height == 0) {
for (i = 1; i < (GS_PAGE_WIDTH / 2); line[i++] = getc(in));
} else {
for (i = 0; i < (GS_PAGE_WIDTH / 2); line[i++] = getc(in));
}

/* optimize for empty lines, if buffers are empty */
if ((cur_height == 0)
&& !LineSum(line, GS_PAGE_WIDTH / 2)
&& (page_height < PAGE_HEIGHT)
&& (page_height < GS_PAGE_HEIGHT)
&& !(blkbuffer.unprinted | colbuffer[0].unprinted
| colbuffer[1].unprinted | colbuffer[3].unprinted))
{
empty_lines++;
}
else /* This line does not seem to be empty or there is still data */
{
if (empty_lines) {
LexMove(out, empty_lines * 2);
empty_lines = 0;
yellowcounter = BLK_V_OFFSET;
}

/* count lines and set values */
blkbuffer.bitpos =
(yellowcounter % BLACK_PENS) % 8;
blkbuffer.bytepos = 5 - (yellowcounter % BLACK_PENS) / 8;

/* cyan */
colbuffer[0].bitpos = (cur_height % 8);
colbuffer[0].bytepos = 1 - (cur_height / 8) % 2;
colbuffer[0].bufpos = cur_height / COLOR_PENS;

/* magenta */
colbuffer[1].bitpos
= ((cur_height + COLOR_GAP + COLOR_PENS) % 8);
colbuffer[1].bytepos
= (MAGENTA_OFFSET * BYTES_PER_COLUMN) + 3 - ((cur_height + COLOR_GAP + COLOR_PENS) / 8) % 2;
colbuffer[1].bufpos
= ((cur_height + COLOR_GAP + COLOR_PENS) / COLOR_PENS) % 3;

/* yellow has 6 buffers, so that it is not mapped to buffers
which have not been printed by cyan yet. The Buffers
> 2 are mapped to the right corresponding buffer
after it has been sent to the printer. */
colbuffer[2].bitpos
= ((cur_height + 2 * (COLOR_GAP + COLOR_PENS)) % 8);
colbuffer[2].bytepos
= 5 - ((cur_height + 2 * (COLOR_GAP + COLOR_PENS)) / 8) % 2;
colbuffer[2].bufpos
= ((cur_height + 2 * (COLOR_GAP + COLOR_PENS)) / COLOR_PENS) % 3;
if (colbuffer[2].bufpos == colbuffer[0].bufpos)
colbuffer[2].bufpos += 3;

/* This extracts the nibbles and transforms them to the bits
in the output stream. */
for(i=0; (i <= blkwidth); i++)
{
nibble = (line[i/2] << (4 * (i % 2))) & 0xF0;

if ((nibble & BLACK) || (nibble && c2050_mono_flag)) {
blkbuffer.buffer[(i * BYTES_PER_COLUMN) + blkbuffer.bytepos]
|= 0x01 << blkbuffer.bitpos;
blkbuffer.unprinted = 1;
}
/* only process colors when not in mono mode */
if (!c2050_mono_flag) {
if (nibble & CYAN) {
colbuffer[colbuffer[0].bufpos].buffer
[(i * BYTES_PER_COLUMN) + colbuffer[0].bytepos]
|= 0x01 << colbuffer[0].bitpos;
colbuffer[colbuffer[0].bufpos].unprinted = 1;
}
if (nibble & MAGENTA) {
colbuffer[colbuffer[1].bufpos].buffer
[(i * BYTES_PER_COLUMN) + colbuffer[1].bytepos]
|= 0x01 << colbuffer[1].bitpos;
colbuffer[colbuffer[1].bufpos].unprinted = 1;
}
if (nibble & YELLOW) {
colbuffer[colbuffer[2].bufpos].buffer
[(i * BYTES_PER_COLUMN) + colbuffer[2].bytepos]
|= 0x01 << colbuffer[2].bitpos;
colbuffer[colbuffer[2].bufpos].unprinted = 1;
}
}
}
cur_height++;
yellowcounter++;
/* Buffer is full or page is over. Print it. Black first...*/
if (!(yellowcounter % BLACK_PENS) || (page_height >= PAGE_HEIGHT))
{
if (skipcolors) {
LexMove(out, 2*COLOR_PENS*skipcolors);
skipcolors=0;
}
PrintSweep(blkbuffer.buffer, lex_blkhd, blkbytesize, blkwidth, LEFT_MARGIN + BLK_O_OFFSET, out);
ClearBuffer(blkbuffer.buffer, blkbytesize);
blkbuffer.unprinted = 0;
}
/* ...then finally colors, if in mono mode
* buffers are empty and will not be printed, easy hack */
if (!(cur_height % COLOR_PENS) || (page_height >= PAGE_HEIGHT))
{
if (colbuffer[CurrentColBuffer].unprinted) {
if (skipcolors) {
LexMove(out, 2*COLOR_PENS*skipcolors);
skipcolors=0;
}
PrintSweep(colbuffer[CurrentColBuffer].buffer,
lex_colhd, colbytesize, colwidth, LEFT_MARGIN + COL_O_OFFSET, out);
ClearBuffer(colbuffer[CurrentColBuffer].buffer, colbytesize);
LexMove(out, 2*COLOR_PENS);
}
else
skipcolors++;
/* now handle the yellow stuff */
for(i = 0; i < colbytesize; i++)
colbuffer[CurrentColBuffer].buffer[i]
|= colbuffer[CurrentColBuffer + 3].buffer[i];
ClearBuffer(colbuffer[CurrentColBuffer + 3].buffer, colbytesize);
colbuffer[CurrentColBuffer].unprinted =
colbuffer[CurrentColBuffer + 3].unprinted;
colbuffer[CurrentColBuffer + 3].unprinted = 0;
/* switch to the next buffer */
CurrentColBuffer = ++CurrentColBuffer % 3;
}
if (cur_height == 3 * COLOR_PENS) cur_height = 0;
if (!(yellowcounter % BLACK_PENS) && !(yellowcounter % COLOR_PENS)) yellowcounter = 0;
}

/* this page has found an end */
if ((page_height++ >= PAGE_HEIGHT)||
(page_height >= GS_PAGE_HEIGHT)) done_page = 1;
}

/* hand out the page */
LexEOP(out);

/* eat any remaining whitespace so process will not hang */
if (PAGE_HEIGHT < GS_PAGE_HEIGHT)
for(i=0;
(i < ((GS_PAGE_HEIGHT - PAGE_HEIGHT) * GS_PAGE_WIDTH / 2)) && (nibble != EOF);
i++)
nibble = getc(in);

/* count the pages and free memory */
numpages++;
free(blkbuffer.buffer);
for (i=0; i < COLOR_BUFFERS; free(colbuffer[i++].buffer));
}
if (numpages == 0) fprintf(stderr, "c2050: No pages printed!");
} /* LexPrint */

/*
* The main program. Sets input and output streams.
* checks for -mono flag
*/
int main(int argc, char *argv[]) {
FILE *InputFile;
FILE *OutPutFile;

InputFile = stdin;
OutPutFile = stdout;

if (argc > 1) {
if (!strcmp(argv[1], "-mono")) {
c2050_mono_flag = 1; /* global var */
} else {
fprintf(stderr, "c2050: unrecognized parameters, only -mono supported\n");
}
};

LexPrint(InputFile, OutPutFile);

fclose(OutPutFile);
fclose(InputFile);

return 0; /* everything okay */
}

c2050-0.4/ps2lexmark000075500000000000000000000002131071405126400141160ustar00rootroot00000000000000#!/bin/sh
gs -q -sDEVICE=bitcmyk \
-r300 \
-dDITHERPPI=150 \
-dNOPAUSE \
-dSAFER \
-dBATCH \
-sOutputFile=\|c2050 \
-
c2050-0.4/ps2monolexmark000075500000000000000000000002221071405126400150070ustar00rootroot00000000000000#!/bin/sh
gs -q -sDEVICE=bitcmyk \
-r300 \
-dDITHERPPI=150 \
-dNOPAUSE \
-dSAFER \
-dBATCH \
-sOutputFile=\|"c2050 -mono"\
-
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin