Skip to content

Commit

Permalink
Merge changes from CUPS 1.4svn-r7999.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@993 a1ca3aef-8c08-0410-bb20-df032aa958be
  • Loading branch information
msweet committed Oct 2, 2008
1 parent 1f6f3db commit cda47a9
Show file tree
Hide file tree
Showing 22 changed files with 1,517 additions and 2,060 deletions.
4 changes: 3 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
CHANGES.txt - 2008-09-27
CHANGES.txt - 2008-10-01
------------------------

CHANGES IN CUPS V1.4b1

- Documentation updates (STR #2567)
- Now support and use a new banner file format for better text
support and easier customization (STR #2490)
- The scheduler now sets the PRINTER_INFO and PRINTER_LOCATION
environment variables from the corresponding IPP attributes.
- The ippRead*() and ippWrite*() functions no longer use a
Expand Down
92 changes: 41 additions & 51 deletions conf/mime.convs.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
# MIME converts file for the Common UNIX Printing System (CUPS).
#
# Copyright 2007 by Apple Inc.
# Copyright 2007-2008 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products.
#
# These coded instructions, statements, and computer programs are the
Expand Down Expand Up @@ -38,62 +38,52 @@
# PostScript filters
#

application/pdf application/postscript 33 pdftops
application/postscript application/vnd.cups-postscript 66 pstops
application/vnd.hp-HPGL application/postscript 66 hpgltops
application/x-cshell application/postscript 33 texttops
application/x-csource application/postscript 33 texttops
application/x-perl application/postscript 33 texttops
application/x-shell application/postscript 33 texttops
text/plain application/postscript 33 texttops
text/html application/postscript 33 texttops
image/gif application/vnd.cups-postscript 66 imagetops
image/png application/vnd.cups-postscript 66 imagetops
image/jpeg application/vnd.cups-postscript 66 imagetops
image/tiff application/vnd.cups-postscript 66 imagetops
image/x-bitmap application/vnd.cups-postscript 66 imagetops
image/x-photocd application/vnd.cups-postscript 66 imagetops
image/x-portable-anymap application/vnd.cups-postscript 66 imagetops
image/x-portable-bitmap application/vnd.cups-postscript 66 imagetops
image/x-portable-graymap application/vnd.cups-postscript 66 imagetops
image/x-portable-pixmap application/vnd.cups-postscript 66 imagetops
image/x-sgi-rgb application/vnd.cups-postscript 66 imagetops
image/x-xbitmap application/vnd.cups-postscript 66 imagetops
image/x-xpixmap application/vnd.cups-postscript 66 imagetops
#image/x-xwindowdump application/vnd.cups-postscript 66 imagetops
image/x-sun-raster application/vnd.cups-postscript 66 imagetops


########################################################################
#
# Form filter...
#
# This filter does not currently exist, but the file format is defined
# in the IDD and registered with the IANA for future use...
#

#application/vnd.cups-form application/vnd.cups-postscript 33 formtops
application/pdf application/postscript 33 pdftops
application/postscript application/vnd.cups-postscript 66 pstops
application/vnd.hp-HPGL application/postscript 66 hpgltops
application/x-cshell application/postscript 33 texttops
application/x-csource application/postscript 33 texttops
application/x-perl application/postscript 33 texttops
application/x-shell application/postscript 33 texttops
text/plain application/postscript 33 texttops
text/html application/postscript 33 texttops
image/gif application/vnd.cups-postscript 66 imagetops
image/png application/vnd.cups-postscript 66 imagetops
image/jpeg application/vnd.cups-postscript 66 imagetops
image/tiff application/vnd.cups-postscript 66 imagetops
image/x-bitmap application/vnd.cups-postscript 66 imagetops
image/x-photocd application/vnd.cups-postscript 66 imagetops
image/x-portable-anymap application/vnd.cups-postscript 66 imagetops
image/x-portable-bitmap application/vnd.cups-postscript 66 imagetops
image/x-portable-graymap application/vnd.cups-postscript 66 imagetops
image/x-portable-pixmap application/vnd.cups-postscript 66 imagetops
image/x-sgi-rgb application/vnd.cups-postscript 66 imagetops
image/x-xbitmap application/vnd.cups-postscript 66 imagetops
image/x-xpixmap application/vnd.cups-postscript 66 imagetops
#image/x-xwindowdump application/vnd.cups-postscript 66 imagetops
image/x-sun-raster application/vnd.cups-postscript 66 imagetops
application/vnd.cups-banner application/vnd.cups-postscript 33 bannertops

########################################################################
#
# Raster filters...
#

image/gif application/vnd.cups-raster 100 imagetoraster
image/png application/vnd.cups-raster 100 imagetoraster
image/jpeg application/vnd.cups-raster 100 imagetoraster
image/tiff application/vnd.cups-raster 100 imagetoraster
image/x-bitmap application/vnd.cups-raster 100 imagetoraster
image/x-photocd application/vnd.cups-raster 100 imagetoraster
image/x-portable-anymap application/vnd.cups-raster 100 imagetoraster
image/x-portable-bitmap application/vnd.cups-raster 100 imagetoraster
image/x-portable-graymap application/vnd.cups-raster 100 imagetoraster
image/x-portable-pixmap application/vnd.cups-raster 100 imagetoraster
image/x-sgi-rgb application/vnd.cups-raster 100 imagetoraster
image/x-xbitmap application/vnd.cups-raster 100 imagetoraster
image/x-xpixmap application/vnd.cups-raster 100 imagetoraster
#image/x-xwindowdump application/vnd.cups-raster 100 imagetoraster
image/x-sun-raster application/vnd.cups-raster 100 imagetoraster
image/gif application/vnd.cups-raster 100 imagetoraster
image/png application/vnd.cups-raster 100 imagetoraster
image/jpeg application/vnd.cups-raster 100 imagetoraster
image/tiff application/vnd.cups-raster 100 imagetoraster
image/x-bitmap application/vnd.cups-raster 100 imagetoraster
image/x-photocd application/vnd.cups-raster 100 imagetoraster
image/x-portable-anymap application/vnd.cups-raster 100 imagetoraster
image/x-portable-bitmap application/vnd.cups-raster 100 imagetoraster
image/x-portable-graymap application/vnd.cups-raster 100 imagetoraster
image/x-portable-pixmap application/vnd.cups-raster 100 imagetoraster
image/x-sgi-rgb application/vnd.cups-raster 100 imagetoraster
image/x-xbitmap application/vnd.cups-raster 100 imagetoraster
image/x-xpixmap application/vnd.cups-raster 100 imagetoraster
#image/x-xwindowdump application/vnd.cups-raster 100 imagetoraster
image/x-sun-raster application/vnd.cups-raster 100 imagetoraster

# pstoraster is part of GPL Ghostscript...
application/vnd.cups-postscript application/vnd.cups-raster 100 pstoraster
Expand Down
6 changes: 4 additions & 2 deletions conf/mime.types
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,14 @@ application/rss+xml rss
# CUPS-specific types...
#

application/vnd.cups-banner string(0,'#CUPS-BANNER')
application/vnd.cups-command string(0,'#CUPS-COMMAND')
application/vnd.cups-form string(0,"<CUPSFORM>")
application/vnd.cups-pdf
application/vnd.cups-postscript
application/vnd.cups-ppd ppd string(0,"*PPD-Adobe:")
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR")
application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR") \
string(0,"RaS2") string(0,"2SaR") \
string(0,"RaS3") string(0,"3SaR")
application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \
string(0,<1B>@) \
(contains(0,128,<1B>%-12345X) + \
Expand Down
4 changes: 1 addition & 3 deletions cups/transcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,9 @@ cupsUTF8ToUTF32(
}

/*
* Convert input UTF-8 to output UTF-32 (and insert BOM)...
* Convert input UTF-8 to output UTF-32...
*/

*dest++ = 0xfeff;

for (i = maxout - 1; *src && i > 0; i --)
{
ch = *src++;
Expand Down
163 changes: 5 additions & 158 deletions data/classified
Original file line number Diff line number Diff line change
@@ -1,159 +1,6 @@
%!PS-Adobe-3.0
%%BoundingBox: 0 0 612 792
%%Pages: 1
%%LanguageLevel: 1
%%DocumentData: Clean7Bit
%%DocumentSuppliedResources: procset bannerprint/1.0
%%DocumentNeededResources: font Helvetica Helvetica-Bold Times-Roman
%%Creator: Michael Sweet, Apple Inc.
%%CreationDate: D:20070620123000+0700
%%Title: Test Page
%%EndComments
%%BeginProlog
%%BeginResource procset bannerprint 1.3 0
%
% PostScript banner page for the Common UNIX Printing System ("CUPS").
%
% Copyright 2007 Apple Inc.
% Copyright 1993-2005 Easy Software Products
%
% These coded instructions, statements, and computer programs are the
% property of Apple Inc. and are protected by Federal copyright law.
% Distribution and use rights are outlined in the file "LICENSE.txt"
% which is included with the CUPS source distribution.
%
/CENTER { % Draw centered text
% (name) CENTER -
dup stringwidth pop % Get the width of the string
0.5 mul neg 0 rmoveto % Shift left 1/2 of the distance
show % Show the string
} bind def
/RIGHT { % Draw right-justified text
% (name) RIGHT -
dup stringwidth pop % Get the width of the string
neg 0 rmoveto % Shift left the entire distance
show % Show the string
} bind def
/NUMBER { % Draw a number
% power n NUMBER -
1 index 1 eq { % power == 1?
round cvi exch pop % Convert "n" to integer
} {
1 index mul round exch div % Truncate extra decimal places
} ifelse
100 string cvs show % Convert to a string and show it...
} bind def
%%EndResource
%%EndProlog
%%Page: 1 1
gsave
#CUPS-BANNER
Show job-id job-name job-originating-user-name job-originating-host-name job-billing
Header Classified
Footer Classified
Image images/cups.rgb

% Determine the imageable area and device resolution...
initclip newpath clippath pathbbox % Get bounding rectangle
72 div /pageTop exch def % Get top margin in inches
72 div /pageRight exch def % Get right margin in inches
72 div /pageBottom exch def % Get bottom margin in inches
72 div /pageLeft exch def % Get left margin in inches

/pageWidth pageRight pageLeft sub def % pageWidth = pageRight - pageLeft
/pageHeight pageTop pageBottom sub def% pageHeight = pageTop - pageBottom

/boxWidth % width of text box
pageWidth pageHeight lt
{ pageWidth 54 mul }
{ pageHeight 42 mul }
ifelse def

newpath % Clear bounding path

% Create fonts...
/bigFont /Helvetica-Bold findfont % bigFont = Helvetica-Bold
pageHeight 3 mul scalefont def % size = pageHeight * 3 (nominally 33)

/mediumFont /Helvetica findfont % mediumFont = Helvetica
pageHeight 1.5 mul scalefont def % size = pageHeight * 1.5 (nominally 16.5)

% Offset page to account for lower-left margin...
pageLeft 72 mul
pageBottom 72 mul
translate

% Draw the label at the top and bottom...
0 setgray % Color

pageWidth 36 mul % Center of page
pageHeight 72 mul % Top of page
pageWidth 9 mul sub % - 3 lines
moveto % Position text
bigFont setfont % Font
(Classified) CENTER % Show text centered

pageWidth 36 mul % Center of page
pageHeight 6 mul % Bottom of page
moveto % Position text
bigFont setfont % Font
(Classified) CENTER % Show text centered

% Job information box...
pageWidth 36 mul 9 add % x = pageWidth * 1/2 * 72 + 9
boxWidth 0.5 mul sub % x-= 1/2 box width
pageHeight 30 mul 9 sub % y = pageHeight * 1/2 * 72 - 9
boxWidth % w = box width
pageHeight 14 mul % h = pageHeight * 1/2 * 72
0.5 setgray rectfill % Draw a shadow

pageWidth 36 mul % x = pageWidth * 1/2 * 72
boxWidth 0.5 mul sub % x-= 1/2 box width
pageHeight 30 mul % y = pageHeight * 1/4 * 72
boxWidth % w = box width
pageHeight 14 mul % h = pageHeight * 1/2 * 72

4 copy 1 setgray rectfill % Clear the box to white
0 setgray rectstroke % Draw a black box around it...

% Job information text...
mediumFont setfont % Medium sized font

pageWidth 36 mul % x = pageWidth * 1/2 * 72
pageHeight 36 mul % y = pageHeight * 1/2 * 72
pageHeight 5 mul add % y += 3.333 lines
2 copy % Copy X & Y
moveto
(Job ID: ) RIGHT
2 copy % Copy X & Y
moveto
({printer-name}-{job-id}) show

pageHeight 3 mul sub % y -= 2 lines
2 copy % Copy X & Y
moveto
(Title: ) RIGHT
2 copy % Copy X & Y
moveto
({job-name}) show

pageHeight 3 mul sub % y -= 2 lines
2 copy % Copy X & Y
moveto
(Requesting User: ) RIGHT
2 copy % Copy X & Y
moveto
({job-originating-user-name}) show

({?job-billing}) () ne {
pageHeight 3 mul sub % y -= 2 lines
2 copy % Copy X & Y
moveto
(Billing Info: ) RIGHT
2 copy % Copy X & Y
moveto
({job-billing}) show
} if

% Show the page...
grestore
showpage
%
% End of "$Id: classified 6649 2007-07-11 21:46:42Z mike $".
%
%%EOF
Loading

0 comments on commit cda47a9

Please sign in to comment.