From: msweet Date: Mon, 27 Oct 2008 21:56:38 +0000 (+0000) Subject: Merge changes from CUPS 1.4svn-r8088, the real official 1.4b1! X-Git-Tag: release-1.6.3~131 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4572d571c24d8e71db08ab9ec16210c2428c761;p=thirdparty%2Fcups.git Merge changes from CUPS 1.4svn-r8088, the real official 1.4b1! git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1035 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-1.3.txt b/CHANGES-1.3.txt index c978695730..f50af051bf 100644 --- a/CHANGES-1.3.txt +++ b/CHANGES-1.3.txt @@ -6,6 +6,9 @@ CHANGES IN CUPS V1.3.10 - SECURITY: The PNG image reading code did not validate the image size properly, leading to a potential buffer overflow (STR #2974) + - Fixed some configure script bugs with rc/xinetd directories + (STR #2970) + - The Epson sample driver PPDs contained errors (STR #2979) CHANGES IN CUPS V1.3.9 diff --git a/backend/usb-libusb.c b/backend/usb-libusb.c index cad8d87ca6..c70940c457 100644 --- a/backend/usb-libusb.c +++ b/backend/usb-libusb.c @@ -380,11 +380,7 @@ get_device_id(usb_printer_t *printer, /* I - Printer */ if (usb_control_msg(printer->handle, USB_TYPE_CLASS | USB_ENDPOINT_IN | USB_RECIP_INTERFACE, - 0, 0, - (printer->iface << 8) | - printer->device->config[printer->conf]. - interface[printer->iface]. - altsetting[printer->altset].bAlternateSetting, + 0, printer->conf, printer->iface, buffer, bufsize, 5000) < 0) { *buffer = '\0'; @@ -614,14 +610,19 @@ open_device(usb_printer_t *printer, /* I - Printer */ fputs("STATE: +connecting-to-device\n", stderr); number = printer->device->config[printer->conf].bConfigurationValue; - while (usb_set_configuration(printer->handle, number) < 0) + + if (usb_set_configuration(printer->handle, number) < 0) { + /* + * If the set fails, chances are that the printer only supports a + * single configuration. Technically these printers don't conform to + * the USB printer specification, but otherwise they'll work... + */ + if (errno != EBUSY) fprintf(stderr, "DEBUG: Failed to set configuration %d for %04x:%04x\n", number, printer->device->descriptor.idVendor, printer->device->descriptor.idProduct); - - goto error; } /* @@ -633,9 +634,9 @@ open_device(usb_printer_t *printer, /* I - Printer */ while (usb_claim_interface(printer->handle, number) < 0) { if (errno != EBUSY) - fprintf(stderr, "DEBUG: Failed to claim interface %d for %04x:%04x\n", + fprintf(stderr, "DEBUG: Failed to claim interface %d for %04x:%04x: %s\n", number, printer->device->descriptor.idVendor, - printer->device->descriptor.idProduct); + printer->device->descriptor.idProduct, strerror(errno)); goto error; } @@ -644,9 +645,9 @@ open_device(usb_printer_t *printer, /* I - Printer */ while (usb_claim_interface(printer->handle, 0) < 0) { if (errno != EBUSY) - fprintf(stderr, "DEBUG: Failed to claim interface 0 for %04x:%04x\n", + fprintf(stderr, "DEBUG: Failed to claim interface 0 for %04x:%04x: %s\n", printer->device->descriptor.idVendor, - printer->device->descriptor.idProduct); + printer->device->descriptor.idProduct, strerror(errno)); goto error; } @@ -661,9 +662,9 @@ open_device(usb_printer_t *printer, /* I - Printer */ { if (errno != EBUSY) fprintf(stderr, - "DEBUG: Failed to set alternate interface %d for %04x:%04x\n", + "DEBUG: Failed to set alternate interface %d for %04x:%04x: %s\n", number, printer->device->descriptor.idVendor, - printer->device->descriptor.idProduct); + printer->device->descriptor.idProduct, strerror(errno)); goto error; } diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index a020203706..bfaf7d3745 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -267,6 +267,9 @@ choose_device_cb( * Update the page... */ + if (!last_device_time) + cgiStartMultipart(); + cgiStartHTML(title); cgiCopyTemplateLang("choose-device.tmpl"); cgiEndHTML(); @@ -906,16 +909,6 @@ do_am_printer(http_t *http, /* I - HTTP connection */ cgiSetVariable("CURRENT_DEVICE_SCHEME", uri); } - /* - * Prime the page with the current device listed... - */ - - cgiStartMultipart(); - cgiStartHTML(title); - cgiCopyTemplateLang("choose-device.tmpl"); - cgiEndHTML(); - fflush(stdout); - /* * Scan for devices for up to 30 seconds, updating the page as we find * them... @@ -923,15 +916,30 @@ do_am_printer(http_t *http, /* I - HTTP connection */ fputs("DEBUG: Getting list of devices...\n", stderr); - time(&last_device_time); - current_device = 0; + last_device_time = 0; + current_device = 0; if (cupsGetDevices(http, 30, NULL, (cups_device_cb_t)choose_device_cb, (void *)title) == IPP_OK) fputs("DEBUG: Got device list!\n", stderr); else + { fprintf(stderr, "ERROR: CUPS-Get-Devices request failed with status %x: %s\n", cupsLastError(), cupsLastErrorString()); + if (cupsLastError() == IPP_NOT_AUTHORIZED) + { + puts("Status: 401\n"); + exit(0); + } + else + { + cgiStartHTML(title); + cgiShowIPPError(modify ? _("Unable to modify printer:") : + _("Unable to add printer:")); + cgiEndHTML(); + return; + } + } /* * Show the final selection page... @@ -1115,12 +1123,16 @@ do_am_printer(http_t *http, /* I - HTTP connection */ var = cgiGetVariable("PPD_MAKE"); if (var) { + const char *make_model; /* Make and model */ + + ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_TEXT, "ppd-make", NULL, var); - if ((var = cgiGetVariable("CURRENT_MAKE_AND_MODEL")) != NULL) + if ((make_model = cgiGetVariable("CURRENT_MAKE_AND_MODEL")) != NULL && + !cgiGetVariable("SELECT_MAKE")) ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_TEXT, - "ppd-make-and-model", NULL, var); + "ppd-make-and-model", NULL, make_model); } else ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index 9b7ee455bd..97431c3717 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -25,9 +25,14 @@ CUPS_REVISION="" #if test -z "$CUPS_REVISION" -a -d .svn; then # CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`" #fi +CUPS_BUILD="cups-$CUPS_VERSION" + +AC_ARG_WITH(cups_build, [ --with-cups-build set "cups-config --build" string ], + CUPS_BUILD="$withval") AC_SUBST(CUPS_VERSION) AC_SUBST(CUPS_REVISION) +AC_SUBST(CUPS_BUILD) AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION$CUPS_REVISION") AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION$CUPS_REVISION") diff --git a/config-scripts/cups-directories.m4 b/config-scripts/cups-directories.m4 index 82783aa7b8..78a4c96d38 100644 --- a/config-scripts/cups-directories.m4 +++ b/config-scripts/cups-directories.m4 @@ -207,7 +207,7 @@ if test x$rcdir = x; then ;; esac -else +elif test "x$rcdir" != xno; then if test "x$rclevels" = x; then INITDDIR="$rcdir" else @@ -232,6 +232,8 @@ if test "x$XINETD" = x -a ! -x /sbin/launchd; then break fi done +elif test "x$XINETD" = xno; then + XINETD="" fi AC_SUBST(XINETD) diff --git a/cups-config.in b/cups-config.in index 1a68a12c70..8a3db33751 100755 --- a/cups-config.in +++ b/cups-config.in @@ -4,7 +4,7 @@ # # CUPS configuration utility. # -# Copyright 2007 by Apple Inc. +# Copyright 2007-2008 by Apple Inc. # Copyright 2001-2006 by Easy Software Products, all rights reserved. # # These coded instructions, statements, and computer programs are the @@ -16,6 +16,7 @@ VERSION="@CUPS_VERSION@" APIVERSION="1.4" +BUILD="@CUPS_BUILD@" prefix=@prefix@ exec_prefix=@exec_prefix@ @@ -62,6 +63,7 @@ fi usage () { echo "Usage: cups-config --api-version" + echo " cups-config --build" echo " cups-config --cflags" echo " cups-config --datadir" echo " cups-config --help" @@ -88,6 +90,9 @@ while test $# -gt 0; do --api-version) echo $APIVERSION ;; + --build) + echo $BUILD + ;; --cflags) echo $CFLAGS ;; diff --git a/cups/api-array.header b/cups/api-array.header index c4d28b4647..825b407543 100644 --- a/cups/api-array.header +++ b/cups/api-array.header @@ -12,8 +12,6 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> -

Array API

-
diff --git a/cups/api-cups.header b/cups/api-cups.header index c95b611fd0..cc4dd408b8 100644 --- a/cups/api-cups.header +++ b/cups/api-cups.header @@ -12,8 +12,6 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> -

CUPS API

-
diff --git a/cups/api-filedir.header b/cups/api-filedir.header index e4c7994f5f..2a46a67713 100644 --- a/cups/api-filedir.header +++ b/cups/api-filedir.header @@ -12,8 +12,6 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> -

File and Directory APIs

-
diff --git a/cups/api-filter.header b/cups/api-filter.header index bfe1a73aab..8f12ebcfad 100644 --- a/cups/api-filter.header +++ b/cups/api-filter.header @@ -13,8 +13,6 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> -

Filter and Backend Programming

-
diff --git a/cups/api-httpipp.header b/cups/api-httpipp.header index 4bb1b3d579..df069fb590 100644 --- a/cups/api-httpipp.header +++ b/cups/api-httpipp.header @@ -13,8 +13,6 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> -

HTTP and IPP APIs

-
diff --git a/cups/api-overview.header b/cups/api-overview.header index 51dbb2776f..23cdd4fee5 100644 --- a/cups/api-overview.header +++ b/cups/api-overview.header @@ -13,8 +13,6 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> -

Introduction to CUPS Programming

-
@@ -37,13 +35,18 @@ - + Programming: Raster API
+ References: PPD Compiler Driver Information File Reference
+ Specifications: CUPS PPD Extensions
See AlsoProgramming: CUPS API
+
Programming: Developing Raster Printer Drivers
+ Programming: Developing PostScript Printer Drivers
+ Programming: Filter and Backend Programming
+ Programming: Introduction to the PPD Compiler
Programming: Array API
+ Programming: CUPS API
Programming: File and Directory APIs
- Programming: Filter and Backend Programming
Programming: HTTP and IPP APIs
Programming: PPD API
- Programming: Raster API
diff --git a/cups/api-ppd.header b/cups/api-ppd.header index 8ec2f7593d..5c74e16d1c 100644 --- a/cups/api-ppd.header +++ b/cups/api-ppd.header @@ -12,8 +12,6 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> -

PPD API

-
diff --git a/cups/auth.c b/cups/auth.c index 36fe0d48aa..d97029e137 100644 --- a/cups/auth.c +++ b/cups/auth.c @@ -530,7 +530,8 @@ cups_local_auth(http_t *http) /* I - HTTP connection to server */ http->auth_ref = NULL; } - if (httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey", + if (!getenv("GATEWAY_INTERFACE") && + httpGetSubField2(http, HTTP_FIELD_WWW_AUTHENTICATE, "authkey", auth_key, sizeof(auth_key))) { status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, diff --git a/cups/testppd.c b/cups/testppd.c index b16052ece7..2583f3fd91 100644 --- a/cups/testppd.c +++ b/cups/testppd.c @@ -724,7 +724,6 @@ main(int argc, /* I - Number of command-line arguments */ else { int j, k; /* Looping vars */ - ppd_attr_t *attr; /* Current attribute */ ppd_group_t *group; /* Option group */ ppd_option_t *option; /* Option */ ppd_coption_t *coption; /* Custom option */ @@ -750,6 +749,14 @@ main(int argc, /* I - Number of command-line arguments */ ppdLocalize(ppd); + if (argc > 3) + { + text = ppdLocalizeIPPReason(ppd, argv[3], NULL, buffer, sizeof(buffer)); + printf("ppdLocalizeIPPReason(%s)=%s\n", argv[3], + text ? text : "(null)"); + return (text == NULL); + } + for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++) diff --git a/doc/Makefile b/doc/Makefile index 016b1d2012..1373dea683 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -29,7 +29,10 @@ WEBIMAGES = \ images/cups.png \ images/cups.rgb \ images/cups-block-diagram.gif \ + images/cups-command-chain.png \ images/cups-icon.png \ + images/cups-postscript-chain.png \ + images/cups-raster-chain.png \ images/left.gif \ images/raster.png \ images/right.gif \ @@ -88,6 +91,7 @@ HELPFILES = \ help/policies.html \ help/postscript-driver.html \ help/ppd-compiler.html \ + help/raster-driver.html \ help/ref-access_log.html \ help/ref-classes-conf.html \ help/ref-client-conf.html \ diff --git a/doc/help/api-array.html b/doc/help/api-array.html index 007d71278b..fe4a8c0767 100644 --- a/doc/help/api-array.html +++ b/doc/help/api-array.html @@ -27,6 +27,11 @@ PRE.command { margin-left: 36pt; } +P.example { + font-style: italic; + margin-left: 36pt; +} + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -54,6 +59,16 @@ BLOCKQUOTE { padding: 10pt; } +A IMG { + border: none; +} + +A:link:hover IMG { + background: #f0f0f0; + border-radius: 10px; + -moz-border-radius: 10px; +} + A:link, A:visited { font-weight: normal; text-decoration: none; @@ -67,6 +82,19 @@ SUB, SUP { font-size: 50%; } +TR.data, TD.data, TR.data TD { + margin-top: 10pt; + padding: 5pt; + border-bottom: solid 1pt #999999; +} + +TR.data TH { + border-bottom: solid 1pt #999999; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; +} + DIV.table TABLE { border: solid thin #999999; border-collapse: collapse; @@ -110,19 +138,23 @@ DIV.figure CAPTION { } TH.label { - padding-top: 5pt; text-align: right; vertical-align: top; } +TH.sublabel { + text-align: right; + font-weight: normal; +} + HR { border: solid thin; } SPAN.info { - background: #000000; - border: thin solid #000000; - color: #ffffff; + background: black; + border: thin solid black; + color: white; font-size: 80%; font-style: italic; font-weight: bold; @@ -138,6 +170,57 @@ H2.title, H3.title { border-bottom: solid 2pt #000000; } +DIV.indent, TABLE.indent { + margin-top: 2em; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.indent { + border-collapse: collapse; +} + +TABLE.indent TD, TABLE.indent TH { + padding: 0; +} + +TABLE.list { + border-collapse: collapse; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.list TH { + background: white; + border-bottom: solid thin #cccccc; + color: #444444; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; + vertical-align: bottom; + white-space: nowrap; +} + +TABLE.list TH A { + color: #4444cc; +} + +TABLE.list TD { + border-bottom: solid thin #eeeeee; + padding-top: 5pt; + padding-left: 5pt; +} + +TABLE.list TR:nth-child(even) { + background: #f8f8f8; +} + +TABLE.list TR:nth-child(odd) { + background: #f4f4f4; +} + DT { margin-left: 36pt; margin-top: 12pt; @@ -156,11 +239,6 @@ P.summary { font-family: monaco, courier, monospace; } -SPAN.message { - font-style: italic; - font-size: smaller; -} - DIV.summary TABLE { border: solid thin #999999; border-collapse: collapse; @@ -266,8 +344,6 @@ div.contents ul.subcontents li { file is missing or damaged, see the license at "http://www.cups.org/". --> -

Array API

-
diff --git a/doc/help/api-cups.html b/doc/help/api-cups.html index ec943f0411..181f66d963 100644 --- a/doc/help/api-cups.html +++ b/doc/help/api-cups.html @@ -27,6 +27,11 @@ PRE.command { margin-left: 36pt; } +P.example { + font-style: italic; + margin-left: 36pt; +} + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -54,6 +59,16 @@ BLOCKQUOTE { padding: 10pt; } +A IMG { + border: none; +} + +A:link:hover IMG { + background: #f0f0f0; + border-radius: 10px; + -moz-border-radius: 10px; +} + A:link, A:visited { font-weight: normal; text-decoration: none; @@ -67,6 +82,19 @@ SUB, SUP { font-size: 50%; } +TR.data, TD.data, TR.data TD { + margin-top: 10pt; + padding: 5pt; + border-bottom: solid 1pt #999999; +} + +TR.data TH { + border-bottom: solid 1pt #999999; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; +} + DIV.table TABLE { border: solid thin #999999; border-collapse: collapse; @@ -110,19 +138,23 @@ DIV.figure CAPTION { } TH.label { - padding-top: 5pt; text-align: right; vertical-align: top; } +TH.sublabel { + text-align: right; + font-weight: normal; +} + HR { border: solid thin; } SPAN.info { - background: #000000; - border: thin solid #000000; - color: #ffffff; + background: black; + border: thin solid black; + color: white; font-size: 80%; font-style: italic; font-weight: bold; @@ -138,6 +170,57 @@ H2.title, H3.title { border-bottom: solid 2pt #000000; } +DIV.indent, TABLE.indent { + margin-top: 2em; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.indent { + border-collapse: collapse; +} + +TABLE.indent TD, TABLE.indent TH { + padding: 0; +} + +TABLE.list { + border-collapse: collapse; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.list TH { + background: white; + border-bottom: solid thin #cccccc; + color: #444444; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; + vertical-align: bottom; + white-space: nowrap; +} + +TABLE.list TH A { + color: #4444cc; +} + +TABLE.list TD { + border-bottom: solid thin #eeeeee; + padding-top: 5pt; + padding-left: 5pt; +} + +TABLE.list TR:nth-child(even) { + background: #f8f8f8; +} + +TABLE.list TR:nth-child(odd) { + background: #f4f4f4; +} + DT { margin-left: 36pt; margin-top: 12pt; @@ -156,11 +239,6 @@ P.summary { font-family: monaco, courier, monospace; } -SPAN.message { - font-style: italic; - font-size: smaller; -} - DIV.summary TABLE { border: solid thin #999999; border-collapse: collapse; @@ -266,8 +344,6 @@ div.contents ul.subcontents li { file is missing or damaged, see the license at "http://www.cups.org/". --> -

CUPS API

-
diff --git a/doc/help/api-filedir.html b/doc/help/api-filedir.html index 5ad93f95f6..0bb9eea2ae 100644 --- a/doc/help/api-filedir.html +++ b/doc/help/api-filedir.html @@ -27,6 +27,11 @@ PRE.command { margin-left: 36pt; } +P.example { + font-style: italic; + margin-left: 36pt; +} + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -54,6 +59,16 @@ BLOCKQUOTE { padding: 10pt; } +A IMG { + border: none; +} + +A:link:hover IMG { + background: #f0f0f0; + border-radius: 10px; + -moz-border-radius: 10px; +} + A:link, A:visited { font-weight: normal; text-decoration: none; @@ -67,6 +82,19 @@ SUB, SUP { font-size: 50%; } +TR.data, TD.data, TR.data TD { + margin-top: 10pt; + padding: 5pt; + border-bottom: solid 1pt #999999; +} + +TR.data TH { + border-bottom: solid 1pt #999999; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; +} + DIV.table TABLE { border: solid thin #999999; border-collapse: collapse; @@ -110,19 +138,23 @@ DIV.figure CAPTION { } TH.label { - padding-top: 5pt; text-align: right; vertical-align: top; } +TH.sublabel { + text-align: right; + font-weight: normal; +} + HR { border: solid thin; } SPAN.info { - background: #000000; - border: thin solid #000000; - color: #ffffff; + background: black; + border: thin solid black; + color: white; font-size: 80%; font-style: italic; font-weight: bold; @@ -138,6 +170,57 @@ H2.title, H3.title { border-bottom: solid 2pt #000000; } +DIV.indent, TABLE.indent { + margin-top: 2em; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.indent { + border-collapse: collapse; +} + +TABLE.indent TD, TABLE.indent TH { + padding: 0; +} + +TABLE.list { + border-collapse: collapse; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.list TH { + background: white; + border-bottom: solid thin #cccccc; + color: #444444; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; + vertical-align: bottom; + white-space: nowrap; +} + +TABLE.list TH A { + color: #4444cc; +} + +TABLE.list TD { + border-bottom: solid thin #eeeeee; + padding-top: 5pt; + padding-left: 5pt; +} + +TABLE.list TR:nth-child(even) { + background: #f8f8f8; +} + +TABLE.list TR:nth-child(odd) { + background: #f4f4f4; +} + DT { margin-left: 36pt; margin-top: 12pt; @@ -156,11 +239,6 @@ P.summary { font-family: monaco, courier, monospace; } -SPAN.message { - font-style: italic; - font-size: smaller; -} - DIV.summary TABLE { border: solid thin #999999; border-collapse: collapse; @@ -266,8 +344,6 @@ div.contents ul.subcontents li { file is missing or damaged, see the license at "http://www.cups.org/". --> -

File and Directory APIs

-
diff --git a/doc/help/api-filter.html b/doc/help/api-filter.html index ae6f993298..fa1c17a80d 100644 --- a/doc/help/api-filter.html +++ b/doc/help/api-filter.html @@ -27,6 +27,11 @@ PRE.command { margin-left: 36pt; } +P.example { + font-style: italic; + margin-left: 36pt; +} + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -54,6 +59,16 @@ BLOCKQUOTE { padding: 10pt; } +A IMG { + border: none; +} + +A:link:hover IMG { + background: #f0f0f0; + border-radius: 10px; + -moz-border-radius: 10px; +} + A:link, A:visited { font-weight: normal; text-decoration: none; @@ -67,6 +82,19 @@ SUB, SUP { font-size: 50%; } +TR.data, TD.data, TR.data TD { + margin-top: 10pt; + padding: 5pt; + border-bottom: solid 1pt #999999; +} + +TR.data TH { + border-bottom: solid 1pt #999999; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; +} + DIV.table TABLE { border: solid thin #999999; border-collapse: collapse; @@ -110,19 +138,23 @@ DIV.figure CAPTION { } TH.label { - padding-top: 5pt; text-align: right; vertical-align: top; } +TH.sublabel { + text-align: right; + font-weight: normal; +} + HR { border: solid thin; } SPAN.info { - background: #000000; - border: thin solid #000000; - color: #ffffff; + background: black; + border: thin solid black; + color: white; font-size: 80%; font-style: italic; font-weight: bold; @@ -138,6 +170,57 @@ H2.title, H3.title { border-bottom: solid 2pt #000000; } +DIV.indent, TABLE.indent { + margin-top: 2em; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.indent { + border-collapse: collapse; +} + +TABLE.indent TD, TABLE.indent TH { + padding: 0; +} + +TABLE.list { + border-collapse: collapse; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.list TH { + background: white; + border-bottom: solid thin #cccccc; + color: #444444; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; + vertical-align: bottom; + white-space: nowrap; +} + +TABLE.list TH A { + color: #4444cc; +} + +TABLE.list TD { + border-bottom: solid thin #eeeeee; + padding-top: 5pt; + padding-left: 5pt; +} + +TABLE.list TR:nth-child(even) { + background: #f8f8f8; +} + +TABLE.list TR:nth-child(odd) { + background: #f4f4f4; +} + DT { margin-left: 36pt; margin-top: 12pt; @@ -156,11 +239,6 @@ P.summary { font-family: monaco, courier, monospace; } -SPAN.message { - font-style: italic; - font-size: smaller; -} - DIV.summary TABLE { border: solid thin #999999; border-collapse: collapse; @@ -267,8 +345,6 @@ div.contents ul.subcontents li { file is missing or damaged, see the license at "http://www.cups.org/". --> -

Filter and Backend Programming

-
diff --git a/doc/help/api-httpipp.html b/doc/help/api-httpipp.html index 74aaaf9ddc..cb411fc3aa 100644 --- a/doc/help/api-httpipp.html +++ b/doc/help/api-httpipp.html @@ -27,6 +27,11 @@ PRE.command { margin-left: 36pt; } +P.example { + font-style: italic; + margin-left: 36pt; +} + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -54,6 +59,16 @@ BLOCKQUOTE { padding: 10pt; } +A IMG { + border: none; +} + +A:link:hover IMG { + background: #f0f0f0; + border-radius: 10px; + -moz-border-radius: 10px; +} + A:link, A:visited { font-weight: normal; text-decoration: none; @@ -67,6 +82,19 @@ SUB, SUP { font-size: 50%; } +TR.data, TD.data, TR.data TD { + margin-top: 10pt; + padding: 5pt; + border-bottom: solid 1pt #999999; +} + +TR.data TH { + border-bottom: solid 1pt #999999; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; +} + DIV.table TABLE { border: solid thin #999999; border-collapse: collapse; @@ -110,19 +138,23 @@ DIV.figure CAPTION { } TH.label { - padding-top: 5pt; text-align: right; vertical-align: top; } +TH.sublabel { + text-align: right; + font-weight: normal; +} + HR { border: solid thin; } SPAN.info { - background: #000000; - border: thin solid #000000; - color: #ffffff; + background: black; + border: thin solid black; + color: white; font-size: 80%; font-style: italic; font-weight: bold; @@ -138,6 +170,57 @@ H2.title, H3.title { border-bottom: solid 2pt #000000; } +DIV.indent, TABLE.indent { + margin-top: 2em; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.indent { + border-collapse: collapse; +} + +TABLE.indent TD, TABLE.indent TH { + padding: 0; +} + +TABLE.list { + border-collapse: collapse; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.list TH { + background: white; + border-bottom: solid thin #cccccc; + color: #444444; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; + vertical-align: bottom; + white-space: nowrap; +} + +TABLE.list TH A { + color: #4444cc; +} + +TABLE.list TD { + border-bottom: solid thin #eeeeee; + padding-top: 5pt; + padding-left: 5pt; +} + +TABLE.list TR:nth-child(even) { + background: #f8f8f8; +} + +TABLE.list TR:nth-child(odd) { + background: #f4f4f4; +} + DT { margin-left: 36pt; margin-top: 12pt; @@ -156,11 +239,6 @@ P.summary { font-family: monaco, courier, monospace; } -SPAN.message { - font-style: italic; - font-size: smaller; -} - DIV.summary TABLE { border: solid thin #999999; border-collapse: collapse; @@ -267,8 +345,6 @@ div.contents ul.subcontents li { file is missing or damaged, see the license at "http://www.cups.org/". --> -

HTTP and IPP APIs

-
diff --git a/doc/help/api-overview.html b/doc/help/api-overview.html index d5d3358c81..998cca91bf 100644 --- a/doc/help/api-overview.html +++ b/doc/help/api-overview.html @@ -27,6 +27,11 @@ PRE.command { margin-left: 36pt; } +P.example { + font-style: italic; + margin-left: 36pt; +} + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -54,6 +59,16 @@ BLOCKQUOTE { padding: 10pt; } +A IMG { + border: none; +} + +A:link:hover IMG { + background: #f0f0f0; + border-radius: 10px; + -moz-border-radius: 10px; +} + A:link, A:visited { font-weight: normal; text-decoration: none; @@ -67,6 +82,19 @@ SUB, SUP { font-size: 50%; } +TR.data, TD.data, TR.data TD { + margin-top: 10pt; + padding: 5pt; + border-bottom: solid 1pt #999999; +} + +TR.data TH { + border-bottom: solid 1pt #999999; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; +} + DIV.table TABLE { border: solid thin #999999; border-collapse: collapse; @@ -110,19 +138,23 @@ DIV.figure CAPTION { } TH.label { - padding-top: 5pt; text-align: right; vertical-align: top; } +TH.sublabel { + text-align: right; + font-weight: normal; +} + HR { border: solid thin; } SPAN.info { - background: #000000; - border: thin solid #000000; - color: #ffffff; + background: black; + border: thin solid black; + color: white; font-size: 80%; font-style: italic; font-weight: bold; @@ -138,6 +170,57 @@ H2.title, H3.title { border-bottom: solid 2pt #000000; } +DIV.indent, TABLE.indent { + margin-top: 2em; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.indent { + border-collapse: collapse; +} + +TABLE.indent TD, TABLE.indent TH { + padding: 0; +} + +TABLE.list { + border-collapse: collapse; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.list TH { + background: white; + border-bottom: solid thin #cccccc; + color: #444444; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; + vertical-align: bottom; + white-space: nowrap; +} + +TABLE.list TH A { + color: #4444cc; +} + +TABLE.list TD { + border-bottom: solid thin #eeeeee; + padding-top: 5pt; + padding-left: 5pt; +} + +TABLE.list TR:nth-child(even) { + background: #f8f8f8; +} + +TABLE.list TR:nth-child(odd) { + background: #f4f4f4; +} + DT { margin-left: 36pt; margin-top: 12pt; @@ -156,11 +239,6 @@ P.summary { font-family: monaco, courier, monospace; } -SPAN.message { - font-style: italic; - font-size: smaller; -} - DIV.summary TABLE { border: solid thin #999999; border-collapse: collapse; @@ -267,8 +345,6 @@ div.contents ul.subcontents li { file is missing or damaged, see the license at "http://www.cups.org/". --> -

Introduction to CUPS Programming

-
@@ -291,13 +367,18 @@ div.contents ul.subcontents li { - + Programming: Raster API
+ References: PPD Compiler Driver Information File Reference
+ Specifications: CUPS PPD Extensions
See AlsoProgramming: CUPS API
+
Programming: Developing Raster Printer Drivers
+ Programming: Developing PostScript Printer Drivers
+ Programming: Filter and Backend Programming
+ Programming: Introduction to the PPD Compiler
Programming: Array API
+ Programming: CUPS API
Programming: File and Directory APIs
- Programming: Filter and Backend Programming
Programming: HTTP and IPP APIs
Programming: PPD API
- Programming: Raster API
diff --git a/doc/help/api-ppd.html b/doc/help/api-ppd.html index 20e51fc4e0..d44fab4224 100644 --- a/doc/help/api-ppd.html +++ b/doc/help/api-ppd.html @@ -27,6 +27,11 @@ PRE.command { margin-left: 36pt; } +P.example { + font-style: italic; + margin-left: 36pt; +} + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -54,6 +59,16 @@ BLOCKQUOTE { padding: 10pt; } +A IMG { + border: none; +} + +A:link:hover IMG { + background: #f0f0f0; + border-radius: 10px; + -moz-border-radius: 10px; +} + A:link, A:visited { font-weight: normal; text-decoration: none; @@ -67,6 +82,19 @@ SUB, SUP { font-size: 50%; } +TR.data, TD.data, TR.data TD { + margin-top: 10pt; + padding: 5pt; + border-bottom: solid 1pt #999999; +} + +TR.data TH { + border-bottom: solid 1pt #999999; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; +} + DIV.table TABLE { border: solid thin #999999; border-collapse: collapse; @@ -110,19 +138,23 @@ DIV.figure CAPTION { } TH.label { - padding-top: 5pt; text-align: right; vertical-align: top; } +TH.sublabel { + text-align: right; + font-weight: normal; +} + HR { border: solid thin; } SPAN.info { - background: #000000; - border: thin solid #000000; - color: #ffffff; + background: black; + border: thin solid black; + color: white; font-size: 80%; font-style: italic; font-weight: bold; @@ -138,6 +170,57 @@ H2.title, H3.title { border-bottom: solid 2pt #000000; } +DIV.indent, TABLE.indent { + margin-top: 2em; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.indent { + border-collapse: collapse; +} + +TABLE.indent TD, TABLE.indent TH { + padding: 0; +} + +TABLE.list { + border-collapse: collapse; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.list TH { + background: white; + border-bottom: solid thin #cccccc; + color: #444444; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; + vertical-align: bottom; + white-space: nowrap; +} + +TABLE.list TH A { + color: #4444cc; +} + +TABLE.list TD { + border-bottom: solid thin #eeeeee; + padding-top: 5pt; + padding-left: 5pt; +} + +TABLE.list TR:nth-child(even) { + background: #f8f8f8; +} + +TABLE.list TR:nth-child(odd) { + background: #f4f4f4; +} + DT { margin-left: 36pt; margin-top: 12pt; @@ -156,11 +239,6 @@ P.summary { font-family: monaco, courier, monospace; } -SPAN.message { - font-style: italic; - font-size: smaller; -} - DIV.summary TABLE { border: solid thin #999999; border-collapse: collapse; @@ -266,8 +344,6 @@ div.contents ul.subcontents li { file is missing or damaged, see the license at "http://www.cups.org/". --> -

PPD API

-
diff --git a/doc/help/api-raster.html b/doc/help/api-raster.html index 2672ec9db0..db6c3e6064 100644 --- a/doc/help/api-raster.html +++ b/doc/help/api-raster.html @@ -27,6 +27,11 @@ PRE.command { margin-left: 36pt; } +P.example { + font-style: italic; + margin-left: 36pt; +} + PRE.example { background: #eeeeee; border: dotted thin #999999; @@ -54,6 +59,16 @@ BLOCKQUOTE { padding: 10pt; } +A IMG { + border: none; +} + +A:link:hover IMG { + background: #f0f0f0; + border-radius: 10px; + -moz-border-radius: 10px; +} + A:link, A:visited { font-weight: normal; text-decoration: none; @@ -67,6 +82,19 @@ SUB, SUP { font-size: 50%; } +TR.data, TD.data, TR.data TD { + margin-top: 10pt; + padding: 5pt; + border-bottom: solid 1pt #999999; +} + +TR.data TH { + border-bottom: solid 1pt #999999; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; +} + DIV.table TABLE { border: solid thin #999999; border-collapse: collapse; @@ -110,19 +138,23 @@ DIV.figure CAPTION { } TH.label { - padding-top: 5pt; text-align: right; vertical-align: top; } +TH.sublabel { + text-align: right; + font-weight: normal; +} + HR { border: solid thin; } SPAN.info { - background: #000000; - border: thin solid #000000; - color: #ffffff; + background: black; + border: thin solid black; + color: white; font-size: 80%; font-style: italic; font-weight: bold; @@ -138,6 +170,57 @@ H2.title, H3.title { border-bottom: solid 2pt #000000; } +DIV.indent, TABLE.indent { + margin-top: 2em; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.indent { + border-collapse: collapse; +} + +TABLE.indent TD, TABLE.indent TH { + padding: 0; +} + +TABLE.list { + border-collapse: collapse; + margin-left: auto; + margin-right: auto; + width: 90%; +} + +TABLE.list TH { + background: white; + border-bottom: solid thin #cccccc; + color: #444444; + padding-top: 10pt; + padding-left: 5pt; + text-align: left; + vertical-align: bottom; + white-space: nowrap; +} + +TABLE.list TH A { + color: #4444cc; +} + +TABLE.list TD { + border-bottom: solid thin #eeeeee; + padding-top: 5pt; + padding-left: 5pt; +} + +TABLE.list TR:nth-child(even) { + background: #f8f8f8; +} + +TABLE.list TR:nth-child(odd) { + background: #f4f4f4; +} + DT { margin-left: 36pt; margin-top: 12pt; @@ -156,11 +239,6 @@ P.summary { font-family: monaco, courier, monospace; } -SPAN.message { - font-style: italic; - font-size: smaller; -} - DIV.summary TABLE { border: solid thin #999999; border-collapse: collapse; @@ -266,8 +344,6 @@ div.contents ul.subcontents li { file is missing or damaged, see the license at "http://www.cups.org/". --> -

Raster API

-
diff --git a/doc/help/postscript-driver.html b/doc/help/postscript-driver.html index 89f2df99b9..dd46cbd202 100644 --- a/doc/help/postscript-driver.html +++ b/doc/help/postscript-driver.html @@ -235,6 +235,40 @@ information file.

Filter application/vnd.cups-postscript 0 - +

Custom Command Filters

+ +

The application/vnd.cups-command file type is used for CUPS command files. Use the following Filter directive to handle CUPS command files:

+ +
+Filter application/vnd.cups-command 100 /path/to/command/filter
+
+ +

To use the standard PostScript command filter, specify commandtops as the path to the command filter.

+ +

Custom PDF Filters

+ +

The application/pdf file type is used for unfiltered PDF files while the application/vnd.cups-pdf file type is used for filtered PDF files. Use the following Filter directive to handle filtered PDF files:

+ +
+Filter application/vnd.cups-pdf 100 /path/to/pdf/filter
+
+ +

For unfiltered PDF files, use:

+ +
+Filter application/pdf 100 /path/to/pdf/filter
+
+ +

Custom PDF filters that accept filtered data do not need to perform number-up processing and other types of page imposition, while those that accept unfiltered data MUST do the number-up processing themselves.

+ +

Custom PostScript Filters

+ +

The application/vnd.cups-postscript file type is used for filtered PostScript files. Use the following Filter directive to handle PostScript files:

+ +
+Filter application/vnd.cups-postscript 100 /path/to/postscript/filter
+
+

Implementing Color Management

diff --git a/doc/help/raster-driver.html b/doc/help/raster-driver.html new file mode 100644 index 0000000000..c2517e1e5e --- /dev/null +++ b/doc/help/raster-driver.html @@ -0,0 +1,198 @@ + + + + Developing Raster Printer Drivers + + + +

This document describes how to develop printer drivers for raster printers. Topics include: printer driver basics, creating new PPD files, using filters, implementing color management, adding Mac OS X features, and deploying your driver.

+ +
+ + + + + + +
See AlsoProgramming: Developing PostScript Printer Drivers
+ Programming: Filter and Backend Programming
+ Programming: Introduction to the PPD Compiler
+ Programming: Raster API
+ References: PPD Compiler Driver Information File Reference
+ Specifications: CUPS PPD Extensions
+ + +

Printer Driver Basics

+ +

A CUPS raster printer driver consists of a PostScript Printer Description (PPD) file that describes the features and capabilities of the device, one or more filter programs that prepare print data for the device, and zero or more support files for color management, online help, and so forth. The PPD file includes references to all of the filters and support files used by the driver.

+ +

Every time a user prints something the scheduler program, cupsd(8), determines the format of the print job and the programs required to convert that job into something the printer understands. CUPS includes filter programs for many common formats, for example to convert Portable Document Format (PDF) files into CUPS raster data. Figure 1 shows the data flow of a typical print job.

+ +
+ + +
Figure 1: Raster Filter Chain
Raster Filter Chain
+ +

The raster filter converts CUPS raster data into a format the printer understands, for example HP-PCL. CUPS includes several sample raster filters supporting standard page description languages (PDLs). Table 1 shows the raster filters that are bundled with CUPS and the languages they support.

+ +
+ + + + + + + + + + + +
Table 1: Standard CUPS Raster Filters
FilterPDLsppdc DriverTypeppdc #include file
rastertoepsonESC/P, ESC/P2epsonepson.h
rastertoescpxESC/P, ESC/P2, EPSON Remote Modeescpescp.h
rastertohpHP-PCL3, HP-PCL5hphp.h
rastertolabelCPCL, Dymo, EPL1, EPL2, Intellitech PCL, ZPLlabellabel.h
rastertopclxHP-RTL, HP-PCL3, HP-PCL3GUI, HP-PCL5, HP-PCL5c, HP-PCL5epclpcl.h
+ +

The optional port monitor handles interface-specific protocol or encoding issues. For example, some raster printers use the 1284.4 communications protocol.

+ +

The backend handles communications with the printer, sending print data from the last filter to the printer and relaying back-channel data from the printer to the upstream filters. CUPS includes backend programs for common direct-connect interfaces and network protocols, and you can provide your own backend to support custom interfaces and protocols.

+ +

The scheduler also supports a special "command" file format for sending maintenance commands and status queries to a printer or printer driver. Command print jobs typically use a single command filter program defined in the PPD file to generate the appropriate printer commands and handle any responses from the printer. Figure 2 shows the data flow of a typical command job.

+ +
+ + +
Figure 2: Command Filter Chain
Command Filter Chain
+ +

Raster printer drivers must provide their own command filter.

+ + +

Creating New PPD Files

+ +

We recommend using the CUPS PPD compiler, ppdc(1), to create new PPD files since it manages many of the tedious (and error-prone!) details of paper sizes and localization for you. It also allows you to easily support multiple devices from a single source file. For more information see the "Introduction to the PPD Compiler" document. Listing 1 shows a driver information file for several similar black-and-white HP-PCL5 laser printers.

+ +

Listing 1: "examples/laserjet-basic.drv"

+ +
+// Include standard font and media definitions
+#include <font.defs>
+#include <media.defs>
+
+// Include HP-PCL driver definitions
+#include <pcl.h>
+
+// Specify that this driver uses the HP-PCL driver...
+DriverType pcl
+
+// Specify the driver options via the model number...
+ModelNumber ($PCL_PAPER_SIZE $PCL_PJL $PCL_PJL_RESOLUTION)
+
+// List the fonts that are supported, in this case all standard fonts...
+Font *
+
+// Manufacturer and driver version
+Manufacturer "HP"
+Version 1.0
+
+// Supported page sizes and their margins
+HWMargins 18 12 18 12
+*MediaSize Letter
+MediaSize Legal
+MediaSize Executive
+MediaSize Monarch
+MediaSize Statement
+MediaSize FanFoldGermanLegal
+
+HWMargins 18 12.72 18 12.72
+MediaSize Env10
+
+HWMargins 9.72 12 9.72 12
+MediaSize A4
+MediaSize A5
+MediaSize B5
+MediaSize EnvC5
+MediaSize EnvDL
+MediaSize EnvISOB5
+MediaSize Postcard
+MediaSize DoublePostcard
+
+// Only black-and-white output with mode 3 compression...
+ColorModel Gray k chunky 3
+
+// Supported resolutions
+Resolution - 1 0 0 0 "300dpi/300 DPI"
+*Resolution - 8 0 0 0 "600dpi/600 DPI"
+
+// Supported input slots
+*InputSlot 7 "Auto/Automatic Selection"
+InputSlot 2 "Manual/Tray 1 - Manual Feed"
+InputSlot 4 "Upper/Tray 1"
+InputSlot 1 "Lower/Tray 2"
+InputSlot 5 "LargeCapacity/Tray 3"
+
+// Tray 3 is an option...
+Installable "OptionLargeCapacity/Tray 3 Installed"
+UIConstraints "*OptionLargeCapacity False *InputSlot LargeCapacity"
+
+{
+  // HP LaserJet 2100 Series
+  Throughput 10
+  ModelName "LaserJet 2100 Series"
+  PCFileName "hpljt211.ppd"
+}
+
+{
+  // LaserJet 2200 and 2300 series have duplexer option...
+  Duplex normal
+  Installable "OptionDuplex/Duplexer Installed"
+  UIConstraints "*OptionDuplex False *Duplex"
+
+  {
+    // HP LaserJet 2200 Series
+    Throughput 19
+    ModelName "LaserJet 2200 Series"
+    PCFileName "hpljt221.ppd"
+  }
+
+  {
+    // HP LaserJet 2300 Series
+    Throughput 25
+    ModelName "LaserJet 2300 Series"
+    PCFileName "hpljt231.ppd"
+  }
+}
+
+ + +

Using Filters

+ +

The standard CUPS raster filters can be specified using the +DriverType directive, for example:

+ +
+// Specify that this driver uses the HP-PCL driver...
+DriverType pcl
+
+ +

Table 1 shows the driver types for each of the standard CUPS raster filters. For drivers that do not use the standard raster filters, the "custom" type is used with Filter directives:

+ +
+DriverType custom
+Filter application/vnd.cups-raster 100 /path/to/raster/filter
+Filter application/vnd.cups-command 100 /path/to/command/filter
+
+ + +

Implementing Color Management

+ +

Talk about ICC color profiles and sRGB as two best options.

+ + +

Adding Mac OS X Features

+ +

Talk about help books, icons, and PDEs.

+ + +

Deploying Your Driver

+ +

Talk about install locations, etc.

+ + + + diff --git a/doc/help/spec-ppd.html b/doc/help/spec-ppd.html index 86ebea316c..27301f5b02 100644 --- a/doc/help/spec-ppd.html +++ b/doc/help/spec-ppd.html @@ -1699,25 +1699,16 @@ Architecture (ICA) driver for scanning. The default is False.

Mac OS X 10.3APPrinterIconPath

-

*APPrinterIconPath: "/Library/Printers/vendor/filename"

+

*APPrinterIconPath: "/Library/Printers/vendor/filename.icns"

This attribute defines the location of a printer icon file to use when -displaying the printer.

+displaying the printer. The file must be in the Apple icon format.

Examples:

 *% Apple icon file
 *APPrinterIconPath: "/Library/Printers/vendor/Icons/filename.icns"
-
-*% TIFF icon file
-*APPrinterIconPath: "/Library/Printers/vendor/Icons/filename.tiff"
-
-*% PNG icon file
-*APPrinterIconPath: "/Library/Printers/vendor/Icons/filename.png"
-
-*% JPEG icon file
-*APPrinterIconPath: "/Library/Printers/vendor/Icons/filename.jpg"
 

Mac OS X 10.4APPrinterLowInkTool

diff --git a/filter/api-raster.header b/filter/api-raster.header index 8c6aaa0ccf..8b54f004fb 100644 --- a/filter/api-raster.header +++ b/filter/api-raster.header @@ -12,8 +12,6 @@ file is missing or damaged, see the license at "http://www.cups.org/". --> -

Raster API

-
diff --git a/man/cups-config.man b/man/cups-config.man index 761261553f..c3dfeeff07 100644 --- a/man/cups-config.man +++ b/man/cups-config.man @@ -12,7 +12,7 @@ .\" which should have been included with this file. If this file is .\" file is missing or damaged, see the license at "http://www.cups.org/". .\" -.TH cups-config 1 "Common UNIX Printing System" "16 June 2008" "Apple Inc." +.TH cups-config 1 "Common UNIX Printing System" "23 October 2008" "Apple Inc." .SH NAME cups-config \- get cups api, compiler, directory, and link information. .SH SYNOPSIS @@ -20,6 +20,9 @@ cups-config \- get cups api, compiler, directory, and link information. --api-version .br .B cups-config +--build +.br +.B cups-config --cflags .br .B cups-config @@ -58,6 +61,10 @@ directories for filters, configuration files, and drivers. .br Displays the current API version (major.minor). .TP 5 +--build +.br +Displays a system-specific build number. +.TP 5 --cflags .br Displays the necessary compiler options. diff --git a/ppdc/ppdc-array.cxx b/ppdc/ppdc-array.cxx index e23b4e0e14..41b0dcb5be 100644 --- a/ppdc/ppdc-array.cxx +++ b/ppdc/ppdc-array.cxx @@ -48,7 +48,7 @@ ppdcArray::ppdcArray(ppdcArray *a) memcpy(data, a->data, count * sizeof(ppdcShared *)); for (int i = 0; i < count; i ++) - data[i]->get(); + data[i]->retain(); } else data = 0; @@ -99,6 +99,7 @@ ppdcArray::add(ppdcShared *d) data = temp; } + d->retain(); data[count++] = d; } diff --git a/ppdc/ppdc-catalog.cxx b/ppdc/ppdc-catalog.cxx index 4961851718..da06bb36da 100644 --- a/ppdc/ppdc-catalog.cxx +++ b/ppdc/ppdc-catalog.cxx @@ -96,9 +96,9 @@ ppdcCatalog::ppdcCatalog(const char *l, // I - Locale ppdcCatalog::~ppdcCatalog() { - delete locale; - delete filename; - delete messages; + locale->release(); + filename->release(); + messages->release(); } diff --git a/ppdc/ppdc-driver.cxx b/ppdc/ppdc-driver.cxx index 3cd4d4ce99..c6e0dda53c 100644 --- a/ppdc/ppdc-driver.cxx +++ b/ppdc/ppdc-driver.cxx @@ -49,15 +49,15 @@ ppdcDriver::ppdcDriver(ppdcDriver *d) // I - Printer driver template { // Bump the use count of any strings we inherit... if (d->manufacturer) - d->manufacturer->get(); + d->manufacturer->retain(); if (d->version) - d->version->get(); + d->version->retain(); if (d->default_font) - d->default_font->get(); + d->default_font->retain(); if (d->default_size) - d->default_size->get(); + d->default_size->retain(); if (d->custom_size_code) - d->custom_size_code->get(); + d->custom_size_code->retain(); // Copy all of the data from the driver template... copyright = new ppdcArray(d->copyright); @@ -140,7 +140,7 @@ ppdcDriver::ppdcDriver(ppdcDriver *d) // I - Printer driver template ppdcDriver::~ppdcDriver() { - delete copyright; + copyright->release(); if (manufacturer) manufacturer->release(); @@ -159,13 +159,13 @@ ppdcDriver::~ppdcDriver() if (custom_size_code) custom_size_code->release(); - delete attrs; - delete constraints; - delete filters; - delete fonts; - delete groups; - delete profiles; - delete sizes; + attrs->release(); + constraints->release(); + filters->release(); + fonts->release(); + groups->release(); + profiles->release(); + sizes->release(); } @@ -256,7 +256,7 @@ ppdcDriver::set_default_font( if (f) { - f->name->get(); + f->name->retain(); default_font = f->name; } else @@ -277,7 +277,7 @@ ppdcDriver::set_default_size( if (m) { - m->name->get(); + m->name->retain(); default_size = m->name; } else @@ -1219,7 +1219,7 @@ ppdcDriver::write_ppd_file( lf); if (delete_cat) - delete catalog; + catalog->release(); return (0); } diff --git a/ppdc/ppdc-group.cxx b/ppdc/ppdc-group.cxx index cf2a66066a..6f63cdffbb 100644 --- a/ppdc/ppdc-group.cxx +++ b/ppdc/ppdc-group.cxx @@ -49,8 +49,8 @@ ppdcGroup::ppdcGroup(ppdcGroup *g) // I - Group template ppdcOption *o; // Current option - g->name->get(); - g->text->get(); + g->name->retain(); + g->text->retain(); name = g->name; text = g->text; @@ -69,7 +69,7 @@ ppdcGroup::~ppdcGroup() { name->release(); text->release(); - delete options; + options->release(); } diff --git a/ppdc/ppdc-message.cxx b/ppdc/ppdc-message.cxx index 1f258553e6..5f7c2203b5 100644 --- a/ppdc/ppdc-message.cxx +++ b/ppdc/ppdc-message.cxx @@ -44,8 +44,8 @@ ppdcMessage::ppdcMessage(const char *i, // I - ID ppdcMessage::~ppdcMessage() { - delete id; - delete string; + id->release(); + string->release(); } diff --git a/ppdc/ppdc-option.cxx b/ppdc/ppdc-option.cxx index 734d406962..5a33a4eb34 100644 --- a/ppdc/ppdc-option.cxx +++ b/ppdc/ppdc-option.cxx @@ -57,10 +57,10 @@ ppdcOption::ppdcOption(ppdcOptType ot, // I - Option type ppdcOption::ppdcOption(ppdcOption *o) // I - Template option { - o->name->get(); - o->text->get(); + o->name->retain(); + o->text->retain(); if (o->defchoice) - o->defchoice->get(); + o->defchoice->retain(); type = o->type; name = o->name; @@ -82,7 +82,7 @@ ppdcOption::~ppdcOption() text->release(); if (defchoice) defchoice->release(); - delete choices; + choices->release(); } @@ -115,7 +115,7 @@ ppdcOption::set_defchoice(ppdcChoice *c) // I - Choice defchoice->release(); if (c->name) - c->name->get(); + c->name->retain(); defchoice = c->name; } diff --git a/ppdc/ppdc-shared.cxx b/ppdc/ppdc-shared.cxx index 6b7cba1c2c..d8697a9297 100644 --- a/ppdc/ppdc-shared.cxx +++ b/ppdc/ppdc-shared.cxx @@ -16,8 +16,8 @@ // // ppdcShared::ppdcShared() - Create shared data. // ppdcShared::~ppdcShared() - Destroy shared data. -// ppdcShared::get() - Increment the use count for this data. // ppdcShared::release() - Decrement the use count and delete as needed. +// ppdcShared::retain() - Increment the use count for this data. // // @@ -47,26 +47,26 @@ ppdcShared::~ppdcShared() // -// 'ppdcShared::get()' - Increment the use count for this data. +// 'ppdcShared::release()' - Decrement the use count and delete as needed. // void -ppdcShared::get(void) +ppdcShared::release(void) { - use ++; + use --; + if (!use) + delete this; } // -// 'ppdcShared::release()' - Decrement the use count and delete as needed. +// 'ppdcShared::retain()' - Increment the use count for this data. // void -ppdcShared::release(void) +ppdcShared::retain() { - use --; - if (!use) - delete this; + use ++; } diff --git a/ppdc/ppdc-source.cxx b/ppdc/ppdc-source.cxx index 7450291e3f..d95f2d6ccc 100644 --- a/ppdc/ppdc-source.cxx +++ b/ppdc/ppdc-source.cxx @@ -115,12 +115,12 @@ ppdcSource::ppdcSource(const char *f, // I - File to read ppdcSource::~ppdcSource() { - delete filename; - delete base_fonts; - delete drivers; - delete po_files; - delete sizes; - delete vars; + filename->release(); + base_fonts->release(); + drivers->release(); + po_files->release(); + sizes->release(); + vars->release(); } @@ -1672,7 +1672,7 @@ ppdcSource::get_po(ppdcFile *fp) // I - File to read cat = new ppdcCatalog(locale, pofilename); // Reset the filename to the name supplied by the user... - delete cat->filename; + cat->filename->release(); cat->filename = new ppdcString(poname); // Return the catalog... diff --git a/ppdc/ppdc.cxx b/ppdc/ppdc.cxx index bd0243cd9c..49d5a6ab5a 100644 --- a/ppdc/ppdc.cxx +++ b/ppdc/ppdc.cxx @@ -181,7 +181,7 @@ main(int argc, // I - Number of command-line arguments "\"%s\"...\n"), argv[i]); if (catalog) - delete catalog; + catalog->release(); catalog = new ppdcCatalog(argv[i]); @@ -371,11 +371,11 @@ main(int argc, // I - Number of command-line arguments usage(); // Delete the printer driver information... - delete src; + src->release(); // Message catalog... if (catalog) - delete catalog; + catalog->release(); // Return with no errors. return (0); diff --git a/ppdc/ppdc.h b/ppdc/ppdc.h index 31519404f7..e8e6f2b232 100644 --- a/ppdc/ppdc.h +++ b/ppdc/ppdc.h @@ -96,8 +96,8 @@ class ppdcShared //// Shared Data Value ppdcShared(); virtual ~ppdcShared(); - void get(void); - void release(void); + void retain(); + void release(); }; class ppdcArray //// Shared Array diff --git a/ppdc/ppdhtml.cxx b/ppdc/ppdhtml.cxx index 8d55639383..90ed5e62ae 100644 --- a/ppdc/ppdhtml.cxx +++ b/ppdc/ppdhtml.cxx @@ -150,8 +150,8 @@ main(int argc, // I - Number of command-line arguments puts(""); puts(""); // Delete the printer driver information... - delete composite; - delete src; + composite->release(); + src->release(); } // If no drivers have been loaded, display the program usage message. diff --git a/ppdc/ppdi.cxx b/ppdc/ppdi.cxx index 314d631087..6abddeb126 100644 --- a/ppdc/ppdi.cxx +++ b/ppdc/ppdi.cxx @@ -112,7 +112,7 @@ main(int argc, // I - Number of command-line arguments src->write_file(srcfile); // Delete the printer driver information... - delete src; + src->release(); // Return with no errors. return (0); diff --git a/ppdc/ppdpo.cxx b/ppdc/ppdpo.cxx index dfec9a4cbd..fe533ba9fc 100644 --- a/ppdc/ppdpo.cxx +++ b/ppdc/ppdpo.cxx @@ -140,7 +140,7 @@ main(int argc, // I - Number of command-line arguments } // Delete the printer driver information... - delete src; + src->release(); } // Write the message catalog... @@ -149,7 +149,7 @@ main(int argc, // I - Number of command-line arguments else catalog->save_messages(outfile); - delete catalog; + catalog->release(); // If no drivers have been loaded, display the program usage message. if (!src) diff --git a/ppdc/sample.drv b/ppdc/sample.drv index d5698359e6..cb9e3a3a64 100644 --- a/ppdc/sample.drv +++ b/ppdc/sample.drv @@ -171,12 +171,6 @@ Version "1.4" ColorDevice No Throughput 1 - HWMargins 18 18 18 18 - *MediaSize Letter - MediaSize Legal - MediaSize A4 - MediaSize FanFoldUS - HWMargins 0 0 0 0 VariablePaperSize Yes MinSize 36 36 @@ -188,11 +182,17 @@ Version "1.4" PCFileName "epson24.ppd" ModelNumber $EPSON_24PIN + HWMargins 18 18 18 18 + *MediaSize Letter + MediaSize Legal + MediaSize A4 + MediaSize FanFoldUS + Resolution k 1 8 0 0 60dpi *Resolution k 1 8 0 0 120x60dpi Resolution k 1 24 0 0 180dpi Resolution k 1 24 0 0 360x180dpi - Resolution k 1 48 0 0 360x180dpi + Resolution k 1 48 0 0 360dpi } // Epson 9-Pin Series @@ -202,6 +202,12 @@ Version "1.4" ModelNumber $EPSON_9PIN ColorDevice No + HWMargins 18 18 18 18 + *MediaSize Letter + MediaSize Legal + MediaSize A4 + MediaSize FanFoldUS + Resolution k 1 8 0 0 60x720dpi *Resolution k 1 8 0 0 120x72dpi Resolution k 1 8 0 0 240x72dpi diff --git a/ppdc/testcatalog.cxx b/ppdc/testcatalog.cxx index 808738d908..e173877a23 100644 --- a/ppdc/testcatalog.cxx +++ b/ppdc/testcatalog.cxx @@ -51,7 +51,7 @@ main(int argc, // I - Number of command-line arguments m = (ppdcMessage *)catalog->messages->next()) printf("%s: %s\n", m->id->value, m->string->value); - delete catalog; + catalog->release(); // Return with no errors. return (0); diff --git a/scheduler/auth.c b/scheduler/auth.c index 5d839283c7..0654af4b7e 100644 --- a/scheduler/auth.c +++ b/scheduler/auth.c @@ -464,15 +464,21 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */ return; } - if (authinfo->count == 1) - strlcpy(username, authinfo->items[0].value, sizeof(username)); - - cupsdLogMessage(CUPSD_LOG_DEBUG, - "cupsdAuthorize: Authorized as %s using AuthRef", - username); + if (authinfo->count == 0 || !authinfo->items[0].value || + authinfo->items[0].valueLength < 2) + { + AuthorizationFreeItemSet(authinfo); + cupsdLogMessage(CUPSD_LOG_ERROR, + "AuthorizationCopyInfo returned empty rights!"); + return; + } + strlcpy(username, authinfo->items[0].value, sizeof(username)); AuthorizationFreeItemSet(authinfo); + cupsdLogMessage(CUPSD_LOG_DEBUG, + "cupsdAuthorize: Authorized as \"%s\" using AuthRef", + username); con->type = CUPSD_AUTH_BASIC; } #endif /* HAVE_AUTHORIZATION_H */ diff --git a/scheduler/cups-driverd.cxx b/scheduler/cups-driverd.cxx index 3ee2974103..a7fc29c087 100644 --- a/scheduler/cups-driverd.cxx +++ b/scheduler/cups-driverd.cxx @@ -364,7 +364,7 @@ cat_drv(const char *name, /* I - PPD name */ d->write_ppd_file(out, NULL, locales, src, PPDC_LFONLY); cupsFileClose(out); - delete locales; + locales->release(); } else { @@ -384,7 +384,7 @@ cat_drv(const char *name, /* I - PPD name */ } } - delete src; + src->release(); return (!d); } @@ -657,8 +657,8 @@ compare_matches(const ppd_info_t *p0, /* I - First PPD */ if (p1->matches != p0->matches) return (p1->matches - p0->matches); else - return (cupsdCompareNames(p1->record.make_and_model, - p0->record.make_and_model)); + return (cupsdCompareNames(p0->record.make_and_model, + p1->record.make_and_model)); } @@ -1828,7 +1828,7 @@ load_drv(const char *filename, /* I - Actual filename */ fprintf(stderr, "ERROR: [cups-driverd] Bad driver information file \"%s\"!\n", filename); - delete src; + src->release(); return (0); } @@ -1909,7 +1909,7 @@ load_drv(const char *filename, /* I - Actual filename */ mtime, size, d->model_number, type); } - delete src; + src->release(); return (1); } diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 048dd959d8..850e3b82de 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -2547,7 +2547,7 @@ add_printer(cupsd_client_t *con, /* I - Client connection */ need_restart_job = 1; - supported = ippFindAttribute(printer->attrs, "port-monitor-supported", + supported = ippFindAttribute(printer->ppd_attrs, "port-monitor-supported", IPP_TAG_NAME); if (supported) { @@ -6340,8 +6340,7 @@ delete_printer(cupsd_client_t *con, /* I - Client connection */ printer->name); unlink(filename); - snprintf(filename, sizeof(filename), "%s/%s.ipp", ServerRoot, - printer->name); + snprintf(filename, sizeof(filename), "%s/%s.ipp", CacheDir, printer->name); unlink(filename); #ifdef __APPLE__ diff --git a/scheduler/job.c b/scheduler/job.c index af81c235fd..3076a29305 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -2898,9 +2898,10 @@ start_job(cupsd_job_t *job, /* I - Job ID */ continue; if (!strncmp(attr->name, "job-", 4) && - strcmp(attr->name, "job-uuid") && + strcmp(attr->name, "job-billing") && strcmp(attr->name, "job-impressions") && strcmp(attr->name, "job-originating-host-name") && + strcmp(attr->name, "job-uuid") && !(printer->type & CUPS_PRINTER_REMOTE)) continue; diff --git a/scheduler/main.c b/scheduler/main.c index bdc46bc591..41d6d19775 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -514,6 +514,7 @@ main(int argc, /* I - Number of command-line args */ */ launchd_checkin(); + launchd_checkout(); } #endif /* HAVE_LAUNCHD */ @@ -749,6 +750,7 @@ main(int argc, /* I - Number of command-line args */ */ launchd_checkin(); + launchd_checkout(); } #endif /* HAVE_LAUNCHD */ diff --git a/templates/edit-config.tmpl b/templates/edit-config.tmpl index 4aa78f9449..ea45d81f5a 100644 --- a/templates/edit-config.tmpl +++ b/templates/edit-config.tmpl @@ -5,7 +5,9 @@ function reset_config() } -

Server Configuration File

+
+ +

Edit Configuration File

@@ -18,3 +20,5 @@ function reset_config() onClick="reset_config();">

+ +