From: msweet Date: Fri, 18 Dec 2015 20:34:33 +0000 (+0000) Subject: Add cupsRasterInitPWGHeader API to setup a raster header using IPP Everywhere X-Git-Tag: v2.2b1~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e5a57e8af67faf6868aab7f69c695120ad77afb;p=thirdparty%2Fcups.git Add cupsRasterInitPWGHeader API to setup a raster header using IPP Everywhere attribute values. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@13024 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/backend/Dependencies b/backend/Dependencies index 66b2de5645..2f4f0c195e 100644 --- a/backend/Dependencies +++ b/backend/Dependencies @@ -6,7 +6,7 @@ ipp.o: ipp.c backend-private.h ../cups/cups-private.h \ ../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \ ../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \ ../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \ - ../cups/ppd-private.h ../cups/ppd.h + ../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h lpd.o: lpd.c ../cups/http-private.h ../config.h ../cups/language.h \ ../cups/array.h ../cups/versioning.h ../cups/http.h \ ../cups/md5-private.h ../cups/ipp-private.h ../cups/ipp.h \ @@ -47,7 +47,7 @@ test1284.o: test1284.c ../cups/string-private.h ../config.h ieee1284.c \ ../cups/language-private.h ../cups/transcode.h ../cups/pwg-private.h \ ../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \ ../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \ - ../cups/ppd-private.h ../cups/ppd.h + ../cups/ppd-private.h ../cups/ppd.h ../cups/raster.h testbackend.o: testbackend.c ../cups/string-private.h ../config.h \ ../cups/cups.h ../cups/file.h ../cups/versioning.h ../cups/ipp.h \ ../cups/http.h ../cups/array.h ../cups/language.h ../cups/pwg.h \ @@ -69,4 +69,4 @@ usb.o: usb.c backend-private.h ../cups/cups-private.h \ ../cups/cups.h ../cups/file.h ../cups/pwg.h ../cups/thread-private.h \ ../cups/snmp-private.h ../cups/backend.h ../cups/sidechannel.h \ usb-darwin.c ../cups/file-private.h ../cups/ppd-private.h \ - ../cups/ppd.h + ../cups/ppd.h ../cups/raster.h diff --git a/cgi-bin/Dependencies b/cgi-bin/Dependencies index 9dda29c78a..b006fe1939 100644 --- a/cgi-bin/Dependencies +++ b/cgi-bin/Dependencies @@ -36,7 +36,8 @@ admin.o: admin.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ ../cups/language-private.h ../cups/transcode.h \ ../cups/string-private.h ../config.h ../cups/ipp-private.h \ ../cups/http-private.h ../cups/md5-private.h ../cups/ppd-private.h \ - ../cups/ppd.h ../cups/pwg-private.h ../cups/adminutil.h + ../cups/ppd.h ../cups/raster.h ../cups/pwg-private.h \ + ../cups/adminutil.h classes.o: classes.c cgi-private.h cgi.h ../cups/cups.h ../cups/file.h \ ../cups/versioning.h ../cups/ipp.h ../cups/http.h ../cups/array.h \ ../cups/language.h ../cups/pwg.h help-index.h ../cups/debug-private.h \ diff --git a/cups/Dependencies b/cups/Dependencies index 6a9b80cf4f..d990a0ca01 100644 --- a/cups/Dependencies +++ b/cups/Dependencies @@ -2,7 +2,8 @@ adminutil.o: adminutil.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ md5-private.h language-private.h ../cups/transcode.h pwg-private.h \ - ../cups/cups.h file.h pwg.h thread-private.h ppd.h adminutil.h + ../cups/cups.h file.h pwg.h thread-private.h ppd.h raster.h \ + adminutil.h array.o: array.c ../cups/cups.h file.h versioning.h ipp.h http.h array.h \ language.h pwg.h string-private.h ../config.h debug-private.h \ array-private.h @@ -17,7 +18,7 @@ backend.o: backend.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ md5-private.h language-private.h ../cups/transcode.h pwg-private.h \ - ../cups/cups.h file.h pwg.h thread-private.h backend.h ppd.h + ../cups/cups.h file.h pwg.h thread-private.h backend.h ppd.h raster.h debug.o: debug.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ @@ -140,57 +141,57 @@ ppd.o: ppd.c cups-private.h string-private.h ../config.h debug-private.h \ ../cups/versioning.h array-private.h ../cups/array.h ipp-private.h \ ../cups/ipp.h http.h http-private.h ../cups/language.h md5-private.h \ language-private.h ../cups/transcode.h pwg-private.h ../cups/cups.h \ - file.h pwg.h thread-private.h ppd-private.h ../cups/ppd.h + file.h pwg.h thread-private.h ppd-private.h ../cups/ppd.h raster.h ppd-attr.o: ppd-attr.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ md5-private.h language-private.h ../cups/transcode.h pwg-private.h \ ../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \ - ../cups/ppd.h + ../cups/ppd.h raster.h ppd-cache.o: ppd-cache.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ md5-private.h language-private.h ../cups/transcode.h pwg-private.h \ ../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \ - ../cups/ppd.h + ../cups/ppd.h raster.h ppd-conflicts.o: ppd-conflicts.c cups-private.h string-private.h \ ../config.h debug-private.h ../cups/versioning.h array-private.h \ ../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \ ../cups/language.h md5-private.h language-private.h \ ../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \ - thread-private.h ppd-private.h ../cups/ppd.h + thread-private.h ppd-private.h ../cups/ppd.h raster.h ppd-custom.o: ppd-custom.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ md5-private.h language-private.h ../cups/transcode.h pwg-private.h \ ../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \ - ../cups/ppd.h + ../cups/ppd.h raster.h ppd-emit.o: ppd-emit.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ md5-private.h language-private.h ../cups/transcode.h pwg-private.h \ - ../cups/cups.h file.h pwg.h thread-private.h ppd.h + ../cups/cups.h file.h pwg.h thread-private.h ppd.h raster.h ppd-localize.o: ppd-localize.c cups-private.h string-private.h \ ../config.h debug-private.h ../cups/versioning.h array-private.h \ ../cups/array.h ipp-private.h ../cups/ipp.h http.h http-private.h \ ../cups/language.h md5-private.h language-private.h \ ../cups/transcode.h pwg-private.h ../cups/cups.h file.h pwg.h \ - thread-private.h ppd-private.h ../cups/ppd.h + thread-private.h ppd-private.h ../cups/ppd.h raster.h ppd-mark.o: ppd-mark.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ md5-private.h language-private.h ../cups/transcode.h pwg-private.h \ ../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \ - ../cups/ppd.h + ../cups/ppd.h raster.h ppd-page.o: ppd-page.c string-private.h ../config.h debug-private.h \ ../cups/versioning.h ppd.h cups.h file.h ipp.h http.h array.h \ - language.h pwg.h + language.h pwg.h raster.h ppd-util.o: ppd-util.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ md5-private.h language-private.h ../cups/transcode.h pwg-private.h \ ../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \ - ../cups/ppd.h + ../cups/ppd.h raster.h pwg-media.o: pwg-media.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ @@ -253,14 +254,15 @@ testadmin.o: testadmin.c adminutil.h cups.h file.h versioning.h ipp.h \ testarray.o: testarray.c string-private.h ../config.h debug-private.h \ ../cups/versioning.h array-private.h ../cups/array.h dir.h testcache.o: testcache.c ppd-private.h ../cups/cups.h file.h versioning.h \ - ipp.h http.h array.h language.h pwg.h ../cups/ppd.h pwg-private.h \ - file-private.h cups-private.h string-private.h ../config.h \ - debug-private.h array-private.h ipp-private.h http-private.h \ - md5-private.h language-private.h ../cups/transcode.h thread-private.h + ipp.h http.h array.h language.h pwg.h ../cups/ppd.h raster.h \ + pwg-private.h file-private.h cups-private.h string-private.h \ + ../config.h debug-private.h array-private.h ipp-private.h \ + http-private.h md5-private.h language-private.h ../cups/transcode.h \ + thread-private.h testconflicts.o: testconflicts.c cups.h file.h versioning.h ipp.h http.h \ - array.h language.h pwg.h ppd.h string-private.h ../config.h + array.h language.h pwg.h ppd.h raster.h string-private.h ../config.h testcups.o: testcups.c string-private.h ../config.h cups.h file.h \ - versioning.h ipp.h http.h array.h language.h pwg.h ppd.h + versioning.h ipp.h http.h array.h language.h pwg.h ppd.h raster.h testdest.o: testdest.c cups.h file.h versioning.h ipp.h http.h array.h \ language.h pwg.h testfile.o: testfile.c string-private.h ../config.h debug-private.h \ @@ -284,18 +286,19 @@ testlang.o: testlang.c cups-private.h string-private.h ../config.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ md5-private.h language-private.h ../cups/transcode.h pwg-private.h \ ../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \ - ../cups/ppd.h + ../cups/ppd.h raster.h testppd.o: testppd.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ md5-private.h language-private.h ../cups/transcode.h pwg-private.h \ ../cups/cups.h file.h pwg.h thread-private.h ppd-private.h \ - ../cups/ppd.h + ../cups/ppd.h raster.h testpwg.o: testpwg.c ppd-private.h ../cups/cups.h file.h versioning.h \ - ipp.h http.h array.h language.h pwg.h ../cups/ppd.h pwg-private.h \ - file-private.h cups-private.h string-private.h ../config.h \ - debug-private.h array-private.h ipp-private.h http-private.h \ - md5-private.h language-private.h ../cups/transcode.h thread-private.h + ipp.h http.h array.h language.h pwg.h ../cups/ppd.h raster.h \ + pwg-private.h file-private.h cups-private.h string-private.h \ + ../config.h debug-private.h array-private.h ipp-private.h \ + http-private.h md5-private.h language-private.h ../cups/transcode.h \ + thread-private.h testsnmp.o: testsnmp.c cups-private.h string-private.h ../config.h \ debug-private.h ../cups/versioning.h array-private.h ../cups/array.h \ ipp-private.h ../cups/ipp.h http.h http-private.h ../cups/language.h \ diff --git a/cups/Makefile b/cups/Makefile index bb360aa3bc..473328b51f 100644 --- a/cups/Makefile +++ b/cups/Makefile @@ -592,9 +592,7 @@ apihelp: mxmldoc --section "Programming" --title "PPD API (DEPRECATED)" \ --css ../doc/cups-printable.css \ --header api-ppd.header --intro api-ppd.shtml \ - api-ppd.xml \ - ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \ - ppd.c >../doc/help/api-ppd.html + api-ppd.xml ppd.h ppd-*.c >../doc/help/api-ppd.html mxmldoc --tokens help/api-ppd.html api-ppd.xml >../doc/help/api-ppd.tokens $(RM) api-ppd.xml mxmldoc --section "Programming" --title "HTTP and IPP APIs" \ diff --git a/cups/ppd.h b/cups/ppd.h index 34d1b4f733..c5989835d1 100644 --- a/cups/ppd.h +++ b/cups/ppd.h @@ -39,6 +39,7 @@ # include "cups.h" # include "array.h" # include "file.h" +# include "raster.h" /* @@ -413,6 +414,11 @@ extern ppd_status_t ppdLastError(int *line) _PPD_DEPRECATED; extern void ppdSetConformance(ppd_conform_t c) _PPD_DEPRECATED; /**** New in CUPS 1.2 ****/ +extern int cupsRasterInterpretPPD(cups_page_header2_t *h, + ppd_file_t *ppd, + int num_options, + cups_option_t *options, + cups_interpret_cb_t func) _PPD_DEPRECATED; extern int ppdCollect2(ppd_file_t *ppd, ppd_section_t section, float min_order, ppd_choice_t ***choices) _PPD_DEPRECATED; diff --git a/cups/raster-private.h b/cups/raster-private.h index 0e9118fcbc..95e54dc02b 100644 --- a/cups/raster-private.h +++ b/cups/raster-private.h @@ -1,18 +1,18 @@ /* * "$Id$" * - * Private image library definitions for CUPS. + * Private image library definitions for CUPS. * - * Copyright 2007-2011 by Apple Inc. - * Copyright 1993-2006 by Easy Software Products. + * Copyright 2007-2015 by Apple Inc. + * Copyright 1993-2006 by 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 should have been included with this file. If this file is - * file is missing or damaged, see the license at "http://www.cups.org/". + * 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 should have been included with this file. If this file is + * file is missing or damaged, see the license at "http://www.cups.org/". * - * This file is subject to the Apple OS-Developed Software exception. + * This file is subject to the Apple OS-Developed Software exception. */ #ifndef _CUPS_RASTER_PRIVATE_H_ diff --git a/cups/raster.h b/cups/raster.h index cfacc906dc..a5aff2e048 100644 --- a/cups/raster.h +++ b/cups/raster.h @@ -1,20 +1,20 @@ /* * "$Id$" * - * Raster file definitions for CUPS. + * Raster file definitions for CUPS. * - * Copyright 2007-2012 by Apple Inc. - * Copyright 1997-2006 by Easy Software Products. + * Copyright 2007-2015 by Apple Inc. + * Copyright 1997-2006 by Easy Software Products. * - * This file is part of the CUPS Imaging library. + * This file is part of the CUPS Imaging library. * - * 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 should have been included with this file. If this file is - * file is missing or damaged, see the license at "http://www.cups.org/". + * 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 should have been included with this file. If this file is + * file is missing or damaged, see the license at "http://www.cups.org/". * - * This file is subject to the Apple OS-Developed Software exception. + * This file is subject to the Apple OS-Developed Software exception. */ #ifndef _CUPS_RASTER_H_ @@ -25,7 +25,6 @@ */ # include "cups.h" -# include "ppd.h" # ifdef __cplusplus @@ -377,11 +376,6 @@ extern unsigned cupsRasterWritePixels(cups_raster_t *r, unsigned char *p, unsigned len); /**** New in CUPS 1.2 ****/ -extern int cupsRasterInterpretPPD(cups_page_header2_t *h, - ppd_file_t *ppd, - int num_options, - cups_option_t *options, - cups_interpret_cb_t func) _CUPS_API_1_2; extern unsigned cupsRasterReadHeader2(cups_raster_t *r, cups_page_header2_t *h) _CUPS_API_1_2; extern unsigned cupsRasterWriteHeader2(cups_raster_t *r, @@ -394,6 +388,9 @@ extern const char *cupsRasterErrorString(void) _CUPS_API_1_3; extern cups_raster_t *cupsRasterOpenIO(cups_raster_iocb_t iocb, void *ctx, cups_mode_t mode); +/**** New in CUPS 2.2 ****/ +extern int cupsRasterInitPWGHeader(cups_page_header2_t *h, pwg_media_t *media, const char *type, int xdpi, int ydpi, const char *sides, const char *sheet_back) _CUPS_API_2_2; + # ifdef __cplusplus } # endif /* __cplusplus */ diff --git a/doc/help/api-cups.html b/doc/help/api-cups.html index 12691827fb..e3917d814b 100644 --- a/doc/help/api-cups.html +++ b/doc/help/api-cups.html @@ -455,15 +455,10 @@ destination.">cupsGetDestMediaCount
  • cupsGetJobs2
  • cupsGetNamedDest
  • cupsGetOption
  • -
  • cupsGetPPD
  • -
  • cupsGetPPD2
  • -
  • cupsGetPPD3
  • cupsGetPassword
  • cupsGetPassword2
  • cupsGetPrinters
  • -
  • cupsGetServerPPD
  • cupsLangDefault
  • cupsLangEncoding
  • @@ -2287,95 +2282,6 @@ const char *cupsGetOption (

    Return Value

    Option value or NULL

    -

    cupsGetPPD

    -

    Get the PPD file for a printer on the default server.

    -

    -const char *cupsGetPPD (
    -    const char *name
    -);

    -

    Parameters

    -
    -
    name
    -
    Destination name
    -
    -

    Return Value

    -

    Filename for PPD file

    -

    Discussion

    -

    For classes, cupsGetPPD returns the PPD file for the first printer -in the class.
    -
    -The returned filename is stored in a static buffer and is overwritten with -each call to cupsGetPPD or cupsGetPPD2. The caller "owns" the -file that is created and must unlink the returned filename.

    -

     CUPS 1.1.21/OS X 10.4 cupsGetPPD2

    -

    Get the PPD file for a printer from the specified server.

    -

    -const char *cupsGetPPD2 (
    -    http_t *http,
    -    const char *name
    -);

    -

    Parameters

    -
    -
    http
    -
    Connection to server or CUPS_HTTP_DEFAULT
    -
    name
    -
    Destination name
    -
    -

    Return Value

    -

    Filename for PPD file

    -

    Discussion

    -

    For classes, cupsGetPPD2 returns the PPD file for the first printer -in the class.
    -
    -The returned filename is stored in a static buffer and is overwritten with -each call to cupsGetPPD or cupsGetPPD2. The caller "owns" the -file that is created and must unlink the returned filename. - -

    -

     CUPS 1.4/OS X 10.6 cupsGetPPD3

    -

    Get the PPD file for a printer on the specified -server if it has changed.

    -

    -http_status_t cupsGetPPD3 (
    -    http_t *http,
    -    const char *name,
    -    time_t *modtime,
    -    char *buffer,
    -    size_t bufsize
    -);

    -

    Parameters

    -
    -
    http
    -
    HTTP connection or CUPS_HTTP_DEFAULT
    -
    name
    -
    Destination name
    -
    modtime
    -
    Modification time
    -
    buffer
    -
    Filename buffer
    -
    bufsize
    -
    Size of filename buffer
    -
    -

    Return Value

    -

    HTTP status

    -

    Discussion

    -

    The "modtime" parameter contains the modification time of any -locally-cached content and is updated with the time from the PPD file on -the server.
    -
    -The "buffer" parameter contains the local PPD filename. If it contains -the empty string, a new temporary file is created, otherwise the existing -file will be overwritten as needed. The caller "owns" the file that is -created and must unlink the returned filename.
    -
    -On success, HTTP_STATUS_OK is returned for a new PPD file and -HTTP_STATUS_NOT_MODIFIED if the existing PPD file is up-to-date. Any other -status is an error.
    -
    -For classes, cupsGetPPD3 returns the PPD file for the first printer -in the class. - -

    cupsGetPassword

    Get a password from the user.

    @@ -2447,33 +2353,6 @@ int cupsGetPrinters (

    This function is deprecated and no longer returns a list of printers - use cupsGetDests instead. -

    -

     CUPS 1.3/OS X 10.5 cupsGetServerPPD

    -

    Get an available PPD file from the server.

    -

    -char *cupsGetServerPPD (
    -    http_t *http,
    -    const char *name
    -);

    -

    Parameters

    -
    -
    http
    -
    Connection to server or CUPS_HTTP_DEFAULT
    -
    name
    -
    Name of PPD file ("ppd-name")
    -
    -

    Return Value

    -

    Name of PPD file or NULL on error

    -

    Discussion

    -

    This function returns the named PPD file from the server. The -list of available PPDs is provided by the IPP CUPS_GET_PPDS -operation.
    -
    -You must remove (unlink) the PPD file when you are finished with -it. The PPD filename is stored in a static location that will be -overwritten on the next call to cupsGetPPD, cupsGetPPD2, -or cupsGetServerPPD. -

    cupsLangDefault

    Return the default language.

    diff --git a/doc/help/api-httpipp.html b/doc/help/api-httpipp.html index 7fc0c066c4..795ebbf474 100644 --- a/doc/help/api-httpipp.html +++ b/doc/help/api-httpipp.html @@ -6639,6 +6639,8 @@ are server-oriented...

    client-error-not-authenticated
    IPP_STATUS_ERROR_NOT_AUTHORIZED
    client-error-not-authorized
    +
    IPP_STATUS_ERROR_NOT_FETCHABLE
    +
    client-error-not-fetchable
    IPP_STATUS_ERROR_NOT_FOUND
    client-error-not-found
    IPP_STATUS_ERROR_NOT_POSSIBLE
    diff --git a/doc/help/api-ppd.html b/doc/help/api-ppd.html index df8f7a98c5..1ace094249 100644 --- a/doc/help/api-ppd.html +++ b/doc/help/api-ppd.html @@ -401,9 +401,13 @@ div.contents ul.subcontents li {
  • Functions
  • Data Types
  • Functions