From 568fa3faf16f8694653600d87955473941cc03c1 Mon Sep 17 00:00:00 2001 From: msweet Date: Thu, 28 Feb 2008 23:00:58 +0000 Subject: [PATCH] Import CUPS 1.4svn-r7356. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@647 a1ca3aef-8c08-0410-bb20-df032aa958be --- CHANGES-1.3.txt | 11 + CHANGES.txt | 7 +- backend/Dependencies | 11 +- backend/Makefile | 32 +- backend/backend-private.h | 17 +- backend/betest.c | 78 - backend/parallel.c | 16 +- backend/runloop.c | 105 +- backend/snmp-supplies.c | 688 ++++ backend/snmp.c | 2 +- backend/socket.c | 94 +- backend/testbackend.c | 310 ++ backend/testsupplies.c | 83 + backend/usb-darwin.c | 63 +- backend/usb-unix.c | 16 +- config-scripts/cups-common.m4 | 5 +- config-scripts/cups-compiler.m4 | 5 + config-scripts/cups-defaults.m4 | 49 + cups/Makefile | 1 - cups/api-cups.shtml | 29 +- cups/auth.c | 2 +- cups/dest.c | 10 +- cups/encode.c | 4 +- cups/getputfile.c | 8 +- cups/http.c | 98 +- cups/ipp.c | 7 +- cups/notify.c | 2 +- cups/request.c | 35 +- cups/snmp.c | 22 +- cups/snmp.h | 8 +- cups/tempfile.c | 4 +- cups/testsnmp.c | 6 +- cups/usersys.c | 2 +- cups/util.c | 67 +- doc/Makefile | 10 +- doc/cups-printable.css | 3 +- doc/cups.css | 1 + doc/help/api-array.html | 3 +- doc/help/api-cups.html | 134 +- doc/help/api-filedir.html | 3 +- doc/help/api-filter.html | 20 +- doc/help/api-httpipp.html | 105 +- doc/help/api-overview.html | 3 +- doc/help/api-ppd.html | 3 +- doc/help/ref-cupsd-conf.html.in | 3 +- filter/image-jpeg.c | 29 +- man/lppasswd.man | 23 +- packaging/cups.list.in | 2 +- scheduler/cups-driverd.c | 9 +- scheduler/dirsvc.c | 33 +- scheduler/ipp.c | 473 ++- scripting/java/CUPSPrinter.java | 438 --- .../java/classes/com/easysw/cups/Cups.class | Bin 12601 -> 0 bytes .../classes/com/easysw/cups/CupsJob.class | Bin 2830 -> 0 bytes .../classes/com/easysw/cups/CupsPrinter.class | Bin 11088 -> 0 bytes .../java/classes/com/easysw/cups/IPP.class | Bin 2100 -> 0 bytes .../com/easysw/cups/IPPAttribute.class | Bin 6695 -> 0 bytes .../com/easysw/cups/IPPBase64Encoder.class | Bin 362 -> 0 bytes .../classes/com/easysw/cups/IPPCalendar.class | Bin 382 -> 0 bytes .../classes/com/easysw/cups/IPPDefs.class | Bin 7640 -> 0 bytes .../classes/com/easysw/cups/IPPError.class | Bin 2663 -> 0 bytes .../classes/com/easysw/cups/IPPHttp.class | Bin 16865 -> 0 bytes .../java/classes/com/easysw/cups/IPPMD5.class | Bin 1912 -> 0 bytes .../classes/com/easysw/cups/IPPRequest.class | Bin 627 -> 0 bytes .../classes/com/easysw/cups/IPPStatus.class | Bin 2402 -> 0 bytes .../com/easysw/cups/IPPURLConnection.class | Bin 413 -> 0 bytes .../classes/com/easysw/cups/IPPValue.class | Bin 1979 -> 0 bytes scripting/java/cups.jar | Bin 37208 -> 0 bytes scripting/java/docs/allclasses-frame.html | 49 - scripting/java/docs/com/easysw/cups/Cups.html | 600 --- .../java/docs/com/easysw/cups/CupsJob.html | 547 --- .../docs/com/easysw/cups/CupsPrinter.html | 533 --- scripting/java/docs/com/easysw/cups/IPP.html | 417 --- .../docs/com/easysw/cups/IPPAttribute.html | 466 --- .../java/docs/com/easysw/cups/IPPDefs.html | 3330 ----------------- .../java/docs/com/easysw/cups/IPPError.html | 178 - .../java/docs/com/easysw/cups/IPPHttp.html | 2596 ------------- .../java/docs/com/easysw/cups/IPPRequest.html | 251 -- .../java/docs/com/easysw/cups/IPPStatus.html | 185 - .../com/easysw/cups/IPPURLConnection.html | 262 -- .../java/docs/com/easysw/cups/IPPValue.html | 376 -- scripting/java/docs/deprecated-list.html | 89 - scripting/java/docs/help-doc.html | 138 - scripting/java/docs/index-all.html | 1588 -------- scripting/java/docs/index.html | 22 - scripting/java/docs/overview-tree.html | 101 - scripting/java/docs/package-list | 1 - scripting/java/docs/packages.html | 26 - scripting/java/docs/serialized-form.html | 89 - scripting/java/docs/stylesheet.css | 29 - scripting/java/example/GLP.class | Bin 1163 -> 0 bytes scripting/java/example/GLP.java | 59 - scripting/java/example/GLPcolors.class | Bin 838 -> 0 bytes scripting/java/example/GLPcolors.java | 22 - scripting/java/example/GLPdetail.class | Bin 5600 -> 0 bytes scripting/java/example/GLPdetail.java | 279 -- scripting/java/example/GLPjobList.class | Bin 3587 -> 0 bytes scripting/java/example/GLPjobList.java | 150 - scripting/java/example/GLPjobTableModel.class | Bin 1849 -> 0 bytes scripting/java/example/GLPjobTableModel.java | 104 - scripting/java/example/GLPoptions$1.class | Bin 1025 -> 0 bytes .../example/GLPoptions$MyTextListener.class | Bin 1217 -> 0 bytes scripting/java/example/GLPoptions.class | Bin 11082 -> 0 bytes scripting/java/example/GLPoptions.java | 662 ---- scripting/java/example/GLPprinterDetail.class | Bin 4832 -> 0 bytes scripting/java/example/GLPprinterDetail.java | 244 -- scripting/java/example/GLPprinters.class | Bin 8749 -> 0 bytes scripting/java/example/GLPprinters.java | 509 --- scripting/java/example/GLPsearch.class | Bin 2428 -> 0 bytes scripting/java/example/GLPsearch.java | 121 - .../example/GLPsearchProgressPanel$1.class | Bin 2470 -> 0 bytes .../example/GLPsearchProgressPanel$2.class | Bin 1188 -> 0 bytes ...LPsearchProgressPanel$ButtonListener.class | Bin 1686 -> 0 bytes .../java/example/GLPsearchProgressPanel.class | Bin 2709 -> 0 bytes .../java/example/GLPsearchProgressPanel.java | 195 - scripting/java/example/GLPserver.class | Bin 4304 -> 0 bytes scripting/java/example/GLPserver.java | 192 - scripting/java/example/GLPtabs$1.class | Bin 1097 -> 0 bytes scripting/java/example/GLPtabs.class | Bin 2611 -> 0 bytes scripting/java/example/GLPtabs.java | 117 - scripting/java/example/GLPvars.class | Bin 1592 -> 0 bytes scripting/java/example/GLPvars.java | 93 - scripting/java/example/buildit | 4 - scripting/java/example/class.list | 13 - scripting/java/example/images/left.gif | Bin 110 -> 0 bytes .../java/example/images/print-test-page.gif | Bin 519 -> 0 bytes .../java/example/images/printer-idle.gif | Bin 706 -> 0 bytes .../java/example/images/printer-stopped.gif | Bin 794 -> 0 bytes scripting/java/example/images/restart-job.gif | Bin 440 -> 0 bytes scripting/java/example/images/show-active.gif | Bin 581 -> 0 bytes .../java/example/images/show-completed.gif | Bin 657 -> 0 bytes scripting/java/example/runit | 2 - .../java/src/com/easysw/cups/Base64Coder.java | 145 - scripting/java/src/com/easysw/cups/Cups.java | 1406 ------- .../java/src/com/easysw/cups/CupsJob.java | 207 - .../java/src/com/easysw/cups/CupsPrinter.java | 828 ---- scripting/java/src/com/easysw/cups/IPP.java | 242 -- .../src/com/easysw/cups/IPPAttribute.java | 607 --- .../java/src/com/easysw/cups/IPPCalendar.java | 53 - .../java/src/com/easysw/cups/IPPDefs.java | 301 -- .../java/src/com/easysw/cups/IPPError.java | 150 - .../java/src/com/easysw/cups/IPPHttp.java | 1343 ------- .../java/src/com/easysw/cups/IPPMD5.java | 125 - .../java/src/com/easysw/cups/IPPRequest.java | 88 - .../java/src/com/easysw/cups/IPPStatus.java | 186 - .../src/com/easysw/cups/IPPURLConnection.java | 69 - .../java/src/com/easysw/cups/IPPValue.java | 255 -- scripting/java/src/com/easysw/cups/buildit | 9 - scripting/java/src/com/easysw/cups/class.list | 14 - scripting/java/src/com/easysw/cups/cups.nfo | 25 - systemv/Makefile | 4 +- templates/Makefile | 2 +- 152 files changed, 2147 insertions(+), 21743 deletions(-) delete mode 100644 backend/betest.c create mode 100644 backend/snmp-supplies.c create mode 100644 backend/testbackend.c create mode 100644 backend/testsupplies.c delete mode 100644 scripting/java/CUPSPrinter.java delete mode 100644 scripting/java/classes/com/easysw/cups/Cups.class delete mode 100644 scripting/java/classes/com/easysw/cups/CupsJob.class delete mode 100644 scripting/java/classes/com/easysw/cups/CupsPrinter.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPP.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPPAttribute.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPPBase64Encoder.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPPCalendar.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPPDefs.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPPError.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPPHttp.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPPMD5.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPPRequest.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPPStatus.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPPURLConnection.class delete mode 100644 scripting/java/classes/com/easysw/cups/IPPValue.class delete mode 100644 scripting/java/cups.jar delete mode 100644 scripting/java/docs/allclasses-frame.html delete mode 100644 scripting/java/docs/com/easysw/cups/Cups.html delete mode 100644 scripting/java/docs/com/easysw/cups/CupsJob.html delete mode 100644 scripting/java/docs/com/easysw/cups/CupsPrinter.html delete mode 100644 scripting/java/docs/com/easysw/cups/IPP.html delete mode 100644 scripting/java/docs/com/easysw/cups/IPPAttribute.html delete mode 100644 scripting/java/docs/com/easysw/cups/IPPDefs.html delete mode 100644 scripting/java/docs/com/easysw/cups/IPPError.html delete mode 100644 scripting/java/docs/com/easysw/cups/IPPHttp.html delete mode 100644 scripting/java/docs/com/easysw/cups/IPPRequest.html delete mode 100644 scripting/java/docs/com/easysw/cups/IPPStatus.html delete mode 100644 scripting/java/docs/com/easysw/cups/IPPURLConnection.html delete mode 100644 scripting/java/docs/com/easysw/cups/IPPValue.html delete mode 100644 scripting/java/docs/deprecated-list.html delete mode 100644 scripting/java/docs/help-doc.html delete mode 100644 scripting/java/docs/index-all.html delete mode 100644 scripting/java/docs/index.html delete mode 100644 scripting/java/docs/overview-tree.html delete mode 100644 scripting/java/docs/package-list delete mode 100644 scripting/java/docs/packages.html delete mode 100644 scripting/java/docs/serialized-form.html delete mode 100644 scripting/java/docs/stylesheet.css delete mode 100644 scripting/java/example/GLP.class delete mode 100644 scripting/java/example/GLP.java delete mode 100644 scripting/java/example/GLPcolors.class delete mode 100644 scripting/java/example/GLPcolors.java delete mode 100644 scripting/java/example/GLPdetail.class delete mode 100644 scripting/java/example/GLPdetail.java delete mode 100644 scripting/java/example/GLPjobList.class delete mode 100644 scripting/java/example/GLPjobList.java delete mode 100644 scripting/java/example/GLPjobTableModel.class delete mode 100644 scripting/java/example/GLPjobTableModel.java delete mode 100644 scripting/java/example/GLPoptions$1.class delete mode 100644 scripting/java/example/GLPoptions$MyTextListener.class delete mode 100644 scripting/java/example/GLPoptions.class delete mode 100644 scripting/java/example/GLPoptions.java delete mode 100644 scripting/java/example/GLPprinterDetail.class delete mode 100644 scripting/java/example/GLPprinterDetail.java delete mode 100644 scripting/java/example/GLPprinters.class delete mode 100644 scripting/java/example/GLPprinters.java delete mode 100644 scripting/java/example/GLPsearch.class delete mode 100644 scripting/java/example/GLPsearch.java delete mode 100644 scripting/java/example/GLPsearchProgressPanel$1.class delete mode 100644 scripting/java/example/GLPsearchProgressPanel$2.class delete mode 100644 scripting/java/example/GLPsearchProgressPanel$ButtonListener.class delete mode 100644 scripting/java/example/GLPsearchProgressPanel.class delete mode 100644 scripting/java/example/GLPsearchProgressPanel.java delete mode 100644 scripting/java/example/GLPserver.class delete mode 100644 scripting/java/example/GLPserver.java delete mode 100644 scripting/java/example/GLPtabs$1.class delete mode 100644 scripting/java/example/GLPtabs.class delete mode 100644 scripting/java/example/GLPtabs.java delete mode 100644 scripting/java/example/GLPvars.class delete mode 100644 scripting/java/example/GLPvars.java delete mode 100755 scripting/java/example/buildit delete mode 100644 scripting/java/example/class.list delete mode 100644 scripting/java/example/images/left.gif delete mode 100644 scripting/java/example/images/print-test-page.gif delete mode 100644 scripting/java/example/images/printer-idle.gif delete mode 100644 scripting/java/example/images/printer-stopped.gif delete mode 100644 scripting/java/example/images/restart-job.gif delete mode 100644 scripting/java/example/images/show-active.gif delete mode 100644 scripting/java/example/images/show-completed.gif delete mode 100755 scripting/java/example/runit delete mode 100644 scripting/java/src/com/easysw/cups/Base64Coder.java delete mode 100644 scripting/java/src/com/easysw/cups/Cups.java delete mode 100644 scripting/java/src/com/easysw/cups/CupsJob.java delete mode 100644 scripting/java/src/com/easysw/cups/CupsPrinter.java delete mode 100644 scripting/java/src/com/easysw/cups/IPP.java delete mode 100644 scripting/java/src/com/easysw/cups/IPPAttribute.java delete mode 100644 scripting/java/src/com/easysw/cups/IPPCalendar.java delete mode 100644 scripting/java/src/com/easysw/cups/IPPDefs.java delete mode 100644 scripting/java/src/com/easysw/cups/IPPError.java delete mode 100644 scripting/java/src/com/easysw/cups/IPPHttp.java delete mode 100644 scripting/java/src/com/easysw/cups/IPPMD5.java delete mode 100644 scripting/java/src/com/easysw/cups/IPPRequest.java delete mode 100644 scripting/java/src/com/easysw/cups/IPPStatus.java delete mode 100644 scripting/java/src/com/easysw/cups/IPPURLConnection.java delete mode 100644 scripting/java/src/com/easysw/cups/IPPValue.java delete mode 100755 scripting/java/src/com/easysw/cups/buildit delete mode 100644 scripting/java/src/com/easysw/cups/class.list delete mode 100644 scripting/java/src/com/easysw/cups/cups.nfo diff --git a/CHANGES-1.3.txt b/CHANGES-1.3.txt index 2117b7a8f..6ec84120c 100644 --- a/CHANGES-1.3.txt +++ b/CHANGES-1.3.txt @@ -1,6 +1,17 @@ CHANGES-1.3.txt --------------- +CHANGES IN CUPS V1.3.7 + + - The image filters did not work with some CMYK JPEG files + produced by Adobe applications (STR #2727) + - The Mac OS X USB backend did not work with printers that + did not report a make or model. + - The job-sheets option was not encoded properly (STR #2715) + - The scheduler incorrectly complained about missing LSB + PPD directories. + + CHANGES IN CUPS V1.3.6 - Documentation updates (STR #2646, STR #2647, STR #2649) diff --git a/CHANGES.txt b/CHANGES.txt index 5d31aead4..0490562f1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,8 +1,13 @@ -CHANGES.txt - 2008-01-30 +CHANGES.txt - 2008-02-26 ------------------------ CHANGES IN CUPS V1.4b1 + - The scheduler now manages ICC color profiles on Mac OS X. + - The network backends (ipp, lpd, socket) now support + SNMP-based supply and page count monitoring (STR #1655) + - The lppasswd program is no longer installed setuid to + root to make the default installation more secure. - Added a new ppdLocalizeMarkerName() function to get the localized version of a marker-names value. - The scheduler now provides the printer-dns-sd-name diff --git a/backend/Dependencies b/backend/Dependencies index fd10e6a94..26652c844 100644 --- a/backend/Dependencies +++ b/backend/Dependencies @@ -1,6 +1,5 @@ # DO NOT DELETE THIS LINE -- make depend depends on it. -betest.o: ../cups/string.h ../config.h ipp.o: ../cups/http-private.h ../config.h ../cups/http.h ../cups/versioning.h ipp.o: ../cups/md5.h ../cups/ipp-private.h ../cups/ipp.h ../cups/backend.h ipp.o: ../cups/cups.h ../cups/ppd.h ../cups/array.h ../cups/file.h @@ -46,6 +45,16 @@ test1284.o: ../cups/backend.h ../cups/versioning.h ../cups/sidechannel.h test1284.o: ../cups/cups.h ../cups/ipp.h ../cups/http.h ../cups/ppd.h test1284.o: ../cups/array.h ../cups/file.h ../cups/language.h ../cups/debug.h test1284.o: ../cups/i18n.h ../cups/transcode.h ../cups/snmp.h +testbackend.o: ../cups/string.h ../config.h ../cups/cups.h ../cups/ipp.h +testbackend.o: ../cups/http.h ../cups/versioning.h ../cups/ppd.h +testbackend.o: ../cups/array.h ../cups/file.h ../cups/language.h +testbackend.o: ../cups/sidechannel.h +testsupplies.o: backend-private.h ../cups/backend.h ../cups/versioning.h +testsupplies.o: ../cups/sidechannel.h ../cups/cups.h ../cups/ipp.h +testsupplies.o: ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h +testsupplies.o: ../cups/language.h ../cups/debug.h ../cups/i18n.h +testsupplies.o: ../cups/transcode.h ../cups/snmp.h ../cups/string.h +testsupplies.o: ../config.h usb.o: ../cups/backend.h ../cups/versioning.h ../cups/cups.h ../cups/ipp.h usb.o: ../cups/http.h ../cups/ppd.h ../cups/array.h ../cups/file.h usb.o: ../cups/language.h ../cups/string.h ../config.h ../cups/i18n.h diff --git a/backend/Makefile b/backend/Makefile index 3dccd1a53..a2bb1621f 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -19,10 +19,11 @@ include ../Makedefs RBACKENDS = ipp lpd UBACKENDS = $(PAP) $(LEGACY_BACKENDS) serial snmp socket usb -TARGETS = betest test1284 libbackend.a $(RBACKENDS) $(UBACKENDS) -LIBOBJS = ieee1284.o runloop.o -OBJS = betest.o ipp.o lpd.o pap.o parallel.o scsi.o \ - serial.o snmp.o socket.o test1284.o usb.o +TARGETS = test1284 testbackend testsupplies \ + libbackend.a $(RBACKENDS) $(UBACKENDS) +LIBOBJS = ieee1284.o runloop.o snmp-supplies.o +OBJS = ipp.o lpd.o pap.o parallel.o scsi.o serial.o snmp.o socket.o \ + test1284.o testbackend.o testsupplies.o usb.o # @@ -84,24 +85,35 @@ uninstall: # -# betest +# test1284 # -betest: betest.o ../cups/$(LIBCUPS) +test1284: test1284.o ../cups/libcups.a echo Linking $@... - $(CC) $(LDFLAGS) -o betest betest.o $(LIBS) + $(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/libcups.a \ + $(SSLLIBS) $(COMMONLIBS) $(LIBZ) # -# test1284 +# testbackend # -test1284: test1284.o ../cups/libcups.a +testbackend: testbackend.o ../cups/libcups.a echo Linking $@... - $(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/libcups.a \ + $(CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/libcups.a \ $(SSLLIBS) $(COMMONLIBS) $(LIBZ) +# +# testsupplies +# + +testsupplies: testsupplies.o libbackend.a ../cups/libcups.a + echo Linking $@... + $(CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \ + ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) + + # # libbackend.a # diff --git a/backend/backend-private.h b/backend/backend-private.h index cd5aaaf47..9bbfa1e50 100644 --- a/backend/backend-private.h +++ b/backend/backend-private.h @@ -97,8 +97,8 @@ extern "C" { #define CUPS_OID_prtMarkerSuppliesType CUPS_OID_prtMarkerSuppliesEntry,5 #define CUPS_OID_prtMarkerSuppliesDescription CUPS_OID_prtMarkerSuppliesEntry,6 #define CUPS_OID_prtMarkerSuppliesSupplyUnit CUPS_OID_prtMarkerSuppliesEntry,7 -#define CUPS_OID_prtMarkerSuppliesMaxCapacity CUPS_OID_prtMarkerSupliesEntry,8 -#define CUPS_OID_prtMarkerSuppliesLevel CUPS_OID_prtMarkerSupliesEntry,9 +#define CUPS_OID_prtMarkerSuppliesMaxCapacity CUPS_OID_prtMarkerSuppliesEntry,8 +#define CUPS_OID_prtMarkerSuppliesLevel CUPS_OID_prtMarkerSuppliesEntry,9 #define CUPS_OID_prtMarkerColorant CUPS_OID_printmib,12 #define CUPS_OID_prtMarkerColorantTable CUPS_OID_prtMarkerColorant,1 @@ -211,10 +211,15 @@ extern int backendGetDeviceID(int fd, char *device_id, int device_id_size, const char *scheme, char *uri, int uri_size); extern int backendGetMakeModel(const char *device_id, char *make_model, int make_model_size); -extern ssize_t backendRunLoop(int print_fd, int device_fd, int use_bc, - void (*side_cb)(int print_fd, int device_fd, - int use_bc)); - +extern void backendNetworkSideCB(int print_fd, int device_fd, int snmp_fd, + http_addr_t *addr, int use_bc); +extern ssize_t backendRunLoop(int print_fd, int device_fd, int snmp_fd, + http_addr_t *addr, int use_bc, + void (*side_cb)(int print_fd, int device_fd, + int snmp_fd, http_addr_t *addr, + int use_bc)); +extern int backendSNMPSupplies(int snmp_fd, http_addr_t *addr, + int *page_count, int *printer_state); # ifdef __cplusplus } diff --git a/backend/betest.c b/backend/betest.c deleted file mode 100644 index ae73a1f1c..000000000 --- a/backend/betest.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * "$Id: betest.c 6649 2007-07-11 21:46:42Z mike $" - * - * Backend test program for the Common UNIX Printing System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2005 by Easy Software Products, all rights reserved. - * - * 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" - * "LICENSE" which should have been included with this file. If this - * file is missing or damaged, see the license at "http://www.cups.org/". - * - * This file is subject to the Apple OS-Developed Software exception. - * - * Contents: - * - * main() - Run the named backend. - */ - -/* - * Include necessary headers. - */ - -#include -#include -#include -#include - - -/* - * 'main()' - Run the named backend. - * - * Usage: - * - * betest device-uri job-id user title copies options [file] - */ - -int /* O - Exit status */ -main(int argc, /* I - Number of command-line arguments (7 or 8) */ - char *argv[]) /* I - Command-line arguments */ -{ - char backend[255]; /* Method in URI */ - - - if (argc < 7 || argc > 8) - { - fputs("Usage: betest device-uri job-id user title copies options [file]\n", - stderr); - return (1); - } - - /* - * Extract the method from the device-uri - that's the program we want to - * execute. - */ - - if (sscanf(argv[1], "%254[^:]", backend) != 1) - { - fputs("betest: Bad device-uri - no colon!\n", stderr); - return (1); - } - - /* - * Execute and return - */ - - execl(backend, argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7], - NULL); - - return (1); -} - - -/* - * End of "$Id: betest.c 6649 2007-07-11 21:46:42Z mike $". - */ diff --git a/backend/parallel.c b/backend/parallel.c index 121f9f46b..84addcb05 100644 --- a/backend/parallel.c +++ b/backend/parallel.c @@ -59,7 +59,8 @@ */ static void list_devices(void); -static void side_cb(int print_fd, int device_fd, int use_bc); +static void side_cb(int print_fd, int device_fd, int snmp_fd, + http_addr_t *addr, int use_bc); /* @@ -283,7 +284,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ lseek(print_fd, 0, SEEK_SET); } - tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb); + tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, side_cb); if (print_fd != 0 && tbytes >= 0) _cupsLangPrintf(stderr, @@ -609,9 +610,11 @@ list_devices(void) */ static void -side_cb(int print_fd, /* I - Print file */ - int device_fd, /* I - Device file */ - int use_bc) /* I - Using back-channel? */ +side_cb(int print_fd, /* I - Print file */ + int device_fd, /* I - Device file */ + int snmp_fd, /* I - SNMP socket (unused) */ + http_addr_t *addr, /* I - Device address (unused) */ + int use_bc) /* I - Using back-channel? */ { cups_sc_command_t command; /* Request command */ cups_sc_status_t status; /* Request/response status */ @@ -619,6 +622,9 @@ side_cb(int print_fd, /* I - Print file */ int datalen; /* Request/response data size */ + (void)snmp_fd; + (void)addr; + datalen = sizeof(data); if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0)) diff --git a/backend/runloop.c b/backend/runloop.c index 5af3d77f1..bbf565d5f 100644 --- a/backend/runloop.c +++ b/backend/runloop.c @@ -25,6 +25,7 @@ */ #include "backend-private.h" +#include #ifdef __hpux # include #else @@ -135,16 +136,84 @@ backendDrainOutput(int print_fd, /* I - Print file descriptor */ } +/* + * 'backendNetworkSideCB()' - Handle common network side-channel commands. + */ + +void +backendNetworkSideCB( + int print_fd, /* I - Print file or -1 */ + int device_fd, /* I - Device file or -1 */ + int snmp_fd, /* I - SNMP socket */ + http_addr_t *addr, /* I - Address of device */ + int use_bc) /* I - Use back-channel data? */ +{ + cups_sc_command_t command; /* Request command */ + cups_sc_status_t status; /* Request/response status */ + char data[2048]; /* Request/response data */ + int datalen; /* Request/response data size */ + const char *device_id; /* 1284DEVICEID env var */ + + + datalen = sizeof(data); + + if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0)) + { + _cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n")); + return; + } + + switch (command) + { + case CUPS_SC_CMD_DRAIN_OUTPUT : + /* + * Our sockets disable the Nagle algorithm and data is sent immediately. + */ + + if (backendDrainOutput(print_fd, device_fd)) + status = CUPS_SC_STATUS_IO_ERROR; + else + status = CUPS_SC_STATUS_OK; + + datalen = 0; + break; + + case CUPS_SC_CMD_GET_BIDI : + data[0] = use_bc; + datalen = 1; + break; + + case CUPS_SC_CMD_GET_DEVICE_ID : + if ((device_id = getenv("1284DEVICEID")) != NULL) + { + strlcpy(data, device_id, sizeof(data)); + datalen = (int)strlen(data); + break; + } + + default : + status = CUPS_SC_STATUS_NOT_IMPLEMENTED; + datalen = 0; + break; + } + + cupsSideChannelWrite(command, status, data, datalen, 1.0); +} + + /* * 'backendRunLoop()' - Read and write print and back-channel data. */ ssize_t /* O - Total bytes on success, -1 on error */ backendRunLoop( - int print_fd, /* I - Print file descriptor */ - int device_fd, /* I - Device file descriptor */ - int use_bc, /* I - Use back-channel? */ - void (*side_cb)(int, int, int)) /* I - Side-channel callback */ + int print_fd, /* I - Print file descriptor */ + int device_fd, /* I - Device file descriptor */ + int snmp_fd, /* I - SNMP socket or -1 if none */ + http_addr_t *addr, /* I - Address of device */ + int use_bc, /* I - Use back-channel? */ + void (*side_cb)(int, int, int, http_addr_t *, int)) + /* I - Side-channel callback */ { int nfds; /* Maximum file descriptor value + 1 */ fd_set input, /* Input set for reading */ @@ -158,15 +227,18 @@ backendRunLoop( char print_buffer[8192], /* Print data buffer */ *print_ptr, /* Pointer into print data buffer */ bc_buffer[1024]; /* Back-channel data buffer */ + struct timeval timeout; /* Timeout for select() */ + time_t curtime, /* Current time */ + snmp_update = 0; #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) struct sigaction action; /* Actions for POSIX signals */ #endif /* HAVE_SIGACTION && !HAVE_SIGSET */ fprintf(stderr, - "DEBUG: backendRunLoop(print_fd=%d, device_fd=%d, use_bc=%d, " - "side_cb=%p)\n", - print_fd, device_fd, use_bc, side_cb); + "DEBUG: backendRunLoop(print_fd=%d, device_fd=%d, snmp_fd=%d, " + "addr=%p, use_bc=%d, side_cb=%p)\n", + print_fd, device_fd, snmp_fd, addr, use_bc, side_cb); /* * If we are printing data from a print driver on stdin, ignore SIGTERM @@ -221,7 +293,10 @@ backendRunLoop( if (use_bc || side_cb) { - if (select(nfds, &input, &output, NULL, NULL) < 0) + timeout.tv_sec = 5; + timeout.tv_usec = 0; + + if (select(nfds, &input, &output, NULL, &timeout) < 0) { /* * Pause printing to clear any pending errors... @@ -250,7 +325,7 @@ backendRunLoop( */ if (side_cb && FD_ISSET(CUPS_SC_FD, &input)) - (*side_cb)(print_fd, device_fd, use_bc); + (*side_cb)(print_fd, device_fd, snmp_fd, addr, use_bc); /* * Check if we have back-channel data ready... @@ -363,6 +438,18 @@ backendRunLoop( total_bytes += bytes; } } + + /* + * Do SNMP updates periodically... + */ + + if (snmp_fd >= 0 && time(&curtime) >= snmp_update) + { + if (backendSNMPSupplies(snmp_fd, addr, NULL, NULL)) + snmp_update = INT_MAX; + else + snmp_update = curtime + 5; + } } /* diff --git a/backend/snmp-supplies.c b/backend/snmp-supplies.c new file mode 100644 index 000000000..806b67f25 --- /dev/null +++ b/backend/snmp-supplies.c @@ -0,0 +1,688 @@ +/* + * "$Id$" + * + * SNMP supplies functions for the Common UNIX Printing System (CUPS). + * + * Copyright 2008 by Apple Inc. + * + * 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" + * "LICENSE" which should have been included with this file. If this + * file is missing or damaged, see the license at "http://www.cups.org/". + * + * This file is subject to the Apple OS-Developed Software exception. + * + * Contents: + * + * backendSNMPSupplies() - Get the current supplies for a device. + * backend_init_supplies() - Initialize the supplies list. + * backend_walk_cb() - Interpret the supply value responses... + */ + +/* + * Include necessary headers. + */ + +#include "backend-private.h" +#include + + +/* + * Local constants... + */ + +#define CUPS_MAX_SUPPLIES 32 /* Maximum number of supplies for a printer */ + + +/* + * Local structures... + */ + +typedef struct +{ + char name[CUPS_SNMP_MAX_STRING], /* Name of supply */ + color[8]; /* Color: "#RRGGBB" or "none" */ + int colorant, /* Colorant index */ + type, /* Supply type */ + max_capacity, /* Maximum capacity */ + level; /* Current level value */ +} backend_supplies_t; + + +/* + * Local globals... + */ + +static http_addr_t current_addr; /* Current address */ +static int num_supplies = 0; + /* Number of supplies found */ +static backend_supplies_t supplies[CUPS_MAX_SUPPLIES]; + /* Supply information */ + +static const int hrDeviceDescr[] = + { CUPS_OID_hrDeviceDescr, 1, -1 }; + /* Device description OID */ +static const int hrPrinterStatus[] = + { CUPS_OID_hrPrinterStatus, 1, -1 }; + /* Current state OID */ +static const int hrPrinterDetectedErrorState[] = + { CUPS_OID_hrPrinterDetectedErrorState, 1, -1 }; + /* Current printer state bits OID */ +static const int prtMarkerColorantValue[] = + { CUPS_OID_prtMarkerColorantValue, -1 }, + /* Colorant OID */ + prtMarkerColorantValueOffset = + (sizeof(prtMarkerColorantValue) / + sizeof(prtMarkerColorantValue[0])); + /* Offset to colorant index */ +static const int prtMarkerLifeCount[] = + { CUPS_OID_prtMarkerLifeCount, 1, 1, -1 }; + /* Page counter OID */ +static const int prtMarkerSuppliesEntry[] = + { CUPS_OID_prtMarkerSuppliesEntry, -1 }; + /* Supplies OID */ +static const int prtMarkerSuppliesColorantIndex[] = + { CUPS_OID_prtMarkerSuppliesColorantIndex, -1 }, + /* Colorant index OID */ + prtMarkerSuppliesColorantIndexOffset = + (sizeof(prtMarkerSuppliesColorantIndex) / + sizeof(prtMarkerSuppliesColorantIndex[0])); + /* Offset to supply index */ +static const int prtMarkerSuppliesDescription[] = + { CUPS_OID_prtMarkerSuppliesDescription, -1 }, + /* Description OID */ + prtMarkerSuppliesDescriptionOffset = + (sizeof(prtMarkerSuppliesDescription) / + sizeof(prtMarkerSuppliesDescription[0])); + /* Offset to supply index */ +static const int prtMarkerSuppliesLevel[] = + { CUPS_OID_prtMarkerSuppliesLevel, -1 }, + /* Level OID */ + prtMarkerSuppliesLevelOffset = + (sizeof(prtMarkerSuppliesLevel) / + sizeof(prtMarkerSuppliesLevel[0])); + /* Offset to supply index */ +static const int prtMarkerSuppliesMaxCapacity[] = + { CUPS_OID_prtMarkerSuppliesMaxCapacity, -1 }, + /* Max capacity OID */ + prtMarkerSuppliesMaxCapacityOffset = + (sizeof(prtMarkerSuppliesMaxCapacity) / + sizeof(prtMarkerSuppliesMaxCapacity[0])); + /* Offset to supply index */ +static const int prtMarkerSuppliesType[] = + { CUPS_OID_prtMarkerSuppliesType, -1 }, + /* Type OID */ + prtMarkerSuppliesTypeOffset = + (sizeof(prtMarkerSuppliesType) / + sizeof(prtMarkerSuppliesType[0])); + /* Offset to supply index */ + + +/* + * Local functions... + */ + +static void backend_init_supplies(int snmp_fd, http_addr_t *addr); +static void backend_walk_cb(cups_snmp_t *packet, void *data); + + +/* + * 'backendSNMPSupplies()' - Get the current supplies for a device. + */ + +int /* O - 0 on success, -1 on error */ +backendSNMPSupplies( + int snmp_fd, /* I - SNMP socket */ + http_addr_t *addr, /* I - Printer address */ + int *page_count, /* O - Page count */ + int *printer_state) /* O - Printer state */ +{ + if (!httpAddrEqual(addr, ¤t_addr)) + backend_init_supplies(snmp_fd, addr); + else if (num_supplies > 0) + cupsSNMPWalk(snmp_fd, ¤t_addr, CUPS_SNMP_VERSION_1, + cupsSNMPDefaultCommunity(), prtMarkerSuppliesLevel, 500, + backend_walk_cb, NULL); + + if (page_count) + *page_count = -1; + + if (printer_state) + *printer_state = -1; + + if (num_supplies > 0) + { + int i; /* Looping var */ + char value[CUPS_MAX_SUPPLIES * 4], + /* marker-levels value string */ + *ptr; /* Pointer into value string */ + cups_snmp_t packet; /* SNMP response packet */ + + + /* + * Generate the marker-levels value string... + */ + + for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr)) + { + if (i) + *ptr++ = ','; + + sprintf(ptr, "%d", 100 * supplies[i].level / supplies[i].max_capacity); + } + + fprintf(stderr, "ATTR: marker-levels=%s\n", value); + + /* + * Get the current printer status bits... + */ + + if (!cupsSNMPWrite(snmp_fd, addr, CUPS_SNMP_VERSION_1, + cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1, + hrPrinterDetectedErrorState)) + return (-1); + + if (!cupsSNMPRead(snmp_fd, &packet, 500) || + packet.object_type != CUPS_ASN1_OCTET_STRING) + return (-1); + + i = ((packet.object_value.string[0] & 255) << 8) | + (packet.object_value.string[1] & 255); + + if (i & CUPS_TC_lowPaper) + fputs("STATE: +media-low-warning\n", stderr); + else + fputs("STATE: -media-low-warning\n", stderr); + + if (i & (CUPS_TC_noPaper | CUPS_TC_inputTrayEmpty)) + fputs("STATE: +media-empty-error\n", stderr); + else + fputs("STATE: -media-empty-error\n", stderr); + + if (i & CUPS_TC_lowToner) + fputs("STATE: +toner-low-warning\n", stderr); + else + fputs("STATE: -toner-low-warning\n", stderr); + + if (i & CUPS_TC_noToner) + fputs("STATE: +toner-empty-error\n", stderr); + else + fputs("STATE: -toner-empty-error\n", stderr); + + if (i & CUPS_TC_doorOpen) + fputs("STATE: +door-open-report\n", stderr); + else + fputs("STATE: -door-open-report\n", stderr); + + if (i & CUPS_TC_jammed) + fputs("STATE: +media-jam-error\n", stderr); + else + fputs("STATE: -media-jam-error\n", stderr); + + if (i & CUPS_TC_offline) + fputs("STATE: +offline-report\n", stderr); + else + fputs("STATE: -offline-report\n", stderr); + + if (i & (CUPS_TC_serviceRequested | CUPS_TC_overduePreventMaint)) + fputs("STATE: +service-needed-error\n", stderr); + else + fputs("STATE: -service-needed-error\n", stderr); + + if (i & CUPS_TC_inputTrayMissing) + fputs("STATE: +input-tray-missing-error\n", stderr); + else + fputs("STATE: -input-tray-missing-error\n", stderr); + + if (i & CUPS_TC_outputTrayMissing) + fputs("STATE: +output-tray-missing-error\n", stderr); + else + fputs("STATE: -output-tray-missing-error\n", stderr); + + if (i & CUPS_TC_markerSupplyMissing) + fputs("STATE: +marker-supply-missing-error\n", stderr); + else + fputs("STATE: -marker-supply-missing-error\n", stderr); + + if (i & CUPS_TC_outputNearFull) + fputs("STATE: +output-area-almost-full-warning\n", stderr); + else + fputs("STATE: -output-area-almost-full-warning\n", stderr); + + if (i & CUPS_TC_outputFull) + fputs("STATE: +output-area-full-error\n", stderr); + else + fputs("STATE: -output-area-full-error\n", stderr); + + /* + * Get the current printer state... + */ + + if (printer_state) + { + if (!cupsSNMPWrite(snmp_fd, addr, CUPS_SNMP_VERSION_1, + cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1, + hrPrinterStatus)) + return (-1); + + if (!cupsSNMPRead(snmp_fd, &packet, 500) || + packet.object_type != CUPS_ASN1_INTEGER) + return (-1); + + *printer_state = packet.object_value.integer; + } + + /* + * Get the current page count... + */ + + if (page_count) + { + if (!cupsSNMPWrite(snmp_fd, addr, CUPS_SNMP_VERSION_1, + cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1, + prtMarkerLifeCount)) + return (-1); + + if (!cupsSNMPRead(snmp_fd, &packet, 500) || + packet.object_type != CUPS_ASN1_COUNTER) + return (-1); + + *page_count = packet.object_value.counter; + } + + return (0); + } + else + return (-1); +} + + +/* + * 'backend_init_supplies()' - Initialize the supplies list. + */ + +static void +backend_init_supplies( + int snmp_fd, /* I - SNMP socket */ + http_addr_t *addr) /* I - Printer address */ +{ + int i, /* Looping var */ + type; /* Current marker type */ + cups_file_t *cachefile; /* Cache file */ + const char *cachedir; /* CUPS_CACHEDIR value */ + char addrstr[1024], /* Address string */ + cachefilename[1024], /* Cache filename */ + description[CUPS_SNMP_MAX_STRING], + /* Device description string */ + value[CUPS_MAX_SUPPLIES * (CUPS_SNMP_MAX_STRING * 2 + 3)], + /* Value string */ + *ptr, /* Pointer into value string */ + *name_ptr; /* Pointer into name string */ + cups_snmp_t packet; /* SNMP response packet */ + static const char * const types[] = /* Supply types */ + { + "other", + "unknown", + "toner", + "wasteToner", + "ink", + "inkCartridge", + "inkRibbon", + "wasteInk", + "opc", + "developer", + "fuserOil", + "solidWax", + "ribbonWax", + "wasteWax", + "fuser", + "coronaWire", + "fuserOilWick", + "cleanerUnit", + "fuserCleaningPad", + "transferUnit", + "tonerCartridge", + "fuserOiler", + "water", + "wasteWater", + "glueWaterAdditive", + "wastePaper", + "bindingSupply", + "bandingSupply", + "stitchingWire", + "shrinkWrap", + "paperWrap", + "staples", + "inserts", + "covers" + }; + + + /* + * Reset state information... + */ + + current_addr = *addr; + num_supplies = -1; + + memset(supplies, 0, sizeof(supplies)); + + /* + * Get the device description... + */ + + if (!cupsSNMPWrite(snmp_fd, addr, CUPS_SNMP_VERSION_1, + cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1, + hrDeviceDescr)) + return; + + if (!cupsSNMPRead(snmp_fd, &packet, 500) || + packet.object_type != CUPS_ASN1_OCTET_STRING) + { + strlcpy(description, "Unknown", sizeof(description)); + num_supplies = 0; + } + else + strlcpy(description, packet.object_value.string, sizeof(description)); + + /* + * See if we have already queried this device... + */ + + httpAddrString(addr, addrstr, sizeof(addrstr)); + + if ((cachedir = getenv("CUPS_CACHEDIR")) == NULL) + cachedir = CUPS_CACHEDIR; + + snprintf(cachefilename, sizeof(cachefilename), "%s/%s.snmp", cachedir, + addrstr); + + if ((cachefile = cupsFileOpen(cachefilename, "r")) != NULL) + { + /* + * Yes, read the cache file: + * + * 1 num_supplies + * device description + * supply structures... + */ + + if (cupsFileGets(cachefile, value, sizeof(value))) + { + if (sscanf(value, "1 %d", &num_supplies) == 1 && + num_supplies <= CUPS_MAX_SUPPLIES && + cupsFileGets(cachefile, value, sizeof(value))) + { + if ((ptr = value + strlen(value) - 1) >= value && *ptr == '\n') + *ptr = '\n'; + + if (!strcmp(description, value)) + cupsFileRead(cachefile, (char *)supplies, + num_supplies * sizeof(backend_supplies_t)); + else + num_supplies = -1; + } + else + num_supplies = -1; + } + + cupsFileClose(cachefile); + } + + /* + * If the cache information isn't correct, scan for supplies... + */ + + if (num_supplies < 0) + { + /* + * Walk the printer configuration information... + */ + + cupsSNMPWalk(snmp_fd, ¤t_addr, CUPS_SNMP_VERSION_1, + cupsSNMPDefaultCommunity(), prtMarkerSuppliesEntry, 500, + backend_walk_cb, NULL); + } + + /* + * Save the cached information... + */ + + if (num_supplies < 0) + num_supplies = 0; + + if ((cachefile = cupsFileOpen(cachefilename, "w")) != NULL) + { + cupsFilePrintf(cachefile, "1 %d\n", num_supplies); + cupsFilePrintf(cachefile, "%s\n", description); + + if (num_supplies > 0) + cupsFileWrite(cachefile, (char *)supplies, + num_supplies * sizeof(backend_supplies_t)); + + cupsFileClose(cachefile); + } + + if (num_supplies <= 0) + return; + + /* + * Get the colors... + */ + + for (i = 0; i < num_supplies; i ++) + strcpy(supplies[i].color, "none"); + + cupsSNMPWalk(snmp_fd, ¤t_addr, CUPS_SNMP_VERSION_1, + cupsSNMPDefaultCommunity(), prtMarkerColorantValue, 500, + backend_walk_cb, NULL); + + /* + * Output the marker-colors attribute... + */ + + for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr)) + { + if (i) + *ptr++ = ','; + + strcpy(ptr, supplies[i].color); + } + + fprintf(stderr, "ATTR: marker-colors=%s\n", value); + + /* + * Output the marker-names attribute... + */ + + for (i = 0, ptr = value; i < num_supplies; i ++) + { + if (i) + *ptr++ = ','; + + *ptr++ = '\"'; + for (name_ptr = supplies[i].name; *name_ptr;) + { + if (*name_ptr == '\\' || *name_ptr == '\"') + *ptr++ = '\\'; + + *ptr++ = *name_ptr++; + } + *ptr++ = '\"'; + } + + *ptr = '\0'; + + fprintf(stderr, "ATTR: marker-names=%s\n", value); + + /* + * Output the marker-types attribute... + */ + + for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr)) + { + if (i) + *ptr++ = ','; + + type = supplies[i].type; + + if (type < CUPS_TC_other || type > CUPS_TC_covers) + strcpy(ptr, "unknown"); + else + strcpy(ptr, types[type - CUPS_TC_other]); + } + + fprintf(stderr, "ATTR: marker-types=%s\n", value); +} + + +/* + * 'backend_walk_cb()' - Interpret the supply value responses... + */ + +static void +backend_walk_cb(cups_snmp_t *packet, /* I - SNMP packet */ + void *data) /* I - User data (unused) */ +{ + int i, j, k; /* Looping vars */ + static const char * const colors[8][2] = + { /* Standard color names */ + { "black", "#000000" }, + { "blue", "#0000FF" }, + { "cyan", "#00FFFF" }, + { "green", "#00FF00" }, + { "magenta", "#FF00FF" }, + { "red", "#FF0000" }, + { "white", "#FFFFFF" }, + { "yellow", "#FFFF00" } + }; + + + (void)data; + + if (cupsSNMPIsOIDPrefixed(packet, prtMarkerColorantValue) && + packet->object_type == CUPS_ASN1_OCTET_STRING) + { + /* + * Get colorant... + */ + + i = packet->object_name[prtMarkerColorantValueOffset]; + + fprintf(stderr, "DEBUG2: prtMarkerColorantValue.1.%d = \"%s\"\n", i, + packet->object_value.string); + + for (j = 0; j < num_supplies; j ++) + if (supplies[j].colorant == i) + { + for (k = 0; k < (int)(sizeof(colors) / sizeof(colors[0])); k ++) + if (!strcmp(colors[k][0], packet->object_value.string)) + { + strcpy(supplies[j].color, colors[k][1]); + break; + } + } + } + else if (cupsSNMPIsOIDPrefixed(packet, prtMarkerSuppliesColorantIndex)) + { + /* + * Get colorant index... + */ + + i = packet->object_name[prtMarkerSuppliesColorantIndexOffset]; + if (i < 1 || i > CUPS_MAX_SUPPLIES || + packet->object_type != CUPS_ASN1_INTEGER) + return; + + fprintf(stderr, "DEBUG2: prtMarkerSuppliesColorantIndex.1.%d = %d\n", i, + packet->object_value.integer); + + if (i > num_supplies) + num_supplies = i; + + supplies[i - 1].colorant = packet->object_value.integer; + } + else if (cupsSNMPIsOIDPrefixed(packet, prtMarkerSuppliesDescription)) + { + /* + * Get supply name/description... + */ + + i = packet->object_name[prtMarkerSuppliesDescriptionOffset]; + if (i < 1 || i > CUPS_MAX_SUPPLIES || + packet->object_type != CUPS_ASN1_OCTET_STRING) + return; + + fprintf(stderr, "DEBUG2: prtMarkerSuppliesDescription.1.%d = \"%s\"\n", i, + packet->object_value.string); + + if (i > num_supplies) + num_supplies = i; + + strlcpy(supplies[i - 1].name, packet->object_value.string, + sizeof(supplies[0].name)); + } + else if (cupsSNMPIsOIDPrefixed(packet, prtMarkerSuppliesLevel)) + { + /* + * Get level... + */ + + i = packet->object_name[prtMarkerSuppliesLevelOffset]; + if (i < 1 || i > CUPS_MAX_SUPPLIES || + packet->object_type != CUPS_ASN1_INTEGER) + return; + + fprintf(stderr, "DEBUG2: prtMarkerSuppliesLevel.1.%d = %d\n", i, + packet->object_value.integer); + + if (i > num_supplies) + num_supplies = i; + + supplies[i - 1].level = packet->object_value.integer; + } + else if (cupsSNMPIsOIDPrefixed(packet, prtMarkerSuppliesMaxCapacity)) + { + /* + * Get max capacity... + */ + + i = packet->object_name[prtMarkerSuppliesMaxCapacityOffset]; + if (i < 1 || i > CUPS_MAX_SUPPLIES || + packet->object_type != CUPS_ASN1_INTEGER) + return; + + fprintf(stderr, "DEBUG2: prtMarkerSuppliesMaxCapacity.1.%d = %d\n", i, + packet->object_value.integer); + + if (i > num_supplies) + num_supplies = i; + + supplies[i - 1].max_capacity = packet->object_value.integer; + } + else if (cupsSNMPIsOIDPrefixed(packet, prtMarkerSuppliesType)) + { + /* + * Get marker type... + */ + + i = packet->object_name[prtMarkerSuppliesTypeOffset]; + if (i < 1 || i > CUPS_MAX_SUPPLIES || + packet->object_type != CUPS_ASN1_INTEGER) + return; + + fprintf(stderr, "DEBUG2: prtMarkerSuppliesType.1.%d = %d\n", i, + packet->object_value.integer); + + if (i > num_supplies) + num_supplies = i; + + supplies[i - 1].type = packet->object_value.integer; + } +} + + +/* + * End of "$Id$". + */ diff --git a/backend/snmp.c b/backend/snmp.c index 9b4532948..abfa6215a 100644 --- a/backend/snmp.c +++ b/backend/snmp.c @@ -902,7 +902,7 @@ read_snmp_response(int fd) /* I - SNMP socket file descriptor */ * Read the response data... */ - if (!cupsSNMPRead(fd, &packet, -1)) + if (!cupsSNMPRead(fd, &packet, -1.0)) { fprintf(stderr, "ERROR: Unable to read data from socket: %s\n", strerror(errno)); diff --git a/backend/socket.c b/backend/socket.c index 66bc52921..140061151 100644 --- a/backend/socket.c +++ b/backend/socket.c @@ -17,7 +17,6 @@ * Contents: * * main() - Send a file to the printer or server. - * side_cb() - Handle side-channel requests... * wait_bc() - Wait for back-channel data... */ @@ -47,7 +46,6 @@ * Local functions... */ -static void side_cb(int print_fd, int device_fd, int use_bc); static int wait_bc(int device_fd, int secs); @@ -85,6 +83,9 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ http_addrlist_t *addrlist, /* Address list */ *addr; /* Connected address */ char addrname[256]; /* Address name */ + int snmp_fd, /* SNMP socket */ + start_count, /* Page count via SNMP at start */ + page_count; /* Page count via SNMP */ ssize_t tbytes; /* Total number of bytes written */ #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET) struct sigaction action; /* Actions for POSIX signals */ @@ -358,6 +359,21 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ httpAddrString(&addr->addr, addrname, sizeof(addrname)), ntohs(addr->addr.ipv4.sin_port)); + /* + * See if the printer supports SNMP... + */ + + if ((snmp_fd = cupsSNMPOpen(addr->addr.addr.sa_family)) >= 0) + if (backendSNMPSupplies(snmp_fd, &(addr->addr), &start_count, NULL)) + { + /* + * No, close it... + */ + + cupsSNMPClose(snmp_fd); + snmp_fd = -1; + } + /* * Print everything... */ @@ -374,7 +390,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ lseek(print_fd, 0, SEEK_SET); } - tbytes = backendRunLoop(print_fd, device_fd, 1, side_cb); + tbytes = backendRunLoop(print_fd, device_fd, snmp_fd, &(addr->addr), 1, + backendNetworkSideCB); if (print_fd != 0 && tbytes >= 0) _cupsLangPrintf(stderr, @@ -406,6 +423,15 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ while (wait_bc(device_fd, 90) > 0); } + /* + * Collect the final page count as needed... + */ + + if (snmp_fd >= 0 && + !backendSNMPSupplies(snmp_fd, &(addr->addr), &page_count, NULL) && + page_count > start_count) + fprintf(stderr, "PAGE: total %d\n", page_count - start_count); + /* * Close the socket connection... */ @@ -428,68 +454,6 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ } -/* - * 'side_cb()' - Handle side-channel requests... - */ - -static void -side_cb(int print_fd, /* I - Print file */ - int device_fd, /* I - Device file */ - int use_bc) /* I - Using back-channel? */ -{ - cups_sc_command_t command; /* Request command */ - cups_sc_status_t status; /* Request/response status */ - char data[2048]; /* Request/response data */ - int datalen; /* Request/response data size */ - const char *device_id; /* 1284DEVICEID env var */ - - - datalen = sizeof(data); - - if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0)) - { - _cupsLangPuts(stderr, _("WARNING: Failed to read side-channel request!\n")); - return; - } - - switch (command) - { - case CUPS_SC_CMD_DRAIN_OUTPUT : - /* - * Our sockets disable the Nagle algorithm and data is sent immediately. - */ - - if (backendDrainOutput(print_fd, device_fd)) - status = CUPS_SC_STATUS_IO_ERROR; - else - status = CUPS_SC_STATUS_OK; - - datalen = 0; - break; - - case CUPS_SC_CMD_GET_BIDI : - data[0] = use_bc; - datalen = 1; - break; - - case CUPS_SC_CMD_GET_DEVICE_ID : - if ((device_id = getenv("1284DEVICEID")) != NULL) - { - strlcpy(data, device_id, sizeof(data)); - datalen = (int)strlen(data); - break; - } - - default : - status = CUPS_SC_STATUS_NOT_IMPLEMENTED; - datalen = 0; - break; - } - - cupsSideChannelWrite(command, status, data, datalen, 1.0); -} - - /* * 'wait_bc()' - Wait for back-channel data... */ diff --git a/backend/testbackend.c b/backend/testbackend.c new file mode 100644 index 000000000..4835ac6f6 --- /dev/null +++ b/backend/testbackend.c @@ -0,0 +1,310 @@ +/* + * "$Id$" + * + * Backend test program for the Common UNIX Printing System (CUPS). + * + * Copyright 2007-2008 by Apple Inc. + * Copyright 1997-2005 by Easy Software Products, all rights reserved. + * + * 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" + * "LICENSE" which should have been included with this file. If this + * file is missing or damaged, see the license at "http://www.cups.org/". + * + * This file is subject to the Apple OS-Developed Software exception. + * + * Contents: + * + * main() - Run the named backend. + * usage() - Show usage information. + */ + +/* + * Include necessary headers. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/* + * Local functions... + */ + +static void usage(void); + + +/* + * 'main()' - Run the named backend. + * + * Usage: + * + * betest [-s] [-t] device-uri job-id user title copies options [file] + */ + +int /* O - Exit status */ +main(int argc, /* I - Number of command-line args */ + char *argv[]) /* I - Command-line arguments */ +{ + int first_arg, /* First argument for backend */ + do_side_tests = 0, /* Test side-channel ops? */ + do_trickle = 0; /* Trickle data to backend */ + char scheme[255], /* Scheme in URI == backend */ + backend[1024]; /* Backend path */ + const char *serverbin; /* CUPS_SERVERBIN environment variable */ + int back_fds[2], /* Back-channel pipe */ + side_fds[2], /* Side-channel socket */ + data_fds[2], /* Data pipe */ + pid, /* Process ID */ + status; /* Exit status */ + + + /* + * See if we have side-channel tests to do... + */ + + for (first_arg = 1; + argv[first_arg] && argv[first_arg][0] == '-'; + first_arg ++) + if (!strcmp(argv[first_arg], "-s")) + do_side_tests = 1; + else if (!strcmp(argv[first_arg], "-t")) + do_trickle = 1; + else + usage(); + + argc -= first_arg; + if (argc < 6 || argc > 7 || (argc == 7 && do_trickle)) + usage(); + + /* + * Extract the scheme from the device-uri - that's the program we want to + * execute. + */ + + if (sscanf(argv[first_arg], "%254[^:]", scheme) != 1) + { + fputs("testbackend: Bad device-uri - no colon!\n", stderr); + return (1); + } + + if (!access(scheme, X_OK)) + strlcpy(backend, scheme, sizeof(backend)); + else + { + if ((serverbin = getenv("CUPS_SERVERBIN")) == NULL) + serverbin = CUPS_SERVERBIN; + + snprintf(backend, sizeof(backend), "%s/backend/%s", serverbin, scheme); + if (access(backend, X_OK)) + { + fprintf(stderr, "testbackend: Unknown device scheme \"%s\"!\n", scheme); + return (1); + } + } + + /* + * Create the back-channel pipe and side-channel socket... + */ + + open("/dev/null", O_WRONLY); /* Make sure fd 3 and 4 are used */ + open("/dev/null", O_WRONLY); + + pipe(back_fds); + fcntl(back_fds[0], F_SETFL, fcntl(back_fds[0], F_GETFL) | O_NONBLOCK); + fcntl(back_fds[1], F_SETFL, fcntl(back_fds[1], F_GETFL) | O_NONBLOCK); + + socketpair(AF_LOCAL, SOCK_STREAM, 0, side_fds); + fcntl(side_fds[0], F_SETFL, fcntl(side_fds[0], F_GETFL) | O_NONBLOCK); + fcntl(side_fds[1], F_SETFL, fcntl(side_fds[1], F_GETFL) | O_NONBLOCK); + + /* + * Execute the trickle process as needed... + */ + + if (do_trickle) + { + pipe(data_fds); + + if ((pid = fork()) == 0) + { + /* + * Trickle child comes here... + */ + + int i; /* Looping var */ + + close(data_fds[0]); + for (i = 0; i < 10; i ++) + { + /* + * Write 10 spaces, 1 per second... + */ + + write(data_fds[1], " ", 1); + sleep(1); + } + + exit(0); + } + else if (pid < 0) + { + perror("testbackend: Unable to fork"); + return (1); + } + } + else + data_fds[0] = data_fds[1] = -1; + + /* + * Execute the backend... + */ + + if ((pid = fork()) == 0) + { + /* + * Child comes here... + */ + + if (do_trickle) + { + close(0); + dup(data_fds[0]); + close(data_fds[0]); + close(data_fds[1]); + } + + close(3); + dup(back_fds[1]); + close(back_fds[0]); + close(back_fds[1]); + + close(4); + dup(side_fds[1]); + close(side_fds[0]); + close(side_fds[1]); + + execv(backend, argv + first_arg); + fprintf(stderr, "textbackend: Unable to execute \"%s\": %s\n", backend, + strerror(errno)); + return (errno); + } + else if (pid < 0) + { + perror("testbackend: Unable to fork"); + return (1); + } + + /* + * Parent comes here, setup back and side channel file descriptors... + */ + + if (do_trickle) + { + close(data_fds[0]); + close(data_fds[1]); + } + + close(3); + dup(back_fds[0]); + close(back_fds[0]); + close(back_fds[1]); + + close(4); + dup(side_fds[0]); + close(side_fds[0]); + close(side_fds[1]); + + /* + * Do side-channel tests as needed, then wait for the backend... + */ + + if (do_side_tests) + { + int length; /* Length of buffer */ + char buffer[2049]; /* Buffer for reponse */ + cups_sc_status_t scstatus; /* Status of side-channel command */ + static const char * const statuses[] = + { + "CUPS_SC_STATUS_NONE", /* No status */ + "CUPS_SC_STATUS_OK", /* Operation succeeded */ + "CUPS_SC_STATUS_IO_ERROR", /* An I/O error occurred */ + "CUPS_SC_STATUS_TIMEOUT", /* The backend did not respond */ + "CUPS_SC_STATUS_NO_RESPONSE", /* The device did not respond */ + "CUPS_SC_STATUS_BAD_MESSAGE", /* The command/response message was invalid */ + "CUPS_SC_STATUS_TOO_BIG", /* Response too big */ + "CUPS_SC_STATUS_NOT_IMPLEMENTED" /* Command not implemented */ + }; + + + length = 0; + scstatus = cupsSideChannelDoRequest(CUPS_SC_CMD_DRAIN_OUTPUT, buffer, + &length, 5.0); + printf("CUPS_SC_CMD_DRAIN_OUTPUT returned %s\n", statuses[scstatus]); + + length = 1; + scstatus = cupsSideChannelDoRequest(CUPS_SC_CMD_GET_BIDI, buffer, + &length, 5.0); + printf("CUPS_SC_CMD_GET_BIDI returned %s, %d\n", statuses[scstatus], buffer[0]); + + length = sizeof(buffer) - 1; + scstatus = cupsSideChannelDoRequest(CUPS_SC_CMD_GET_DEVICE_ID, buffer, + &length, 5.0); + buffer[length] = '\0'; + printf("CUPS_SC_CMD_GET_DEVICE_ID returned %s, \"%s\"\n", + statuses[scstatus], buffer); + + length = 1; + scstatus = cupsSideChannelDoRequest(CUPS_SC_CMD_GET_STATE, buffer, + &length, 5.0); + printf("CUPS_SC_CMD_GET_STATE returned %s, %02X\n", statuses[scstatus], + buffer[0] & 255); + + length = 0; + scstatus = cupsSideChannelDoRequest(CUPS_SC_CMD_SOFT_RESET, buffer, + &length, 5.0); + printf("CUPS_SC_CMD_SOFT_RESET returned %s\n", statuses[scstatus]); + } + + while (wait(&status) != pid); + + if (status) + { + if (WIFEXITED(status)) + printf("%s exited with status %d!\n", backend, WEXITSTATUS(status)); + else + printf("%s crashed with signal %d!\n", backend, WTERMSIG(status)); + } + + /* + * Exit accordingly... + */ + + return (status != 0); +} + + +/* + * 'usage()' - Show usage information. + */ + +static void +usage(void) +{ + fputs("Usage: betest [-s] [-t] device-uri job-id user title copies options " + "[file]\n", stderr); + exit(1); +} + + +/* + * End of "$Id$". + */ diff --git a/backend/testsupplies.c b/backend/testsupplies.c new file mode 100644 index 000000000..1a8246abc --- /dev/null +++ b/backend/testsupplies.c @@ -0,0 +1,83 @@ +/* + * "$Id$" + * + * SNMP supplies test program for the Common UNIX Printing System (CUPS). + * + * Copyright 2008 by Apple Inc. + * + * 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" + * "LICENSE" which should have been included with this file. If this + * file is missing or damaged, see the license at "http://www.cups.org/". + * + * This file is subject to the Apple OS-Developed Software exception. + * + * Contents: + * + * main() - Show the supplies state of a printer. + */ + +/* + * Include necessary headers. + */ + +#include "backend-private.h" + + +/* + * 'main()' - Show the supplies state of a printer. + */ + +int /* O - Exit status */ +main(int argc, /* I - Number of command-line args */ + char *argv[]) /* I - Command-line arguments */ +{ + http_addrlist_t *host; /* Host addresses */ + int snmp_fd; /* SNMP socket */ + int page_count, /* Current page count */ + printer_state; /* Current printer state */ + + + if (argc != 2) + { + puts("Usage: testsupplies ip-or-hostname"); + return (1); + } + + if ((host = httpAddrGetList(argv[1], AF_UNSPEC, "9100")) == NULL) + { + perror(argv[1]); + return (1); + } + + if ((snmp_fd = cupsSNMPOpen(host->addr.addr.sa_family)) < 0) + { + perror(argv[1]); + return (1); + } + + for (;;) + { + fputs("backendSNMPSupplies: ", stdout); + + if (backendSNMPSupplies(snmp_fd, &(host->addr), &page_count, + &printer_state)) + { + puts("FAIL"); + return (1); + } + + printf("backendSNMPSupplies: %s (page_count=%d, printer_state=%d)\n", + page_count < 0 || printer_state < CUPS_TC_other || + printer_state > CUPS_TC_warmup ? "FAIL" : "PASS", + page_count, printer_state); + + sleep(5); + } +} + + +/* + * End of "$Id$". + */ diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index 4e9826db5..f6b94df16 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -1017,16 +1017,12 @@ static Boolean list_device_cb(void *refcon, CFStringGetCString(deviceIDString, idstr, sizeof(idstr), kCFStringEncodingUTF8); - if (make) - CFStringGetCString(make, makestr, sizeof(makestr), - kCFStringEncodingUTF8); - else + if (!CFStringGetCString(make, makestr, sizeof(makestr), + kCFStringEncodingUTF8)) strcpy(makestr, "Unknown"); - if (model) - CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1, - kCFStringEncodingUTF8); - else + if (!CFStringGetCString(model, &modelstr[1], sizeof(modelstr)-1, + kCFStringEncodingUTF8)) strcpy(modelstr + 1, "Printer"); optionsstr[0] = '\0'; @@ -1041,16 +1037,6 @@ static Boolean list_device_cb(void *refcon, httpAssembleURI(HTTP_URI_CODING_ALL, uristr, sizeof(uristr), "usb", NULL, makestr, 0, modelstr); strncat(uristr, optionsstr, sizeof(uristr)); - /* - * Fix common HP 1284 bug... - */ - - if (!strcasecmp(makestr, "Hewlett-Packard")) - strcpy(makestr, "HP"); - - if (!strncasecmp(modelstr + 1, "hp ", 3)) - _cups_strcpy(modelstr + 1, modelstr + 4); - printf("direct %s \"%s %s\" \"%s %s USB\" \"%s\"\n", uristr, makestr, &modelstr[1], makestr, &modelstr[1], idstr); @@ -1186,11 +1172,48 @@ static void copy_deviceinfo(CFStringRef deviceIDString, CFStringRef modelKeys[] = { CFSTR("MDL:"), CFSTR("MODEL:"), NULL }; CFStringRef makeKeys[] = { CFSTR("MFG:"), CFSTR("MANUFACTURER:"), NULL }; CFStringRef serialKeys[] = { CFSTR("SN:"), CFSTR("SERN:"), NULL }; + CFRange hpRange = { 0, 3 }; if (make != NULL) - *make = copy_value_for_key(deviceIDString, makeKeys); + { + if ((*make = copy_value_for_key(deviceIDString, makeKeys)) == NULL) + *make = CFStringCreateWithCString(kCFAllocatorDefault, "Unknown", + kCFStringEncodingUTF8); + else if (!CFStringCompare(*make, CFSTR("Hewlett-Packard"), + kCFCompareCaseInsensitive)) + { + /* + * Fix a common HP 1284 bug... + */ + + CFRelease(*make); + *make = CFStringCreateWithCString(kCFAllocatorDefault, "HP", + kCFStringEncodingUTF8); + } + } + if (model != NULL) - *model = copy_value_for_key(deviceIDString, modelKeys); + { + if ((*model = copy_value_for_key(deviceIDString, modelKeys)) == NULL) + *model = CFStringCreateWithCString(kCFAllocatorDefault, "Printer", + kCFStringEncodingUTF8); + else if (!CFStringCompareWithOptions(*model, CFSTR("hp "), hpRange, + kCFCompareCaseInsensitive | + kCFCompareAnchored)) + { + /* + * Fix a common HP 1284 bug... + */ + + CFRange subRange = { 3, CFStringGetLength(*model) - 3 }; + CFStringRef sub = CFStringCreateWithSubstring(kCFAllocatorDefault, + *model, subRange); + + CFRelease(*model); + *model = sub; + } + } + if (serial != NULL) *serial = copy_value_for_key(deviceIDString, serialKeys); } diff --git a/backend/usb-unix.c b/backend/usb-unix.c index 104ea7d43..64215815e 100644 --- a/backend/usb-unix.c +++ b/backend/usb-unix.c @@ -37,7 +37,8 @@ */ static int open_device(const char *uri, int *use_bc); -static void side_cb(int print_fd, int device_fd, int use_bc); +static void side_cb(int print_fd, int device_fd, int snmp_fd, + http_addr_t *addr, int use_bc); /* @@ -173,7 +174,7 @@ print_device(const char *uri, /* I - Device URI */ lseek(print_fd, 0, SEEK_SET); } - tbytes = backendRunLoop(print_fd, device_fd, use_bc, side_cb); + tbytes = backendRunLoop(print_fd, device_fd, -1, NULL, use_bc, side_cb); if (print_fd != 0 && tbytes >= 0) _cupsLangPrintf(stderr, @@ -543,9 +544,11 @@ open_device(const char *uri, /* I - Device URI */ */ static void -side_cb(int print_fd, /* I - Print file */ - int device_fd, /* I - Device file */ - int use_bc) /* I - Using back-channel? */ +side_cb(int print_fd, /* I - Print file */ + int device_fd, /* I - Device file */ + int snmp_fd, /* I - SNMP socket (unused) */ + http_addr_t *addr, /* I - Device address (unused) */ + int use_bc) /* I - Using back-channel? */ { cups_sc_command_t command; /* Request command */ cups_sc_status_t status; /* Request/response status */ @@ -553,6 +556,9 @@ side_cb(int print_fd, /* I - Print file */ int datalen; /* Request/response data size */ + (void)snmp_fd; + (void)addr; + datalen = sizeof(data); if (cupsSideChannelRead(&command, &status, data, &datalen, 1.0)) diff --git a/config-scripts/cups-common.m4 b/config-scripts/cups-common.m4 index 8f51586bc..57cdb5290 100644 --- a/config-scripts/cups-common.m4 +++ b/config-scripts/cups-common.m4 @@ -218,7 +218,8 @@ if test "x$enable_dbus" != xno; then CUPSDLIBS="$CUPSDLIBS `$PKGCONFIG --libs dbus-1`" AC_CHECK_LIB(dbus-1, dbus_message_iter_init_append, - AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND)) + AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND),, + `$PKGCONFIG --libs dbus-1`) else AC_MSG_RESULT(no) fi @@ -238,7 +239,7 @@ case $uname in FONTS="" LEGACY_BACKENDS="" BACKLIBS="$BACKLIBS -framework IOKit" - CUPSDLIBS="$CUPSDLIBS -sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration" + CUPSDLIBS="$CUPSDLIBS -sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration -framework ApplicationServices" LIBS="-framework SystemConfiguration -framework CoreFoundation $LIBS" dnl Check for framework headers... diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4 index fc1c821ea..ae1db0873 100644 --- a/config-scripts/cups-compiler.m4 +++ b/config-scripts/cups-compiler.m4 @@ -141,6 +141,11 @@ if test -n "$GCC"; then # CUPS since we already use buffer-limited calls, but # this will catch any additions that are broken. CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2" + + if test x$enable_pie = xyes; then + # GCC 4 on Mac OS X needs -Wl,-pie as well + LDFLAGS="$LDFLAGS -Wl,-pie" + fi ;; HP-UX*) diff --git a/config-scripts/cups-defaults.m4 b/config-scripts/cups-defaults.m4 index e9d6038e4..c09b99a98 100644 --- a/config-scripts/cups-defaults.m4 +++ b/config-scripts/cups-defaults.m4 @@ -289,6 +289,55 @@ fi AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTCAP, "$CUPS_DEFAULT_PRINTCAP") +dnl Default LPD config file... +AC_ARG_WITH(lpdconfigfile, [ --with-lpdconfigfile set default LPDConfigFile URI], + default_lpdconfigfile="$withval", + default_lpdconfigfile="default") + +if test x$default_lpdconfigfile != xno; then + if test "x$default_lpdconfigfile" = "xdefault"; then + case $uname in + Darwin*) + CUPS_DEFAULT_LPD_CONFIG_FILE="launchd:///System/Library/LaunchDaemons/org.cups.cups-lpd.plist" + ;; + *) + if test -d /etc/xinetd.d; then + CUPS_DEFAULT_LPD_CONFIG_FILE="xinetd:///etc/xinetd.d/cups-lpd" + else + CUPS_DEFAULT_LPD_CONFIG_FILE="" + fi + ;; + esac + else + CUPS_DEFAULT_LPD_CONFIG_FILE="$default_lpdconfigfile" + fi +else + CUPS_DEFAULT_LPD_CONFIG_FILE="" +fi + +AC_DEFINE_UNQUOTED(CUPS_DEFAULT_LPD_CONFIG_FILE, "$CUPS_DEFAULT_LPD_CONFIG_FILE") + +dnl Default SMB config file... +AC_ARG_WITH(smbconfigfile, [ --with-smbconfigfile set default SMBConfigFile URI], + default_smbconfigfile="$withval", + default_smbconfigfile="default") + +if test x$default_smbconfigfile != xno; then + if test "x$default_smbconfigfile" = "xdefault"; then + if test -f /etc/smb.conf; then + CUPS_DEFAULT_SMB_CONFIG_FILE="samba:///etc/smb.conf" + else + CUPS_DEFAULT_SMB_CONFIG_FILE="" + fi + else + CUPS_DEFAULT_SMB_CONFIG_FILE="$default_smbconfigfile" + fi +else + CUPS_DEFAULT_SMB_CONFIG_FILE="" +fi + +AC_DEFINE_UNQUOTED(CUPS_DEFAULT_SMB_CONFIG_FILE, "$CUPS_DEFAULT_SMB_CONFIG_FILE") + dnl Default MaxCopies value... AC_ARG_WITH(max-copies, [ --with-max-copies set max copies value, default=100 ], CUPS_MAX_COPIES="$withval", diff --git a/cups/Makefile b/cups/Makefile index eb94eac13..e7a7a8123 100644 --- a/cups/Makefile +++ b/cups/Makefile @@ -93,7 +93,6 @@ HEADERS = \ dir.h \ file.h \ http.h \ - i18n.h \ ipp.h \ language.h \ ppd.h \ diff --git a/cups/api-cups.shtml b/cups/api-cups.shtml index 29982e58d..bc9a05286 100644 --- a/cups/api-cups.shtml +++ b/cups/api-cups.shtml @@ -19,13 +19,24 @@ applications, filters, printer drivers, and backends that need to interface with the CUPS scheduler.

+

Clients and Servers

+ +

CUPS is based on the Internet Printing Protocol ("IPP"), which allows +clients (applications) to communicate with a server (the scheduler) to get a +list of printers, send print jobs, and so forth. You identify which server +you want to communicate with using a pointer to the opaque structure +http_t. All of the examples in this document use the +CUPS_HTTP_DEFAULT constant, referring to the default connection +to the scheduler. The HTTP and IPP +APIs document provides more information on server connections.

+

Printers and Classes

Printers and classes (collections of printers) are accessed through the cups_dest_t structure which includes the name (name), instance (instance - -a way of selected certain saved options), and the options and attributes -associated with that destination (num_options and +a way of selecting certain saved options/settings), and the options and +attributes associated with that destination (num_options and options). Destinations are created using the cupsGetDests function and freed using the cupsFreeDests function. @@ -172,7 +183,8 @@ int num_options = 0; cups_dest_t *dest; for (i = 0; i < dest->num_options; i ++) - num_options = cupsAddOption(dest->options[i].name, dest->options[i].value, num_options, &options); + num_options = cupsAddOption(dest->options[i].name, dest->options[i].value, + num_options, &options);

Use the cupsFreeOptions @@ -199,7 +211,8 @@ int num_options; int job_id; /* Print a single file */ -job_id = cupsPrintFile(dest->name, "/usr/share/cups/data/testprint.ps", "Test Print", num_options, options); +job_id = cupsPrintFile(dest->name, "/usr/share/cups/data/testprint.ps", + "Test Print", num_options, options);

The cupsPrintFiles function @@ -237,7 +250,8 @@ int i; char buffer[1024]; /* Create the job */ -job_id = cupsCreateJob(CUPS_HTTP_DEFAULT, dest->name, "10 Text Files", num_options, options); +job_id = cupsCreateJob(CUPS_HTTP_DEFAULT, dest->name, "10 Text Files", + num_options, options); /* If the job is created, add 10 files */ if (job_id > 0) @@ -246,7 +260,8 @@ if (job_id > 0) { snprintf(buffer, sizeof(buffer), "file%d.txt", i); - cupsStartDocument(CUPS_HTTP_DEFAULT, dest->name, job_id, buffer, CUPS_FORMAT_TEXT, i == 10); + cupsStartDocument(CUPS_HTTP_DEFAULT, dest->name, job_id, buffer, + CUPS_FORMAT_TEXT, i == 10); snprintf(buffer, sizeof(buffer), "File %d\n" @@ -338,7 +353,7 @@ while (job_state < IPP_JOB_STOPPED) cupsCancelJob function with the job ID:

-
+
 #include <cups/cups.h>
 
 cups_dest_t *dest;
diff --git a/cups/auth.c b/cups/auth.c
index adc2436c9..4391a3db0 100644
--- a/cups/auth.c
+++ b/cups/auth.c
@@ -83,7 +83,7 @@ static int	cups_local_auth(http_t *http);
  */
 
 int					/* O - 0 on success, -1 on error */
-cupsDoAuthentication(http_t     *http,	/* I - HTTP connection to server */
+cupsDoAuthentication(http_t     *http,	/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
                      const char *method,/* I - Request method ("GET", "POST", "PUT") */
 		     const char *resource)
 					/* I - Resource path */
diff --git a/cups/dest.c b/cups/dest.c
index 6f61181d6..bafe52f14 100644
--- a/cups/dest.c
+++ b/cups/dest.c
@@ -310,7 +310,7 @@ cupsGetDests(cups_dest_t **dests)	/* O - Destinations */
  */
 
 int					/* O - Number of destinations */
-cupsGetDests2(http_t      *http,	/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
+cupsGetDests2(http_t      *http,	/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
               cups_dest_t **dests)	/* O - Destinations */
 {
   int		i;			/* Looping var */
@@ -495,8 +495,8 @@ cupsGetDests2(http_t      *http,	/* I - HTTP connection or @code CUPS_HTTP_DEFAU
  */
 
 cups_dest_t *				/* O - Destination or @code NULL@ */
-cupsGetNamedDest(http_t     *http,	/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
-                 const char *name,	/* I - Destination name or @code NULL@ */
+cupsGetNamedDest(http_t     *http,	/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
+                 const char *name,	/* I - Destination name or @code NULL@ for the default destination */
                  const char *instance)	/* I - Instance name or @code NULL@ */
 {
   cups_dest_t	*dest;			/* Destination */
@@ -704,7 +704,7 @@ cupsSetDests(int         num_dests,	/* I - Number of destinations */
  */
 
 int					/* O - 0 on success, -1 on error */
-cupsSetDests2(http_t      *http,	/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
+cupsSetDests2(http_t      *http,	/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
               int         num_dests,	/* I - Number of destinations */
               cups_dest_t *dests)	/* I - Destinations */
 {
@@ -1473,7 +1473,7 @@ cups_get_dests(const char  *filename,	/* I - File to read from */
  */
 
 static int				/* O - Number of destinations */
-cups_get_sdests(http_t      *http,	/* I - HTTP connection or CUPS_HTTP_DEFAULT */
+cups_get_sdests(http_t      *http,	/* I - Connection to server or CUPS_HTTP_DEFAULT */
                 ipp_op_t    op,		/* I - IPP operation */
 		const char  *name,	/* I - Name of destination */
                 int         num_dests,	/* I - Number of destinations */
diff --git a/cups/encode.c b/cups/encode.c
index 506b87f0f..0fb288b1a 100644
--- a/cups/encode.c
+++ b/cups/encode.c
@@ -3,7 +3,7 @@
  *
  *   Option encoding routines 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
@@ -67,6 +67,8 @@ static const _ipp_option_t ipp_options[] =
   { 0, "job-page-limit",	IPP_TAG_INTEGER,	IPP_TAG_JOB },
   { 0, "job-priority",		IPP_TAG_INTEGER,	IPP_TAG_JOB },
   { 0, "job-quota-period",	IPP_TAG_INTEGER,	IPP_TAG_JOB },
+  { 1, "job-sheets",		IPP_TAG_NAME,		IPP_TAG_JOB },
+  { 1, "job-sheets-default",	IPP_TAG_NAME,		IPP_TAG_PRINTER },
   { 0, "job-uuid",		IPP_TAG_URI,		IPP_TAG_JOB },
   { 0, "landscape",		IPP_TAG_BOOLEAN,	IPP_TAG_JOB },
   { 1, "media",			IPP_TAG_KEYWORD,	IPP_TAG_JOB },
diff --git a/cups/getputfile.c b/cups/getputfile.c
index e144bd8e6..1694f498a 100644
--- a/cups/getputfile.c
+++ b/cups/getputfile.c
@@ -51,7 +51,7 @@
  */
 
 http_status_t				/* O - HTTP status */
-cupsGetFd(http_t     *http,		/* I - HTTP connection to server or @code CUPS_HTTP_DEFAULT@ */
+cupsGetFd(http_t     *http,		/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
 	  const char *resource,		/* I - Resource name */
 	  int        fd)		/* I - File descriptor */
 {
@@ -191,7 +191,7 @@ cupsGetFd(http_t     *http,		/* I - HTTP connection to server or @code CUPS_HTTP
  */
 
 http_status_t				/* O - HTTP status */
-cupsGetFile(http_t     *http,		/* I - HTTP connection to server or @code CUPS_HTTP_DEFAULT@ */
+cupsGetFile(http_t     *http,		/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
 	    const char *resource,	/* I - Resource name */
 	    const char *filename)	/* I - Filename */
 {
@@ -259,7 +259,7 @@ cupsGetFile(http_t     *http,		/* I - HTTP connection to server or @code CUPS_HT
  */
 
 http_status_t				/* O - HTTP status */
-cupsPutFd(http_t     *http,		/* I - HTTP connection to server or @code CUPS_HTTP_DEFAULT@ */
+cupsPutFd(http_t     *http,		/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
           const char *resource,		/* I - Resource name */
 	  int        fd)		/* I - File descriptor */
 {
@@ -444,7 +444,7 @@ cupsPutFd(http_t     *http,		/* I - HTTP connection to server or @code CUPS_HTTP
  */
 
 http_status_t				/* O - HTTP status */
-cupsPutFile(http_t     *http,		/* I - HTTP connection to server or @code CUPS_HTTP_DEFAULT@ */
+cupsPutFile(http_t     *http,		/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
             const char *resource,	/* I - Resource name */
 	    const char *filename)	/* I - Filename */
 {
diff --git a/cups/http.c b/cups/http.c
index f860a221d..82b612aca 100644
--- a/cups/http.c
+++ b/cups/http.c
@@ -220,7 +220,7 @@ _httpBIOMethods(void)
  */
 
 void
-httpBlocking(http_t *http,		/* I - HTTP connection */
+httpBlocking(http_t *http,		/* I - Connection to server */
              int    b)			/* I - 1 = blocking, 0 = non-blocking */
 {
   if (http)
@@ -233,7 +233,7 @@ httpBlocking(http_t *http,		/* I - HTTP connection */
  */
 
 int					/* O - 0 = no data, 1 = data available */
-httpCheck(http_t *http)			/* I - HTTP connection */
+httpCheck(http_t *http)			/* I - Connection to server */
 {
   return (httpWait(http, 0));
 }
@@ -246,7 +246,7 @@ httpCheck(http_t *http)			/* I - HTTP connection */
  */
 
 void
-httpClearCookie(http_t *http)		/* I - HTTP connection */
+httpClearCookie(http_t *http)		/* I - Connection to server */
 {
   if (!http)
     return;
@@ -264,7 +264,7 @@ httpClearCookie(http_t *http)		/* I - HTTP connection */
  */
 
 void
-httpClearFields(http_t *http)		/* I - HTTP connection */
+httpClearFields(http_t *http)		/* I - Connection to server */
 {
   if (http)
   {
@@ -290,7 +290,7 @@ httpClearFields(http_t *http)		/* I - HTTP connection */
  */
 
 void
-httpClose(http_t *http)			/* I - HTTP connection */
+httpClose(http_t *http)			/* I - Connection to server */
 {
 #ifdef HAVE_GSSAPI
   OM_uint32	minor_status,		/* Minor status code */
@@ -459,7 +459,7 @@ httpConnectEncrypt(
  */
 
 int					/* O - Status of call (0 = success) */
-httpDelete(http_t     *http,		/* I - HTTP connection */
+httpDelete(http_t     *http,		/* I - Connection to server */
            const char *uri)		/* I - URI to delete */
 {
   return (http_send(http, HTTP_DELETE, uri));
@@ -471,7 +471,7 @@ httpDelete(http_t     *http,		/* I - HTTP connection */
  */
 
 int					/* O - -1 on error, 0 on success */
-httpEncryption(http_t            *http,	/* I - HTTP connection */
+httpEncryption(http_t            *http,	/* I - Connection to server */
                http_encryption_t e)	/* I - New encryption preference */
 {
   DEBUG_printf(("httpEncryption(http=%p, e=%d)\n", http, e));
@@ -503,7 +503,7 @@ httpEncryption(http_t            *http,	/* I - HTTP connection */
  */
 
 int					/* O - Error code (errno) value */
-httpError(http_t *http)			/* I - HTTP connection */
+httpError(http_t *http)			/* I - Connection to server */
 {
   if (http)
     return (http->error);
@@ -517,7 +517,7 @@ httpError(http_t *http)			/* I - HTTP connection */
  */
 
 void
-httpFlush(http_t *http)			/* I - HTTP connection */
+httpFlush(http_t *http)			/* I - Connection to server */
 {
   char	buffer[8192];			/* Junk buffer */
   int	blocking;			/* To block or not to block */
@@ -576,7 +576,7 @@ httpFlush(http_t *http)			/* I - HTTP connection */
  */
 
 int					/* O - Bytes written or -1 on error */
-httpFlushWrite(http_t *http)		/* I - HTTP connection */
+httpFlushWrite(http_t *http)		/* I - Connection to server */
 {
   int	bytes;				/* Bytes written */
 
@@ -602,7 +602,7 @@ httpFlushWrite(http_t *http)		/* I - HTTP connection */
  */
 
 int					/* O - Status of call (0 = success) */
-httpGet(http_t     *http,		/* I - HTTP connection */
+httpGet(http_t     *http,		/* I - Connection to server */
         const char *uri)		/* I - URI to get */
 {
   return (http_send(http, HTTP_GET, uri));
@@ -621,7 +621,7 @@ httpGet(http_t     *http,		/* I - HTTP connection */
  */
 
 char *					/* O - Authorization string */
-httpGetAuthString(http_t *http)		/* I - HTTP connection */
+httpGetAuthString(http_t *http)		/* I - Connection to server */
 {
   if (http)
     return (http->authstring);
@@ -637,7 +637,7 @@ httpGetAuthString(http_t *http)		/* I - HTTP connection */
  */
 
 int					/* O - 1 if blocking, 0 if non-blocking */
-httpGetBlocking(http_t *http)		/* I - HTTP connection */
+httpGetBlocking(http_t *http)		/* I - Connection to server */
 {
   return (http ? http->blocking : 0);
 }
@@ -663,7 +663,7 @@ httpGetCookie(http_t *http)		/* I - HTTP connecion */
  */
 
 int					/* O - File descriptor or -1 if none */
-httpGetFd(http_t *http)			/* I - HTTP connection */
+httpGetFd(http_t *http)			/* I - Connection to server */
 {
   return (http ? http->fd : -1);
 }
@@ -674,7 +674,7 @@ httpGetFd(http_t *http)			/* I - HTTP connection */
  */
 
 const char *				/* O - Field value */
-httpGetField(http_t       *http,	/* I - HTTP connection */
+httpGetField(http_t       *http,	/* I - Connection to server */
              http_field_t field)	/* I - Field to get */
 {
   if (!http || field <= HTTP_FIELD_UNKNOWN || field >= HTTP_FIELD_MAX)
@@ -705,7 +705,7 @@ httpGetField(http_t       *http,	/* I - HTTP connection */
  */
 
 int					/* O - Content length */
-httpGetLength(http_t *http)		/* I - HTTP connection */
+httpGetLength(http_t *http)		/* I - Connection to server */
 {
  /*
   * Get the read content length and return the 32-bit value.
@@ -733,7 +733,7 @@ httpGetLength(http_t *http)		/* I - HTTP connection */
  */
 
 off_t					/* O - Content length */
-httpGetLength2(http_t *http)		/* I - HTTP connection */
+httpGetLength2(http_t *http)		/* I - Connection to server */
 {
   DEBUG_printf(("httpGetLength2(http=%p), state=%d\n", http, http->state));
 
@@ -795,7 +795,7 @@ httpGetLength2(http_t *http)		/* I - HTTP connection */
  */
 
 http_status_t				/* O - HTTP status */
-httpGetStatus(http_t *http)		/* I - HTTP connection */
+httpGetStatus(http_t *http)		/* I - Connection to server */
 {
   return (http ? http->status : HTTP_ERROR);
 }
@@ -808,7 +808,7 @@ httpGetStatus(http_t *http)		/* I - HTTP connection */
  */
 
 char *					/* O - Value or NULL */
-httpGetSubField(http_t       *http,	/* I - HTTP connection */
+httpGetSubField(http_t       *http,	/* I - Connection to server */
                 http_field_t field,	/* I - Field index */
                 const char   *name,	/* I - Name of sub-field */
 		char         *value)	/* O - Value string */
@@ -824,7 +824,7 @@ httpGetSubField(http_t       *http,	/* I - HTTP connection */
  */
 
 char *					/* O - Value or NULL */
-httpGetSubField2(http_t       *http,	/* I - HTTP connection */
+httpGetSubField2(http_t       *http,	/* I - Connection to server */
                  http_field_t field,	/* I - Field index */
                  const char   *name,	/* I - Name of sub-field */
 		 char         *value,	/* O - Value string */
@@ -951,7 +951,7 @@ httpGetSubField2(http_t       *http,	/* I - HTTP connection */
 char *					/* O - Line or NULL */
 httpGets(char   *line,			/* I - Line to read into */
          int    length,			/* I - Max length of buffer */
-	 http_t *http)			/* I - HTTP connection */
+	 http_t *http)			/* I - Connection to server */
 {
   char	*lineptr,			/* Pointer into line */
 	*lineend,			/* End of line */
@@ -1106,7 +1106,7 @@ httpGets(char   *line,			/* I - Line to read into */
  */
 
 int					/* O - Status of call (0 = success) */
-httpHead(http_t     *http,		/* I - HTTP connection */
+httpHead(http_t     *http,		/* I - Connection to server */
          const char *uri)		/* I - URI for head */
 {
   return (http_send(http, HTTP_HEAD, uri));
@@ -1187,7 +1187,7 @@ httpInitialize(void)
  */
 
 int					/* O - Status of call (0 = success) */
-httpOptions(http_t     *http,		/* I - HTTP connection */
+httpOptions(http_t     *http,		/* I - Connection to server */
             const char *uri)		/* I - URI for options */
 {
   return (http_send(http, HTTP_OPTIONS, uri));
@@ -1199,7 +1199,7 @@ httpOptions(http_t     *http,		/* I - HTTP connection */
  */
 
 int					/* O - Status of call (0 = success) */
-httpPost(http_t     *http,		/* I - HTTP connection */
+httpPost(http_t     *http,		/* I - Connection to server */
          const char *uri)		/* I - URI for post */
 {
   return (http_send(http, HTTP_POST, uri));
@@ -1213,7 +1213,7 @@ httpPost(http_t     *http,		/* I - HTTP connection */
  */
 
 int					/* O - Number of bytes written */
-httpPrintf(http_t     *http,		/* I - HTTP connection */
+httpPrintf(http_t     *http,		/* I - Connection to server */
            const char *format,		/* I - printf-style format string */
 	   ...)				/* I - Additional args as needed */
 {
@@ -1252,7 +1252,7 @@ httpPrintf(http_t     *http,		/* I - HTTP connection */
  */
 
 int					/* O - Status of call (0 = success) */
-httpPut(http_t     *http,		/* I - HTTP connection */
+httpPut(http_t     *http,		/* I - Connection to server */
         const char *uri)		/* I - URI to put */
 {
   return (http_send(http, HTTP_PUT, uri));
@@ -1269,7 +1269,7 @@ httpPut(http_t     *http,		/* I - HTTP connection */
  */
 
 int					/* O - Number of bytes read */
-httpRead(http_t *http,			/* I - HTTP connection */
+httpRead(http_t *http,			/* I - Connection to server */
          char   *buffer,		/* I - Buffer for data */
 	 int    length)			/* I - Maximum number of bytes */
 {
@@ -1284,7 +1284,7 @@ httpRead(http_t *http,			/* I - HTTP connection */
  */
 
 ssize_t					/* O - Number of bytes read */
-httpRead2(http_t *http,			/* I - HTTP connection */
+httpRead2(http_t *http,			/* I - Connection to server */
           char   *buffer,		/* I - Buffer for data */
 	  size_t length)		/* I - Maximum number of bytes */
 {
@@ -1590,7 +1590,7 @@ _httpReadCDSA(
 
 ssize_t					/* O - Number of bytes read or -1 on error */
 _httpReadGNUTLS(
-    gnutls_transport_ptr ptr,		/* I - HTTP connection */
+    gnutls_transport_ptr ptr,		/* I - Connection to server */
     void                 *data,		/* I - Buffer */
     size_t               length)	/* I - Number of bytes to read */
 {
@@ -1622,7 +1622,7 @@ _httpReadGNUTLS(
  */
 
 int					/* O - 0 on success, non-zero on failure */
-httpReconnect(http_t *http)		/* I - HTTP connection */
+httpReconnect(http_t *http)		/* I - Connection to server */
 {
   http_addrlist_t	*addr;		/* Connected address */
 
@@ -1714,7 +1714,7 @@ httpReconnect(http_t *http)		/* I - HTTP connection */
  */
 
 void
-httpSetAuthString(http_t     *http,	/* I - HTTP connection */
+httpSetAuthString(http_t     *http,	/* I - Connection to server */
                   const char *scheme,	/* I - Auth scheme (NULL to clear it) */
 		  const char *data)	/* I - Auth data (NULL for none) */
 {
@@ -1795,7 +1795,7 @@ httpSetCookie(http_t     *http,		/* I - Connection */
  */
 
 void
-httpSetExpect(http_t        *http,	/* I - HTTP connection */
+httpSetExpect(http_t        *http,	/* I - Connection to server */
               http_status_t expect)	/* I - HTTP status to expect (HTTP_CONTINUE) */
 {
   if (http)
@@ -1808,7 +1808,7 @@ httpSetExpect(http_t        *http,	/* I - HTTP connection */
  */
 
 void
-httpSetField(http_t       *http,	/* I - HTTP connection */
+httpSetField(http_t       *http,	/* I - Connection to server */
              http_field_t field,	/* I - Field index */
 	     const char   *value)	/* I - Value */
 {
@@ -1842,7 +1842,7 @@ httpSetField(http_t       *http,	/* I - HTTP connection */
  */
 
 void
-httpSetLength(http_t *http,		/* I - HTTP connection */
+httpSetLength(http_t *http,		/* I - Connection to server */
               size_t length)		/* I - Length (0 for chunked) */
 {
   if (!http)
@@ -1867,7 +1867,7 @@ httpSetLength(http_t *http,		/* I - HTTP connection */
  */
 
 int					/* O - Status of call (0 = success) */
-httpTrace(http_t     *http,		/* I - HTTP connection */
+httpTrace(http_t     *http,		/* I - Connection to server */
           const char *uri)		/* I - URI for trace */
 {
   return (http_send(http, HTTP_TRACE, uri));
@@ -1879,7 +1879,7 @@ httpTrace(http_t     *http,		/* I - HTTP connection */
  */
 
 http_status_t				/* O - HTTP status */
-httpUpdate(http_t *http)		/* I - HTTP connection */
+httpUpdate(http_t *http)		/* I - Connection to server */
 {
   char		line[32768],		/* Line from connection... */
 		*value;			/* Pointer to value on line */
@@ -2059,7 +2059,7 @@ httpUpdate(http_t *http)		/* I - HTTP connection */
  */
 
 int					/* O - 1 if data is available, 0 otherwise */
-httpWait(http_t *http,			/* I - HTTP connection */
+httpWait(http_t *http,			/* I - Connection to server */
          int    msec)			/* I - Milliseconds to wait */
 {
  /*
@@ -2100,7 +2100,7 @@ httpWait(http_t *http,			/* I - HTTP connection */
  */
  
 int					/* O - Number of bytes written */
-httpWrite(http_t     *http,		/* I - HTTP connection */
+httpWrite(http_t     *http,		/* I - Connection to server */
           const char *buffer,		/* I - Buffer for data */
 	  int        length)		/* I - Number of bytes to write */
 {
@@ -2115,7 +2115,7 @@ httpWrite(http_t     *http,		/* I - HTTP connection */
  */
  
 ssize_t					/* O - Number of bytes written */
-httpWrite2(http_t     *http,		/* I - HTTP connection */
+httpWrite2(http_t     *http,		/* I - Connection to server */
            const char *buffer,		/* I - Buffer for data */
 	   size_t     length)		/* I - Number of bytes to write */
 {
@@ -2286,7 +2286,7 @@ _httpWriteCDSA(
 
 ssize_t					/* O - Number of bytes written or -1 on error */
 _httpWriteGNUTLS(
-    gnutls_transport_ptr ptr,		/* I - HTTP connection */
+    gnutls_transport_ptr ptr,		/* I - Connection to server */
     const void           *data,		/* I - Data buffer */
     size_t               length)	/* I - Number of bytes to write */
 {
@@ -2465,7 +2465,7 @@ http_field(const char *name)	/* I - String name */
  */
 
 static int				/* O - Bytes read */
-http_read_ssl(http_t *http,		/* I - HTTP connection */
+http_read_ssl(http_t *http,		/* I - Connection to server */
 	      char   *buf,		/* I - Buffer to store data */
 	      int    len)		/* I - Length of buffer */
 {
@@ -2517,7 +2517,7 @@ http_read_ssl(http_t *http,		/* I - HTTP connection */
  */
 
 static int			/* O - 0 on success, non-zero on error */
-http_send(http_t       *http,	/* I - HTTP connection */
+http_send(http_t       *http,	/* I - Connection to server */
           http_state_t request,	/* I - Request code */
 	  const char   *uri)	/* I - URI */
 {
@@ -2681,7 +2681,7 @@ http_send(http_t       *http,	/* I - HTTP connection */
  */
 
 static int				/* O - Status of connection */
-http_setup_ssl(http_t *http)		/* I - HTTP connection */
+http_setup_ssl(http_t *http)		/* I - Connection to server */
 {
 #  ifdef HAVE_LIBSSL
   SSL_CTX	*context;		/* Context for encryption */
@@ -2836,7 +2836,7 @@ http_setup_ssl(http_t *http)		/* I - HTTP connection */
  */
 
 static void
-http_shutdown_ssl(http_t *http)		/* I - HTTP connection */
+http_shutdown_ssl(http_t *http)		/* I - Connection to server */
 {
 #  ifdef HAVE_LIBSSL
   SSL_CTX	*context;		/* Context for encryption */
@@ -2893,7 +2893,7 @@ http_shutdown_ssl(http_t *http)		/* I - HTTP connection */
  */
 
 static int				/* O - Status of connection */
-http_upgrade(http_t *http)		/* I - HTTP connection */
+http_upgrade(http_t *http)		/* I - Connection to server */
 {
   int		ret;			/* Return value */
   http_t	myhttp;			/* Local copy of HTTP data */
@@ -2975,7 +2975,7 @@ http_upgrade(http_t *http)		/* I - HTTP connection */
  */
 
 static int				/* O - 1 if data is available, 0 otherwise */
-http_wait(http_t *http,			/* I - HTTP connection */
+http_wait(http_t *http,			/* I - Connection to server */
           int    msec,			/* I - Milliseconds to wait */
 	  int    usessl)		/* I - Use SSL context? */
 {
@@ -3063,7 +3063,7 @@ http_wait(http_t *http,			/* I - HTTP connection */
  */
  
 static int				/* O - Number of bytes written */
-http_write(http_t     *http,		/* I - HTTP connection */
+http_write(http_t     *http,		/* I - Connection to server */
           const char *buffer,		/* I - Buffer for data */
 	  int        length)		/* I - Number of bytes to write */
 {
@@ -3151,7 +3151,7 @@ http_write(http_t     *http,		/* I - HTTP connection */
  */
 
 static int				/* O - Number bytes written */
-http_write_chunk(http_t     *http,	/* I - HTTP connection */
+http_write_chunk(http_t     *http,	/* I - Connection to server */
                  const char *buffer,	/* I - Buffer to write */
 		 int        length)	/* I - Length of buffer */
 {
@@ -3194,7 +3194,7 @@ http_write_chunk(http_t     *http,	/* I - HTTP connection */
  */
 
 static int				/* O - Bytes written */
-http_write_ssl(http_t     *http,	/* I - HTTP connection */
+http_write_ssl(http_t     *http,	/* I - Connection to server */
 	       const char *buf,		/* I - Buffer holding data */
 	       int        len)		/* I - Length of buffer */
 {
diff --git a/cups/ipp.c b/cups/ipp.c
index 41f65c1d6..9a5e0931e 100644
--- a/cups/ipp.c
+++ b/cups/ipp.c
@@ -1019,7 +1019,7 @@ ippReadIO(void       *src,		/* I - Data source */
           ipp_t      *ipp)		/* I - IPP data */
 {
   int			n;		/* Length of data */
-  unsigned char		buffer[IPP_MAX_LENGTH],
+  unsigned char		buffer[IPP_MAX_LENGTH + 1],
 					/* Data buffer */
 			string[IPP_MAX_NAME],
 					/* Small string buffer */
@@ -2415,7 +2415,8 @@ ippWriteIO(void       *dst,		/* I - Destination */
 	    return (IPP_ERROR);
 	  }
 
-          DEBUG_printf(("ippWriteIO: wrote %d bytes\n", bufptr - buffer));
+          DEBUG_printf(("ippWriteIO: wrote %d bytes\n",
+	                (int)(bufptr - buffer)));
 
 	 /*
           * If blocking is disabled, stop here...
@@ -2743,7 +2744,7 @@ ipp_read_http(http_t      *http,	/* I - Client connection */
   
 
   DEBUG_printf(("ipp_read_http(http=%p, buffer=%p, length=%d)\n",
-                http, buffer, length));
+                http, buffer, (int)length));
 
  /*
   * Loop until all bytes are read...
diff --git a/cups/notify.c b/cups/notify.c
index 32ff2c805..03a382e6d 100644
--- a/cups/notify.c
+++ b/cups/notify.c
@@ -31,7 +31,7 @@
 /*
  * 'cupsNotifySubject()' - Return the subject for the given notification message.
  *
- * The returned string must be freed by the caller using free().
+ * The returned string must be freed by the caller using @code free@.
  *
  * @since CUPS 1.2@
  */
diff --git a/cups/request.c b/cups/request.c
index 6544c3448..bab7c7e66 100644
--- a/cups/request.c
+++ b/cups/request.c
@@ -51,15 +51,15 @@
  * 'cupsDoFileRequest()' - Do an IPP request with a file.
  *
  * This function sends the IPP request to the specified server, retrying
- * and authenticating as necessary.  The request is freed with ippDelete()
+ * and authenticating as necessary.  The request is freed with @link ippDelete@
  * after receiving a valid IPP response.
  */
 
 ipp_t *					/* O - Response data */
-cupsDoFileRequest(http_t     *http,	/* I - HTTP connection or CUPS_HTTP_DEFAULT */
+cupsDoFileRequest(http_t     *http,	/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
                   ipp_t      *request,	/* I - IPP request */
                   const char *resource,	/* I - HTTP resource for POST */
-		  const char *filename)	/* I - File to send or NULL for none */
+		  const char *filename)	/* I - File to send or @code NULL@ for none */
 {
   ipp_t		*response;		/* IPP response data */
   int		infile;			/* Input file */
@@ -110,7 +110,7 @@ cupsDoFileRequest(http_t     *http,	/* I - HTTP connection or CUPS_HTTP_DEFAULT
  */
 
 ipp_t *					/* O - Response data */
-cupsDoIORequest(http_t     *http,	/* I - HTTP connection or CUPS_HTTP_DEFAULT */
+cupsDoIORequest(http_t     *http,	/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
                 ipp_t      *request,	/* I - IPP request */
                 const char *resource,	/* I - HTTP resource for POST */
 		int        infile,	/* I - File to read from or -1 for none */
@@ -247,6 +247,9 @@ cupsDoIORequest(http_t     *http,	/* I - HTTP connection or CUPS_HTTP_DEFAULT */
       status   = http->status;
     }
 
+    if (status == HTTP_FORBIDDEN)
+      break;
+
     if (response)
     {
       if (outfile >= 0)
@@ -289,7 +292,7 @@ cupsDoIORequest(http_t     *http,	/* I - HTTP connection or CUPS_HTTP_DEFAULT */
  */
 
 ipp_t *					/* O - Response data */
-cupsDoRequest(http_t     *http,		/* I - HTTP connection or CUPS_HTTP_DEFAULT */
+cupsDoRequest(http_t     *http,		/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
               ipp_t      *request,	/* I - IPP request */
               const char *resource)	/* I - HTTP resource for POST */
 {
@@ -307,8 +310,8 @@ cupsDoRequest(http_t     *http,		/* I - HTTP connection or CUPS_HTTP_DEFAULT */
  * @since CUPS 1.4@
  */
 
-ipp_t *					/* O - Response or NULL on HTTP error */
-cupsGetResponse(http_t     *http,	/* I - HTTP connection or CUPS_HTTP_DEFAULT */
+ipp_t *					/* O - Response or @code NULL@ on HTTP error */
+cupsGetResponse(http_t     *http,	/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
                 const char *resource)	/* I - HTTP resource for POST */
 {
   http_status_t	status;			/* HTTP status */
@@ -399,10 +402,14 @@ cupsGetResponse(http_t     *http,	/* I - HTTP connection or CUPS_HTTP_DEFAULT */
       * See if we can do authentication...
       */
 
+      int auth_result;
+
       DEBUG_puts("cupsGetResponse: Need authorization...");
 
-      if (!cupsDoAuthentication(http, "POST", resource))
+      if ((auth_result =cupsDoAuthentication(http, "POST", resource)) == 0)
 	httpReconnect(http);
+      else if (auth_result < 0)
+        http->status = status = HTTP_FORBIDDEN;
     }
 
 #ifdef HAVE_SSL
@@ -449,7 +456,7 @@ cupsGetResponse(http_t     *http,	/* I - HTTP connection or CUPS_HTTP_DEFAULT */
 
 ssize_t					/* O - Bytes read, 0 on EOF, -1 on error */
 cupsReadResponseData(
-    http_t *http,			/* I - HTTP connection or CUPS_HTTP_DEFAULT */
+    http_t *http,			/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
     char   *buffer,			/* I - Buffer to use */
     size_t length)			/* I - Number of bytes to read */
 {
@@ -492,7 +499,7 @@ cupsReadResponseData(
  */
 
 http_status_t				/* O - Initial HTTP status */
-cupsSendRequest(http_t     *http,	/* I - HTTP connection or CUPS_HTTP_DEFAULT */
+cupsSendRequest(http_t     *http,	/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
                 ipp_t      *request,	/* I - IPP request */
                 const char *resource,	/* I - Resource path */
 		size_t     length)	/* I - Length of data to follow or CUPS_LENGTH_VARIABLE */
@@ -662,15 +669,15 @@ cupsSendRequest(http_t     *http,	/* I - HTTP connection or CUPS_HTTP_DEFAULT */
 /*
  * 'cupsWriteRequestData()' - Write additional data after an IPP request.
  *
- * This function is used after cupsSendRequest() or cupsStartDocument()
- * to provide a PPD or document file as needed.
+ * This function is used after @link cupsSendRequest@ to provide a PPD and
+ * after @link cupsStartDocument@ to provide a document file.
  *
  * @since CUPS 1.4@
  */
 
-http_status_t				/* O - HTTP_CONTINUE if OK or HTTP status on error */
+http_status_t				/* O - @code HTTP_CONTINUE@ if OK or HTTP status on error */
 cupsWriteRequestData(
-    http_t     *http,			/* I - HTTP connection or CUPS_HTTP_DEFAULT */
+    http_t     *http,			/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
     const char *buffer,			/* I - Bytes to write */
     size_t     length)			/* I - Number of bytes to write */
 {
diff --git a/cups/snmp.c b/cups/snmp.c
index 1441b7f18..054b633e1 100644
--- a/cups/snmp.c
+++ b/cups/snmp.c
@@ -313,7 +313,7 @@ cupsSNMPOpen(int family)		/* I - Address family - @code AF_INET@ or @code AF_INE
 cups_snmp_t *				/* O - SNMP packet or @code NULL@ if none */
 cupsSNMPRead(int         fd,		/* I - SNMP socket file descriptor */
              cups_snmp_t *packet,	/* I - SNMP packet buffer */
-	     int         msec)		/* I - Timeout in milliseconds */
+	     double      timeout)	/* I - Timeout in seconds */
 {
   unsigned char	buffer[CUPS_SNMP_MAX_PACKET];
 					/* Data packet */
@@ -333,7 +333,7 @@ cupsSNMPRead(int         fd,		/* I - SNMP socket file descriptor */
   * Optionally wait for a response...
   */
 
-  if (msec >= 0)
+  if (timeout >= 0.0)
   {
     int			ready;		/* Data ready on socket? */
 #ifdef HAVE_POLL
@@ -342,21 +342,22 @@ cupsSNMPRead(int         fd,		/* I - SNMP socket file descriptor */
     pfd.fd     = fd;
     pfd.events = POLLIN;
 
-    while ((ready = poll(&pfd, 1, msec)) < 0 && errno == EINTR);
+    while ((ready = poll(&pfd, 1, (int)(timeout * 1000.0))) < 0 &&
+           errno == EINTR);
 
 #else
     fd_set		input_set;	/* select() input set */
-    struct timeval	timeout;	/* select() timeout */
+    struct timeval	stimeout;	/* select() timeout */
 
     do
     {
       FD_ZERO(&input_set);
       FD_SET(fd, &input_set);
 
-      timeout.tv_sec  = msec / 1000;
-      timeout.tv_usec = (msec % 1000) * 1000;
+      stimeout.tv_sec  = (int)timeout;
+      stimeout.tv_usec = (int)((timeout - stimeout.tv_usec) * 1000000);
 
-      ready = select(fd + 1, &input_set, NULL, NULL, &timeout);
+      ready = select(fd + 1, &input_set, NULL, NULL, &stimeout);
     }
 #  ifdef WIN32
     while (ready < 0 && WSAGetLastError() == WSAEINTR);
@@ -425,6 +426,9 @@ cupsSNMPSetDebug(int level)		/* I - 1 to enable debug output, 0 otherwise */
  *
  * The array pointed to by "prefix" is terminated by the value -1.
  *
+ * If "timeout" is negative, @code cupsSNMPWalk@ will wait for a response
+ * indefinitely.
+ *
  * @since CUPS 1.4@
  */
 
@@ -434,7 +438,7 @@ cupsSNMPWalk(int            fd,		/* I - SNMP socket */
 	     int            version,	/* I - SNMP version */
 	     const char     *community,	/* I - Community name */
              const int      *prefix,	/* I - OID prefix */
-	     int            msec,	/* I - Timeout for each response in milliseconds */
+	     double         timeout,	/* I - Timeout for each response in seconds */
 	     cups_snmp_cb_t cb,		/* I - Function to call for each response */
 	     void           *data)	/* I - User data pointer that is passed to the callback function */
 {
@@ -466,7 +470,7 @@ cupsSNMPWalk(int            fd,		/* I - SNMP socket */
 		       packet.object_name))
       return (-1);
 
-    if (!cupsSNMPRead(fd, &packet, msec))
+    if (!cupsSNMPRead(fd, &packet, timeout))
       return (-1);
 
     if (!cupsSNMPIsOIDPrefixed(&packet, prefix))
diff --git a/cups/snmp.h b/cups/snmp.h
index 9f1d8dc19..8e5dfa56d 100644
--- a/cups/snmp.h
+++ b/cups/snmp.h
@@ -119,13 +119,13 @@ extern int		cupsSNMPIsOID(cups_snmp_t *packet, const int *oid)
 extern int		cupsSNMPIsOIDPrefixed(cups_snmp_t *packet,
 			                      const int *prefix) _CUPS_API_1_4;
 extern int		cupsSNMPOpen(int family) _CUPS_API_1_4;
-extern cups_snmp_t	*cupsSNMPRead(int fd, cups_snmp_t *packet, int msec)
-			    _CUPS_API_1_4;
+extern cups_snmp_t	*cupsSNMPRead(int fd, cups_snmp_t *packet,
+			              double timeout) _CUPS_API_1_4;
 extern void		cupsSNMPSetDebug(int level) _CUPS_API_1_4;
 extern int		cupsSNMPWalk(int fd, http_addr_t *address, int version,
 			             const char *community, const int *prefix,
-				     int msec, cups_snmp_cb_t cb, void *data)
-			    _CUPS_API_1_4;
+				     double timeout, cups_snmp_cb_t cb,
+				     void *data) _CUPS_API_1_4;
 extern int		cupsSNMPWrite(int fd, http_addr_t *address, int version,
 				      const char *community,
 				      cups_asn1_t request_type,
diff --git a/cups/tempfile.c b/cups/tempfile.c
index 30cbc0cae..f25886461 100644
--- a/cups/tempfile.c
+++ b/cups/tempfile.c
@@ -161,7 +161,7 @@ cupsTempFd(char *filename,		/* I - Pointer to buffer */
  * @deprecated@
  */
 
-char *					/* O - Filename or NULL on error */
+char *					/* O - Filename or @code NULL@ on error */
 cupsTempFile(char *filename,		/* I - Pointer to buffer */
              int  len)			/* I - Size of buffer */
 {
@@ -209,7 +209,7 @@ cupsTempFile(char *filename,		/* I - Pointer to buffer */
  * @since CUPS 1.2@
  */
 
-cups_file_t *				/* O - CUPS file or NULL on error */
+cups_file_t *				/* O - CUPS file or @code NULL@ on error */
 cupsTempFile2(char *filename,		/* I - Pointer to buffer */
               int  len)			/* I - Size of buffer */
 {
diff --git a/cups/testsnmp.c b/cups/testsnmp.c
index e13b23847..eb47254a1 100644
--- a/cups/testsnmp.c
+++ b/cups/testsnmp.c
@@ -268,7 +268,7 @@ show_oid(int         fd,		/* I - SNMP socket */
       printf(".%d", oid[i]);
     puts("):");
 
-    if (cupsSNMPWalk(fd, addr, CUPS_SNMP_VERSION_1, community, oid, 5000,
+    if (cupsSNMPWalk(fd, addr, CUPS_SNMP_VERSION_1, community, oid, 5.0,
                      print_packet, NULL) < 0)
     {
       printf("FAIL (%s)\n", strerror(errno));
@@ -291,9 +291,9 @@ show_oid(int         fd,		/* I - SNMP socket */
 
     puts("PASS");
 
-    fputs("cupsSNMPRead(5000): ", stdout);
+    fputs("cupsSNMPRead(5.0): ", stdout);
 
-    if (!cupsSNMPRead(fd, &packet, 5000))
+    if (!cupsSNMPRead(fd, &packet, 5.0))
     {
       puts("FAIL (timeout)");
       return (0);
diff --git a/cups/usersys.c b/cups/usersys.c
index c8d2b2864..28b40d0be 100644
--- a/cups/usersys.c
+++ b/cups/usersys.c
@@ -54,7 +54,7 @@ static cups_file_t	*cups_open_client_conf(void);
  * 'cupsEncryption()' - Get the default encryption settings.
  *
  * The default encryption setting comes from the CUPS_ENCRYPTION
- * environment variable, then the ~/.cupsrc file, and finally the
+ * environment variable, then the ~/.cups/client.conf file, and finally the
  * /etc/cups/client.conf file. If not set, the default is
  * @code HTTP_ENCRYPT_IF_REQUESTED@.
  */
diff --git a/cups/util.c b/cups/util.c
index eade62f08..a572e6fa9 100644
--- a/cups/util.c
+++ b/cups/util.c
@@ -93,7 +93,7 @@ static int	cups_get_printer_uri(http_t *http, const char *name,
 
 int					/* O - 1 on success, 0 on failure */
 cupsCancelJob(const char *name,		/* I - Name of printer or class */
-              int        job_id)	/* I - Job ID */
+              int        job_id)	/* I - Job ID, @code CUPS_JOBID_CURRENT@ for the current job, or @code CUPS_JOBID_ALL@ for all jobs */
 {
   return (cupsCancelJob2(CUPS_HTTP_DEFAULT, name, job_id, 0)
               < IPP_REDIRECTION_OTHER_SITE);
@@ -116,9 +116,9 @@ cupsCancelJob(const char *name,		/* I - Name of printer or class */
  */
 
 ipp_status_t				/* O - IPP status */
-cupsCancelJob2(http_t     *http,	/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
+cupsCancelJob2(http_t     *http,	/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
                const char *name,	/* I - Name of printer or class */
-               int        job_id,	/* I - Job ID or 0 for the current job, -1 for all jobs */
+               int        job_id,	/* I - Job ID, @code CUPS_JOBID_CURRENT@ for the current job, or @code CUPS_JOBID_ALL@ for all jobs */
 	       int        purge)	/* I - 1 to purge, 0 to cancel */
 {
   char		uri[HTTP_MAX_URI];	/* Job/printer URI */
@@ -192,18 +192,21 @@ cupsCancelJob2(http_t     *http,	/* I - HTTP connection or @code CUPS_HTTP_DEFAU
 
 
 /*
- * 'cupsCreateJob()' - Create an empty job.
+ * 'cupsCreateJob()' - Create an empty job for streaming.
  *
- * Submit files for printing to the job using the @link cupsStartDocument@,
- * @link cupsWriteRequestData@, and @link cupsFinishDocument@ functions.
+ * Use this function when you want to stream print data using the
+ * @link cupsStartDocument@, @link cupsWriteRequestData@, and
+ * @link cupsFinishDocument@ functions.  If you have one or more files to
+ * print, use the @link cupsPrintFile2@ or @link cupsPrintFiles2@ function
+ * instead.
  *
  * @since CUPS 1.4@
  */
 
 int					/* O - Job ID or 0 on error */
 cupsCreateJob(
-    http_t        *http,		/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
-    const char    *name,		/* I - Printer or class name */
+    http_t        *http,		/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
+    const char    *name,		/* I - Destination name */
     const char    *title,		/* I - Title of job */
     int           num_options,		/* I - Number of options */
     cups_option_t *options)		/* I - Options */
@@ -281,8 +284,8 @@ cupsCreateJob(
  */
 
 ipp_status_t				/* O - Status of document submission */
-cupsFinishDocument(http_t     *http,	/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
-                   const char *name)	/* I - Printer or class name */
+cupsFinishDocument(http_t     *http,	/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
+                   const char *name)	/* I - Destination name */
 {
   char	resource[1024];			/* Printer resource */
 
@@ -450,7 +453,7 @@ cupsGetDefault(void)
  */
 
 const char *				/* O - Default printer or @code NULL@ */
-cupsGetDefault2(http_t *http)		/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
+cupsGetDefault2(http_t *http)		/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
 {
   ipp_t		*request,		/* IPP Request */
 		*response;		/* IPP Response */
@@ -522,7 +525,7 @@ cupsGetDefault2(http_t *http)		/* I - HTTP connection or @code CUPS_HTTP_DEFAULT
 
 int					/* O - Number of jobs */
 cupsGetJobs(cups_job_t **jobs,		/* O - Job data */
-            const char *name,		/* I - @code NULL@ = all destinations, otherwise show jobs for mydest */
+            const char *name,		/* I - @code NULL@ = all destinations, otherwise show jobs for named destination */
             int        myjobs,		/* I - 0 = all users, 1 = mine */
 	    int        whichjobs)	/* I - @code CUPS_WHICHJOBS_ALL@, @code CUPS_WHICHJOBS_ACTIVE@, or @code CUPS_WHICHJOBS_COMPLETED@ */
 {
@@ -547,9 +550,9 @@ cupsGetJobs(cups_job_t **jobs,		/* O - Job data */
  */
 
 int					/* O - Number of jobs */
-cupsGetJobs2(http_t     *http,		/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
+cupsGetJobs2(http_t     *http,		/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
              cups_job_t **jobs,		/* O - Job data */
-             const char *name,		/* I - @code NULL@ = all destinations, otherwise show jobs for mydest */
+             const char *name,		/* I - @code NULL@ = all destinations, otherwise show jobs for named destination */
              int        myjobs,		/* I - 0 = all users, 1 = mine */
 	     int        whichjobs)	/* I - @code CUPS_WHICHJOBS_ALL@, @code CUPS_WHICHJOBS_ACTIVE@, or @code CUPS_WHICHJOBS_COMPLETED@ */
 {
@@ -810,10 +813,13 @@ cupsGetJobs2(http_t     *http,		/* I - HTTP connection or @code CUPS_HTTP_DEFAUL
  *
  * For classes, @code 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 @code cupsGetPPD@ or @link cupsGetPPD2@.
  */
 
 const char *				/* O - Filename for PPD file */
-cupsGetPPD(const char *name)		/* I - Printer name */
+cupsGetPPD(const char *name)		/* I - Destination name */
 {
   _cups_globals_t *cg = _cupsGlobals();	/* Pointer to library globals */
   time_t	modtime = 0;		/* Modification time */
@@ -839,12 +845,15 @@ cupsGetPPD(const char *name)		/* I - Printer name */
  * For classes, @code 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 @link cupsGetPPD@ or @code cupsGetPPD2@.
+ *
  * @since CUPS 1.1.21@
  */
 
 const char *				/* O - Filename for PPD file */
-cupsGetPPD2(http_t     *http,		/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
-            const char *name)		/* I - Printer name */
+cupsGetPPD2(http_t     *http,		/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
+            const char *name)		/* I - Destination name */
 {
   _cups_globals_t *cg = _cupsGlobals();	/* Pointer to library globals */
   time_t	modtime = 0;		/* Modification time */
@@ -878,11 +887,13 @@ cupsGetPPD2(http_t     *http,		/* I - HTTP connection or @code CUPS_HTTP_DEFAULT
  *
  * For classes, @code cupsGetPPD3@ returns the PPD file for the first printer
  * in the class.
+ *
+ * @since CUPS 1.4@
  */
 
 http_status_t				/* O  - HTTP status */
 cupsGetPPD3(http_t     *http,		/* I  - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
-            const char *name,		/* I  - Printer name */
+            const char *name,		/* I  - Destination name */
 	    time_t     *modtime,	/* IO - Modification time */
 	    char       *buffer,		/* I  - Filename buffer */
 	    size_t     bufsize)		/* I  - Size of filename buffer */
@@ -1181,7 +1192,7 @@ cupsGetPrinters(char ***printers)	/* O - Printers */
  */
 
 char *					/* O - Name of PPD file or @code NULL@ on error */
-cupsGetServerPPD(http_t     *http,	/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
+cupsGetServerPPD(http_t     *http,	/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
                  const char *name)	/* I - Name of PPD file ("ppd-name") */
 {
   int			fd;		/* PPD file descriptor */
@@ -1271,7 +1282,7 @@ cupsLastErrorString(void)
  */
 
 int					/* O - Job ID or 0 on error */
-cupsPrintFile(const char    *name,	/* I - Printer or class name */
+cupsPrintFile(const char    *name,	/* I - Destination name */
               const char    *filename,	/* I - File to print */
 	      const char    *title,	/* I - Title of job */
               int           num_options,/* I - Number of options */
@@ -1295,8 +1306,8 @@ cupsPrintFile(const char    *name,	/* I - Printer or class name */
 
 int					/* O - Job ID or 0 on error */
 cupsPrintFile2(
-    http_t        *http,		/* I - HTTP connection */
-    const char    *name,		/* I - Printer or class name */
+    http_t        *http,		/* I - Connection to server */
+    const char    *name,		/* I - Destination name */
     const char    *filename,		/* I - File to print */
     const char    *title,		/* I - Title of job */
     int           num_options,		/* I - Number of options */
@@ -1318,7 +1329,7 @@ cupsPrintFile2(
 
 int					/* O - Job ID or 0 on error */
 cupsPrintFiles(
-    const char    *name,		/* I - Printer or class name */
+    const char    *name,		/* I - Destination name */
     int           num_files,		/* I - Number of files */
     const char    **files,		/* I - File(s) to print */
     const char    *title,		/* I - Title of job */
@@ -1348,8 +1359,8 @@ cupsPrintFiles(
 
 int					/* O - Job ID or 0 on error */
 cupsPrintFiles2(
-    http_t        *http,		/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
-    const char    *name,		/* I - Printer or class name */
+    http_t        *http,		/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
+    const char    *name,		/* I - Destination name */
     int           num_files,		/* I - Number of files */
     const char    **files,		/* I - File(s) to print */
     const char    *title,		/* I - Title of job */
@@ -1459,8 +1470,8 @@ cupsPrintFiles2(
 
 http_status_t				/* O - HTTP status of request */
 cupsStartDocument(
-    http_t     *http,			/* I - HTTP connection or @code CUPS_HTTP_DEFAULT@ */
-    const char *name,			/* I - Printer or class name */
+    http_t     *http,			/* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
+    const char *name,			/* I - Destination name */
     int        job_id,			/* I - Job ID from @link cupsCreateJob@ */
     const char *docname,		/* I - Name of document */
     const char *format,			/* I - MIME type or @code CUPS_FORMAT_foo@ */
@@ -1589,7 +1600,7 @@ _cupsConnect(void)
 
 static int				/* O - 1 on success, 0 on failure */
 cups_get_printer_uri(
-    http_t     *http,			/* I - HTTP connection */
+    http_t     *http,			/* I - Connection to server */
     const char *name,			/* I - Name of printer or class */
     char       *host,			/* I - Hostname buffer */
     int        hostsize,		/* I - Size of hostname buffer */
diff --git a/doc/Makefile b/doc/Makefile
index 197344c15..08c5d8cc6 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -159,12 +159,10 @@ install:	all $(INSTALL_LANGUAGES)
 
 install-languages:
 	for lang in $(LANGUAGES); do \
-		$(INSTALL_DIR) -m 755 $(DOCDIR)/$$lang/images; \
-		if test -f $$lang/index.html; then \
-			$(INSTALL_MAN) $$lang/index.html $(DOCDIR)/$$lang; \
-		fi; \
-		if test -f $$lang/cups.css; then \
-			$(INSTALL_MAN) $$lang/cups.css $(DOCDIR)/$$lang; \
+		if test -d $$lang; then \
+			$(INSTALL_DIR) -m 755 $(DOCDIR)/$$lang/images; \
+			$(INSTALL_MAN) $$lang/index.html $(DOCDIR)/$$lang 2>/dev/null || true; \
+			$(INSTALL_MAN) $$lang/cups.css $(DOCDIR)/$$lang 2>/dev/null || true; \
 		fi; \
 	done
 
diff --git a/doc/cups-printable.css b/doc/cups-printable.css
index 83693894d..5256cae38 100644
--- a/doc/cups-printable.css
+++ b/doc/cups-printable.css
@@ -47,13 +47,12 @@ BLOCKQUOTE {
 }
 
 A:link, A:visited {
+  font-weight: normal;
   text-decoration: none;
-  font-weight: bold;
 }
 
 A:link:hover, A:visited:hover, A:active {
   text-decoration: underline;
-  font-weight: bold;
 }
 
 SUB, SUP {
diff --git a/doc/cups.css b/doc/cups.css
index 8c522609e..77fefb044 100644
--- a/doc/cups.css
+++ b/doc/cups.css
@@ -66,6 +66,7 @@ A:link:hover IMG {
 }
 
 A:link, A:visited {
+  font-weight: normal;
   text-decoration: none;
   color: #000099;
 }
diff --git a/doc/help/api-array.html b/doc/help/api-array.html
index e902ed3fc..e29419d39 100644
--- a/doc/help/api-array.html
+++ b/doc/help/api-array.html
@@ -55,13 +55,12 @@ BLOCKQUOTE {
 }
 
 A:link, A:visited {
+  font-weight: normal;
   text-decoration: none;
-  font-weight: bold;
 }
 
 A:link:hover, A:visited:hover, A:active {
   text-decoration: underline;
-  font-weight: bold;
 }
 
 SUB, SUP {
diff --git a/doc/help/api-cups.html b/doc/help/api-cups.html
index 36f731675..654edaf27 100644
--- a/doc/help/api-cups.html
+++ b/doc/help/api-cups.html
@@ -55,13 +55,12 @@ BLOCKQUOTE {
 }
 
 A:link, A:visited {
+  font-weight: normal;
   text-decoration: none;
-  font-weight: bold;
 }
 
 A:link:hover, A:visited:hover, A:active {
   text-decoration: underline;
-  font-weight: bold;
 }
 
 SUB, SUP {
@@ -297,6 +296,7 @@ div.contents ul.subcontents li {
 
 
-
-
-
-
-All Classes
-
-
-
-
-
-All Classes
-
- - - - - -
Cups -
-CupsJob -
-CupsPrinter -
-IPP -
-IPPAttribute -
-IPPDefs -
-IPPError -
-IPPHttp -
-IPPMD5 -
-IPPRequest -
-IPPStatus -
-IPPURLConnection -
-IPPValue -
-
- - - diff --git a/scripting/java/docs/com/easysw/cups/Cups.html b/scripting/java/docs/com/easysw/cups/Cups.html deleted file mode 100644 index 77f25a7f1..000000000 --- a/scripting/java/docs/com/easysw/cups/Cups.html +++ /dev/null @@ -1,600 +0,0 @@ - - - - - - -: Class Cups - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class Cups

-
-java.lang.Object
-  |
-  +--com.easysw.cups.Cups
-
-
-
-
public class Cups
extends java.lang.Object
- -

-


- -

- - - - - - - - - - - - - - - - - - - -
-Constructor Summary
Cups() - -
-          Void constructor.
Cups(java.net.URL p_url) - -
-          Constructor using a URL.
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- intcupsCancelJob(java.lang.String printer_name, - int p_job_id, - java.lang.String p_user_name) - -
-          Cancel a job - send a job cancel request to the server.
- java.lang.StringcupsGetDefault() - -
-          Get default destination.
- CupsJob[]cupsGetJobs(boolean showMyJobs, - boolean showCompleted) - -
-          Get a list of jobs.
- java.util.ListcupsGetPrinterAttributes(java.lang.String printer_name) - -
-          Get printer attributes
- java.lang.String[]cupsGetPrinters() - -
-          Get a list of printers.
- java.util.ListcupsGetPrinterStatus(java.lang.String printer_name) - -
-           
- CupsJobcupsPrintFile(java.lang.String p_filename, - IPPAttribute[] p_attrs) - -
-          Print a file.
- booleandoRequest() - -
-          Do a CUPS request to the server.
- booleandoRequest(java.io.File file) - -
-          Send a FILE to the CUPS server.
- booleandoRequest(java.lang.String from) - -
-           
- booleangetEncrypt() - -
-          Get the value of the encrypt member.
- voidsetDest(java.lang.String p_dest) - -
-          Set the value of the dest member.
- voidsetEncrypt(boolean p_encrypt) - -
-          Set the value of the encrypt member.
- voidsetInstance(java.lang.String p_instance) - -
-          Set the value of the instance member.
- voidsetPasswd(java.lang.String p_passwd) - -
-          Set the value of the passwd member.
- voidsetPath(java.lang.String p_path) - -
-          Set the value of the path member.
- voidsetPort(int p_port) - -
-          Set the value of the port member.
- voidsetProtocol(java.lang.String p_protocol) - -
-          Set the value of the protocol member.
- voidsetServer(java.lang.String p_server) - -
-          Set the value of the server member.
- voidsetUser(java.lang.String p_user) - -
-          Set the value of the user member.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-Cups

-
-public Cups()
-
-
Void constructor.
-
- -

-Cups

-
-public Cups(java.net.URL p_url)
-
-
Constructor using a URL.
-
Parameters:
p_url - A URL object.
-
-
- - - - - - - - -
-Method Detail
- -

-setProtocol

-
-public void setProtocol(java.lang.String p_protocol)
-
-
Set the value of the protocol member. Valid values - are ipp or http.
-
Parameters:
p_protocol - String with protocol.
-
-
-
- -

-setServer

-
-public void setServer(java.lang.String p_server)
-
-
Set the value of the server member. This is an - IP address or a hostname.
-
Parameters:
p_server - IP address or hostname.
-
-
-
- -

-setPort

-
-public void setPort(int p_port)
-
-
Set the value of the port member.
-
Parameters:
p_port - Port number.
-
-
-
- -

-setUser

-
-public void setUser(java.lang.String p_user)
-
-
Set the value of the user member.
-
Parameters:
p_user - User name.
-
-
-
- -

-setPasswd

-
-public void setPasswd(java.lang.String p_passwd)
-
-
Set the value of the passwd member.
-
Parameters:
p_passwd - Password.
-
-
-
- -

-setDest

-
-public void setDest(java.lang.String p_dest)
-
-
Set the value of the dest member.
-
Parameters:
p_dest - Destination.
-
-
-
- -

-setInstance

-
-public void setInstance(java.lang.String p_instance)
-
-
Set the value of the instance member.
-
Parameters:
p_instance - Instance.
-
-
-
- -

-setEncrypt

-
-public void setEncrypt(boolean p_encrypt)
-
-
Set the value of the encrypt member.
-
Parameters:
p_enrypt - Yes or no.
-
-
-
- -

-getEncrypt

-
-public boolean getEncrypt()
-
-
Get the value of the encrypt member.
-
Returns:
boolean Encryption on or off.
-
-
-
- -

-setPath

-
-public void setPath(java.lang.String p_path)
-
-
Set the value of the path member. This is the - path that will be used in the POST method.
-
Parameters:
p_path - Path on server.
-
-
-
- -

-doRequest

-
-public boolean doRequest(java.lang.String from)
-                  throws java.io.IOException
-
-
-
- -

-doRequest

-
-public boolean doRequest()
-                  throws java.io.IOException
-
-
Do a CUPS request to the server.
-
Parameters:
p_dest - Destination name.
Returns:
boolean True on success, false otherwise
-
-
-
- -

-doRequest

-
-public boolean doRequest(java.io.File file)
-                  throws java.io.IOException
-
-
Send a FILE to the CUPS server.
-
Parameters:
file - File to send.
Returns:
boolean True on success, false otherwise
-
-
-
- -

-cupsGetJobs

-
-public CupsJob[] cupsGetJobs(boolean showMyJobs,
-                             boolean showCompleted)
-                      throws java.io.IOException
-
-
Get a list of jobs.
-
Parameters:
showMyJobs - Show only jobs for user.
showCompleted - Show completed OR active jobs.
Returns:
CupsJob[] Array of job objects, or null.
-
-
-
- -

-cupsGetPrinters

-
-public java.lang.String[] cupsGetPrinters()
-                                   throws java.io.IOException
-
-
Get a list of printers.
-
Returns:
String[] Array of printers, or null.
-
-
-
- -

-cupsGetDefault

-
-public java.lang.String cupsGetDefault()
-                                throws java.io.IOException
-
-
Get default destination.
-
Returns:
String Name of default printer, or null.
-
-
-
- -

-cupsGetPrinterAttributes

-
-public java.util.List cupsGetPrinterAttributes(java.lang.String printer_name)
-                                        throws java.io.IOException
-
-
Get printer attributes
-
Parameters:
printer_name - Name of printer to get info for.
Returns:
List List of attributes.
See Also:
CupsPrinter
-
-
-
- -

-cupsPrintFile

-
-public CupsJob cupsPrintFile(java.lang.String p_filename,
-                             IPPAttribute[] p_attrs)
-                      throws java.io.IOException
-
-
Print a file.
-
Parameters:
p_filename - Path of file to print.
p_attrs[] - Array of print job attributes.
Returns:
CupsJob Object with job info.
See Also:
CupsJob
-
-
-
- -

-cupsCancelJob

-
-public int cupsCancelJob(java.lang.String printer_name,
-                         int p_job_id,
-                         java.lang.String p_user_name)
-                  throws java.io.IOException
-
-
Cancel a job - send a job cancel request to the server.
-
Parameters:
printer_name - Destination.
p_job_id - ID of job.
p_user_name - Requesting user name.
-
-
-
- -

-cupsGetPrinterStatus

-
-public java.util.List cupsGetPrinterStatus(java.lang.String printer_name)
-                                    throws java.io.IOException
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/com/easysw/cups/CupsJob.html b/scripting/java/docs/com/easysw/cups/CupsJob.html deleted file mode 100644 index c75fb8fa7..000000000 --- a/scripting/java/docs/com/easysw/cups/CupsJob.html +++ /dev/null @@ -1,547 +0,0 @@ - - - - - - -: Class CupsJob - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class CupsJob

-
-java.lang.Object
-  |
-  +--com.easysw.cups.CupsJob
-
-
-
-
public class CupsJob
extends java.lang.Object
- -

-


- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
- java.lang.Stringdocument_format - -
-           
- java.lang.Stringjob_hold_until - -
-           
- intjob_id - -
-           
- intjob_k_octets - -
-           
- intjob_media_sheets_completed - -
-           
- java.lang.Stringjob_more_info - -
-           
- java.lang.Stringjob_name - -
-           
- java.lang.Stringjob_originating_host_name - -
-           
- java.lang.Stringjob_originating_user_name - -
-           
- longjob_printer_up_time - -
-           
- java.lang.Stringjob_printer_uri - -
-           
- intjob_priority - -
-           
- java.lang.Stringjob_sheets - -
-           
- intjob_state - -
-           
- java.lang.Stringjob_state_reasons - -
-           
- java.lang.Stringjob_uri - -
-           
- longtime_at_completed - -
-           
- longtime_at_creation - -
-           
- longtime_at_processing - -
-           
-  - - - - - - - - - - -
-Constructor Summary
CupsJob() - -
-          Constructor - set some default values.
-  - - - - - - - - - - - - - - - -
-Method Summary
- java.lang.StringjobStatusText() - -
-          Convert a job status to a string.
- voidupdateAttribute(IPPAttribute a) - -
-          Process an attribute from a cups.doRequest() call - and move the value into a local member.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-job_id

-
-public int job_id
-
-
-
- -

-job_more_info

-
-public java.lang.String job_more_info
-
-
-
- -

-job_uri

-
-public java.lang.String job_uri
-
-
-
- -

-job_printer_uri

-
-public java.lang.String job_printer_uri
-
-
-
- -

-job_printer_up_time

-
-public long job_printer_up_time
-
-
-
- -

-job_name

-
-public java.lang.String job_name
-
-
-
- -

-job_originating_user_name

-
-public java.lang.String job_originating_user_name
-
-
-
- -

-document_format

-
-public java.lang.String document_format
-
-
-
- -

-job_originating_host_name

-
-public java.lang.String job_originating_host_name
-
-
-
- -

-job_priority

-
-public int job_priority
-
-
-
- -

-job_state

-
-public int job_state
-
-
-
- -

-job_media_sheets_completed

-
-public int job_media_sheets_completed
-
-
-
- -

-job_k_octets

-
-public int job_k_octets
-
-
-
- -

-time_at_creation

-
-public long time_at_creation
-
-
-
- -

-time_at_processing

-
-public long time_at_processing
-
-
-
- -

-time_at_completed

-
-public long time_at_completed
-
-
-
- -

-job_hold_until

-
-public java.lang.String job_hold_until
-
-
-
- -

-job_sheets

-
-public java.lang.String job_sheets
-
-
-
- -

-job_state_reasons

-
-public java.lang.String job_state_reasons
-
-
- - - - - - - - -
-Constructor Detail
- -

-CupsJob

-
-public CupsJob()
-
-
Constructor - set some default values.
- - - - - - - - -
-Method Detail
- -

-updateAttribute

-
-public void updateAttribute(IPPAttribute a)
-
-
Process an attribute from a cups.doRequest() call - and move the value into a local member.
-
See Also:
IPPDefs, -IPPValues, -IPPAttributes
-
-
-
- -

-jobStatusText

-
-public java.lang.String jobStatusText()
-
-
Convert a job status to a string.
-
See Also:
IPPDefs
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/com/easysw/cups/CupsPrinter.html b/scripting/java/docs/com/easysw/cups/CupsPrinter.html deleted file mode 100644 index 3235483a0..000000000 --- a/scripting/java/docs/com/easysw/cups/CupsPrinter.html +++ /dev/null @@ -1,533 +0,0 @@ - - - - - - -: Class CupsPrinter - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class CupsPrinter

-
-java.lang.Object
-  |
-  +--com.easysw.cups.CupsPrinter
-
-
-
-
public class CupsPrinter
extends java.lang.Object
- -

-


- -

- - - - - - - - - - - - - - - - - - - -
-Constructor Summary
CupsPrinter(Cups c) - -
-          Constructor.
CupsPrinter(Cups c, - java.lang.String name) - -
-          Constructor with name.
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- booleangetAttributes(Cups c) - -
-          Get the printer's attributes.
- intgetCopiesDefault() - -
-          Get the printer number of copies default.
- java.lang.StringgetJobSheetsDefault() - -
-          Get the default job sheets.
- java.lang.String[]getJobSheetsSupported() - -
-          Get the printer job sheets supported.
- java.lang.StringgetLocation() - -
-          Get the printer location.
- intgetLowerCopiesSupported() - -
-          Get the printer lower copies supported.
- java.lang.StringgetMakeAndModel() - -
-          Get the printer make and model.
- intgetOrientationDefault() - -
-          Get the default orientation.
- int[]getOrientationSupported() - -
-          Get the printer orientation supported.
- booleangetPageRangesSupported() - -
-          Get whether the printer supports page ranges.
- java.lang.StringgetPrinterName() - -
-          Get the printer name.
- java.lang.StringgetStateReasons() - -
-          Get the printer state reasons.
- java.lang.StringgetStateText() - -
-          Get the printer state text.
- booleangetStatus(Cups c) - -
-          Get the printer's status.
- intgetUpperCopiesSupported() - -
-          Get the printer upper copies supported.
- voidsetDefaults() - -
-          Initialize the members with mostly sane values.
- voidupdateAttribute(IPPAttribute a) - -
-          Process an attribute from the cups.doRequest() method and move - the values into local members.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-CupsPrinter

-
-public CupsPrinter(Cups c)
-
-
Constructor. Does not get status or attributes.
-
Parameters:
c - Cups object.
See Also:
Cups
-
-
-
- -

-CupsPrinter

-
-public CupsPrinter(Cups c,
-                   java.lang.String name)
-
-
Constructor with name. Get status and attributes.
-
Parameters:
c - Cups object.
name - Name of printer.
See Also:
Cups
-
-
- - - - - - - - -
-Method Detail
- -

-setDefaults

-
-public void setDefaults()
-
-
Initialize the members with mostly sane values.
-
- -

-getStatus

-
-public boolean getStatus(Cups c)
-
-
Get the printer's status.
-
Parameters:
c - Cups object.
Returns:
Boolean True on success.
See Also:
Cups
-
-
-
- -

-getAttributes

-
-public boolean getAttributes(Cups c)
-
-
Get the printer's attributes.
-
Parameters:
c - Cups object.
Returns:
Boolean True on success.
See Also:
Cups
-
-
-
- -

-updateAttribute

-
-public void updateAttribute(IPPAttribute a)
-
-
Process an attribute from the cups.doRequest() method and move - the values into local members.
-
Parameters:
a - IPPAttribute.
See Also:
IPPAttributes, -IPPValues
-
-
-
- -

-getPrinterName

-
-public java.lang.String getPrinterName()
-
-
Get the printer name.
-
Returns:
String Printer Name.
-
-
-
- -

-getStateText

-
-public java.lang.String getStateText()
-
-
Get the printer state text.
-
Returns:
String State text.
-
-
-
- -

-getStateReasons

-
-public java.lang.String getStateReasons()
-
-
Get the printer state reasons.
-
Returns:
String State reason.
-
-
-
- -

-getLocation

-
-public java.lang.String getLocation()
-
-
Get the printer location.
-
Returns:
String State location.
-
-
-
- -

-getMakeAndModel

-
-public java.lang.String getMakeAndModel()
-
-
Get the printer make and model.
-
Returns:
String Make and model.
-
-
-
- -

-getJobSheetsDefault

-
-public java.lang.String getJobSheetsDefault()
-
-
Get the default job sheets.
-
Returns:
String Default job sheets.
-
-
-
- -

-getJobSheetsSupported

-
-public java.lang.String[] getJobSheetsSupported()
-
-
Get the printer job sheets supported.
-
Returns:
String[] Array of supported job sheets.
-
-
-
- -

-getOrientationDefault

-
-public int getOrientationDefault()
-
-
Get the default orientation.
-
Returns:
int Default page orientation.
-
-
-
- -

-getOrientationSupported

-
-public int[] getOrientationSupported()
-
-
Get the printer orientation supported.
-
Returns:
int[] Array of supported orientations.
-
-
-
- -

-getLowerCopiesSupported

-
-public int getLowerCopiesSupported()
-
-
Get the printer lower copies supported.
-
Returns:
int Lower of the range.
-
-
-
- -

-getUpperCopiesSupported

-
-public int getUpperCopiesSupported()
-
-
Get the printer upper copies supported.
-
Returns:
int Upper of the range.
-
-
-
- -

-getCopiesDefault

-
-public int getCopiesDefault()
-
-
Get the printer number of copies default.
-
Returns:
int Default number of copies.
-
-
-
- -

-getPageRangesSupported

-
-public boolean getPageRangesSupported()
-
-
Get whether the printer supports page ranges.
-
Returns:
boolean True or false.
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/com/easysw/cups/IPP.html b/scripting/java/docs/com/easysw/cups/IPP.html deleted file mode 100644 index 77f1284d7..000000000 --- a/scripting/java/docs/com/easysw/cups/IPP.html +++ /dev/null @@ -1,417 +0,0 @@ - - - - - - -: Class IPP - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class IPP

-
-java.lang.Object
-  |
-  +--com.easysw.cups.IPP
-
-
-
-
public class IPP
extends java.lang.Object
- -

-An IPP object is used to hold the various - attributes and status of an ipp request.. -

-

-
Since:
JDK1.3
-
-
- -

- - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
- java.util.Listattrs - -
-           
- IPPRequestrequest - -
-           
- IPPStatusstatus - -
-           
-  - - - - - - - - - - -
-Constructor Summary
IPP() - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- booleanaddAttribute(IPPAttribute a) - -
-          Add an attribute to the attibutes list - for later parsing.
- voiddump_response() - -
-           
- IPPAttributegetCurrentAttribute() - -
-          Get the current attribute pointed at by - current.
- IPPAttributeippFindAttribute(java.lang.String p_name, - int p_type) - -
-          Find the named attribute of the correct type.
- IPPAttributeippFindNextAttribute(java.lang.String p_name, - int p_type) - -
-          Find the named attribute of the correct type.
- voidsetRequestID(short p_id) - -
-          Set the IPP request ID.
- voidsetRequestOperationID(short p_operation_id) - -
-          Set the IPP operation ID.
- intsizeInBytes() - -
-          Get the size in bytes of an IPP request.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-request

-
-public IPPRequest request
-
-
-
- -

-status

-
-public IPPStatus status
-
-
-
- -

-attrs

-
-public java.util.List attrs
-
-
- - - - - - - - -
-Constructor Detail
- -

-IPP

-
-public IPP()
-
-
- - - - - - - - -
-Method Detail
- -

-addAttribute

-
-public boolean addAttribute(IPPAttribute a)
-
-
Add an attribute to the attibutes list - for later parsing.
-
Parameters:
a - IPPAttribute to add.
Returns:
true always returns true - for now.
See Also:
IPPAttribute, -IPPValue
-
-
-
- -

-getCurrentAttribute

-
-public IPPAttribute getCurrentAttribute()
-
-
Get the current attribute pointed at by - current.
-
Returns:
IPPAttribute Return the current attribute.
-
-
-
- -

-ippFindAttribute

-
-public IPPAttribute ippFindAttribute(java.lang.String p_name,
-                                     int p_type)
-
-
Find the named attribute of the correct type. Both must match. - This methos searches from the beginning of the attribute list, - rather than from the current position.
-
Parameters:
p_name - String containing the name.
p_type - int attribute type.
Returns:
IPPAttribute Matching attribute if found.
-
-
-
- -

-ippFindNextAttribute

-
-public IPPAttribute ippFindNextAttribute(java.lang.String p_name,
-                                         int p_type)
-
-
Find the named attribute of the correct type. Both must match. - This methos searches from the current position in the attribute list.
-
Parameters:
p_name - String containing the name.
p_type - int attribute type.
Returns:
IPPAttribute Matching attribute if found.
-
-
-
- -

-sizeInBytes

-
-public int sizeInBytes()
-
-
Get the size in bytes of an IPP request.
-
Returns:
int Number of bytes for the request.
-
-
-
- -

-setRequestID

-
-public void setRequestID(short p_id)
-
-
Set the IPP request ID.
-
Parameters:
p_id - short request id.
-
-
-
- -

-setRequestOperationID

-
-public void setRequestOperationID(short p_operation_id)
-
-
Set the IPP operation ID.
-
Parameters:
p_operation_id - short operation id.
-
-
-
- -

-dump_response

-
-public void dump_response()
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/com/easysw/cups/IPPAttribute.html b/scripting/java/docs/com/easysw/cups/IPPAttribute.html deleted file mode 100644 index 544b0c368..000000000 --- a/scripting/java/docs/com/easysw/cups/IPPAttribute.html +++ /dev/null @@ -1,466 +0,0 @@ - - - - - - -: Class IPPAttribute - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class IPPAttribute

-
-java.lang.Object
-  |
-  +--com.easysw.cups.IPPAttribute
-
-
-
-
public class IPPAttribute
extends java.lang.Object
- -

-


- -

- - - - - - - - - - - - - - - - -
-Constructor Summary
IPPAttribute(int p_group_tag, - int p_value_tag, - java.lang.String p_name) - -
-           
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- booleanaddBoolean(boolean p_bool) - -
-           
- booleanaddBooleans(boolean[] p_bools) - -
-           
- booleanaddDate(char[] p_date) - -
-           
- booleanaddEnum(int p_int) - -
-           
- booleanaddInteger(int p_int) - -
-           
- booleanaddIntegers(int[] p_ints) - -
-           
- booleanaddRange(int p_lower, - int p_upper) - -
-           
- booleanaddRanges(int[] p_lower, - int[] p_upper) - -
-           
- booleanaddResolution(byte p_units, - int p_xres, - int p_yres) - -
-           
- booleanaddResolutions(byte p_units, - int[] p_xres, - int[] p_yres) - -
-           
- booleanaddSeparator() - -
-           
- booleanaddString(java.lang.String p_charset, - java.lang.String p_text) - -
-           
- booleanaddStrings(java.lang.String p_charset, - java.lang.String[] p_texts) - -
-           
- voiddump_values() - -
-           
- byte[]getBytes(int sz, - int last_group) - -
-           
- intsizeInBytes(int last_group) - -
-           
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-IPPAttribute

-
-public IPPAttribute(int p_group_tag,
-                    int p_value_tag,
-                    java.lang.String p_name)
-
-
- - - - - - - - -
-Method Detail
- -

-addBoolean

-
-public boolean addBoolean(boolean p_bool)
-
-
-
- -

-addBooleans

-
-public boolean addBooleans(boolean[] p_bools)
-
-
-
- -

-addEnum

-
-public boolean addEnum(int p_int)
-
-
-
- -

-addInteger

-
-public boolean addInteger(int p_int)
-
-
-
- -

-addIntegers

-
-public boolean addIntegers(int[] p_ints)
-
-
-
- -

-addString

-
-public boolean addString(java.lang.String p_charset,
-                         java.lang.String p_text)
-
-
-
- -

-addStrings

-
-public boolean addStrings(java.lang.String p_charset,
-                          java.lang.String[] p_texts)
-
-
-
- -

-addDate

-
-public boolean addDate(char[] p_date)
-
-
-
- -

-addRange

-
-public boolean addRange(int p_lower,
-                        int p_upper)
-
-
-
- -

-addRanges

-
-public boolean addRanges(int[] p_lower,
-                         int[] p_upper)
-
-
-
- -

-addResolution

-
-public boolean addResolution(byte p_units,
-                             int p_xres,
-                             int p_yres)
-
-
-
- -

-addResolutions

-
-public boolean addResolutions(byte p_units,
-                              int[] p_xres,
-                              int[] p_yres)
-
-
-
- -

-addSeparator

-
-public boolean addSeparator()
-
-
-
- -

-sizeInBytes

-
-public int sizeInBytes(int last_group)
-
-
-
- -

-getBytes

-
-public byte[] getBytes(int sz,
-                       int last_group)
-
-
-
- -

-dump_values

-
-public void dump_values()
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/com/easysw/cups/IPPDefs.html b/scripting/java/docs/com/easysw/cups/IPPDefs.html deleted file mode 100644 index 63901cb9c..000000000 --- a/scripting/java/docs/com/easysw/cups/IPPDefs.html +++ /dev/null @@ -1,3330 +0,0 @@ - - - - - - -: Class IPPDefs - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class IPPDefs

-
-java.lang.Object
-  |
-  +--com.easysw.cups.IPPDefs
-
-
-
-
public class IPPDefs
extends java.lang.Object
- -

-IPPDefs is a collection of constants for use - in the IPP and CUPS classes. -

-

-
Since:
JDK1.3
-
-
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
-static intACTIVATE_PRINTER - -
-           
-static intATTRIBUTE - -
-           
-static intATTRIBUTES - -
-           
-static intATTRIBUTES_NOT_SETTABLE - -
-           
-static intBAD_REQUEST - -
-           
-static intCANCEL_CURRENT_JOB - -
-           
-static intCANCEL_JOB - -
-           
-static intCANCEL_SUBSCRIPTION - -
-           
-static intCHARSET - -
-           
-static intCOMPRESSION_ERROR - -
-           
-static intCOMPRESSION_NOT_SUPPORTED - -
-           
-static intCONFLICT - -
-           
-static intCREATE_JOB - -
-           
-static intCREATE_JOB_SUBSCRIPTION - -
-           
-static intCREATE_PRINTER_SUBSCRIPTION - -
-           
-static intCUPS_ACCEPT_JOBS - -
-           
-static intCUPS_ADD_CLASS - -
-           
-static intCUPS_ADD_DEVICE - -
-           
-static intCUPS_ADD_PRINTER - -
-           
-static intCUPS_DELETE_CLASS - -
-           
-static intCUPS_DELETE_DEVICE - -
-           
-static intCUPS_DELETE_PRINTER - -
-           
-static intCUPS_GET_CLASSES - -
-           
-static intCUPS_GET_DEFAULT - -
-           
-static intCUPS_GET_DEVICES - -
-           
-static intCUPS_GET_PPDS - -
-           
-static intCUPS_GET_PRINTERS - -
-           
-static intCUPS_MOVE_JOB - -
-           
-static intCUPS_REJECT_JOBS - -
-           
-static intCUPS_SET_DEFAULT - -
-           
-static intDATA - -
-           
-static intDEACTIVATE_PRINTER - -
-           
-static intDEVICE_ERROR - -
-           
-static intDISABLE_PRINTER - -
-           
-static intDOCUMENT_ACCESS_ERROR - -
-           
-static intDOCUMENT_FORMAT - -
-           
-static intDOCUMENT_FORMAT_ERROR - -
-           
-static intENABLE_PRINTER - -
-           
-static intERROR - -
-           
-static intERROR_JOB_CANCELLED - -
-           
-static intFINISHINGS_BALE - -
-           
-static intFINISHINGS_BIND - -
-           
-static intFINISHINGS_BIND_BOTTOM - -
-           
-static intFINISHINGS_BIND_LEFT - -
-           
-static intFINISHINGS_BIND_RIGHT - -
-           
-static intFINISHINGS_BIND_TOP - -
-           
-static intFINISHINGS_BOOKLET_MAKER - -
-           
-static intFINISHINGS_COVER - -
-           
-static intFINISHINGS_EDGE_STITCH - -
-           
-static intFINISHINGS_EDGE_STITCH_BOTTOM - -
-           
-static intFINISHINGS_EDGE_STITCH_LEFT - -
-           
-static intFINISHINGS_EDGE_STITCH_RIGHT - -
-           
-static intFINISHINGS_EDGE_STITCH_TOP - -
-           
-static intFINISHINGS_FOLD - -
-           
-static intFINISHINGS_JOB_OFFSET - -
-           
-static intFINISHINGS_NONE - -
-           
-static intFINISHINGS_PUNCH - -
-           
-static intFINISHINGS_SADDLE_STITCH - -
-           
-static intFINISHINGS_STAPLE - -
-           
-static intFINISHINGS_STAPLE_BOTTOM_LEFT - -
-           
-static intFINISHINGS_STAPLE_BOTTOM_RIGHT - -
-           
-static intFINISHINGS_STAPLE_DUAL_BOTTOM - -
-           
-static intFINISHINGS_STAPLE_DUAL_LEFT - -
-           
-static intFINISHINGS_STAPLE_DUAL_RIGHT - -
-           
-static intFINISHINGS_STAPLE_DUAL_TOP - -
-           
-static intFINISHINGS_STAPLE_TOP_LEFT - -
-           
-static intFINISHINGS_STAPLE_TOP_RIGHT - -
-           
-static intFINISHINGS_TRIM - -
-           
-static intFORBIDDEN - -
-           
-static intGET_JOB_ATTRIBUTES - -
-           
-static intGET_JOBS - -
-           
-static intGET_NOTIFICATIONS - -
-           
-static intGET_PRINT_SUPPORT_FILES - -
-           
-static intGET_PRINTER_ATTRIBUTES - -
-           
-static intGET_PRINTER_SUPPORTED_VALUES - -
-           
-static intGET_SUBSCRIPTION_ATTRIBUTES - -
-           
-static intGET_SUBSCRIPTIONS - -
-           
-static intGONE - -
-           
-static intHEADER - -
-           
-static intHOLD_JOB - -
-           
-static intHOLD_NEW_JOBS - -
-           
-static intIDLE - -
-           
-static intIGNORED_ALL_NOTIFICATIONS - -
-           
-static intIGNORED_ALL_SUBSCRIPTIONS - -
-           
-static intINTERNAL_ERROR - -
-           
-static intJOB_ABORTED - -
-           
-static intJOB_CANCELLED - -
-           
-static intJOB_COMPLETED - -
-           
-static intJOB_HELD - -
-           
-static intJOB_PENDING - -
-           
-static intJOB_PROCESSING - -
-           
-static intJOB_STOPPED - -
-           
-static intLANDSCAPE - -
-           
-static intMAX_NAME - -
-           
-static intMAX_VALUES - -
-           
-static intMULTIPLE_JOBS_NOT_SUPPORTED - -
-           
-static intNOT_ACCEPTING - -
-           
-static intNOT_AUTHENTICATED - -
-           
-static intNOT_AUTHORIZED - -
-           
-static intNOT_FOUND - -
-           
-static intNOT_POSSIBLE - -
-           
-static intOK - -
-           
-static intOK_BUT_CANCEL_SUBSCRIPTION - -
-           
-static intOK_CONFLICT - -
-           
-static intOK_IGNORED_NOTIFICATIONS - -
-           
-static intOK_IGNORED_SUBSCRIPTIONS - -
-           
-static intOK_SUBST - -
-           
-static intOK_TOO_MANY_EVENTS - -
-           
-static intOPERATION_NOT_SUPPORTED - -
-           
-static intPAUSE_PRINTER - -
-           
-static intPAUSE_PRINTER_AFTER_CURRENT_JOB - -
-           
-static intPORT - -
-           
-static intPORTRAIT - -
-           
-static intPRINT_JOB - -
-           
-static intPRINT_SUPPORT_FILE_NOT_FOUND - -
-           
-static intPRINT_URI - -
-           
-static intPRINTER_BUSY - -
-           
-static intPRINTER_IDLE - -
-           
-static intPRINTER_IS_DEACTIVATED - -
-           
-static intPRINTER_PROCESSING - -
-           
-static intPRINTER_STOPPED - -
-           
-static intPRIVATE - -
-           
-static intPROMOTE_JOB - -
-           
-static intPURGE_JOBS - -
-           
-static intQUALITY_DRAFT - -
-           
-static intQUALITY_HIGH - -
-           
-static intQUALITY_NORMAL - -
-           
-static intREDIRECTION_OTHER_SITE - -
-           
-static intRELEASE_HELD_NEW_JOBS - -
-           
-static intRELEASE_JOB - -
-           
-static intRENEW_SUBSCRIPTION - -
-           
-static intREPROCESS_JOB - -
-           
-static intREQUEST_ENTITY - -
-           
-static intREQUEST_VALUE - -
-           
-static intRES_PER_CM - -
-           
-static intRES_PER_INCH - -
-           
-static intRESTART_JOB - -
-           
-static intRESTART_PRINTER - -
-           
-static intRESUME_JOB - -
-           
-static intRESUME_PRINTER - -
-           
-static intREVERSE_LANDSCAPE - -
-           
-static intREVERSE_PORTRAIT - -
-           
-static intSCHEDULE_JOB_AFTER - -
-           
-static intSEND_DOCUMENT - -
-           
-static intSEND_NOTIFICATIONS - -
-           
-static intSEND_URI - -
-           
-static intSERVICE_UNAVAILABLE - -
-           
-static intSET_JOB_ATTRIBUTES - -
-           
-static intSET_PRINTER_ATTRIBUTES - -
-           
-static intSHUTDOWN_PRINTER - -
-           
-static intSTARTUP_PRINTER - -
-           
-static intSUSPEND_CURRENT_JOB - -
-           
-static intTAG_ADMINDEFINE - -
-           
-static intTAG_BEGIN_COLLECTION - -
-           
-static intTAG_BOOLEAN - -
-           
-static intTAG_CHARSET - -
-           
-static intTAG_COPY - -
-           
-static intTAG_DATE - -
-           
-static intTAG_DEFAULT - -
-           
-static intTAG_DELETEATTR - -
-           
-static intTAG_END - -
-           
-static intTAG_END_COLLECTION - -
-           
-static intTAG_ENUM - -
-           
-static intTAG_EVENT_NOTIFICATION - -
-           
-static intTAG_INTEGER - -
-           
-static intTAG_JOB - -
-           
-static intTAG_KEYWORD - -
-           
-static intTAG_LANGUAGE - -
-           
-static intTAG_MASK - -
-           
-static intTAG_MEMBERNAME - -
-           
-static intTAG_MIMETYPE - -
-           
-static intTAG_NAME - -
-           
-static intTAG_NAMELANG - -
-           
-static intTAG_NOTSETTABLE - -
-           
-static intTAG_NOVALUE - -
-           
-static intTAG_OPERATION - -
-           
-static intTAG_PRINTER - -
-           
-static intTAG_RANGE - -
-           
-static intTAG_RESOLUTION - -
-           
-static intTAG_STRING - -
-           
-static intTAG_SUBSCRIPTION - -
-           
-static intTAG_TEXT - -
-           
-static intTAG_TEXTLANG - -
-           
-static intTAG_UNKNOWN - -
-           
-static intTAG_UNSUPPORTED_GROUP - -
-           
-static intTAG_UNSUPPORTED_VALUE - -
-           
-static intTAG_URI - -
-           
-static intTAG_URISCHEME - -
-           
-static intTAG_ZERO - -
-           
-static intTEMPORARY_ERROR - -
-           
-static intTIMEOUT - -
-           
-static intTOO_MANY_SUBSCRIPTIONS - -
-           
-static intURI_SCHEME - -
-           
-static intVALIDATE_JOB - -
-           
-static byte[]VERSION - -
-           
-static intVERSION_NOT_SUPPORTED - -
-           
-  - - - - - - - - - - -
-Constructor Summary
IPPDefs() - -
-           
-  - - - - - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-VERSION

-
-public static final byte[] VERSION
-
-
-
- -

-PORT

-
-public static final int PORT
-
-
-
- -

-MAX_NAME

-
-public static final int MAX_NAME
-
-
-
- -

-MAX_VALUES

-
-public static final int MAX_VALUES
-
-
-
- -

-TAG_ZERO

-
-public static final int TAG_ZERO
-
-
-
- -

-TAG_OPERATION

-
-public static final int TAG_OPERATION
-
-
-
- -

-TAG_JOB

-
-public static final int TAG_JOB
-
-
-
- -

-TAG_END

-
-public static final int TAG_END
-
-
-
- -

-TAG_PRINTER

-
-public static final int TAG_PRINTER
-
-
-
- -

-TAG_UNSUPPORTED_GROUP

-
-public static final int TAG_UNSUPPORTED_GROUP
-
-
-
- -

-TAG_SUBSCRIPTION

-
-public static final int TAG_SUBSCRIPTION
-
-
-
- -

-TAG_EVENT_NOTIFICATION

-
-public static final int TAG_EVENT_NOTIFICATION
-
-
-
- -

-TAG_UNSUPPORTED_VALUE

-
-public static final int TAG_UNSUPPORTED_VALUE
-
-
-
- -

-TAG_DEFAULT

-
-public static final int TAG_DEFAULT
-
-
-
- -

-TAG_UNKNOWN

-
-public static final int TAG_UNKNOWN
-
-
-
- -

-TAG_NOVALUE

-
-public static final int TAG_NOVALUE
-
-
-
- -

-TAG_NOTSETTABLE

-
-public static final int TAG_NOTSETTABLE
-
-
-
- -

-TAG_DELETEATTR

-
-public static final int TAG_DELETEATTR
-
-
-
- -

-TAG_ADMINDEFINE

-
-public static final int TAG_ADMINDEFINE
-
-
-
- -

-TAG_INTEGER

-
-public static final int TAG_INTEGER
-
-
-
- -

-TAG_BOOLEAN

-
-public static final int TAG_BOOLEAN
-
-
-
- -

-TAG_ENUM

-
-public static final int TAG_ENUM
-
-
-
- -

-TAG_STRING

-
-public static final int TAG_STRING
-
-
-
- -

-TAG_DATE

-
-public static final int TAG_DATE
-
-
-
- -

-TAG_RESOLUTION

-
-public static final int TAG_RESOLUTION
-
-
-
- -

-TAG_RANGE

-
-public static final int TAG_RANGE
-
-
-
- -

-TAG_BEGIN_COLLECTION

-
-public static final int TAG_BEGIN_COLLECTION
-
-
-
- -

-TAG_TEXTLANG

-
-public static final int TAG_TEXTLANG
-
-
-
- -

-TAG_NAMELANG

-
-public static final int TAG_NAMELANG
-
-
-
- -

-TAG_END_COLLECTION

-
-public static final int TAG_END_COLLECTION
-
-
-
- -

-TAG_TEXT

-
-public static final int TAG_TEXT
-
-
-
- -

-TAG_NAME

-
-public static final int TAG_NAME
-
-
-
- -

-TAG_KEYWORD

-
-public static final int TAG_KEYWORD
-
-
-
- -

-TAG_URI

-
-public static final int TAG_URI
-
-
-
- -

-TAG_URISCHEME

-
-public static final int TAG_URISCHEME
-
-
-
- -

-TAG_CHARSET

-
-public static final int TAG_CHARSET
-
-
-
- -

-TAG_LANGUAGE

-
-public static final int TAG_LANGUAGE
-
-
-
- -

-TAG_MIMETYPE

-
-public static final int TAG_MIMETYPE
-
-
-
- -

-TAG_MEMBERNAME

-
-public static final int TAG_MEMBERNAME
-
-
-
- -

-TAG_MASK

-
-public static final int TAG_MASK
-
-
-
- -

-TAG_COPY

-
-public static final int TAG_COPY
-
-
-
- -

-RES_PER_INCH

-
-public static final int RES_PER_INCH
-
-
-
- -

-RES_PER_CM

-
-public static final int RES_PER_CM
-
-
-
- -

-FINISHINGS_NONE

-
-public static final int FINISHINGS_NONE
-
-
-
- -

-FINISHINGS_STAPLE

-
-public static final int FINISHINGS_STAPLE
-
-
-
- -

-FINISHINGS_PUNCH

-
-public static final int FINISHINGS_PUNCH
-
-
-
- -

-FINISHINGS_COVER

-
-public static final int FINISHINGS_COVER
-
-
-
- -

-FINISHINGS_BIND

-
-public static final int FINISHINGS_BIND
-
-
-
- -

-FINISHINGS_SADDLE_STITCH

-
-public static final int FINISHINGS_SADDLE_STITCH
-
-
-
- -

-FINISHINGS_EDGE_STITCH

-
-public static final int FINISHINGS_EDGE_STITCH
-
-
-
- -

-FINISHINGS_FOLD

-
-public static final int FINISHINGS_FOLD
-
-
-
- -

-FINISHINGS_TRIM

-
-public static final int FINISHINGS_TRIM
-
-
-
- -

-FINISHINGS_BALE

-
-public static final int FINISHINGS_BALE
-
-
-
- -

-FINISHINGS_BOOKLET_MAKER

-
-public static final int FINISHINGS_BOOKLET_MAKER
-
-
-
- -

-FINISHINGS_JOB_OFFSET

-
-public static final int FINISHINGS_JOB_OFFSET
-
-
-
- -

-FINISHINGS_STAPLE_TOP_LEFT

-
-public static final int FINISHINGS_STAPLE_TOP_LEFT
-
-
-
- -

-FINISHINGS_STAPLE_BOTTOM_LEFT

-
-public static final int FINISHINGS_STAPLE_BOTTOM_LEFT
-
-
-
- -

-FINISHINGS_STAPLE_TOP_RIGHT

-
-public static final int FINISHINGS_STAPLE_TOP_RIGHT
-
-
-
- -

-FINISHINGS_STAPLE_BOTTOM_RIGHT

-
-public static final int FINISHINGS_STAPLE_BOTTOM_RIGHT
-
-
-
- -

-FINISHINGS_EDGE_STITCH_LEFT

-
-public static final int FINISHINGS_EDGE_STITCH_LEFT
-
-
-
- -

-FINISHINGS_EDGE_STITCH_TOP

-
-public static final int FINISHINGS_EDGE_STITCH_TOP
-
-
-
- -

-FINISHINGS_EDGE_STITCH_RIGHT

-
-public static final int FINISHINGS_EDGE_STITCH_RIGHT
-
-
-
- -

-FINISHINGS_EDGE_STITCH_BOTTOM

-
-public static final int FINISHINGS_EDGE_STITCH_BOTTOM
-
-
-
- -

-FINISHINGS_STAPLE_DUAL_LEFT

-
-public static final int FINISHINGS_STAPLE_DUAL_LEFT
-
-
-
- -

-FINISHINGS_STAPLE_DUAL_TOP

-
-public static final int FINISHINGS_STAPLE_DUAL_TOP
-
-
-
- -

-FINISHINGS_STAPLE_DUAL_RIGHT

-
-public static final int FINISHINGS_STAPLE_DUAL_RIGHT
-
-
-
- -

-FINISHINGS_STAPLE_DUAL_BOTTOM

-
-public static final int FINISHINGS_STAPLE_DUAL_BOTTOM
-
-
-
- -

-FINISHINGS_BIND_LEFT

-
-public static final int FINISHINGS_BIND_LEFT
-
-
-
- -

-FINISHINGS_BIND_TOP

-
-public static final int FINISHINGS_BIND_TOP
-
-
-
- -

-FINISHINGS_BIND_RIGHT

-
-public static final int FINISHINGS_BIND_RIGHT
-
-
-
- -

-FINISHINGS_BIND_BOTTOM

-
-public static final int FINISHINGS_BIND_BOTTOM
-
-
-
- -

-PORTRAIT

-
-public static final int PORTRAIT
-
-
-
- -

-LANDSCAPE

-
-public static final int LANDSCAPE
-
-
-
- -

-REVERSE_LANDSCAPE

-
-public static final int REVERSE_LANDSCAPE
-
-
-
- -

-REVERSE_PORTRAIT

-
-public static final int REVERSE_PORTRAIT
-
-
-
- -

-QUALITY_DRAFT

-
-public static final int QUALITY_DRAFT
-
-
-
- -

-QUALITY_NORMAL

-
-public static final int QUALITY_NORMAL
-
-
-
- -

-QUALITY_HIGH

-
-public static final int QUALITY_HIGH
-
-
-
- -

-JOB_PENDING

-
-public static final int JOB_PENDING
-
-
-
- -

-JOB_HELD

-
-public static final int JOB_HELD
-
-
-
- -

-JOB_PROCESSING

-
-public static final int JOB_PROCESSING
-
-
-
- -

-JOB_STOPPED

-
-public static final int JOB_STOPPED
-
-
-
- -

-JOB_CANCELLED

-
-public static final int JOB_CANCELLED
-
-
-
- -

-JOB_ABORTED

-
-public static final int JOB_ABORTED
-
-
-
- -

-JOB_COMPLETED

-
-public static final int JOB_COMPLETED
-
-
-
- -

-PRINTER_IDLE

-
-public static final int PRINTER_IDLE
-
-
-
- -

-PRINTER_PROCESSING

-
-public static final int PRINTER_PROCESSING
-
-
-
- -

-PRINTER_STOPPED

-
-public static final int PRINTER_STOPPED
-
-
-
- -

-ERROR

-
-public static final int ERROR
-
-
-
- -

-IDLE

-
-public static final int IDLE
-
-
-
- -

-HEADER

-
-public static final int HEADER
-
-
-
- -

-ATTRIBUTE

-
-public static final int ATTRIBUTE
-
-
-
- -

-DATA

-
-public static final int DATA
-
-
-
- -

-PRINT_JOB

-
-public static final int PRINT_JOB
-
-
-
- -

-PRINT_URI

-
-public static final int PRINT_URI
-
-
-
- -

-VALIDATE_JOB

-
-public static final int VALIDATE_JOB
-
-
-
- -

-CREATE_JOB

-
-public static final int CREATE_JOB
-
-
-
- -

-SEND_DOCUMENT

-
-public static final int SEND_DOCUMENT
-
-
-
- -

-SEND_URI

-
-public static final int SEND_URI
-
-
-
- -

-CANCEL_JOB

-
-public static final int CANCEL_JOB
-
-
-
- -

-GET_JOB_ATTRIBUTES

-
-public static final int GET_JOB_ATTRIBUTES
-
-
-
- -

-GET_JOBS

-
-public static final int GET_JOBS
-
-
-
- -

-GET_PRINTER_ATTRIBUTES

-
-public static final int GET_PRINTER_ATTRIBUTES
-
-
-
- -

-HOLD_JOB

-
-public static final int HOLD_JOB
-
-
-
- -

-RELEASE_JOB

-
-public static final int RELEASE_JOB
-
-
-
- -

-RESTART_JOB

-
-public static final int RESTART_JOB
-
-
-
- -

-PAUSE_PRINTER

-
-public static final int PAUSE_PRINTER
-
-
-
- -

-RESUME_PRINTER

-
-public static final int RESUME_PRINTER
-
-
-
- -

-PURGE_JOBS

-
-public static final int PURGE_JOBS
-
-
-
- -

-SET_PRINTER_ATTRIBUTES

-
-public static final int SET_PRINTER_ATTRIBUTES
-
-
-
- -

-SET_JOB_ATTRIBUTES

-
-public static final int SET_JOB_ATTRIBUTES
-
-
-
- -

-GET_PRINTER_SUPPORTED_VALUES

-
-public static final int GET_PRINTER_SUPPORTED_VALUES
-
-
-
- -

-CREATE_PRINTER_SUBSCRIPTION

-
-public static final int CREATE_PRINTER_SUBSCRIPTION
-
-
-
- -

-CREATE_JOB_SUBSCRIPTION

-
-public static final int CREATE_JOB_SUBSCRIPTION
-
-
-
- -

-GET_SUBSCRIPTION_ATTRIBUTES

-
-public static final int GET_SUBSCRIPTION_ATTRIBUTES
-
-
-
- -

-GET_SUBSCRIPTIONS

-
-public static final int GET_SUBSCRIPTIONS
-
-
-
- -

-RENEW_SUBSCRIPTION

-
-public static final int RENEW_SUBSCRIPTION
-
-
-
- -

-CANCEL_SUBSCRIPTION

-
-public static final int CANCEL_SUBSCRIPTION
-
-
-
- -

-GET_NOTIFICATIONS

-
-public static final int GET_NOTIFICATIONS
-
-
-
- -

-SEND_NOTIFICATIONS

-
-public static final int SEND_NOTIFICATIONS
-
-
-
- -

-GET_PRINT_SUPPORT_FILES

-
-public static final int GET_PRINT_SUPPORT_FILES
-
-
-
- -

-ENABLE_PRINTER

-
-public static final int ENABLE_PRINTER
-
-
-
- -

-DISABLE_PRINTER

-
-public static final int DISABLE_PRINTER
-
-
-
- -

-PAUSE_PRINTER_AFTER_CURRENT_JOB

-
-public static final int PAUSE_PRINTER_AFTER_CURRENT_JOB
-
-
-
- -

-HOLD_NEW_JOBS

-
-public static final int HOLD_NEW_JOBS
-
-
-
- -

-RELEASE_HELD_NEW_JOBS

-
-public static final int RELEASE_HELD_NEW_JOBS
-
-
-
- -

-DEACTIVATE_PRINTER

-
-public static final int DEACTIVATE_PRINTER
-
-
-
- -

-ACTIVATE_PRINTER

-
-public static final int ACTIVATE_PRINTER
-
-
-
- -

-RESTART_PRINTER

-
-public static final int RESTART_PRINTER
-
-
-
- -

-SHUTDOWN_PRINTER

-
-public static final int SHUTDOWN_PRINTER
-
-
-
- -

-STARTUP_PRINTER

-
-public static final int STARTUP_PRINTER
-
-
-
- -

-REPROCESS_JOB

-
-public static final int REPROCESS_JOB
-
-
-
- -

-CANCEL_CURRENT_JOB

-
-public static final int CANCEL_CURRENT_JOB
-
-
-
- -

-SUSPEND_CURRENT_JOB

-
-public static final int SUSPEND_CURRENT_JOB
-
-
-
- -

-RESUME_JOB

-
-public static final int RESUME_JOB
-
-
-
- -

-PROMOTE_JOB

-
-public static final int PROMOTE_JOB
-
-
-
- -

-SCHEDULE_JOB_AFTER

-
-public static final int SCHEDULE_JOB_AFTER
-
-
-
- -

-PRIVATE

-
-public static final int PRIVATE
-
-
-
- -

-CUPS_GET_DEFAULT

-
-public static final int CUPS_GET_DEFAULT
-
-
-
- -

-CUPS_GET_PRINTERS

-
-public static final int CUPS_GET_PRINTERS
-
-
-
- -

-CUPS_ADD_PRINTER

-
-public static final int CUPS_ADD_PRINTER
-
-
-
- -

-CUPS_DELETE_PRINTER

-
-public static final int CUPS_DELETE_PRINTER
-
-
-
- -

-CUPS_GET_CLASSES

-
-public static final int CUPS_GET_CLASSES
-
-
-
- -

-CUPS_ADD_CLASS

-
-public static final int CUPS_ADD_CLASS
-
-
-
- -

-CUPS_DELETE_CLASS

-
-public static final int CUPS_DELETE_CLASS
-
-
-
- -

-CUPS_ACCEPT_JOBS

-
-public static final int CUPS_ACCEPT_JOBS
-
-
-
- -

-CUPS_REJECT_JOBS

-
-public static final int CUPS_REJECT_JOBS
-
-
-
- -

-CUPS_SET_DEFAULT

-
-public static final int CUPS_SET_DEFAULT
-
-
-
- -

-CUPS_GET_DEVICES

-
-public static final int CUPS_GET_DEVICES
-
-
-
- -

-CUPS_GET_PPDS

-
-public static final int CUPS_GET_PPDS
-
-
-
- -

-CUPS_MOVE_JOB

-
-public static final int CUPS_MOVE_JOB
-
-
-
- -

-CUPS_ADD_DEVICE

-
-public static final int CUPS_ADD_DEVICE
-
-
-
- -

-CUPS_DELETE_DEVICE

-
-public static final int CUPS_DELETE_DEVICE
-
-
-
- -

-OK

-
-public static final int OK
-
-
-
- -

-OK_SUBST

-
-public static final int OK_SUBST
-
-
-
- -

-OK_CONFLICT

-
-public static final int OK_CONFLICT
-
-
-
- -

-OK_IGNORED_SUBSCRIPTIONS

-
-public static final int OK_IGNORED_SUBSCRIPTIONS
-
-
-
- -

-OK_IGNORED_NOTIFICATIONS

-
-public static final int OK_IGNORED_NOTIFICATIONS
-
-
-
- -

-OK_TOO_MANY_EVENTS

-
-public static final int OK_TOO_MANY_EVENTS
-
-
-
- -

-OK_BUT_CANCEL_SUBSCRIPTION

-
-public static final int OK_BUT_CANCEL_SUBSCRIPTION
-
-
-
- -

-REDIRECTION_OTHER_SITE

-
-public static final int REDIRECTION_OTHER_SITE
-
-
-
- -

-BAD_REQUEST

-
-public static final int BAD_REQUEST
-
-
-
- -

-FORBIDDEN

-
-public static final int FORBIDDEN
-
-
-
- -

-NOT_AUTHENTICATED

-
-public static final int NOT_AUTHENTICATED
-
-
-
- -

-NOT_AUTHORIZED

-
-public static final int NOT_AUTHORIZED
-
-
-
- -

-NOT_POSSIBLE

-
-public static final int NOT_POSSIBLE
-
-
-
- -

-TIMEOUT

-
-public static final int TIMEOUT
-
-
-
- -

-NOT_FOUND

-
-public static final int NOT_FOUND
-
-
-
- -

-GONE

-
-public static final int GONE
-
-
-
- -

-REQUEST_ENTITY

-
-public static final int REQUEST_ENTITY
-
-
-
- -

-REQUEST_VALUE

-
-public static final int REQUEST_VALUE
-
-
-
- -

-DOCUMENT_FORMAT

-
-public static final int DOCUMENT_FORMAT
-
-
-
- -

-ATTRIBUTES

-
-public static final int ATTRIBUTES
-
-
-
- -

-URI_SCHEME

-
-public static final int URI_SCHEME
-
-
-
- -

-CHARSET

-
-public static final int CHARSET
-
-
-
- -

-CONFLICT

-
-public static final int CONFLICT
-
-
-
- -

-COMPRESSION_NOT_SUPPORTED

-
-public static final int COMPRESSION_NOT_SUPPORTED
-
-
-
- -

-COMPRESSION_ERROR

-
-public static final int COMPRESSION_ERROR
-
-
-
- -

-DOCUMENT_FORMAT_ERROR

-
-public static final int DOCUMENT_FORMAT_ERROR
-
-
-
- -

-DOCUMENT_ACCESS_ERROR

-
-public static final int DOCUMENT_ACCESS_ERROR
-
-
-
- -

-ATTRIBUTES_NOT_SETTABLE

-
-public static final int ATTRIBUTES_NOT_SETTABLE
-
-
-
- -

-IGNORED_ALL_SUBSCRIPTIONS

-
-public static final int IGNORED_ALL_SUBSCRIPTIONS
-
-
-
- -

-TOO_MANY_SUBSCRIPTIONS

-
-public static final int TOO_MANY_SUBSCRIPTIONS
-
-
-
- -

-IGNORED_ALL_NOTIFICATIONS

-
-public static final int IGNORED_ALL_NOTIFICATIONS
-
-
-
- -

-PRINT_SUPPORT_FILE_NOT_FOUND

-
-public static final int PRINT_SUPPORT_FILE_NOT_FOUND
-
-
-
- -

-INTERNAL_ERROR

-
-public static final int INTERNAL_ERROR
-
-
-
- -

-OPERATION_NOT_SUPPORTED

-
-public static final int OPERATION_NOT_SUPPORTED
-
-
-
- -

-SERVICE_UNAVAILABLE

-
-public static final int SERVICE_UNAVAILABLE
-
-
-
- -

-VERSION_NOT_SUPPORTED

-
-public static final int VERSION_NOT_SUPPORTED
-
-
-
- -

-DEVICE_ERROR

-
-public static final int DEVICE_ERROR
-
-
-
- -

-TEMPORARY_ERROR

-
-public static final int TEMPORARY_ERROR
-
-
-
- -

-NOT_ACCEPTING

-
-public static final int NOT_ACCEPTING
-
-
-
- -

-PRINTER_BUSY

-
-public static final int PRINTER_BUSY
-
-
-
- -

-ERROR_JOB_CANCELLED

-
-public static final int ERROR_JOB_CANCELLED
-
-
-
- -

-MULTIPLE_JOBS_NOT_SUPPORTED

-
-public static final int MULTIPLE_JOBS_NOT_SUPPORTED
-
-
-
- -

-PRINTER_IS_DEACTIVATED

-
-public static final int PRINTER_IS_DEACTIVATED
-
-
- - - - - - - - -
-Constructor Detail
- -

-IPPDefs

-
-public IPPDefs()
-
-
- - - - -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/com/easysw/cups/IPPError.html b/scripting/java/docs/com/easysw/cups/IPPError.html deleted file mode 100644 index 395f43759..000000000 --- a/scripting/java/docs/com/easysw/cups/IPPError.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - -: Class IPPError - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class IPPError

-
-java.lang.Object
-  |
-  +--com.easysw.cups.IPPError
-
-
-
-
public class IPPError
extends java.lang.Object
- -

-


- -

- - - - - - - - - - - - - - - - -
-Constructor Summary
IPPError(int p_error) - -
-          Constructor that sets error_string after creation.
-  - - - - - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-IPPError

-
-public IPPError(int p_error)
-
-
Constructor that sets error_string after creation.
-
Parameters:
error_number - Error number to convert.
See Also:
IPPDefs
-
-
- - - - -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/com/easysw/cups/IPPHttp.html b/scripting/java/docs/com/easysw/cups/IPPHttp.html deleted file mode 100644 index 2e6befb65..000000000 --- a/scripting/java/docs/com/easysw/cups/IPPHttp.html +++ /dev/null @@ -1,2596 +0,0 @@ - - - - - - -: Class IPPHttp - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class IPPHttp

-
-java.lang.Object
-  |
-  +--com.easysw.cups.IPPHttp
-
-
-
-
public class IPPHttp
extends java.lang.Object
- -

-


- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Field Summary
- intactivity - -
-           
- java.lang.Stringauth_type - -
-           
- java.io.BufferedReaderbr - -
-           
- java.net.Socketconn - -
-           
- booleanconnected - -
-           
-static java.lang.String[]days - -
-           
- interror - -
-           
- java.lang.Stringhostname - -
-           
-static intHTTP_0_9 - -
-           
-static intHTTP_1_0 - -
-           
-static intHTTP_1_1 - -
-           
-static intHTTP_ACCEPTED - -
-           
-static intHTTP_AUTH_BASIC - -
-           
-static intHTTP_AUTH_MD5 - -
-           
-static intHTTP_AUTH_MD5_INT - -
-           
-static intHTTP_AUTH_MD5_SESS - -
-           
-static intHTTP_AUTH_MD5_SESS_INT - -
-           
-static intHTTP_AUTH_NONE - -
-           
-static intHTTP_BAD_GATEWAY - -
-           
-static intHTTP_BAD_REQUEST - -
-           
-static intHTTP_CLOSE - -
-           
-static intHTTP_CONFLICT - -
-           
- inthttp_content_length - -
-           
-static intHTTP_CONTINUE - -
-           
-static intHTTP_CREATED - -
-           
-static intHTTP_DELETE - -
-           
-static intHTTP_ENCODE_CHUNKED - -
-           
-static intHTTP_ENCODE_LENGTH - -
-           
-static intHTTP_ENCRYPT_ALWAYS - -
-           
-static intHTTP_ENCRYPT_IF_REQUESTED - -
-           
-static intHTTP_ENCRYPT_NEVER - -
-           
-static intHTTP_ENCRYPT_REQUIRED - -
-           
-static intHTTP_ERROR - -
-           
-static intHTTP_FIELD_ACCEPT_LANGUAGE - -
-           
-static intHTTP_FIELD_ACCEPT_RANGES - -
-           
-static intHTTP_FIELD_AUTHORIZATION - -
-           
-static intHTTP_FIELD_CONNECTION - -
-           
-static intHTTP_FIELD_CONTENT_ENCODING - -
-           
-static intHTTP_FIELD_CONTENT_LANGUAGE - -
-           
-static intHTTP_FIELD_CONTENT_LENGTH - -
-           
-static intHTTP_FIELD_CONTENT_LOCATION - -
-           
-static intHTTP_FIELD_CONTENT_MD5 - -
-           
-static intHTTP_FIELD_CONTENT_RANGE - -
-           
-static intHTTP_FIELD_CONTENT_TYPE - -
-           
-static intHTTP_FIELD_CONTENT_VERSION - -
-           
-static intHTTP_FIELD_DATE - -
-           
-static intHTTP_FIELD_HOST - -
-           
-static intHTTP_FIELD_IF_MODIFIED_SINCE - -
-           
-static intHTTP_FIELD_IF_UNMODIFIED_SINCE - -
-           
-static intHTTP_FIELD_KEEP_ALIVE - -
-           
-static intHTTP_FIELD_LAST_MODIFIED - -
-           
-static intHTTP_FIELD_LINK - -
-           
-static intHTTP_FIELD_LOCATION - -
-           
-static intHTTP_FIELD_MAX - -
-           
-static intHTTP_FIELD_RANGE - -
-           
-static intHTTP_FIELD_REFERER - -
-           
-static intHTTP_FIELD_RETRY_AFTER - -
-           
-static intHTTP_FIELD_TRANSFER_ENCODING - -
-           
-static intHTTP_FIELD_UNKNOWN - -
-           
-static intHTTP_FIELD_UPGRADE - -
-           
-static intHTTP_FIELD_USER_AGENT - -
-           
-static intHTTP_FIELD_WWW_AUTHENTICATE - -
-           
-static java.lang.String[]http_fields - -
-           
-static intHTTP_FORBIDDEN - -
-           
-static intHTTP_GATEWAY_TIMEOUT - -
-           
-static intHTTP_GET - -
-           
-static intHTTP_GET_SEND - -
-           
-static intHTTP_GONE - -
-           
-static intHTTP_HEAD - -
-           
-static intHTTP_KEEPALIVE_OFF - -
-           
-static intHTTP_KEEPALIVE_ON - -
-           
-static intHTTP_LENGTH_REQUIRED - -
-           
-static intHTTP_METHOD_NOT_ALLOWED - -
-           
-static intHTTP_MOVED_PERMANENTLY - -
-           
-static intHTTP_MOVED_TEMPORARILY - -
-           
-static intHTTP_MULTIPLE_CHOICES - -
-           
-static intHTTP_NO_CONTENT - -
-           
-static intHTTP_NOT_ACCEPTABLE - -
-           
-static intHTTP_NOT_AUTHORITATIVE - -
-           
-static intHTTP_NOT_FOUND - -
-           
-static intHTTP_NOT_IMPLEMENTED - -
-           
-static intHTTP_NOT_MODIFIED - -
-           
-static intHTTP_NOT_SUPPORTED - -
-           
-static intHTTP_OK - -
-           
-static intHTTP_OPTIONS - -
-           
-static intHTTP_PARTIAL_CONTENT - -
-           
-static intHTTP_PAYMENT_REQUIRED - -
-           
-static intHTTP_POST - -
-           
-static intHTTP_POST_RECV - -
-           
-static intHTTP_POST_SEND - -
-           
-static intHTTP_PRECONDITION - -
-           
-static intHTTP_PROXY_AUTHENTICATION - -
-           
-static intHTTP_PUT - -
-           
-static intHTTP_PUT_RECV - -
-           
- java.lang.Stringhttp_request - -
-           
-static intHTTP_REQUEST_TIMEOUT - -
-           
-static intHTTP_REQUEST_TOO_LARGE - -
-           
-static intHTTP_RESET_CONTENT - -
-           
-static intHTTP_SEE_OTHER - -
-           
-static intHTTP_SERVER_ERROR - -
-           
-static intHTTP_SERVICE_UNAVAILABLE - -
-           
-static intHTTP_STATUS - -
-           
-static intHTTP_SWITCHING_PROTOCOLS - -
-           
-static intHTTP_TRACE - -
-           
-static intHTTP_UNAUTHORIZED - -
-           
-static intHTTP_UNSUPPORTED_MEDIATYPE - -
-           
-static intHTTP_UPGRADE_REQUIRED - -
-           
-static intHTTP_URI_TOO_LONG - -
-           
-static intHTTP_USE_PROXY - -
-           
-static intHTTP_WAITING - -
-          Class constants - most not in use yet.
- java.io.BufferedInputStreamis - -
-           
- java.lang.Stringmethod - -
-           
-static java.lang.String[]months - -
-           
- java.lang.Stringnonce - -
-           
- java.lang.Stringopaque - -
-           
- java.io.BufferedOutputStreamos - -
-           
- java.lang.Stringpasswd - -
-           
- java.lang.Stringpath - -
-           
- intport - -
-           
- char[]read_buffer - -
-           
- java.lang.Stringread_header_charset - -
-           
- java.lang.Stringread_header_content_language - -
-           
- intread_header_content_length - -
-           
- java.lang.Stringread_header_content_type - -
-           
- java.lang.Stringread_header_date - -
-           
- java.lang.Stringread_header_server - -
-           
- java.lang.Stringrealm - -
-           
- java.lang.Stringresource - -
-           
- intstatus - -
-           
- java.lang.Stringstatus_text - -
-           
- java.lang.Stringuser - -
-           
- java.lang.Stringversion - -
-           
- intwrite_content_length - -
-           
-  - - - - - - - - - - - - - -
-Constructor Summary
IPPHttp(java.lang.String request_url) - -
-          Constructor using URL.
IPPHttp(java.lang.String request_url, - java.lang.String p_auth_type, - java.lang.String p_user, - java.lang.String p_passwd) - -
-          Constructor using URL, user and pass.
-  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Method Summary
- intcheckForResponse() - -
-           
- voidparseAuthenticate(java.lang.String p_auth) - -
-           
- IPPprocessResponse() - -
-          Process the HTTP response from the server.
- intread_header() - -
-          Read the HTTP header from the input stream.
- java.lang.Stringread_line() - -
-          Read a line from the input stream.
- char[]read(int count) - -
-          Read up to count bytes from the input stream.
- booleanreConnect() - -
-          Re-establish a dropped connection.
- voidsetPassword(java.lang.String p_passwd) - -
-          Set the password.
- voidsetUser(java.lang.String p_user) - -
-          Set the user name.
- voidwrite(byte[] bytes) - -
-          Write bytes to the output stream.
- voidwrite(byte[] bytes, - int length) - -
-          Write bytes to the output stream.
- intwriteHeader(java.lang.String request, - int content_length) - -
-          Write the request header bytes to the server.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - -
-Field Detail
- -

-HTTP_WAITING

-
-public static final int HTTP_WAITING
-
-
Class constants - most not in use yet.
-
- -

-HTTP_OPTIONS

-
-public static final int HTTP_OPTIONS
-
-
-
- -

-HTTP_GET

-
-public static final int HTTP_GET
-
-
-
- -

-HTTP_GET_SEND

-
-public static final int HTTP_GET_SEND
-
-
-
- -

-HTTP_HEAD

-
-public static final int HTTP_HEAD
-
-
-
- -

-HTTP_POST

-
-public static final int HTTP_POST
-
-
-
- -

-HTTP_POST_RECV

-
-public static final int HTTP_POST_RECV
-
-
-
- -

-HTTP_POST_SEND

-
-public static final int HTTP_POST_SEND
-
-
-
- -

-HTTP_PUT

-
-public static final int HTTP_PUT
-
-
-
- -

-HTTP_PUT_RECV

-
-public static final int HTTP_PUT_RECV
-
-
-
- -

-HTTP_DELETE

-
-public static final int HTTP_DELETE
-
-
-
- -

-HTTP_TRACE

-
-public static final int HTTP_TRACE
-
-
-
- -

-HTTP_CLOSE

-
-public static final int HTTP_CLOSE
-
-
-
- -

-HTTP_STATUS

-
-public static final int HTTP_STATUS
-
-
-
- -

-HTTP_0_9

-
-public static final int HTTP_0_9
-
-
-
- -

-HTTP_1_0

-
-public static final int HTTP_1_0
-
-
-
- -

-HTTP_1_1

-
-public static final int HTTP_1_1
-
-
-
- -

-HTTP_KEEPALIVE_OFF

-
-public static final int HTTP_KEEPALIVE_OFF
-
-
-
- -

-HTTP_KEEPALIVE_ON

-
-public static final int HTTP_KEEPALIVE_ON
-
-
-
- -

-HTTP_ENCODE_LENGTH

-
-public static final int HTTP_ENCODE_LENGTH
-
-
-
- -

-HTTP_ENCODE_CHUNKED

-
-public static final int HTTP_ENCODE_CHUNKED
-
-
-
- -

-HTTP_ENCRYPT_IF_REQUESTED

-
-public static final int HTTP_ENCRYPT_IF_REQUESTED
-
-
-
- -

-HTTP_ENCRYPT_NEVER

-
-public static final int HTTP_ENCRYPT_NEVER
-
-
-
- -

-HTTP_ENCRYPT_REQUIRED

-
-public static final int HTTP_ENCRYPT_REQUIRED
-
-
-
- -

-HTTP_ENCRYPT_ALWAYS

-
-public static final int HTTP_ENCRYPT_ALWAYS
-
-
-
- -

-HTTP_AUTH_NONE

-
-public static final int HTTP_AUTH_NONE
-
-
-
- -

-HTTP_AUTH_BASIC

-
-public static final int HTTP_AUTH_BASIC
-
-
-
- -

-HTTP_AUTH_MD5

-
-public static final int HTTP_AUTH_MD5
-
-
-
- -

-HTTP_AUTH_MD5_SESS

-
-public static final int HTTP_AUTH_MD5_SESS
-
-
-
- -

-HTTP_AUTH_MD5_INT

-
-public static final int HTTP_AUTH_MD5_INT
-
-
-
- -

-HTTP_AUTH_MD5_SESS_INT

-
-public static final int HTTP_AUTH_MD5_SESS_INT
-
-
-
- -

-HTTP_ERROR

-
-public static final int HTTP_ERROR
-
-
-
- -

-HTTP_CONTINUE

-
-public static final int HTTP_CONTINUE
-
-
-
- -

-HTTP_SWITCHING_PROTOCOLS

-
-public static final int HTTP_SWITCHING_PROTOCOLS
-
-
-
- -

-HTTP_OK

-
-public static final int HTTP_OK
-
-
-
- -

-HTTP_CREATED

-
-public static final int HTTP_CREATED
-
-
-
- -

-HTTP_ACCEPTED

-
-public static final int HTTP_ACCEPTED
-
-
-
- -

-HTTP_NOT_AUTHORITATIVE

-
-public static final int HTTP_NOT_AUTHORITATIVE
-
-
-
- -

-HTTP_NO_CONTENT

-
-public static final int HTTP_NO_CONTENT
-
-
-
- -

-HTTP_RESET_CONTENT

-
-public static final int HTTP_RESET_CONTENT
-
-
-
- -

-HTTP_PARTIAL_CONTENT

-
-public static final int HTTP_PARTIAL_CONTENT
-
-
-
- -

-HTTP_MULTIPLE_CHOICES

-
-public static final int HTTP_MULTIPLE_CHOICES
-
-
-
- -

-HTTP_MOVED_PERMANENTLY

-
-public static final int HTTP_MOVED_PERMANENTLY
-
-
-
- -

-HTTP_MOVED_TEMPORARILY

-
-public static final int HTTP_MOVED_TEMPORARILY
-
-
-
- -

-HTTP_SEE_OTHER

-
-public static final int HTTP_SEE_OTHER
-
-
-
- -

-HTTP_NOT_MODIFIED

-
-public static final int HTTP_NOT_MODIFIED
-
-
-
- -

-HTTP_USE_PROXY

-
-public static final int HTTP_USE_PROXY
-
-
-
- -

-HTTP_BAD_REQUEST

-
-public static final int HTTP_BAD_REQUEST
-
-
-
- -

-HTTP_UNAUTHORIZED

-
-public static final int HTTP_UNAUTHORIZED
-
-
-
- -

-HTTP_PAYMENT_REQUIRED

-
-public static final int HTTP_PAYMENT_REQUIRED
-
-
-
- -

-HTTP_FORBIDDEN

-
-public static final int HTTP_FORBIDDEN
-
-
-
- -

-HTTP_NOT_FOUND

-
-public static final int HTTP_NOT_FOUND
-
-
-
- -

-HTTP_METHOD_NOT_ALLOWED

-
-public static final int HTTP_METHOD_NOT_ALLOWED
-
-
-
- -

-HTTP_NOT_ACCEPTABLE

-
-public static final int HTTP_NOT_ACCEPTABLE
-
-
-
- -

-HTTP_PROXY_AUTHENTICATION

-
-public static final int HTTP_PROXY_AUTHENTICATION
-
-
-
- -

-HTTP_REQUEST_TIMEOUT

-
-public static final int HTTP_REQUEST_TIMEOUT
-
-
-
- -

-HTTP_CONFLICT

-
-public static final int HTTP_CONFLICT
-
-
-
- -

-HTTP_GONE

-
-public static final int HTTP_GONE
-
-
-
- -

-HTTP_LENGTH_REQUIRED

-
-public static final int HTTP_LENGTH_REQUIRED
-
-
-
- -

-HTTP_PRECONDITION

-
-public static final int HTTP_PRECONDITION
-
-
-
- -

-HTTP_REQUEST_TOO_LARGE

-
-public static final int HTTP_REQUEST_TOO_LARGE
-
-
-
- -

-HTTP_URI_TOO_LONG

-
-public static final int HTTP_URI_TOO_LONG
-
-
-
- -

-HTTP_UNSUPPORTED_MEDIATYPE

-
-public static final int HTTP_UNSUPPORTED_MEDIATYPE
-
-
-
- -

-HTTP_UPGRADE_REQUIRED

-
-public static final int HTTP_UPGRADE_REQUIRED
-
-
-
- -

-HTTP_SERVER_ERROR

-
-public static final int HTTP_SERVER_ERROR
-
-
-
- -

-HTTP_NOT_IMPLEMENTED

-
-public static final int HTTP_NOT_IMPLEMENTED
-
-
-
- -

-HTTP_BAD_GATEWAY

-
-public static final int HTTP_BAD_GATEWAY
-
-
-
- -

-HTTP_SERVICE_UNAVAILABLE

-
-public static final int HTTP_SERVICE_UNAVAILABLE
-
-
-
- -

-HTTP_GATEWAY_TIMEOUT

-
-public static final int HTTP_GATEWAY_TIMEOUT
-
-
-
- -

-HTTP_NOT_SUPPORTED

-
-public static final int HTTP_NOT_SUPPORTED
-
-
-
- -

-HTTP_FIELD_UNKNOWN

-
-public static final int HTTP_FIELD_UNKNOWN
-
-
-
- -

-HTTP_FIELD_ACCEPT_LANGUAGE

-
-public static final int HTTP_FIELD_ACCEPT_LANGUAGE
-
-
-
- -

-HTTP_FIELD_ACCEPT_RANGES

-
-public static final int HTTP_FIELD_ACCEPT_RANGES
-
-
-
- -

-HTTP_FIELD_AUTHORIZATION

-
-public static final int HTTP_FIELD_AUTHORIZATION
-
-
-
- -

-HTTP_FIELD_CONNECTION

-
-public static final int HTTP_FIELD_CONNECTION
-
-
-
- -

-HTTP_FIELD_CONTENT_ENCODING

-
-public static final int HTTP_FIELD_CONTENT_ENCODING
-
-
-
- -

-HTTP_FIELD_CONTENT_LANGUAGE

-
-public static final int HTTP_FIELD_CONTENT_LANGUAGE
-
-
-
- -

-HTTP_FIELD_CONTENT_LENGTH

-
-public static final int HTTP_FIELD_CONTENT_LENGTH
-
-
-
- -

-HTTP_FIELD_CONTENT_LOCATION

-
-public static final int HTTP_FIELD_CONTENT_LOCATION
-
-
-
- -

-HTTP_FIELD_CONTENT_MD5

-
-public static final int HTTP_FIELD_CONTENT_MD5
-
-
-
- -

-HTTP_FIELD_CONTENT_RANGE

-
-public static final int HTTP_FIELD_CONTENT_RANGE
-
-
-
- -

-HTTP_FIELD_CONTENT_TYPE

-
-public static final int HTTP_FIELD_CONTENT_TYPE
-
-
-
- -

-HTTP_FIELD_CONTENT_VERSION

-
-public static final int HTTP_FIELD_CONTENT_VERSION
-
-
-
- -

-HTTP_FIELD_DATE

-
-public static final int HTTP_FIELD_DATE
-
-
-
- -

-HTTP_FIELD_HOST

-
-public static final int HTTP_FIELD_HOST
-
-
-
- -

-HTTP_FIELD_IF_MODIFIED_SINCE

-
-public static final int HTTP_FIELD_IF_MODIFIED_SINCE
-
-
-
- -

-HTTP_FIELD_IF_UNMODIFIED_SINCE

-
-public static final int HTTP_FIELD_IF_UNMODIFIED_SINCE
-
-
-
- -

-HTTP_FIELD_KEEP_ALIVE

-
-public static final int HTTP_FIELD_KEEP_ALIVE
-
-
-
- -

-HTTP_FIELD_LAST_MODIFIED

-
-public static final int HTTP_FIELD_LAST_MODIFIED
-
-
-
- -

-HTTP_FIELD_LINK

-
-public static final int HTTP_FIELD_LINK
-
-
-
- -

-HTTP_FIELD_LOCATION

-
-public static final int HTTP_FIELD_LOCATION
-
-
-
- -

-HTTP_FIELD_RANGE

-
-public static final int HTTP_FIELD_RANGE
-
-
-
- -

-HTTP_FIELD_REFERER

-
-public static final int HTTP_FIELD_REFERER
-
-
-
- -

-HTTP_FIELD_RETRY_AFTER

-
-public static final int HTTP_FIELD_RETRY_AFTER
-
-
-
- -

-HTTP_FIELD_TRANSFER_ENCODING

-
-public static final int HTTP_FIELD_TRANSFER_ENCODING
-
-
-
- -

-HTTP_FIELD_UPGRADE

-
-public static final int HTTP_FIELD_UPGRADE
-
-
-
- -

-HTTP_FIELD_USER_AGENT

-
-public static final int HTTP_FIELD_USER_AGENT
-
-
-
- -

-HTTP_FIELD_WWW_AUTHENTICATE

-
-public static final int HTTP_FIELD_WWW_AUTHENTICATE
-
-
-
- -

-HTTP_FIELD_MAX

-
-public static final int HTTP_FIELD_MAX
-
-
-
- -

-http_fields

-
-public static final java.lang.String[] http_fields
-
-
-
- -

-days

-
-public static final java.lang.String[] days
-
-
-
- -

-months

-
-public static final java.lang.String[] months
-
-
-
- -

-conn

-
-public java.net.Socket conn
-
-
-
- -

-connected

-
-public boolean connected
-
-
-
- -

-is

-
-public java.io.BufferedInputStream is
-
-
-
- -

-br

-
-public java.io.BufferedReader br
-
-
-
- -

-os

-
-public java.io.BufferedOutputStream os
-
-
-
- -

-write_content_length

-
-public int write_content_length
-
-
-
- -

-read_header_date

-
-public java.lang.String read_header_date
-
-
-
- -

-read_header_server

-
-public java.lang.String read_header_server
-
-
-
- -

-read_header_charset

-
-public java.lang.String read_header_charset
-
-
-
- -

-read_header_content_language

-
-public java.lang.String read_header_content_language
-
-
-
- -

-read_header_content_type

-
-public java.lang.String read_header_content_type
-
-
-
- -

-read_header_content_length

-
-public int read_header_content_length
-
-
-
- -

-read_buffer

-
-public char[] read_buffer
-
-
-
- -

-status

-
-public int status
-
-
-
- -

-status_text

-
-public java.lang.String status_text
-
-
-
- -

-version

-
-public java.lang.String version
-
-
-
- -

-error

-
-public int error
-
-
-
- -

-activity

-
-public int activity
-
-
-
- -

-hostname

-
-public java.lang.String hostname
-
-
-
- -

-port

-
-public int port
-
-
-
- -

-path

-
-public java.lang.String path
-
-
-
- -

-user

-
-public java.lang.String user
-
-
-
- -

-passwd

-
-public java.lang.String passwd
-
-
-
- -

-auth_type

-
-public java.lang.String auth_type
-
-
-
- -

-realm

-
-public java.lang.String realm
-
-
-
- -

-opaque

-
-public java.lang.String opaque
-
-
-
- -

-nonce

-
-public java.lang.String nonce
-
-
-
- -

-resource

-
-public java.lang.String resource
-
-
-
- -

-method

-
-public java.lang.String method
-
-
-
- -

-http_request

-
-public java.lang.String http_request
-
-
-
- -

-http_content_length

-
-public int http_content_length
-
-
- - - - - - - - -
-Constructor Detail
- -

-IPPHttp

-
-public IPPHttp(java.lang.String request_url)
-        throws java.io.IOException,
-               java.net.UnknownHostException
-
-
Constructor using URL.
-
Parameters:
request_url - URL of server to connect to.
-
-
-
- -

-IPPHttp

-
-public IPPHttp(java.lang.String request_url,
-               java.lang.String p_auth_type,
-               java.lang.String p_user,
-               java.lang.String p_passwd)
-        throws java.io.IOException,
-               java.net.UnknownHostException
-
-
Constructor using URL, user and pass.
-
Parameters:
request_url - URL of server to connect to.
p_auth_type - String basic or digest.
p_user - String User name.
p_passwd - String password.
-
-
- - - - - - - - -
-Method Detail
- -

-reConnect

-
-public boolean reConnect()
-                  throws java.io.IOException
-
-
Re-establish a dropped connection.
-
Returns:
boolean True if connected.
-
-
-
- -

-setUser

-
-public void setUser(java.lang.String p_user)
-
-
Set the user name.
-
Parameters:
p_user - String - user name.
-
-
-
- -

-setPassword

-
-public void setPassword(java.lang.String p_passwd)
-
-
Set the password.
-
Parameters:
p_passwd - String - password.
-
-
-
- -

-writeHeader

-
-public int writeHeader(java.lang.String request,
-                       int content_length)
-                throws java.io.IOException
-
-
Write the request header bytes to the server.
-
Parameters:
request - String - the request.
content_length - int - size of the total request.
-
-
-
- -

-checkForResponse

-
-public int checkForResponse()
-
-
-
- -

-write

-
-public void write(byte[] bytes)
-           throws java.io.IOException
-
-
Write bytes to the output stream.
-
Parameters:
bytes - Array of bytes to write to the stream.
-
-
-
- -

-write

-
-public void write(byte[] bytes,
-                  int length)
-           throws java.io.IOException
-
-
Write bytes to the output stream.
-
Parameters:
bytes - Array of bytes to write to the stream.
length - Number of bytes to write to the stream.
-
-
-
- -

-read_header

-
-public int read_header()
-                throws java.io.IOException
-
-
Read the HTTP header from the input stream.
-
Returns:
int Content length of response.
-
-
-
- -

-read_line

-
-public java.lang.String read_line()
-                           throws java.io.IOException
-
-
Read a line from the input stream.
-
Returns:
String Line read.
-
-
-
- -

-read

-
-public char[] read(int count)
-            throws java.io.IOException
-
-
Read up to count bytes from the input stream.
-
Parameters:
count - Number of bytes to read.
Returns:
char[] Character array of data read.
-
-
-
- -

-processResponse

-
-public IPP processResponse()
-
-
Process the HTTP response from the server.
-
Returns:
IPP IPP object containing response data.
See Also:
IPP, -IPPRequest, -IPPAttribute, -IPPValue, -IPPDefs
-
-
-
- -

-parseAuthenticate

-
-public void parseAuthenticate(java.lang.String p_auth)
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/com/easysw/cups/IPPRequest.html b/scripting/java/docs/com/easysw/cups/IPPRequest.html deleted file mode 100644 index 82361d90f..000000000 --- a/scripting/java/docs/com/easysw/cups/IPPRequest.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - -: Class IPPRequest - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class IPPRequest

-
-java.lang.Object
-  |
-  +--com.easysw.cups.IPPRequest
-
-
-
-
public class IPPRequest
extends java.lang.Object
- -

-An IPPRequest object is used to hold the - status and id's of a request. -

-

-
Since:
JDK1.3
-
-
- -

- - - - - - - - - - - - - - - - - - - -
-Constructor Summary
IPPRequest() - -
-          Constructor
IPPRequest(int p_request_id, - short p_operation_id) - -
-          Constructor using request id and operation id.
-  - - - - - - - - - - - - - - - -
-Method Summary
- voidsetOpStatus(short p_status_code) - -
-          Set the operation status of a request.
- voidsetStatus(short p_status_code) - -
-          Set the current status of a request.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-IPPRequest

-
-public IPPRequest()
-
-
Constructor
-
- -

-IPPRequest

-
-public IPPRequest(int p_request_id,
-                  short p_operation_id)
-
-
Constructor using request id and operation id.
-
Parameters:
p_request_id - ID of request.
p_operation_id - Operation ID for request.
See Also:
IPPDefs
-
-
- - - - - - - - -
-Method Detail
- -

-setStatus

-
-public void setStatus(short p_status_code)
-
-
Set the current status of a request.
-
Parameters:
p_status_code - Status code.
See Also:
IPPDefs
-
-
-
- -

-setOpStatus

-
-public void setOpStatus(short p_status_code)
-
-
Set the operation status of a request.
-
Parameters:
p_status_code - Operation status code.
See Also:
IPPDefs
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/com/easysw/cups/IPPStatus.html b/scripting/java/docs/com/easysw/cups/IPPStatus.html deleted file mode 100644 index ba8bcaad4..000000000 --- a/scripting/java/docs/com/easysw/cups/IPPStatus.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - -: Class IPPStatus - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class IPPStatus

-
-java.lang.Object
-  |
-  +--com.easysw.cups.IPPStatus
-
-
-
-
public class IPPStatus
extends java.lang.Object
- -

-Class to convert a status code to text. -

-

-
Since:
JDK1.3
-
-
- -

- - - - - - - - - - - - - - - - -
-Constructor Summary
IPPStatus(int p_status) - -
-          Constructor, access the status_text member - after creation.
-  - - - - - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-IPPStatus

-
-public IPPStatus(int p_status)
-
-
Constructor, access the status_text member - after creation.
-
Parameters:
p_status - Status code to convert.
See Also:
IPPDefs
-
-
- - - - -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/com/easysw/cups/IPPURLConnection.html b/scripting/java/docs/com/easysw/cups/IPPURLConnection.html deleted file mode 100644 index 3a02e1ae2..000000000 --- a/scripting/java/docs/com/easysw/cups/IPPURLConnection.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - -: Class IPPURLConnection - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class IPPURLConnection

-
-java.lang.Object
-  |
-  +--java.net.URLConnection
-        |
-        +--com.easysw.cups.IPPURLConnection
-
-
-
-
public class IPPURLConnection
extends java.net.URLConnection
- -

-


- -

- - - - - - - - - - - - - -
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
-  - - - - - - - - - - -
-Constructor Summary
IPPURLConnection(java.net.URL url) - -
-          Constructor.
-  - - - - - - - - - - - - - - - - - - - -
-Method Summary
- voidconnect() - -
-          Not used.
- voiddisconnect() - -
-          Not used.
- booleanusingProxy() - -
-          Determine if using proxy.
- - - - - - - -
Methods inherited from class java.net.URLConnection
getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getIfModifiedSince, getInputStream, getLastModified, getOutputStream, getPermission, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setRequestProperty, setUseCaches, toString
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-IPPURLConnection

-
-public IPPURLConnection(java.net.URL url)
-
-
Constructor.
- - - - - - - - -
-Method Detail
- -

-usingProxy

-
-public boolean usingProxy()
-
-
Determine if using proxy.
-
Returns:
boolean Always false for now.
-
-
-
- -

-connect

-
-public void connect()
-
-
Not used.
-
Overrides:
connect in class java.net.URLConnection
-
-
-
- -

-disconnect

-
-public void disconnect()
-
-
Not used.
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/com/easysw/cups/IPPValue.html b/scripting/java/docs/com/easysw/cups/IPPValue.html deleted file mode 100644 index 96df5bc3a..000000000 --- a/scripting/java/docs/com/easysw/cups/IPPValue.html +++ /dev/null @@ -1,376 +0,0 @@ - - - - - - -: Class IPPValue - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -

- -com.easysw.cups -
-Class IPPValue

-
-java.lang.Object
-  |
-  +--com.easysw.cups.IPPValue
-
-
-
-
public class IPPValue
extends java.lang.Object
- -

-


- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Constructor Summary
IPPValue(boolean p_boolean) - -
-          Boolean constructor.
IPPValue(byte p_byte) - -
-          Byte constructor.
IPPValue(byte p_units, - int p_xres, - int p_yres) - -
-          Resolution constructor.
IPPValue(char[] p_date) - -
-          Date constructor.
IPPValue(int p_int) - -
-          Integer constructor.
IPPValue(int p_int, - boolean anything) - -
-          Enum constructor.
IPPValue(int p_length, - char[] p_data) - -
-          Raw data constructor.
IPPValue(int p_lower, - int p_upper) - -
-          Range constructor.
IPPValue(short p_short) - -
-          Short constructor.
IPPValue(java.lang.String p_charset, - java.lang.String p_text) - -
-          String constructor.
-  - - - - - - - - - - - -
-Method Summary
- longIPPDateToTime() - -
-          Convert an IPP Date value to Unix Time.
- - - - - - - -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-  -

- - - - - - - - - - - -
-Constructor Detail
- -

-IPPValue

-
-public IPPValue(byte p_byte)
-
-
Byte constructor.
-
Parameters:
p_byte - Byte value.
-
-
-
- -

-IPPValue

-
-public IPPValue(short p_short)
-
-
Short constructor.
-
Parameters:
p_short - Short value.
-
-
-
- -

-IPPValue

-
-public IPPValue(int p_int)
-
-
Integer constructor.
-
Parameters:
p_int - Integer value.
-
-
-
- -

-IPPValue

-
-public IPPValue(int p_int,
-                boolean anything)
-
-
Enum constructor.
-
Parameters:
p_int - Integer value - force to IPP enum.
-
-
-
- -

-IPPValue

-
-public IPPValue(boolean p_boolean)
-
-
Boolean constructor.
-
Parameters:
p_boolean - Boolean value.
-
-
-
- -

-IPPValue

-
-public IPPValue(char[] p_date)
-
-
Date constructor. Also set the unix_time member.
-
Parameters:
p_date[] - Character array with date value.
-
-
-
- -

-IPPValue

-
-public IPPValue(java.lang.String p_charset,
-                java.lang.String p_text)
-
-
String constructor. Set the string and - charset values.
-
Parameters:
p_charset - Charset for string.
p_text - Text for string.
-
-
-
- -

-IPPValue

-
-public IPPValue(int p_lower,
-                int p_upper)
-
-
Range constructor. Automatically swap as needed.
-
Parameters:
p_lower - Integer lower value.
p_upper - Integer upper value.
-
-
-
- -

-IPPValue

-
-public IPPValue(byte p_units,
-                int p_xres,
-                int p_yres)
-
-
Resolution constructor.
-
Parameters:
p_units - Unit of measure.
p_xres - X resolution.
p_yres - Y resolution.
-
-
-
- -

-IPPValue

-
-public IPPValue(int p_length,
-                char[] p_data)
-
-
Raw data constructor.
-
Parameters:
p_length - Size of array.
p_data[] - Data.
-
-
- - - - - - - - -
-Method Detail
- -

-IPPDateToTime

-
-public long IPPDateToTime()
-
-
Convert an IPP Date value to Unix Time.
-
Returns:
long Unix time in seconds.
See Also:
IPPCalender
-
-
- -
- - - - - - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/deprecated-list.html b/scripting/java/docs/deprecated-list.html deleted file mode 100644 index 3c2bcd94f..000000000 --- a/scripting/java/docs/deprecated-list.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - -: Deprecated List - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Deprecated API

-
-
- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/help-doc.html b/scripting/java/docs/help-doc.html deleted file mode 100644 index e564cd6ef..000000000 --- a/scripting/java/docs/help-doc.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - -: API Help - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-How This API Document Is Organized

-
-This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

-Package

-
- -

-Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    -
  • Interfaces (italic)
  • Classes
  • Exceptions
  • Errors
-
-

-Class/Interface

-
- -

-Each class, interface, inner class and inner interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    -
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description -

    -

  • Inner Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary -

    -

  • Field Detail
  • Constructor Detail
  • Method Detail
-Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
-

-Tree (Class Hierarchy)

-
-There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    -
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
-
-

-Deprecated API

-
-The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
-

-Index

-
-The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
-

-Prev/Next

-These links take you to the next or previous class, interface, package, or related page.

-Frames/No Frames

-These links show and hide the HTML frames. All pages are available with or without frames. -

-

-Serialized Form

-Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. -

- - -This help file applies to API documentation generated using the standard doclet. - -
-


- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/index-all.html b/scripting/java/docs/index-all.html deleted file mode 100644 index 21461d858..000000000 --- a/scripting/java/docs/index-all.html +++ /dev/null @@ -1,1588 +0,0 @@ - - - - - - -: Index - - - - - - - - - - - - - - - - - -
- -
- - -A B C D E F G H I J L M N O P Q R S T U V W
-

-A

-
-
ACTIVATE_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
activity - -Variable in class com.easysw.cups.IPPHttp -
  -
addAttribute(IPPAttribute) - -Method in class com.easysw.cups.IPP -
Add an attribute to the attibutes list - for later parsing. -
addBoolean(boolean) - -Method in class com.easysw.cups.IPPAttribute -
  -
addBooleans(boolean[]) - -Method in class com.easysw.cups.IPPAttribute -
  -
addDate(char[]) - -Method in class com.easysw.cups.IPPAttribute -
  -
addEnum(int) - -Method in class com.easysw.cups.IPPAttribute -
  -
addInteger(int) - -Method in class com.easysw.cups.IPPAttribute -
  -
addIntegers(int[]) - -Method in class com.easysw.cups.IPPAttribute -
  -
addRange(int, int) - -Method in class com.easysw.cups.IPPAttribute -
  -
addRanges(int[], int[]) - -Method in class com.easysw.cups.IPPAttribute -
  -
addResolution(byte, int, int) - -Method in class com.easysw.cups.IPPAttribute -
  -
addResolutions(byte, int[], int[]) - -Method in class com.easysw.cups.IPPAttribute -
  -
addSeparator() - -Method in class com.easysw.cups.IPPAttribute -
  -
addString(String, String) - -Method in class com.easysw.cups.IPPAttribute -
  -
addStrings(String, String[]) - -Method in class com.easysw.cups.IPPAttribute -
  -
ATTRIBUTE - -Static variable in class com.easysw.cups.IPPDefs -
  -
ATTRIBUTES - -Static variable in class com.easysw.cups.IPPDefs -
  -
ATTRIBUTES_NOT_SETTABLE - -Static variable in class com.easysw.cups.IPPDefs -
  -
attrs - -Variable in class com.easysw.cups.IPP -
  -
auth_type - -Variable in class com.easysw.cups.IPPHttp -
  -
-
-

-B

-
-
BAD_REQUEST - -Static variable in class com.easysw.cups.IPPDefs -
  -
br - -Variable in class com.easysw.cups.IPPHttp -
  -
-
-

-C

-
-
CANCEL_CURRENT_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
CANCEL_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
CANCEL_SUBSCRIPTION - -Static variable in class com.easysw.cups.IPPDefs -
  -
CHARSET - -Static variable in class com.easysw.cups.IPPDefs -
  -
checkForResponse() - -Method in class com.easysw.cups.IPPHttp -
  -
com.easysw.cups - package com.easysw.cups
 
COMPRESSION_ERROR - -Static variable in class com.easysw.cups.IPPDefs -
  -
COMPRESSION_NOT_SUPPORTED - -Static variable in class com.easysw.cups.IPPDefs -
  -
CONFLICT - -Static variable in class com.easysw.cups.IPPDefs -
  -
conn - -Variable in class com.easysw.cups.IPPHttp -
  -
connect() - -Method in class com.easysw.cups.IPPURLConnection -
Not used. -
connected - -Variable in class com.easysw.cups.IPPHttp -
  -
CREATE_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
CREATE_JOB_SUBSCRIPTION - -Static variable in class com.easysw.cups.IPPDefs -
  -
CREATE_PRINTER_SUBSCRIPTION - -Static variable in class com.easysw.cups.IPPDefs -
  -
Cups - class com.easysw.cups.Cups.
 
CUPS_ACCEPT_JOBS - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_ADD_CLASS - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_ADD_DEVICE - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_ADD_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_DELETE_CLASS - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_DELETE_DEVICE - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_DELETE_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_GET_CLASSES - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_GET_DEFAULT - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_GET_DEVICES - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_GET_PPDS - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_GET_PRINTERS - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_MOVE_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_REJECT_JOBS - -Static variable in class com.easysw.cups.IPPDefs -
  -
CUPS_SET_DEFAULT - -Static variable in class com.easysw.cups.IPPDefs -
  -
Cups() - -Constructor for class com.easysw.cups.Cups -
Void constructor. -
Cups(URL) - -Constructor for class com.easysw.cups.Cups -
Constructor using a URL. -
cupsCancelJob(String, int, String) - -Method in class com.easysw.cups.Cups -
Cancel a job - send a job cancel request to the server. -
cupsGetDefault() - -Method in class com.easysw.cups.Cups -
Get default destination. -
cupsGetJobs(boolean, boolean) - -Method in class com.easysw.cups.Cups -
Get a list of jobs. -
cupsGetPrinterAttributes(String) - -Method in class com.easysw.cups.Cups -
Get printer attributes -
cupsGetPrinters() - -Method in class com.easysw.cups.Cups -
Get a list of printers. -
cupsGetPrinterStatus(String) - -Method in class com.easysw.cups.Cups -
  -
CupsJob - class com.easysw.cups.CupsJob.
 
CupsJob() - -Constructor for class com.easysw.cups.CupsJob -
Constructor - set some default values. -
CupsPrinter - class com.easysw.cups.CupsPrinter.
 
CupsPrinter(Cups) - -Constructor for class com.easysw.cups.CupsPrinter -
Constructor. -
CupsPrinter(Cups, String) - -Constructor for class com.easysw.cups.CupsPrinter -
Constructor with name. -
cupsPrintFile(String, IPPAttribute[]) - -Method in class com.easysw.cups.Cups -
Print a file. -
-
-

-D

-
-
DATA - -Static variable in class com.easysw.cups.IPPDefs -
  -
days - -Static variable in class com.easysw.cups.IPPHttp -
  -
DEACTIVATE_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
DEVICE_ERROR - -Static variable in class com.easysw.cups.IPPDefs -
  -
DISABLE_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
disconnect() - -Method in class com.easysw.cups.IPPURLConnection -
Not used. -
DOCUMENT_ACCESS_ERROR - -Static variable in class com.easysw.cups.IPPDefs -
  -
document_format - -Variable in class com.easysw.cups.CupsJob -
  -
DOCUMENT_FORMAT - -Static variable in class com.easysw.cups.IPPDefs -
  -
DOCUMENT_FORMAT_ERROR - -Static variable in class com.easysw.cups.IPPDefs -
  -
doRequest() - -Method in class com.easysw.cups.Cups -
Do a CUPS request to the server. -
doRequest(File) - -Method in class com.easysw.cups.Cups -
Send a FILE to the CUPS server. -
doRequest(String) - -Method in class com.easysw.cups.Cups -
  -
dump_response() - -Method in class com.easysw.cups.IPP -
  -
dump_values() - -Method in class com.easysw.cups.IPPAttribute -
  -
-
-

-E

-
-
ENABLE_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
error - -Variable in class com.easysw.cups.IPPHttp -
  -
ERROR - -Static variable in class com.easysw.cups.IPPDefs -
  -
ERROR_JOB_CANCELLED - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-F

-
-
FINISHINGS_BALE - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_BIND - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_BIND_BOTTOM - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_BIND_LEFT - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_BIND_RIGHT - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_BIND_TOP - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_BOOKLET_MAKER - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_COVER - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_EDGE_STITCH - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_EDGE_STITCH_BOTTOM - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_EDGE_STITCH_LEFT - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_EDGE_STITCH_RIGHT - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_EDGE_STITCH_TOP - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_FOLD - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_JOB_OFFSET - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_NONE - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_PUNCH - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_SADDLE_STITCH - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_STAPLE - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_STAPLE_BOTTOM_LEFT - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_STAPLE_BOTTOM_RIGHT - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_STAPLE_DUAL_BOTTOM - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_STAPLE_DUAL_LEFT - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_STAPLE_DUAL_RIGHT - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_STAPLE_DUAL_TOP - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_STAPLE_TOP_LEFT - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_STAPLE_TOP_RIGHT - -Static variable in class com.easysw.cups.IPPDefs -
  -
FINISHINGS_TRIM - -Static variable in class com.easysw.cups.IPPDefs -
  -
FORBIDDEN - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-G

-
-
GET_JOB_ATTRIBUTES - -Static variable in class com.easysw.cups.IPPDefs -
  -
GET_JOBS - -Static variable in class com.easysw.cups.IPPDefs -
  -
GET_NOTIFICATIONS - -Static variable in class com.easysw.cups.IPPDefs -
  -
GET_PRINT_SUPPORT_FILES - -Static variable in class com.easysw.cups.IPPDefs -
  -
GET_PRINTER_ATTRIBUTES - -Static variable in class com.easysw.cups.IPPDefs -
  -
GET_PRINTER_SUPPORTED_VALUES - -Static variable in class com.easysw.cups.IPPDefs -
  -
GET_SUBSCRIPTION_ATTRIBUTES - -Static variable in class com.easysw.cups.IPPDefs -
  -
GET_SUBSCRIPTIONS - -Static variable in class com.easysw.cups.IPPDefs -
  -
getAttributes(Cups) - -Method in class com.easysw.cups.CupsPrinter -
Get the printer's attributes. -
getBytes(int, int) - -Method in class com.easysw.cups.IPPAttribute -
  -
getCopiesDefault() - -Method in class com.easysw.cups.CupsPrinter -
Get the printer number of copies default. -
getCurrentAttribute() - -Method in class com.easysw.cups.IPP -
Get the current attribute pointed at by - current. -
getEncrypt() - -Method in class com.easysw.cups.Cups -
Get the value of the encrypt member. -
getInstance() - -Static method in class com.easysw.cups.IPPMD5 -
This returns the singleton instance -
getJobSheetsDefault() - -Method in class com.easysw.cups.CupsPrinter -
Get the default job sheets. -
getJobSheetsSupported() - -Method in class com.easysw.cups.CupsPrinter -
Get the printer job sheets supported. -
getLocation() - -Method in class com.easysw.cups.CupsPrinter -
Get the printer location. -
getLowerCopiesSupported() - -Method in class com.easysw.cups.CupsPrinter -
Get the printer lower copies supported. -
getMakeAndModel() - -Method in class com.easysw.cups.CupsPrinter -
Get the printer make and model. -
getOrientationDefault() - -Method in class com.easysw.cups.CupsPrinter -
Get the default orientation. -
getOrientationSupported() - -Method in class com.easysw.cups.CupsPrinter -
Get the printer orientation supported. -
getPageRangesSupported() - -Method in class com.easysw.cups.CupsPrinter -
Get whether the printer supports page ranges. -
getPrinterName() - -Method in class com.easysw.cups.CupsPrinter -
Get the printer name. -
getStateReasons() - -Method in class com.easysw.cups.CupsPrinter -
Get the printer state reasons. -
getStateText() - -Method in class com.easysw.cups.CupsPrinter -
Get the printer state text. -
getStatus(Cups) - -Method in class com.easysw.cups.CupsPrinter -
Get the printer's status. -
getUpperCopiesSupported() - -Method in class com.easysw.cups.CupsPrinter -
Get the printer upper copies supported. -
GONE - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-H

-
-
hashData(byte[]) - -Method in class com.easysw.cups.IPPMD5 -
  -
HEADER - -Static variable in class com.easysw.cups.IPPDefs -
  -
hexStringFromBytes(byte[]) - -Method in class com.easysw.cups.IPPMD5 -
  -
HOLD_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
HOLD_NEW_JOBS - -Static variable in class com.easysw.cups.IPPDefs -
  -
hostname - -Variable in class com.easysw.cups.IPPHttp -
  -
HTTP_0_9 - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_1_0 - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_1_1 - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_ACCEPTED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_AUTH_BASIC - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_AUTH_MD5 - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_AUTH_MD5_INT - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_AUTH_MD5_SESS - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_AUTH_MD5_SESS_INT - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_AUTH_NONE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_BAD_GATEWAY - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_BAD_REQUEST - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_CLOSE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_CONFLICT - -Static variable in class com.easysw.cups.IPPHttp -
  -
http_content_length - -Variable in class com.easysw.cups.IPPHttp -
  -
HTTP_CONTINUE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_CREATED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_DELETE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_ENCODE_CHUNKED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_ENCODE_LENGTH - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_ENCRYPT_ALWAYS - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_ENCRYPT_IF_REQUESTED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_ENCRYPT_NEVER - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_ENCRYPT_REQUIRED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_ERROR - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_ACCEPT_LANGUAGE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_ACCEPT_RANGES - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_AUTHORIZATION - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_CONNECTION - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_CONTENT_ENCODING - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_CONTENT_LANGUAGE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_CONTENT_LENGTH - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_CONTENT_LOCATION - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_CONTENT_MD5 - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_CONTENT_RANGE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_CONTENT_TYPE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_CONTENT_VERSION - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_DATE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_HOST - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_IF_MODIFIED_SINCE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_IF_UNMODIFIED_SINCE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_KEEP_ALIVE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_LAST_MODIFIED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_LINK - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_LOCATION - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_MAX - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_RANGE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_REFERER - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_RETRY_AFTER - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_TRANSFER_ENCODING - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_UNKNOWN - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_UPGRADE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_USER_AGENT - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FIELD_WWW_AUTHENTICATE - -Static variable in class com.easysw.cups.IPPHttp -
  -
http_fields - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_FORBIDDEN - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_GATEWAY_TIMEOUT - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_GET - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_GET_SEND - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_GONE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_HEAD - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_KEEPALIVE_OFF - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_KEEPALIVE_ON - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_LENGTH_REQUIRED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_METHOD_NOT_ALLOWED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_MOVED_PERMANENTLY - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_MOVED_TEMPORARILY - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_MULTIPLE_CHOICES - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_NO_CONTENT - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_NOT_ACCEPTABLE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_NOT_AUTHORITATIVE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_NOT_FOUND - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_NOT_IMPLEMENTED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_NOT_MODIFIED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_NOT_SUPPORTED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_OK - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_OPTIONS - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_PARTIAL_CONTENT - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_PAYMENT_REQUIRED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_POST - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_POST_RECV - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_POST_SEND - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_PRECONDITION - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_PROXY_AUTHENTICATION - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_PUT - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_PUT_RECV - -Static variable in class com.easysw.cups.IPPHttp -
  -
http_request - -Variable in class com.easysw.cups.IPPHttp -
  -
HTTP_REQUEST_TIMEOUT - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_REQUEST_TOO_LARGE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_RESET_CONTENT - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_SEE_OTHER - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_SERVER_ERROR - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_SERVICE_UNAVAILABLE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_STATUS - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_SWITCHING_PROTOCOLS - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_TRACE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_UNAUTHORIZED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_UNSUPPORTED_MEDIATYPE - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_UPGRADE_REQUIRED - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_URI_TOO_LONG - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_USE_PROXY - -Static variable in class com.easysw.cups.IPPHttp -
  -
HTTP_WAITING - -Static variable in class com.easysw.cups.IPPHttp -
Class constants - most not in use yet. -
-
-

-I

-
-
IDLE - -Static variable in class com.easysw.cups.IPPDefs -
  -
IGNORED_ALL_NOTIFICATIONS - -Static variable in class com.easysw.cups.IPPDefs -
  -
IGNORED_ALL_SUBSCRIPTIONS - -Static variable in class com.easysw.cups.IPPDefs -
  -
INTERNAL_ERROR - -Static variable in class com.easysw.cups.IPPDefs -
  -
IPP - class com.easysw.cups.IPP.
An IPP object is used to hold the various - attributes and status of an ipp request..
IPP() - -Constructor for class com.easysw.cups.IPP -
  -
IPPAttribute - class com.easysw.cups.IPPAttribute.
 
IPPAttribute(int, int, String) - -Constructor for class com.easysw.cups.IPPAttribute -
  -
IPPDateToTime() - -Method in class com.easysw.cups.IPPValue -
Convert an IPP Date value to Unix Time. -
IPPDefs - class com.easysw.cups.IPPDefs.
IPPDefs is a collection of constants for use - in the IPP and CUPS classes.
IPPDefs() - -Constructor for class com.easysw.cups.IPPDefs -
  -
IPPError - class com.easysw.cups.IPPError.
 
IPPError(int) - -Constructor for class com.easysw.cups.IPPError -
Constructor that sets error_string after creation. -
ippFindAttribute(String, int) - -Method in class com.easysw.cups.IPP -
Find the named attribute of the correct type. -
ippFindNextAttribute(String, int) - -Method in class com.easysw.cups.IPP -
Find the named attribute of the correct type. -
IPPHttp - class com.easysw.cups.IPPHttp.
 
IPPHttp(String) - -Constructor for class com.easysw.cups.IPPHttp -
Constructor using URL. -
IPPHttp(String, String, String, String) - -Constructor for class com.easysw.cups.IPPHttp -
Constructor using URL, user and pass. -
IPPMD5 - class com.easysw.cups.IPPMD5.
 
IPPRequest - class com.easysw.cups.IPPRequest.
An IPPRequest object is used to hold the - status and id's of a request.
IPPRequest() - -Constructor for class com.easysw.cups.IPPRequest -
Constructor -
IPPRequest(int, short) - -Constructor for class com.easysw.cups.IPPRequest -
Constructor using request id and operation id. -
IPPStatus - class com.easysw.cups.IPPStatus.
Class to convert a status code to text.
IPPStatus(int) - -Constructor for class com.easysw.cups.IPPStatus -
Constructor, access the status_text member - after creation. -
IPPURLConnection - class com.easysw.cups.IPPURLConnection.
 
IPPURLConnection(URL) - -Constructor for class com.easysw.cups.IPPURLConnection -
Constructor. -
IPPValue - class com.easysw.cups.IPPValue.
 
IPPValue(boolean) - -Constructor for class com.easysw.cups.IPPValue -
Boolean constructor. -
IPPValue(byte) - -Constructor for class com.easysw.cups.IPPValue -
Byte constructor. -
IPPValue(byte, int, int) - -Constructor for class com.easysw.cups.IPPValue -
Resolution constructor. -
IPPValue(char[]) - -Constructor for class com.easysw.cups.IPPValue -
Date constructor. -
IPPValue(int) - -Constructor for class com.easysw.cups.IPPValue -
Integer constructor. -
IPPValue(int, boolean) - -Constructor for class com.easysw.cups.IPPValue -
Enum constructor. -
IPPValue(int, char[]) - -Constructor for class com.easysw.cups.IPPValue -
Raw data constructor. -
IPPValue(int, int) - -Constructor for class com.easysw.cups.IPPValue -
Range constructor. -
IPPValue(short) - -Constructor for class com.easysw.cups.IPPValue -
Short constructor. -
IPPValue(String, String) - -Constructor for class com.easysw.cups.IPPValue -
String constructor. -
is - -Variable in class com.easysw.cups.IPPHttp -
  -
-
-

-J

-
-
JOB_ABORTED - -Static variable in class com.easysw.cups.IPPDefs -
  -
JOB_CANCELLED - -Static variable in class com.easysw.cups.IPPDefs -
  -
JOB_COMPLETED - -Static variable in class com.easysw.cups.IPPDefs -
  -
JOB_HELD - -Static variable in class com.easysw.cups.IPPDefs -
  -
job_hold_until - -Variable in class com.easysw.cups.CupsJob -
  -
job_id - -Variable in class com.easysw.cups.CupsJob -
  -
job_k_octets - -Variable in class com.easysw.cups.CupsJob -
  -
job_media_sheets_completed - -Variable in class com.easysw.cups.CupsJob -
  -
job_more_info - -Variable in class com.easysw.cups.CupsJob -
  -
job_name - -Variable in class com.easysw.cups.CupsJob -
  -
job_originating_host_name - -Variable in class com.easysw.cups.CupsJob -
  -
job_originating_user_name - -Variable in class com.easysw.cups.CupsJob -
  -
JOB_PENDING - -Static variable in class com.easysw.cups.IPPDefs -
  -
job_printer_up_time - -Variable in class com.easysw.cups.CupsJob -
  -
job_printer_uri - -Variable in class com.easysw.cups.CupsJob -
  -
job_priority - -Variable in class com.easysw.cups.CupsJob -
  -
JOB_PROCESSING - -Static variable in class com.easysw.cups.IPPDefs -
  -
job_sheets - -Variable in class com.easysw.cups.CupsJob -
  -
job_state - -Variable in class com.easysw.cups.CupsJob -
  -
job_state_reasons - -Variable in class com.easysw.cups.CupsJob -
  -
JOB_STOPPED - -Static variable in class com.easysw.cups.IPPDefs -
  -
job_uri - -Variable in class com.easysw.cups.CupsJob -
  -
jobStatusText() - -Method in class com.easysw.cups.CupsJob -
Convert a job status to a string. -
-
-

-L

-
-
LANDSCAPE - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-M

-
-
MAX_NAME - -Static variable in class com.easysw.cups.IPPDefs -
  -
MAX_VALUES - -Static variable in class com.easysw.cups.IPPDefs -
  -
md - -Variable in class com.easysw.cups.IPPMD5 -
  -
MD5Digest(String, String, String, String, String, String) - -Method in class com.easysw.cups.IPPMD5 -
  -
method - -Variable in class com.easysw.cups.IPPHttp -
  -
months - -Static variable in class com.easysw.cups.IPPHttp -
  -
MULTIPLE_JOBS_NOT_SUPPORTED - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-N

-
-
nonce - -Variable in class com.easysw.cups.IPPHttp -
  -
NOT_ACCEPTING - -Static variable in class com.easysw.cups.IPPDefs -
  -
NOT_AUTHENTICATED - -Static variable in class com.easysw.cups.IPPDefs -
  -
NOT_AUTHORIZED - -Static variable in class com.easysw.cups.IPPDefs -
  -
NOT_FOUND - -Static variable in class com.easysw.cups.IPPDefs -
  -
NOT_POSSIBLE - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-O

-
-
OK - -Static variable in class com.easysw.cups.IPPDefs -
  -
OK_BUT_CANCEL_SUBSCRIPTION - -Static variable in class com.easysw.cups.IPPDefs -
  -
OK_CONFLICT - -Static variable in class com.easysw.cups.IPPDefs -
  -
OK_IGNORED_NOTIFICATIONS - -Static variable in class com.easysw.cups.IPPDefs -
  -
OK_IGNORED_SUBSCRIPTIONS - -Static variable in class com.easysw.cups.IPPDefs -
  -
OK_SUBST - -Static variable in class com.easysw.cups.IPPDefs -
  -
OK_TOO_MANY_EVENTS - -Static variable in class com.easysw.cups.IPPDefs -
  -
opaque - -Variable in class com.easysw.cups.IPPHttp -
  -
OPERATION_NOT_SUPPORTED - -Static variable in class com.easysw.cups.IPPDefs -
  -
os - -Variable in class com.easysw.cups.IPPHttp -
  -
-
-

-P

-
-
parseAuthenticate(String) - -Method in class com.easysw.cups.IPPHttp -
  -
passwd - -Variable in class com.easysw.cups.IPPHttp -
  -
path - -Variable in class com.easysw.cups.IPPHttp -
  -
PAUSE_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
PAUSE_PRINTER_AFTER_CURRENT_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
port - -Variable in class com.easysw.cups.IPPHttp -
  -
PORT - -Static variable in class com.easysw.cups.IPPDefs -
  -
PORTRAIT - -Static variable in class com.easysw.cups.IPPDefs -
  -
PRINT_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
PRINT_SUPPORT_FILE_NOT_FOUND - -Static variable in class com.easysw.cups.IPPDefs -
  -
PRINT_URI - -Static variable in class com.easysw.cups.IPPDefs -
  -
PRINTER_BUSY - -Static variable in class com.easysw.cups.IPPDefs -
  -
PRINTER_IDLE - -Static variable in class com.easysw.cups.IPPDefs -
  -
PRINTER_IS_DEACTIVATED - -Static variable in class com.easysw.cups.IPPDefs -
  -
PRINTER_PROCESSING - -Static variable in class com.easysw.cups.IPPDefs -
  -
PRINTER_STOPPED - -Static variable in class com.easysw.cups.IPPDefs -
  -
PRIVATE - -Static variable in class com.easysw.cups.IPPDefs -
  -
processResponse() - -Method in class com.easysw.cups.IPPHttp -
Process the HTTP response from the server. -
PROMOTE_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
PURGE_JOBS - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-Q

-
-
QUALITY_DRAFT - -Static variable in class com.easysw.cups.IPPDefs -
  -
QUALITY_HIGH - -Static variable in class com.easysw.cups.IPPDefs -
  -
QUALITY_NORMAL - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-R

-
-
read_buffer - -Variable in class com.easysw.cups.IPPHttp -
  -
read_header_charset - -Variable in class com.easysw.cups.IPPHttp -
  -
read_header_content_language - -Variable in class com.easysw.cups.IPPHttp -
  -
read_header_content_length - -Variable in class com.easysw.cups.IPPHttp -
  -
read_header_content_type - -Variable in class com.easysw.cups.IPPHttp -
  -
read_header_date - -Variable in class com.easysw.cups.IPPHttp -
  -
read_header_server - -Variable in class com.easysw.cups.IPPHttp -
  -
read_header() - -Method in class com.easysw.cups.IPPHttp -
Read the HTTP header from the input stream. -
read_line() - -Method in class com.easysw.cups.IPPHttp -
Read a line from the input stream. -
read(int) - -Method in class com.easysw.cups.IPPHttp -
Read up to count bytes from the input stream. -
realm - -Variable in class com.easysw.cups.IPPHttp -
  -
reConnect() - -Method in class com.easysw.cups.IPPHttp -
Re-establish a dropped connection. -
REDIRECTION_OTHER_SITE - -Static variable in class com.easysw.cups.IPPDefs -
  -
RELEASE_HELD_NEW_JOBS - -Static variable in class com.easysw.cups.IPPDefs -
  -
RELEASE_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
RENEW_SUBSCRIPTION - -Static variable in class com.easysw.cups.IPPDefs -
  -
REPROCESS_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
request - -Variable in class com.easysw.cups.IPP -
  -
REQUEST_ENTITY - -Static variable in class com.easysw.cups.IPPDefs -
  -
REQUEST_VALUE - -Static variable in class com.easysw.cups.IPPDefs -
  -
RES_PER_CM - -Static variable in class com.easysw.cups.IPPDefs -
  -
RES_PER_INCH - -Static variable in class com.easysw.cups.IPPDefs -
  -
resource - -Variable in class com.easysw.cups.IPPHttp -
  -
RESTART_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
RESTART_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
RESUME_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
RESUME_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
REVERSE_LANDSCAPE - -Static variable in class com.easysw.cups.IPPDefs -
  -
REVERSE_PORTRAIT - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-S

-
-
SCHEDULE_JOB_AFTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
SEND_DOCUMENT - -Static variable in class com.easysw.cups.IPPDefs -
  -
SEND_NOTIFICATIONS - -Static variable in class com.easysw.cups.IPPDefs -
  -
SEND_URI - -Static variable in class com.easysw.cups.IPPDefs -
  -
SERVICE_UNAVAILABLE - -Static variable in class com.easysw.cups.IPPDefs -
  -
SET_JOB_ATTRIBUTES - -Static variable in class com.easysw.cups.IPPDefs -
  -
SET_PRINTER_ATTRIBUTES - -Static variable in class com.easysw.cups.IPPDefs -
  -
setDefaults() - -Method in class com.easysw.cups.CupsPrinter -
Initialize the members with mostly sane values. -
setDest(String) - -Method in class com.easysw.cups.Cups -
Set the value of the dest member. -
setEncrypt(boolean) - -Method in class com.easysw.cups.Cups -
Set the value of the encrypt member. -
setInstance(String) - -Method in class com.easysw.cups.Cups -
Set the value of the instance member. -
setOpStatus(short) - -Method in class com.easysw.cups.IPPRequest -
Set the operation status of a request. -
setPasswd(String) - -Method in class com.easysw.cups.Cups -
Set the value of the passwd member. -
setPassword(String) - -Method in class com.easysw.cups.IPPHttp -
Set the password. -
setPath(String) - -Method in class com.easysw.cups.Cups -
Set the value of the path member. -
setPort(int) - -Method in class com.easysw.cups.Cups -
Set the value of the port member. -
setProtocol(String) - -Method in class com.easysw.cups.Cups -
Set the value of the protocol member. -
setRequestID(short) - -Method in class com.easysw.cups.IPP -
Set the IPP request ID. -
setRequestOperationID(short) - -Method in class com.easysw.cups.IPP -
Set the IPP operation ID. -
setServer(String) - -Method in class com.easysw.cups.Cups -
Set the value of the server member. -
setStatus(short) - -Method in class com.easysw.cups.IPPRequest -
Set the current status of a request. -
setUser(String) - -Method in class com.easysw.cups.IPPHttp -
Set the user name. -
setUser(String) - -Method in class com.easysw.cups.Cups -
Set the value of the user member. -
SHUTDOWN_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
sizeInBytes() - -Method in class com.easysw.cups.IPP -
Get the size in bytes of an IPP request. -
sizeInBytes(int) - -Method in class com.easysw.cups.IPPAttribute -
  -
STARTUP_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
status - -Variable in class com.easysw.cups.IPPHttp -
  -
status - -Variable in class com.easysw.cups.IPP -
  -
status_text - -Variable in class com.easysw.cups.IPPHttp -
  -
SUSPEND_CURRENT_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-T

-
-
TAG_ADMINDEFINE - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_BEGIN_COLLECTION - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_BOOLEAN - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_CHARSET - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_COPY - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_DATE - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_DEFAULT - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_DELETEATTR - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_END - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_END_COLLECTION - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_ENUM - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_EVENT_NOTIFICATION - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_INTEGER - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_KEYWORD - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_LANGUAGE - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_MASK - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_MEMBERNAME - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_MIMETYPE - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_NAME - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_NAMELANG - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_NOTSETTABLE - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_NOVALUE - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_OPERATION - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_PRINTER - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_RANGE - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_RESOLUTION - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_STRING - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_SUBSCRIPTION - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_TEXT - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_TEXTLANG - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_UNKNOWN - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_UNSUPPORTED_GROUP - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_UNSUPPORTED_VALUE - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_URI - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_URISCHEME - -Static variable in class com.easysw.cups.IPPDefs -
  -
TAG_ZERO - -Static variable in class com.easysw.cups.IPPDefs -
  -
TEMPORARY_ERROR - -Static variable in class com.easysw.cups.IPPDefs -
  -
time_at_completed - -Variable in class com.easysw.cups.CupsJob -
  -
time_at_creation - -Variable in class com.easysw.cups.CupsJob -
  -
time_at_processing - -Variable in class com.easysw.cups.CupsJob -
  -
TIMEOUT - -Static variable in class com.easysw.cups.IPPDefs -
  -
TOO_MANY_SUBSCRIPTIONS - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-U

-
-
updateAttribute(IPPAttribute) - -Method in class com.easysw.cups.CupsPrinter -
Process an attribute from the cups.doRequest() method and move - the values into local members. -
updateAttribute(IPPAttribute) - -Method in class com.easysw.cups.CupsJob -
Process an attribute from a cups.doRequest() call - and move the value into a local member. -
URI_SCHEME - -Static variable in class com.easysw.cups.IPPDefs -
  -
user - -Variable in class com.easysw.cups.IPPHttp -
  -
usingProxy() - -Method in class com.easysw.cups.IPPURLConnection -
Determine if using proxy. -
-
-

-V

-
-
VALIDATE_JOB - -Static variable in class com.easysw.cups.IPPDefs -
  -
version - -Variable in class com.easysw.cups.IPPHttp -
  -
VERSION - -Static variable in class com.easysw.cups.IPPDefs -
  -
VERSION_NOT_SUPPORTED - -Static variable in class com.easysw.cups.IPPDefs -
  -
-
-

-W

-
-
write_content_length - -Variable in class com.easysw.cups.IPPHttp -
  -
write(byte[]) - -Method in class com.easysw.cups.IPPHttp -
Write bytes to the output stream. -
write(byte[], int) - -Method in class com.easysw.cups.IPPHttp -
Write bytes to the output stream. -
writeHeader(String, int) - -Method in class com.easysw.cups.IPPHttp -
Write the request header bytes to the server. -
-
-A B C D E F G H I J L M N O P Q R S T U V W - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/index.html b/scripting/java/docs/index.html deleted file mode 100644 index 0d8e5330a..000000000 --- a/scripting/java/docs/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -Generated Documentation (Untitled) - - - - - - - -<H2> -Frame Alert</H2> - -<P> -This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. -<BR> -Link to <A HREF="com/easysw/cups/package-summary.html">Non-frame version.</A> - diff --git a/scripting/java/docs/overview-tree.html b/scripting/java/docs/overview-tree.html deleted file mode 100644 index 26375784a..000000000 --- a/scripting/java/docs/overview-tree.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - -: Class Hierarchy - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Hierarchy For All Packages

-
-
-
Package Hierarchies:
com.easysw.cups
-
-

-Class Hierarchy -

- -
- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/package-list b/scripting/java/docs/package-list deleted file mode 100644 index 87ef3d4ba..000000000 --- a/scripting/java/docs/package-list +++ /dev/null @@ -1 +0,0 @@ -com.easysw.cups diff --git a/scripting/java/docs/packages.html b/scripting/java/docs/packages.html deleted file mode 100644 index ed4ad951e..000000000 --- a/scripting/java/docs/packages.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - -
- -
- -
-
-The front page has been relocated.Please see: -
-          Frame version -
-          Non-frame version.
- - - diff --git a/scripting/java/docs/serialized-form.html b/scripting/java/docs/serialized-form.html deleted file mode 100644 index ed30f6fe6..000000000 --- a/scripting/java/docs/serialized-form.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - -Serialized Form - - - - - - - - - - - - - - - - - -
- -
- - -
-
-

-Serialized Form

-
-
- - - - - - - - - - - - - -
- -
- - -
- - - diff --git a/scripting/java/docs/stylesheet.css b/scripting/java/docs/stylesheet.css deleted file mode 100644 index 95f576498..000000000 --- a/scripting/java/docs/stylesheet.css +++ /dev/null @@ -1,29 +0,0 @@ -/* Javadoc style sheet */ - -/* Define colors, fonts and other style attributes here to override the defaults */ - -/* Page background color */ -body { background-color: #FFFFFF } - -/* Table colors */ -.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ -.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ -.TableRowColor { background: #FFFFFF } /* White */ - -/* Font used in left-hand frame lists */ -.FrameTitleFont { font-size: normal; font-family: normal } -.FrameHeadingFont { font-size: normal; font-family: normal } -.FrameItemFont { font-size: normal; font-family: normal } - -/* Example of smaller, sans-serif font in frames */ -/* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */ - -/* Navigation bar fonts and colors */ -.NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */ -.NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */ -.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} -.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} - -.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} -.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} - diff --git a/scripting/java/example/GLP.class b/scripting/java/example/GLP.class deleted file mode 100644 index bfb69b487094f86c83c32fbeb6a11426a8b4afac..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 1163 zc-nnb+fEZv6kVqjrX7Y$3kA6fa+}sdMM18jSSS`tX@U~Lr_=U82HP1jGhE_V_!m9{ zu@Ia10e+NmpJ@{yK_6z%p0(G$pEJMz{QL!A3ONYgD~PJ_OJo8u1y5Bd zwU4;eCKXJn#2r(R2;iBD7EG&nju%qQD43PVODX20n3rNf!J>jChG3Z+W{#Vp#L$yD z;-~yP;hY)fVPf+G&*w!^+KAV*Y?y|-!qA{ccNzRit0)-SGKML#C*{1biCvNiFSv$f z=7fD<*=12=c&vM26a36gh*M#@iB*rXF7+iZn5==JOaEMBmN=!~ac!!?v#UGSiCqvW zLna7pWO7rIrlAl08hX&HU|GW}^fPq-qX7*o=w(pI*X4Of!)v_Ju!^_T4`B@9dyXla zmu0F=0*A;hQzaFwX;?=}!v>NJ9k->fpBKcjY)QjAq%~~fy@m|7G-R>O(0()L!`kzfk^oOS$ zx$E*Vy~Ry_C~Fy|z)9P3oLq^!a;X{1`m$;kQ$m!ICGI#`Z&;o6r1#=7v^v7Q<4^;V zmPw6z<nd)H{Z zLQ@qAX@M&QFA=OjCFp|K41**G=>`JrbUif$5hB@vE_7lD5kyI&3qX1;PY*pl>3Qqk z#L>UqE&zo9 diff --git a/scripting/java/example/GLP.java b/scripting/java/example/GLP.java deleted file mode 100644 index 815a21187..000000000 --- a/scripting/java/example/GLP.java +++ /dev/null @@ -1,59 +0,0 @@ - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import java.net.URL; -import java.net.*; -import java.io.*; -import com.easysw.cups.*; - -public class GLP implements ActionListener -{ - private JTabbedPane mainPanel = null; - - // Constructor - public GLP() - { - GLPvars.init(); - - GLPvars.mainGLPPanel = new JTabbedPane(); - GLPvars.tabs = new GLPtabs(); - GLPvars.mainGLPPanel = GLPvars.tabs.getPanel(); - } - - // Implementation of ActionListener interface. - public void actionPerformed(ActionEvent event) - { - // if ("comboBoxChanged".equals(event.getActionCommand())) - // { - // update the icon to display the new phase - // phaseIconLabel.setIcon(images[phaseChoices.getSelectedIndex()]); - // } - } - - // main method - public static void main(String[] args) - { - // create a new instance of CupsApplet - GLP app = new GLP(); - - // Create a frame and container for the panels. - JFrame glpFrame = new JFrame("Java GLP"); - - // Set the look and feel. - try { - UIManager.setLookAndFeel( - UIManager.getCrossPlatformLookAndFeelClassName()); - } catch(Exception e) {} - - glpFrame.setContentPane(GLPvars.mainGLPPanel); - - // Exit when the window is closed. - glpFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - glpFrame.setSize(600,400); - - // Show the converter. - // glpFrame.pack(); - glpFrame.setVisible(true); - } -} diff --git a/scripting/java/example/GLPcolors.class b/scripting/java/example/GLPcolors.class deleted file mode 100644 index ad7faf183387df4223ad8eb0d245540899e986cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 838 zc-nQ5Ur*Ce7{;HovVWy)-PiyT6$a=wV7v21!Uan(OBNxKka*davr(vRQaklKc)_)a zdFc7wAs&Wi*UEx#u%4JntQNJnBu06R>a(i$w3H!L((e z2-`x5rOYzRQemmG%(2X~EWj4X-wvj9)wsY32km|LRC)=0cfH%~Hjc1D`%<8N&C^Nq z)m=$@S^KQ^iuS7ZIqmb>7nG+U_$Ns3Q}uvckf)nh5SMf#utb_sFoPU5{BHe@H2Ao< zM(R}wKS$RUjL(=Fp>KBI?kkWUfsb@)l3`*PhAOgL*nPD^ft&(0yH>)v0{O|8n3HIF pe3|v<7n(42IwsaIji<2Cp)3z61xXpcrzamMvrp6`@K7c5=oi06sZam_ diff --git a/scripting/java/example/GLPcolors.java b/scripting/java/example/GLPcolors.java deleted file mode 100644 index 6cfa8d5ae..000000000 --- a/scripting/java/example/GLPcolors.java +++ /dev/null @@ -1,22 +0,0 @@ - -import java.awt.*; -import javax.swing.*; -import com.easysw.cups.*; - -public class GLPcolors -{ - - public static Color backgroundColor = new Color(0xff,0xff,0xff); - public static Color errorlightColor = new Color(0xcf,0x66,0x66); - public static Color highlightColor = new Color(0x99,0x99,0x66); - public static Color foregroundColor = new Color(0,0,0); - - public static Color labelBackgroundColor = new Color( 0x66, 0xcf, 0x66 ); - - public static Color tabBackgroundColor = new Color(0x22,0x22,0x8f); - public static Color tabForegroundColor = new Color(0xff,0xff,0xff); - - public static Color buttonForegroundColor = new Color(0xff,0xff,0xff); - public static Color buttonBackgroundColor = new Color(0x22,0x22,0x8f); - -} diff --git a/scripting/java/example/GLPdetail.class b/scripting/java/example/GLPdetail.class deleted file mode 100644 index 2d93c1bfa40b1bef2aee4e7debb26d1be3400021..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 5600 zc-qxid3aRS75|;d@@6J4B$*_vLINm;fEigt380Vw3Qb5PV2leonRy9=GxOrige0`? zd)2D7R;6NVwNjV165$1nO09~ZRZCr}bi=w^*H)>!J?AZxOfvBG-%h^o+;h)8_ug~Q zIlp`E%TwPx_y~Y1THwW%==I?HxL?RtA=`u)Li&Vk7xI9R2Zi*z@sP9+yYYy$JKXrK zw2un;osh?bJTBx31v|Ycl?|T6F5z}7c*=`0cv?EY_u?5mE8KJT*dM$o!yX}j6!Lr~ zPS$!sxZT3NDBMeCcNkZSKMfEMUdAg5_A2{0Nl z7xVECnem!%uM78vaBnJj%ZnPkt>7Im7UNw7|MX%h-j&XK!o9EH122~2L;HYfHYoT= z!N+d=%Zn4`m@IPR->LE4sX5Qt-7<0A%lO2NPo=Xz<%Ru&{qZvXagc6{Z<*Z9W6ndnI zV11z5pXdt5+WpH-={$lO)MLrG9HpMtGQ!A=YCN7h zKO74uk7b`#Og)L!YxR)EN39FTv=yDvRxQ3N&>CThC#iQVwrzE{Ye_p;BP*t6j&?yH zm<;Q&MlIf^$D>+^P*!1iC(xDjYwNXG(!a=5St9&A+1%TtcgBO7c!w~84{SN7N~WpU zj9;p_8b45RjgV`FT!$a3xE?=JaRYv=;zr!0;$|TmaT71mv{vsbuXSRi;wQL;U1>_| zd&(s$DmIxi(_!U-@;2UE#jUtS#ZU1w6}RE%DsIOeDt>`GIZDINs!*;<3b|GC5Cf+; zb;jf4;gFS)Y&+$tq*A^@BUCD&LY0chXDbiMJ5erHsYFOAjZ|rrtUX%D81kw#mc}V` zh)Uy4yUpEVTGGFIWgSOjX!_N3wzWx?C~K3+j%vSOr3qA~QaMdz?^Ms3HN$TwQi6vj ziL@kBo`_A8RXUX2LWhZAQ-nL5iV5Qml72F+f>1a#vqe6Y!#$AFD(=Ovm{297F(ayF z&NRopVcoy1VM%vT>yQK*8Wt1id_63Q$Mtx5L=S{mTy9%XUCw7*p*!93gci|)oE%ju zO{XLHS~9akGIPDAQk5LmFLEoF7DXcEs}t-l!sI~~ly|M=ycxcgLPx4JgJ!BUi)Jfy zluC0riRoxMMxnVXRnt6`=8G#lsbpt&4Fs{FbsZbWAkPRKahw*D@XGX{9?`|Fg4RIr ztoFFx84J~lh!-5dohe~-<|njdO-hg5S}{~d@TgQQN9zsztt_70Xl4wV=#~LC`wDw55L|V-;d-gnQcSnCh#X(fXfYOTL zm$1kSc@fKRd?7>wa_XW$C^XcSlMZl8IU3d;ttM1!hI-nTFV*8(nq1sHAmqE2Hzri3 zIX&8;$IOc`laOPleMR3I)7c}i$OAh@A4)szTR1< zq+)8OBIZu&7SCR@H?VIV(;;qwz5s&_<+ECxSA>m$M4~HX#n9oWRb;M4nFCi|anKSc zD&vM$p|nTC=rlja7-bSiGp~yhjOtW@kb=NZpHr+uSOwZE8udNa(AWbPFg~Gp(kx&@ zy=cK$ig7X^%Xp-i3v0*Kk`{G#gcu!*)1E~U)z@rq zw%d(%%T?EGH`(p2cFP6UY`MmoEtgrdC4}S5tY7zZ739Rkr1DdVj(4!{U~ke!$?_pD_p%8 zWnlDxFpGs*{TS1dotu->hp`66iNwvn?Ks51cKNQ?g+E%ak_!cn7NavAG2EeF`IpGly8oKqqpN2roOpMSb?d5 z>ORb?<5SIVnbwB|;>oQj>BX@Iju7Nt6%{EZqZ1Y(LRycf)frjSISYFRd zoR~V%%JgG2N$yzsih)(lTTEr&>Y*biHE-e1qo}LewE&Hro_BMyeuLwfPUfUl;Xyt| z@Lw?sFq(lh9zIM$2@dBEujv?x87w`TzoQpmENXEGPGF6COu$P1u4={NSUhv7K#V-d|o z4b@^XHDC#yilx+!I*Ou^Zoo>q4NY_pR&n;PrYF%%FX3c*1E8?DiagD?o zu1Pr4RfT}78m)X{&9w$?u61a4orQ?28&TKAIGeq2PYSAQY^biwgsJ9(Vd~^GOtqvi zb&83aKAh^{$z+FOsTZf+%$ViG_ML8Ejl-O=8KowlXW&eS3D{_B?M2X<o z<+uQ=aUsscMbL2xI&m3~Ue2ZODlTbPb8)(c3(3G2v#!Gxc z{#LTE#y1DQSGdg)cihK}b^KgYxR>d#@f%B(HgRQTSW?k61K+Ec!r;CWx(S*&OgBQw z-i++5`*E6soO2xJ++Lh#;C!ZAaRJBf!p(TbLDEGIb8-42!>4SNJw4{0L37XGfO^mY z-X#um>F@ox1`**fp1}8A9DC^ z&BtqegTKK~qBr?2ev9whw=oy*$iE5EfDdpoK13Tn;+y(o&a+QAr}lFmea4TW&pAK7 w;HS%%9Hp-~-oP#*>>(HSQWo}6Hs0sE`cv}YE6Sr>QmK#%*n<1a$Iq7k0w3AlZ2$lO diff --git a/scripting/java/example/GLPdetail.java b/scripting/java/example/GLPdetail.java deleted file mode 100644 index c8e7b61ee..000000000 --- a/scripting/java/example/GLPdetail.java +++ /dev/null @@ -1,279 +0,0 @@ - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import java.net.URL; -import java.net.*; -import java.io.*; -import com.easysw.cups.*; - -public class GLPdetail implements ActionListener -{ - private JPanel mainPanel = null; - private JPanel controlPanel = null; - private JPanel detailPanel = null; - private JScrollPane jobPanel = null; - private BoxLayout mainLayout = null; - - private JLabel tmp = null; - - private JButton completedButton = null; - private JButton myJobsButton = null; - private JButton printFileButton = null; - - private String completedText = "Show Completed"; - private String myJobsText = "Show My Jobs"; - private String printFileText = "Print a file"; - - private GLPprinterDetail detail = null; - private GLPjobList joblist = null; - private CupsPrinter printer = null; - private Cups cups = null; - - - public GLPdetail() - { - URL u; - - mainPanel = new JPanel(); - mainPanel.setBackground(GLPcolors.backgroundColor); - - // Create the buttons panel - controlPanel = new JPanel(); - controlPanel.setLayout(new GridLayout(1,3,2,2)); - controlPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - controlPanel.setBackground(GLPcolors.backgroundColor); - completedButton = new JButton(completedText); - myJobsButton = new JButton(myJobsText); - printFileButton = new JButton(printFileText); - - completedButton.setActionCommand(completedText); - completedButton.addActionListener(this); - - myJobsButton.setActionCommand(myJobsText); - myJobsButton.addActionListener(this); - - printFileButton.setActionCommand(printFileText); - printFileButton.addActionListener(this); - - completedButton.setBackground(GLPcolors.buttonBackgroundColor); - completedButton.setForeground(GLPcolors.buttonForegroundColor); - - myJobsButton.setBackground(GLPcolors.buttonBackgroundColor); - myJobsButton.setForeground(GLPcolors.buttonForegroundColor); - - printFileButton.setBackground(GLPcolors.buttonBackgroundColor); - printFileButton.setForeground(GLPcolors.buttonForegroundColor); - - controlPanel.add(completedButton); - controlPanel.add(myJobsButton); - controlPanel.add(printFileButton); - - // ----------------------------------------------------------- - // - // Now get the printer objects - // - if (GLPvars.selectedPrinterName != null) - { - try - { - u = new URL("http://" + GLPvars.getServerName() + - ":631/printers/" + GLPvars.selectedPrinterName ); - cups = new Cups(u); - cups.setUser(GLPvars.cupsUser); - cups.setPasswd(GLPvars.cupsPasswd); - printer = new CupsPrinter( cups, GLPvars.selectedPrinterName ); - - detail = new GLPprinterDetail( printer ); - joblist = new GLPjobList(printer); - - detailPanel = detail.getPanel(); - jobPanel = joblist.getPanel(); - - mainLayout = new BoxLayout(mainPanel, BoxLayout.Y_AXIS); - mainPanel.setLayout(mainLayout); - mainPanel.add(detailPanel); - mainPanel.add(controlPanel); - mainPanel.add(jobPanel); - } - catch (IOException e) - { - tmp = new JLabel("Error loading printer: " + GLPvars.selectedPrinterName); - mainPanel.add(tmp); - return; - } - } - else - { - tmp = new JLabel("No printer selected."); - mainPanel.add(tmp); - } - - - } // - - - - public void topDetail() - { - URL u; - - mainPanel = new JPanel(); - mainPanel.setBackground(GLPcolors.backgroundColor); - - // Create the buttons panel - controlPanel = new JPanel(); - controlPanel.setLayout(new GridLayout(1,3,2,2)); - controlPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - controlPanel.setBackground(GLPcolors.backgroundColor); - completedButton = new JButton(); - myJobsButton = new JButton(); - printFileButton = new JButton(printFileText); - - if (GLPvars.showCompletedJobs) - { - completedButton.setText("Show Active"); - completedButton.setActionCommand("Show Active"); - } - else - { - completedButton.setText("Show Completed"); - completedButton.setActionCommand("Show Completed"); - } - completedButton.addActionListener(this); - - if (GLPvars.showMyJobs) - { - myJobsButton.setText("Show All Users"); - myJobsButton.setActionCommand("Show All Users"); - } - else - { - myJobsButton.setText("Show My Jobs"); - myJobsButton.setActionCommand("Show My Jobs"); - } - myJobsButton.addActionListener(this); - - printFileButton.setActionCommand(printFileText); - printFileButton.addActionListener(this); - - completedButton.setBackground(GLPcolors.buttonBackgroundColor); - completedButton.setForeground(GLPcolors.buttonForegroundColor); - - myJobsButton.setBackground(GLPcolors.buttonBackgroundColor); - myJobsButton.setForeground(GLPcolors.buttonForegroundColor); - - printFileButton.setBackground(GLPcolors.buttonBackgroundColor); - printFileButton.setForeground(GLPcolors.buttonForegroundColor); - - controlPanel.add(completedButton); - controlPanel.add(myJobsButton); - controlPanel.add(printFileButton); - - // ----------------------------------------------------------- - // - // Now get the printer objects - // - if (GLPvars.selectedPrinterName != null) - { - try - { - // - // Create connection - // - u = new URL("http://" + GLPvars.getServerName() + - ":631/printers/" + GLPvars.selectedPrinterName ); - cups = new Cups(u); - cups.setUser(GLPvars.cupsUser); - cups.setPasswd(GLPvars.cupsPasswd); - // - // - - printer = new CupsPrinter( cups, GLPvars.selectedPrinterName ); - detail = new GLPprinterDetail( printer ); - joblist = new GLPjobList(printer); - - detailPanel = detail.getPanel(); - - jobPanel = joblist.getPanel(); - - mainLayout = new BoxLayout(mainPanel, BoxLayout.Y_AXIS); - mainPanel.setLayout(mainLayout); - mainPanel.add(detailPanel); - mainPanel.add(controlPanel); - mainPanel.add(jobPanel); - } - catch (IOException e) - { - tmp = new JLabel("IOException while loading printer: " + - GLPvars.selectedPrinterName); - mainPanel.add(tmp); - return; - } - } - else - { - tmp = new JLabel("No printer selected."); - mainPanel.add(tmp); - } - } - - public JPanel getPanel() - { - return(mainPanel); - } - - public void actionPerformed(ActionEvent e) - { - // String source = e.getActionCommand(); - Object source = e.getSource(); - if (source == completedButton) - { - if (GLPvars.showCompletedJobs) - { - GLPvars.showCompletedJobs = !GLPvars.showCompletedJobs; - completedButton.setText("Show Active"); - completedButton.setActionCommand("Show Active"); - GLPvars.tabs.updateDetailPanel(); - GLPvars.tabs.tabPanel.setSelectedIndex(2); - } - else - { - completedButton.setText("Show Completed"); - completedButton.setActionCommand("Show Completed"); - GLPvars.showCompletedJobs = !GLPvars.showCompletedJobs; - GLPvars.tabs.updateDetailPanel(); - GLPvars.tabs.tabPanel.setSelectedIndex(2); - } - } - else if (source == myJobsButton) - { - if (GLPvars.showMyJobs) - { - GLPvars.showMyJobs = !GLPvars.showMyJobs; - myJobsButton.setText("Show All Users"); - myJobsButton.setActionCommand("Show All Users"); - GLPvars.tabs.updateDetailPanel(); - GLPvars.tabs.tabPanel.setSelectedIndex(2); - } - else - { - GLPvars.showMyJobs = !GLPvars.showMyJobs; - myJobsButton.setText("Show My Jobs"); - myJobsButton.setActionCommand("Show My Jobs"); - GLPvars.tabs.updateDetailPanel(); - GLPvars.tabs.tabPanel.setSelectedIndex(2); - } - } - else if (source == printFileButton) - { - if (printer != null) - { - GLPvars.tabs.updateOptionsPanel(printer); - GLPvars.tabs.tabPanel.setSelectedIndex(3); - } - } - } - -} - diff --git a/scripting/java/example/GLPjobList.class b/scripting/java/example/GLPjobList.class deleted file mode 100644 index be74a67c9b1f8fa9d0daa2f61b15ecad69b841c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 3587 zc-nnedw3Mp760AY$IMO!NR}+PJi_u&H-WG!CDIK=NC=Rygh&E)p%^BcAxzlpq_eXL zLB(1l)>5^tl@@Dl#kR2z)F5uaw6xV$tM);qZ(7@a{l|X(+kX9{Uv1BsSxAV{-EYr5 z_uO;O{himH+1KBF@jQT)_?wFD=nkP329y0vdYBwgiI_5aWgJwYpj$zf$G#A9uoU#G z_&98qA`Hv8 zPsL&!4dH%#in#|Ad|JUV1)ovypn`{7SqKl~vkE?^;PVO|QSgP5=A&%uxPmV#_>zJX z3LaDNWf_mFSc7gEUr~|76TJDWOuokC$pGAs?`>8($t2J6r&#yv3ce9s|L}TOL&Y~S zqTp$jR=?#Q$mH8hz9ZwiGET{OM!=sb^ydZUq%u}t!qD?W`N0H>5{*Ra1=K#>%%$`p ztKbMkQoZ_sp3n!K#Ae&<_Qb4Y*tTW2={X}SQ0XciO5_L4Tu-9Km6DF!YjrU%5WQNV zJ!4zhEH9B(aIKj$opl1S__T=HY%}K=c763Og5GF#let+bGiS6G`nn9eL+{Fx#GkeF zZd%YYj%nrE412$2_ZcKv6rXUw7%*~9VuP#F#Jp=$=`oy=AM@kY9{^Nsw+eQ~*ktm7 zvo@#N$i0-AcUJNi4QV{9;a2R>(2fobJF!c{M{%2mz1S_FxhQgmli0ZhQj{+hD|X$;5hxsL_))J7?p8a!}B;JFf&=V>c&LB7m9pB#tRyX7}Ic;NgC%U z3DX6S*Iv{xjx!p*hjSXf&)j+Det;ip_z{zr@Up;c7m;ZtnzuI{${76|B!P0zO*hKh zDE3)4_+x>kO`QH1h0Y=HF;aAP=$FK0--D0 z1$?xVB<{ADl_Oqi-l*YMc$2EBRqx}X+L`B+lr`Fh?ijHS(-pRxhiM45JGxU~1a904 zj+sqtBrSqDk=ka;R*zw`KNmIpnnV8^Ccnk+H2fZa(C|lG;2d5ezz1dgiTOVhlD;kt zZ*gY-!W;jJi&T9R1xIO_IAeQPuaP0q!fDH#)r}l`;fr&z2lf7bBS-G9DD}mp60EOI zO<$GV%5?gGZnM8!TkVEDVAx)i!tXUio%8{nOg6aXyoqO{GG0BM6~(bUp6;RP@RCCn zC3&f{ypHA*z1+!p!|^zkg>8C1KScO#3aR3>jD389-os2Z;5QR~O2>bM8K zk9$-^REM1=Z4}L(G1^q<%Xz7s6K|eAQ~tQ?tHPUeu4Dk~u zrs?tEj`W0ZM|wyQ^^;y2yNT|hSt}&^0#!9*5H;cjNKAZ8{7eEh%Zmt(g73wTu^zqP z0JF);41_R~zO!gnj%!efg@};W-pjWADFjFhKE+q(ABUVChmsycD6AGyb{ZPd@C+h! zz)Tv7m^Fs-Z8hVlNUs<}n4z43bQ-gZsPwo<5pz6l?rB_8M6`7TYmun_Vgxj$c#hra41u7)Qr}iuk-ur z0=_yrdroa6c+(jye;hOk4hO_=P(*?e|C9gwMi82(G_c;pl^v*kql>7FKJ% ztVZUQh$>&fQAA5brEpdat75oJM9MfDwG(mFyf|u8;<%N$@;ODMT&AjsZKKo|KI)FW znCEqqs6h*L(*lylumVfyje98?unZ|&M|yG6T#jB^$)grW=r77KB=9J1z;Ud?V_1zR zP=}Ma8Bf#BXX!2ddDP<^*5U%z;Sz4af3RKzu|dp6gII`0QH4!n2{wysu|+ILi&%}V zVhvKFp5{&1F1F%Uu?suIZnTSi=n&o5C63`XaU5y!6un)Z!XEJqZWrU|6fa|+cmuk) zh%Rvn8S!^?i+9i?{)q$P-!R30k&|Rt68$-nVz8wI^3pmKq*e?_dvHiPfFbDt+##L9 zozfWYl3u|P={1BqO0n7EjNGy)G1 Z-3Ps-wva}ax>oj#j=!-&J+EN~l!#2e{c9*h1Nec}P4^d#H1qnHg>AG?gDRyB0 z4&V1fkti#WcE9a@*dK*B*LK^)2}O}+a_62oGjrx9|9|=X4}b+!)5zk=FfzC*%{2vM z(*LO7C+UBd=K2Vha3h6Z(zuCRX+~}y7nC$$RTGwo1NL zbM4YoX&=b@B>|_)Ft3eN=w%B(7Itm-uEhwYu3-3oeP(w6N%2s@tD3*YNG zvQtP9q9u zy#0VwE-2cooMg*vbpt2#uI3Ij?x^5e9#=8m4Gf|Z=Xhn?byw?-9|{{N|C@jsoXfux zY}WIs&jwGA7SAD$QtR3POB#DZXSWz*F6Dp>p8O4}D zEKl0KNuQ9)2YxE>D)A?AiZ;*FD`xgU=Jq#M!-x%71 zV&vtW#=G}~QzP0lNYNf==?sS1NR~yXSbUbH&#}0{(gM>s9Tl6V=Tb@f0jb>snxP;l zJDOo?2>pTmCg?LpaSy4Y@d?8T99GT-P0w)bSq?PE=p4HVQ= aRow && colCount >= aColumn) - return (rowData[aRow][aColumn]); - else - return(null); - } - - public void setValueAt(Object aValue, int aRow, int aColumn) - { - if (rowCount >= aRow && colCount >= aColumn) - rowData[aRow][aColumn] = aValue; - } - - public int getRowCount() - { - return (rowCount); - } - - public int getColumnCount() - { - return (colCount); - } - - public void setColumnName(int aColumn, String aName) - { - if (colCount >= aColumn) - { - colNames[aColumn] = aName; - } - } - - public String getColumnName(int aColumn) - { - if (colCount >= aColumn) - return (colNames[aColumn]); - else - return(""); - } - - public Class getColumnClass(int aColumn) - { - if (colCount >= aColumn) - { - if (rowData[0][aColumn] != null) - return (rowData[0][aColumn].getClass()); - else - return( null ); - } - else return(null); - } - - public boolean isCellEditable(int row, int column) - { - return(false); - } - - -// -// Implementation of the TableModelListener interface, -// - // By default forward all events to all the listeners. - public void tableChanged(TableModelEvent e) - { - fireTableChanged(e); - } -} diff --git a/scripting/java/example/GLPoptions$1.class b/scripting/java/example/GLPoptions$1.class deleted file mode 100644 index 079ff0df4d1e1beb2ac55e0bf4f11e96a976851a..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 1025 zc-nPS>rN9v7(LTsmo6j4a+QmCsnV9qf`T`0k}3w%K$8;xPuqbG+3u3v;o__K7A8;= zfA|2tfYBI@FJk;=Q3?Sz+4<)C<~wK3oZ0>I=hJ5ZQ&_RVF_c6HhRraN#4U{4xQ#nz zxNFjTHZr(x;{nD@nzfL#FkxYmA+ayq%vP0Qu(%`k#i0`(C~w<&v#MNKsQZ2>gL#Hz z`JJchQY&gq=(-9s(+s@$x>)jewer1?dJ+rDQ+kOZmp!|1HEr%KLtDYGNrqHWd2)TP zQIWx>sJNygss>+@!ImF1WQ}1o8&NspKs$0@dfHiuT3(rXL}r)$y`U=19z@X6FlBHY z-I(IIfiy=aQWhMJY0Ox7$nglX9CLWg@dQsTJmYwdc?%01i&)}V#tS-ai!U?70IIBc zo(u}E2tye%bVcf1LC4&v?8vHS7`aq%QH5F(k|CarWVe{f>4s2VNqEv_=sE9QR3)Pa zu5y&2Gpzdu8@tkbsf6oqGxVP^t>8CyeJ?U=jr`e`x-4DNDQhQ=b!BrW&B}L7g|@oB zMR8Le>QyCOx`To9icVLkm7j$&SVUhEx=yF~Pa9cN)&W7OzwdG;LWWYCl%Y3!5oio+ zH>%b}gSJUu?4XangZ>B-j~LSCu4&!{^Q6u7pJp+7yU{~=FU`g%k5f$LKZ51Qj}gmH z93%b#=BoQ>Oi%>A(%6rIe;`4iHi~okBgE;A9igp>Ym3A0kujwv66+^rYqE*Omq0zLC=Jr055R@Dn-w!YqE%1~((EgBYi16QUzhkH4f5_FDh| diff --git a/scripting/java/example/GLPoptions$MyTextListener.class b/scripting/java/example/GLPoptions$MyTextListener.class deleted file mode 100644 index fb4c7f5d6936deca7260aac2aa65c75c9598b3e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 1217 zc-nPSTTc@~7(Fvowp~`rMUX0@AYy5OqId~Km(HSxRjwRDcjoJa*=3Eyu`#y zOnle)0?#H;5>1TH{uTd&@tdWzQgAo>%{Ski^UayFyTAT?`vIT}x{6vf`%r@x6=%_^ z;G7R_IIqHkpo(^c6ogfH(IG>pTYYWhi$ROuMz4LDPry z`>C{JrYyUU!8f^PISaxuyQ}*!}H|&xv zG&JCvhC0+MxUQiWq_tiytVZk=(@I1}r^KogGevSvLBEC@7|?JNw-nsga0gL_YFA0p zAnb_ch=j<L!c<6b!<&;qMNoOERkWTEG=jw7LC!Q zVcWuHs48wbF}o<@bjZfT{3tdk3rbf4|22&qO9*GzD28LfcD-~9@79%b7NkS@~)U ziY8o<42+1CX(J)@)QZUDb@~g1J(vr5m`?A9xP@H^n(1e$1<9wUMt&?b9*4ZjC~H7~ z;t86yfYS}Ap&hVLcpLmH%@|HnET<9t5yeKF%Hsp{NIWZrEmLeNz<$%8=ArR(IES*I z@QihYw!pV=WCP)RmP7e?XAX+z3)W@nJG?WUJMiV8Zlhuo^LdI^plCT9-J=X2pj2+6 zCr|NjAehf`sM@2{9iUVf57CQCI>cjm`8sO(6EyLsXyeb&$Dbp{U*Z9Og&F=D7Jq{^ f{thqrd%Wcz@QHsUKTf-@oWW)3r0aMaE`j|8@r@f- diff --git a/scripting/java/example/GLPoptions.class b/scripting/java/example/GLPoptions.class deleted file mode 100644 index 197db162216e4d67548023bb439a48a00d4be32d..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 11082 zc-p;K33!y%)qc;-GLzxU&K3wTEJ8Bbkewh~!WIk=h!A6nI7vQ2Aeo7i2>})Bf_14D z_XQQfg-}~tL}o(8eQU8=m)cgVw$)avwQ8}gOSSr+bH8tvgn_?(p8xriC+D8;+;h*p z=iIa1Jp1*7j{qoD3taeu7N_BJS|XrIz)~ljDr2>PWdfE9SRtTBz)AtD1k?&RO~7ga zYXsB@INd?@F67b~^3mX+Z@Dno+GnkU&U7J<77Jxv8l6R6!5SUZ%(s?p$gmSJHpTTmo#V(IxS7^*Z-*utRvQVQ|!9iEL&_Gv-Qr{D7hm)?hEp&}-2nG(i)=Ag7 z&`hR-u6Ln@Zjg^1V$d4}YZUAz!Fb`#(S?>(opg(cw5;o(owC`jE_Bgtg556IE&)3P zG{$y~mvBc+f-KrCU{61O2i@tyWwry@>+b5i?rsO&zs7I$T*;F ztj(+K-p@RJ-SzCuA(!dYZW+m$(#pKu!Lr4H*5(Rti!~EDTczLE z85BMHv+0Qda|Fd^8EmuK4W=3F6lK}ExebZb&GH9YO<&L(Z1wwW#_TxK8gE;d&{RVe z-`d$--nQ1@R+}%~{*3TsMt5A%A#3|eiqNPkwlYG??C`dj)&6cX(1)_Rqa#K!grcu; zej8s6oxx1LuJ%fQN2?j#a3E8(oMXvaSYL8>r`cvU1PqY2 zY~DE4D*RgrL;BurrN6z=&l7B7BWf4Tm=Qg-?LJu@wpNuJ%%)8Vh1nBwtx;3it23gO zvI$18PpA#AUR+({*BW<@>l=qGF7=dFUu$pEEHVdhO5@!6=*W8<7dWPpj6fwR7zzA{*A8%g!OG7zFAJ^Gr&%YQ{OeLInkM#$GQYe)(WK^vR zf1ue6SgFsT59qHB`p}?{=wpNaMo0V0sP;B$M_BH6+m*l_30c|r6NCOPEB_%YQ!7nj zFzBE3sX>!zl0oyRjGZoV-Zf|d85~C^NVf*1Q-*^+Gw5^r!k~ZAml0`k4pY&!e!Z@J z+6S264*J~&eMSFv(ANfiqrfrb_WRrpMTSy*2`Wj!P|0jul_DTjfJ1;&r5Va4V1RrY zDxI}a83s+EsRm6GFkQe50W$^6qNyBleQYMaQMtkI@03#wPF%v+cq-E%2RRLurLx(x z-Lg!MuI*gz=0n$+Qjl^J)He3Rih#en({z`Xma^(`-f^;s&M{Oj--{YZAG4f=UM)xB z*d3P^%H3|;F^OGNAztJrB;*lpAhb|*DdKu^Y&n33ZA(RB;NdEtI~ljN*q}6W88n|Nq=LvPd}gq0^{Q%S*$@nN zl$VtmYJ@mVM)|bKCzsi7-^q?VFi~QXlZ-UfDDf+|XfRr^F@lX%<07VM^_NwxSh%Ih z)VE})lhk-aP0+6C^ZQIg6)4sutG{m>lta0O@~9$Cp*8-1#048Rt=j8r?ridQa1P2| z#fd7wo)AaNiqIlU3{|X(3{@haR6vGHhniuinX24Sv(zbunk{iSN6s^s0nMSg zY!7iV?n6o(YM!CyOY(ENd6O=)xzwR53{^>=^4Ve@-^Xk#8aHxs;w~;>8jn@)%!0V` ztrL4%rx}bm?(n!WV9}O&eXNRAkkfc&lfTU$klw7(+q9`A;P3J^R|<&_6I-e&($})+ ziYOnuL_vQZ5j!YREo6Eo7bmmN79wv^l*m1Xx0zvKAF1sf>{eW}s{7kU%gl=pFsmXg z;$r9za0iy%6fn7TFKq7!ZndVQnpW{o-+rS}&)KVISq6;ok1RL=s~jNJ%bk^+y*Ob9 zkT}QlCc{tAEpfz3mtlQaFOh)-g^8MT2jAdkuiRgT2&pv#nTYcg zZXl!xzQrEdNXgQOu%K?UwPiz)Cul+Ri>FgsJG{b{!8VDjXM`yyxTNDeImBF^gv$yO z5&3KdRk9|Vy`sO{k2y|%6YX4OVPT)xs6Jk8vz)e3*Q1L5QDD;-^>^LD1r3QkGK(!$ zYj+k^zGjn6>R^%-OrB&_7WtdHI%ArQK1P#13|i*k1ip2KZsJ(-LZ5Wt&0;Q1OK*__ z#2g{pUTjwfEzl|6vRc=5Ih=*LgjmBb?(SwQ2qJiTQ^Yr|Zm~MSasHPc^+dh!AU<%k zldtXS=-^y0`V5lJH-XdV#`7;Q*L%C#*tA2K8rKuV$w_88Rn|6f4AF)Bu&J_^$2|<= zmdi}s+c0h>t3`rBh*4pwZKkh9;%o>fn#5@^jeQ^znG+INGQlc-$~t(}LVg%pQNaWk z6YP$I?~_0D%Z4MCH&=T=uC;Nhaw^&B# z=kG&~bJuJhuEgtF#i)IP(Rv6;n=fzf4gT(BW@jgtsRgaxHh&97<8yq$9mc;HgFH$g zKm0C{A9V>czc{+pPO4kJ$mf#B75Wq5)WCd zIKR;tPLwkt8DfP!o?clHf)bD|@RBe$MK4-8=tA7jV)twtGEVj|Y?Oe5x?9dmIm=HU{|#}4MY5tZ1D1=>uLY%`t0yCw0ihyEYT zR3tJFBKaBSm9ZBm^X# znc2)Zk?&!SjC=ue?Qxzx&X+MGgbI7Cl+h8w0y#^Ge1x%3j=%?7RObm}ad~ngk;%5m z6kBAbEpi~1^b?ww949r8l~^ibPc2VLBsQhrNe80(_<~d71*e3uTm-KuPfa8^^}i9E z8ZS6Cj2aQVvfPnKu;V{Bgd<+8BaBrdwzk}vNUZZe7we1{>kQ*G5xcrPEs@x){&qNl z+_ZSPX<@9Xi^dvNa7+MeIo8hNDDz?%N6blR=IAjw@2ux2+`!pqBQ|3bwxNwPP&=;T zXu1J@+>Q?1gR?n?0tlfKk0Xd@ne#<-<5g_IA2{OP!#VgH=dRCj9+$FhT&~WiA^0|p z#)UKi7jcrmn5JVp&BZ0O7~i3lxRe@j88zW@>cACr4z8pNa1~vK@6pxRK{w-S+Kp@I zUR+BDaUDH`>*)w?pkLx9dJQ+zTeyYZ$4)wmTj>kjrUuj5;1qUsj}3L48p)E1tnQq@g}*QZK$0 z!dkwYwS3!W>IAtimIlr$D#`JN(O4u5k|&!Eqq#oE?8W->iP?T=>G3P|~X98NsJ*i#sSr#YwojPvCYOviIvU7qI~e-SJ2 z66)~^`@ygHZvV)4_$OS1cW?#XWl7Vb+CF91oGlS;W9oHS3ZJbN3fLK+37uBr53=@M z^{mw9UUY}Bg|X~iTulyIXc${H8pb&?>Xqjf6^kj(6H{yvQ*4XVtQ^w#e8`%8#I@pM z_T!^mB|hP*@OMnYKUuR+S+mbL>wk_0Zn#W*$=>`Gd+XOMVfuff(fO7}-_{yk5Yy;F zOQVY-8eOb4+Rj*(rIAK0jkenwZPzO=u{8RQXtZ54y0pJW+@3ip1-abz4dWJR9HpU% zV`vh$d-EwBOSs*urA#z%TW3-Z+PJOTOoLd$jHpJh+8SLJr_p7MTpq?1mPX&z8eJLF z=qgL2?`aQB)egFYkC?toSGpaCakc1~-ivF(xHgRIgecCd$AcIY#`S_~SvM3FhjC+_ zsJJ7Ho9f~;oWmK1TTRw*IBS^C8jfTQN3n)()^H5w&{!;_aX5pU$3_~DcFq{x+&FF{ z4`+&EmNGMW3{~5(()G8W@mlQt$Yxp7q^9QJ7c%&sa+PvD&HX(tFl|0 zWKYZ_cUmU7OVjVRpIcEi8q*cd$M(djS5=`VyZ>m1fOuh+sj>m3q|4gC`_NLZrl!MGjAaDD(a^NuE4 zWIf!}0uOD#6l%pOv=NJF6LX#t=>)k`OwzHl=D+NC4@Y~yhx&KC4@W!RM`9hXNBT_) zAcZ<%P#1>KR*d1=H<8XoIh}_Ev<;`y`B=@hkZ5+)QX}}`C@)26poYfOOcf$+=dU?@ ztrqJIY*Yu2(!)Pmo^lwE)koUW$GHPNgeRmWeX>u7%57;co+{@m^K^Y4tNe`U@Y67U z#>0^?o-HntZtdsGOZJzi(th4FmAmQHTu0)qeGO8%YEPz}m`%5`CbzLByEtpz!P?x# zefPZRL+^67wZw3`$2!9EAzW->zsPyv9uy|c?$Ix?i}NSh(Rvc18Iz@yMQU z-nJLN_{hU}DTK|D&k$ag^)3AQa(<~r{N-+IeYQosm(RS2|B|!`#k%0v1^A5t-F$7% z&v~V`2cs?YSBws}&|fn;z(RjhYoA3QVb3?$S?H_Q@Y-(P%R+z4kF6ezv%g-Ir&kos zu+i7}85VPrja<|~2QYvhUh>gJj2qwAcSSzZlkbk8u3Z?&!+>3^66e~Tnm%F|28?(ZZ!GI!C*Pkm zEjcP+T=5`wus7;cvMO@k?8WbD`Fm1MiZ%cHy6wp#)0w&lW1@^>bN&!vl({h8vf1Pm zF}Be;Z^yBvhw(?7jZZkmI$?=*!tv2HlXLzQx5g!0VZ0;jievG04n{KiE?en6q;b1x z&|ff^K0qG*6{G1xE@B^HCVk8)aBXiIy#bjkj#bTJ-hD2k>2m2Gi7zpUYul=mA@?K^{*%2 zO^ZBI?Mr&`K^T7x!PP@kgma(8$rb0r2xop@&H+8-63#7q;pP){=@Wevvi$#L>G4WK zaQ5IGVcOo0DNC3n_Om91;ON0)!nDKMle>tItv&a!9)0%YfVxpQ*Y4GMVr>|IvrmWf zJtZNe_F%KjhxfwAL#j2^Qm_5N1!~Ya4|WH4f=&JaW_o3{wRtQH7{fML1QJpjMTlf!`?Y zYAU+abZq0d$|b5CH>tVoAoKa%Qh^_;N<5?%;wiNlNB9l%lB&X6><;g%WjLyq;|oLs?{`Ht)a2%bShE}G+C{sIcgm(RcFyk)kt-!iOy2Zv`cMbXI{uBR9y4F;xUIS Ra4z@CUvk{H=>J9He*l;)CwBk< diff --git a/scripting/java/example/GLPoptions.java b/scripting/java/example/GLPoptions.java deleted file mode 100644 index 1bd974e12..000000000 --- a/scripting/java/example/GLPoptions.java +++ /dev/null @@ -1,662 +0,0 @@ - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.filechooser.*; -import java.net.URL; -import java.net.*; -import java.io.*; -import com.easysw.cups.*; - -public class GLPoptions implements ActionListener -{ - Cups cups = null; - CupsJob job = null; - CupsPrinter printer = null; - - String fileName = ""; - - JPanel mainPanel; - JTextField fileTextField; - JButton printButton; - GridBagLayout mainLayout; - GridBagConstraints mainConst; - - // - // Print options; - // - String[] jobSheetsNames; - String[] orientationNames; - int[] orientationValues; - String[] qualityNames; - int[] qualityValues; - - String jobSheetsOption = ""; - int orientationOption = -1; - int qualityOption = -1; - - int pageLowerOption = 0; - int pageUpperOption = 0; - boolean pagePrintAll = true; - - int numCopiesOption = 1; - int numLowerCopiesOption = -1; - int numUpperCopiesOption = -1; - - int selectedJobSheets = 0; - int selectedOrientation = 0; - int selectedQuality = 0; - - JComboBox orientationBox; - JComboBox jobSheetsBox; - JTextField numCopiesField; - JCheckBox printAllCheckBox; - JTextField pageLowerField; - JTextField pageUpperField; - MyTextListener textListener = new MyTextListener(); - - - // Constructor - public GLPoptions() - { - mainPanel = new JPanel(); - mainPanel.setLayout(new BorderLayout()); - mainPanel.setBackground(GLPcolors.backgroundColor); - JLabel label = new JLabel("No printer selected"); - label.setForeground(GLPcolors.foregroundColor); - mainPanel.add(label,BorderLayout.CENTER); - } - - // Constructor - public GLPoptions(CupsPrinter cp) - { - printer = cp; - if (printer != null) - { - load(printer); - } - else - { - mainPanel = new JPanel(); - mainPanel.setLayout(new BorderLayout()); - mainPanel.setBackground(GLPcolors.backgroundColor); - JLabel label = new JLabel("No printer selected"); - label.setForeground(GLPcolors.foregroundColor); - mainPanel.add(label,BorderLayout.CENTER); - } - } - - - private void load( CupsPrinter cp ) - { - - fillOptionValues(); - - // Create the main panel to contain the two sub panels. - mainPanel = new JPanel(); - mainLayout = new GridBagLayout(); - mainConst = new GridBagConstraints(); - - mainPanel.setLayout(mainLayout); - mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - mainPanel.setBackground(GLPcolors.backgroundColor); - - String tmp_s = "Printing to " + printer.getPrinterName() + - " on " + GLPvars.cupsServerName; - JLabel printerNameText = new JLabel(tmp_s); - printerNameText.setForeground(GLPcolors.foregroundColor); - mainConst.gridwidth = GridBagConstraints.RELATIVE; - mainConst.gridx = 0; - mainConst.gridy = 0; - mainConst.fill = GridBagConstraints.NONE; - mainConst.weightx = 0.0; - mainConst.weighty = 0.0; - mainConst.ipady = 4; - mainLayout.setConstraints( printerNameText, mainConst ); - mainPanel.add(printerNameText); - - JPanel filePanel = buildFilePanel(); - mainConst.gridwidth = GridBagConstraints.RELATIVE; - mainConst.gridx = 0; - mainConst.gridy = 1; - mainConst.fill = GridBagConstraints.HORIZONTAL; - mainConst.weightx = 1.0; - mainConst.weighty = 0.1; - mainConst.ipady = 4; - mainLayout.setConstraints( filePanel, mainConst ); - mainPanel.add(filePanel); - - JPanel orientationPanel = buildOrientationComboBox(); - mainConst.gridwidth = GridBagConstraints.RELATIVE; - mainConst.gridx = 0; - mainConst.gridy = 2; - mainConst.fill = GridBagConstraints.NONE; - mainConst.weightx = 0.8; - mainConst.weighty = 0.1; - mainConst.ipady = 4; - mainLayout.setConstraints( orientationPanel, mainConst ); - mainPanel.add(orientationPanel); - - JPanel jobSheetsPanel = buildJobSheetsComboBox(); - mainConst.gridwidth = GridBagConstraints.RELATIVE; - mainConst.gridx = 0; - mainConst.gridy = 3; - mainConst.fill = GridBagConstraints.NONE; - mainConst.weightx = 0.8; - mainConst.weighty = 0.1; - mainConst.ipady = 4; - mainLayout.setConstraints( jobSheetsPanel, mainConst ); - mainPanel.add(jobSheetsPanel); - - JPanel numCopiesPanel = buildNumCopiesPanel(); - mainConst.gridwidth = GridBagConstraints.RELATIVE; - mainConst.gridx = 0; - mainConst.gridy = 4; - mainConst.fill = GridBagConstraints.HORIZONTAL; - mainConst.weightx = 1.0; - mainConst.weighty = 0.1; - mainConst.ipady = 4; - mainLayout.setConstraints( numCopiesPanel, mainConst ); - mainPanel.add(numCopiesPanel); - - JPanel pageRangePanel = buildPageRangePanel(); - mainConst.gridwidth = GridBagConstraints.RELATIVE; - mainConst.gridx = 0; - mainConst.gridy = 5; - mainConst.fill = GridBagConstraints.HORIZONTAL; - mainConst.weightx = 1.0; - mainConst.weighty = 0.1; - mainConst.ipady = 4; - mainLayout.setConstraints( pageRangePanel, mainConst ); - mainPanel.add(pageRangePanel); - - JPanel buttonPanel = buildButtonPanel(); - mainConst.gridwidth = GridBagConstraints.RELATIVE; - mainConst.gridx = 0; - mainConst.gridy = 6; - mainConst.fill = GridBagConstraints.NONE; - mainConst.weightx = 1.0; - mainConst.weighty = 0.1; - mainConst.ipady = 4; - mainLayout.setConstraints( buttonPanel, mainConst ); - mainPanel.add(buttonPanel); - - } - - - // -------------------------------------------------------------- - // - // Filename / Browse panel - // - public JPanel buildFilePanel() - { - JPanel localPanel = new JPanel(); - final JFileChooser fc = new JFileChooser(); - - localPanel.setBackground(GLPcolors.backgroundColor); - localPanel.setLayout(new BorderLayout()); - - //Create a regular text field. - fileTextField = new JTextField(50); - fileTextField.addActionListener(this); - - //Create some labels for the fields. - JLabel fileFieldLabel = new JLabel(" File to print: "); - fileFieldLabel.setForeground(GLPcolors.foregroundColor); - // fileFieldLabel.setLabelFor(fileTextField); - - localPanel.add( fileFieldLabel, BorderLayout.WEST ); - localPanel.add( fileTextField, BorderLayout.CENTER ); - - //Create the open button - JButton openButton = new JButton("Browse ..." ); - openButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - int returnVal = fc.showOpenDialog(mainPanel); - if (returnVal == JFileChooser.APPROVE_OPTION) - { - File file = fc.getSelectedFile(); - // fileTextField.setText(file.getPath() + file.getName()); - fileTextField.setText(file.getPath()); - fileName = file.getPath(); - } - } - }); - openButton.setBackground(GLPcolors.buttonBackgroundColor); - openButton.setForeground(GLPcolors.buttonForegroundColor); - localPanel.add(openButton, BorderLayout.EAST ); - return(localPanel); - } - - - - public JPanel buildOrientationComboBox() - { - JPanel localPanel = new JPanel(); - localPanel.setLayout(new BorderLayout()); - localPanel.setBackground(GLPcolors.backgroundColor); - - JLabel localLabel = new JLabel("Page Orientation: "); - localLabel.setBackground(GLPcolors.backgroundColor); - localLabel.setForeground(GLPcolors.foregroundColor); - - orientationBox = new JComboBox(orientationNames); - if (selectedOrientation > 0) - orientationBox.setSelectedIndex(selectedOrientation); - orientationBox.addActionListener(this); - orientationBox.setBackground(GLPcolors.backgroundColor); - - localPanel.add(localLabel,BorderLayout.WEST); - localPanel.add(orientationBox,BorderLayout.CENTER); - - return(localPanel); - } - - - public JPanel buildJobSheetsComboBox() - { - JPanel localPanel = new JPanel(); - localPanel.setLayout(new BorderLayout()); - localPanel.setBackground(GLPcolors.backgroundColor); - - JLabel localLabel = new JLabel("Job Sheets: "); - localLabel.setBackground(GLPcolors.backgroundColor); - localLabel.setForeground(GLPcolors.foregroundColor); - - jobSheetsBox = new JComboBox(jobSheetsNames); - if (selectedJobSheets > 0) - jobSheetsBox.setSelectedIndex(selectedJobSheets); - jobSheetsBox.addActionListener(this); - jobSheetsBox.setBackground(GLPcolors.backgroundColor); - - localPanel.add(localLabel,BorderLayout.WEST); - localPanel.add(jobSheetsBox,BorderLayout.CENTER); - - return(localPanel); - } - - public JPanel buildNumCopiesPanel() - { - JPanel localPanel = new JPanel(); - localPanel.setLayout(new FlowLayout()); - localPanel.setBackground(GLPcolors.backgroundColor); - - JLabel localLabel = new JLabel("Number of copies: "); - localLabel.setBackground(GLPcolors.backgroundColor); - localLabel.setForeground(GLPcolors.foregroundColor); - - numCopiesField = new JTextField(3); - if (numCopiesOption > 0) - numCopiesField.setText(new Integer(numCopiesOption).toString()); - numCopiesField.addActionListener(this); - numCopiesField.addFocusListener(textListener); - numCopiesField.setBackground(GLPcolors.backgroundColor); - - localPanel.add(localLabel); - localPanel.add(numCopiesField); - - return(localPanel); - } - - - public JPanel buildPageRangePanel() - { - JPanel localPanel = new JPanel(); - localPanel.setLayout(new FlowLayout()); - localPanel.setBackground(GLPcolors.backgroundColor); - - printAllCheckBox = new JCheckBox("Print all", pagePrintAll ); - printAllCheckBox.setBackground(GLPcolors.backgroundColor); - printAllCheckBox.setForeground(GLPcolors.foregroundColor); - printAllCheckBox.addActionListener(this); - - JLabel localLabel = new JLabel("-or- pages: "); - localLabel.setBackground(GLPcolors.backgroundColor); - localLabel.setForeground(GLPcolors.foregroundColor); - - JLabel localLabel2 = new JLabel(" to "); - localLabel2.setBackground(GLPcolors.backgroundColor); - localLabel2.setForeground(GLPcolors.foregroundColor); - - pageLowerField = new JTextField(4); - pageUpperField = new JTextField(4); - - pageLowerField.addActionListener(this); - pageUpperField.addActionListener(this); - pageLowerField.addFocusListener(textListener); - pageUpperField.addFocusListener(textListener); - - pageLowerField.setBackground(GLPcolors.backgroundColor); - pageUpperField.setBackground(GLPcolors.backgroundColor); - pageLowerField.setEnabled(false); - pageUpperField.setEnabled(false); - - localPanel.add(printAllCheckBox); - localPanel.add(localLabel); - localPanel.add(pageLowerField); - localPanel.add(localLabel2); - localPanel.add(pageUpperField); - - return(localPanel); - } - - - - - public JPanel buildTextPanel() - { - JPanel localPanel = new JPanel(); - return(localPanel); - } - - public JPanel buildButtonPanel() - { - JPanel localPanel = new JPanel(); - localPanel.setLayout(new BorderLayout()); - printButton = new JButton(" Print "); - printButton.setBackground(GLPcolors.buttonBackgroundColor); - printButton.setForeground(GLPcolors.buttonForegroundColor); - printButton.addActionListener( this ); - localPanel.add(printButton, BorderLayout.WEST ); - return(localPanel); - } - - - - public void updateOptions(CupsPrinter cp) - { - printer = cp; - if (printer != null) - { - load(printer); - } - else - { - mainPanel = new JPanel(); - mainPanel.setLayout(new BorderLayout()); - mainPanel.setBackground(GLPcolors.backgroundColor); - JLabel label = new JLabel("No printer selected"); - label.setForeground(GLPcolors.foregroundColor); - mainPanel.add(label,BorderLayout.CENTER); - } - } - - public JPanel getPanel() - { - return(mainPanel); - } - - - - - public CupsJob printFile( String filename ) - { - Cups cups; - CupsJob job; - URL u; - IPPAttribute attrs[]; - - attrs = buildPrintAttributes(); - - // for (int i=0; i < attrs.length; i++) - // attrs[i].dump_values(); - - try - { - u = new URL("http://" + GLPvars.getServerName() + - ":631/printers/" + printer.getPrinterName() ); - cups = new Cups(u); - cups.setUser(GLPvars.cupsUser); - cups.setPasswd(GLPvars.cupsPasswd); - - job = cups.cupsPrintFile(filename,attrs); - return(job); - } - catch (IOException e) - { - return(null); - } - } - - - - - private void fillOptionValues() - { - IPPAttribute a; - int i, n; - - // - // Job sheets .... - // - jobSheetsNames = printer.getJobSheetsSupported(); - if (printer.getJobSheetsDefault() != "none") - { - for (i=0; i < jobSheetsNames.length; i++) - if (jobSheetsNames[i] == printer.getJobSheetsDefault()) - selectedJobSheets = i; - } - - // - // Orientation .... - // - orientationNames = new String[printer.getOrientationSupported().length]; - orientationValues = printer.getOrientationSupported(); - for (i=0; i < printer.getOrientationSupported().length; i++) - { - if (orientationValues[i] == printer.getOrientationDefault()) - selectedOrientation = i; - switch( orientationValues[i] ) - { - case IPPDefs.PORTRAIT: - orientationNames[i] = "Portrait"; - break; - case IPPDefs.LANDSCAPE: - orientationNames[i] = "Landscape"; - break; - case IPPDefs.REVERSE_LANDSCAPE: - orientationNames[i] = "Reverse Landscape"; - break; - case IPPDefs.REVERSE_PORTRAIT: - orientationNames[i] = "Reverse Portrait"; - break; - } - } - - if (printer.getLowerCopiesSupported() == - printer.getUpperCopiesSupported()) - { - numCopiesOption = printer.getCopiesDefault(); - } - else - { - numCopiesOption = printer.getLowerCopiesSupported(); - numLowerCopiesOption = printer.getLowerCopiesSupported(); - numUpperCopiesOption = printer.getUpperCopiesSupported(); - } - } - - - private IPPAttribute[] buildPrintAttributes() - { - IPPAttribute a; - IPPAttribute[] attrs; - int num_attrs = 0; - - if (orientationOption >= 0) - num_attrs++; - if (jobSheetsOption.length() > 0) - num_attrs++; - if (numCopiesOption > 1) - num_attrs++; - if ((pageLowerOption > 0) && (pageUpperOption > 0) && (!pagePrintAll)) - num_attrs++; - - if (num_attrs > 0) - attrs = new IPPAttribute[num_attrs]; - else - return(null); - - int i = 0; - if (jobSheetsOption.length() > 0) - { - attrs[i] = new IPPAttribute( IPPDefs.TAG_JOB, - IPPDefs.TAG_NAME, - "job-sheets" ); - attrs[i].addString( "", jobSheetsOption ); - i++; - } - if (orientationOption >= IPPDefs.PORTRAIT) - { - attrs[i] = new IPPAttribute( IPPDefs.TAG_JOB, - IPPDefs.TAG_ENUM, - "orientation-requested" ); - attrs[i].addEnum( orientationOption ); - i++; - } - if (numCopiesOption > 1) - { - attrs[i] = new IPPAttribute( IPPDefs.TAG_JOB, - IPPDefs.TAG_INTEGER, - "copies" ); - attrs[i].addInteger( numCopiesOption ); - i++; - } - if ((pageLowerOption > 0) && (pageUpperOption > 0) && (!pagePrintAll)) - { - attrs[i] = new IPPAttribute( IPPDefs.TAG_JOB, - IPPDefs.TAG_RANGE, - "page-ranges" ); - attrs[i].addRange( pageLowerOption, pageUpperOption ); - i++; - } - return(attrs); - } - - - - // Implementation of ActionListener interface. - public void actionPerformed(ActionEvent e) - { - Object source = e.getSource(); - - // - // Name typed in - // - if (source == printAllCheckBox) - { - JCheckBox cb = (JCheckBox)source; - pagePrintAll = cb.isSelected(); - pageLowerField.setEnabled(!pagePrintAll); - pageUpperField.setEnabled(!pagePrintAll); - } - else if (source == pageLowerField) - { - String s = pageLowerField.getText(); - if (s.length() > 1) - { - pageLowerOption = new Integer(s).intValue(); - // if (pageLowerOption > 0) - // printAllCheckBox.setChecked(false); - } - } - else if (source == pageUpperField) - { - String s = pageUpperField.getText(); - if (s.length() > 1) - { - pageUpperOption = new Integer(s).intValue(); - // if (pageUpperOption > 0) - // printAllCheckBox.setChecked(false); - } - } - else if (source == orientationBox) - { - JComboBox cb = (JComboBox)source; - selectedOrientation = cb.getSelectedIndex(); - orientationOption = orientationValues[selectedOrientation]; - } - else if (source == jobSheetsBox) - { - JComboBox cb = (JComboBox)source; - selectedJobSheets = cb.getSelectedIndex(); - jobSheetsOption = jobSheetsNames[selectedJobSheets]; - } - else if (source == numCopiesField) - { - String s = numCopiesField.getText(); - if (s.length() >= 1) - { - numCopiesOption = new Integer(s).intValue(); - } - } - else if (source == fileTextField) - { - String s = fileTextField.getText(); - if (s.length() > 1) - { - fileName = s; - } - } - else if (source == printButton) - { - if (fileName.length() > 1) - { - job = printFile( fileName ); - if (job != null) - { - fileName = ""; - fileTextField.setText(""); - JOptionPane.showMessageDialog(mainPanel, - "Job " + printer.getPrinterName() + "-" + - new Integer(job.job_id).toString() + - " queued."); - } - } - } - } - - - - - - public class MyTextListener implements FocusListener - { - - public void focusGained(FocusEvent e) - { - } - - public void focusLost(FocusEvent e) - { - JTextField txtField = (JTextField)e.getSource(); - if (txtField == numCopiesField) - { - String s = numCopiesField.getText(); - if (s.length() >= 1) - { - numCopiesOption = new Integer(s).intValue(); - } - } - else if (txtField == pageLowerField) - { - String s = pageLowerField.getText(); - if (s.length() >= 1) - { - pageLowerOption = new Integer(s).intValue(); - } - } - else if (txtField == pageUpperField) - { - String s = pageUpperField.getText(); - if (s.length() >= 1) - { - pageUpperOption = new Integer(s).intValue(); - } - } - } - } - -} diff --git a/scripting/java/example/GLPprinterDetail.class b/scripting/java/example/GLPprinterDetail.class deleted file mode 100644 index ffdcddb68ed42cc3e0df116e95dbe0e6e023bd4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 4832 zc-pmBd3+T0761NbW;2`JNkTT~50Vf(N(dp*ir12&5QGLdhy;mIsZKUSvas2SyBm^t z)>cugR>iBu3q{2X4>S`rYPEP&TaRk7TD6{dReNA-FROiT_8^Io{?+i|z4!b5-u>S1 z{dS)D^1(*{)QhP;oQd_hI0Kh4xSYWiJ_1+jxXOndtmnl~bo|tZT&&lz!3RI%t9{7B zHOz6X57*&(rZ(o{2HeQhrt|?(I&Sizl=aXKGu)hI*r?+cA2#DwA1ZKLE^fyiOx@|l z7Cyc!mrUKw;2s9|GT6%CJ_h$Q7-Fv+W**kD&4)Uy_u>J@53=GBFCOB>!#+HMpXqqi zhuL^c$Irdk?#1Ii9E2xyJjwVr1{)b{V(^p~zwqK|CZBQD?+$1zwUO=o(skSQIql1@ zym;1!5T5hmc`sh@;@4ih=*3I9_ziZj$jc0V%W|*m5!^X3coo0%;x)#v>v+Ql3%_T} zZ)Sb{zkp5S_H?|Z<81-GHy(*4t++sCC~WsMSY~1{(ccj6>rFH?5m=f!o+IE(gyVKJ zy3~wW0y4DPTx$+AB>E$*=uK%gv4`?PyWk>=aOIm}^oxj^@}ZJ8k=b|Dk(g*SuX;GOeJr z<{Nl?t#)5LY%Pqi8zqZEOVh>|SV=Pyt!Ehn>u`aA@8c{3Kfn(SoQ-n~{0J8a1ir4* zz=gPo4Dv~X*`I7!6pwVyH@iaSpxu`gm@@vL$&MwGamsTtK^}}&INu&fNwEj-7DX!DeSBcxLwuy;V*`J{Ck8&nAJej~=J|HK(~4(g|AbG*dm1u3tf-DZ8~6)$vG&h& z{MEqUSl8#QOKYH#!!@xiBF9ZK(@CAeaF!&N*83GIhErlXfVisB^?x;ytT9cH@ zuK9hdR&h@j);C0Y%q}a@kk0TdLwH1vA$05_d-YwBRfh0lmo9P*;S>IGxoBqD=CBabHbo=hHPuPGy31xLP%%AGZ4D%?Sf|xl9icvr_b`8TFF9Fn zhyr|Oh)En*UbZF+?HE*1rMne3y6&|9oT zg0$))V2C17Y={!7m?&jXCdzdo4KZ0vAssP0W*MSFRHl=Y?XheRi7GDjdvwFb_c?9t z&csn2tF18kT3!>%>Y*kjz8KxLX1=1i2`iax=uvE`y%sY@9;dFn9NW;`mkZ5s(vA;O zwZd`BOj<|u^d<*WM*`Don(1%sW$kd!($aHM)-(K7HG5!nU8PvVcGQkjG7CD)@S3i; z-52X@;w=h$bcnP=+Vfa@mXDHIGoFXl=66TBx})?znbtIA4+DzWc@(7dMt;u&GpPMu_fKnY9n5ZB9q$W1`ph)IOuY+Ql z<1R}i*)JtcWe&=vwiVLBWU1xQpDQ(G1QqQw9aIjZDwr?xw_>V;YN^Tmz%&PYNuM%= zy`@hb!agqCSNc3d_?GnL4`I3sYow1dHbZ(z$mgJz>}w8YwvC{U%+3nbJ7^#S`w

jv!Qv4d)SeMJI3-faB8Q|zWbrT#4F)!2221Ucbr^Gk z0U5}K*eC;TD!wBFDbBevkP$y@l=$H(aR>9xbXXzTeHh z-_5??&A#9DBbS8y?1wHr4vwVkhuQ-z+9YEbOE_b^@}yS9Y&38bn=En3rA(H(4({lckJ~m1T_DWjUkc zq-1owtdhkJPLL&TB38;$7k^Kdx%fm`?&6cAbg{{*9dulWwM+%V4mvkrHQ%lgSnXbq z$1{vo!{`c5l~ZMjgYGuMlO04DmpWL@c#4BHjHyIX#uW~F7?(SUF{a+I8B^(c8CN+t zxotDrGG_FznTe;(B+_P*X)}FkGi%dk`qO3x(q;w;yKQrdTkLG%-3Ii#4d{0p&|fgR z@KZB|r<9!9Rwr{DoJL4@aC%$aJrH7Fu~M9bU}}gdJa2*NG_Gn`Wm740LRl;!b-6(Iz%19;$U=& zmFOmK*NAnn#d`FL4LDhBLPBiETJbdc#q$^tJ1{6-!ztozoGL!RY2s6yEGquhw=lr6Yk*@lhEcHE#mhZ~hwag(wWH!Hhvi}DpV(`VAHs>JPTHSSQS z<4(06Ths$_m)eNC)h67l9*M1LEACT|$Ng#;L+Tnlpq_4!oyzW2Y9w`&vIf(9Xn1+B$r!U4&1l6MjrJOFe&; ag!%dN(2J+tlYQ%Q+|6ACFL58`OaBW^Gvv|$ diff --git a/scripting/java/example/GLPprinterDetail.java b/scripting/java/example/GLPprinterDetail.java deleted file mode 100644 index 4422c1e07..000000000 --- a/scripting/java/example/GLPprinterDetail.java +++ /dev/null @@ -1,244 +0,0 @@ - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import java.net.URL; -import java.net.*; -import java.io.*; -import com.easysw.cups.*; - -public class GLPprinterDetail -{ - - private CupsPrinter printer = null; - private JScrollPane scrollPane = null; - private JPanel mainPanel = null; - - - // Constructor - public GLPprinterDetail( CupsPrinter cp ) - { - printer = cp; - load(); - } - - public void load() - { - mainPanel = new JPanel(); - mainPanel = printerInfoPanel( printer ); - } - - - - // ----------------------------------------------------------- - // - // Build an info panel for an individual printer. - // - private JPanel printerInfoPanel( CupsPrinter cp ) - { - JPanel printerPanel = new JPanel(); - BoxLayout printerBox; - - JPanel leftHeader = new JPanel(); - JPanel rightHeader = new JPanel(); - - JPanel leftPane = new JPanel(); - JPanel rightPane = new JPanel(); - - GridBagLayout leftLayout = new GridBagLayout(); - GridBagLayout rightLayout = new GridBagLayout(); - - GridBagConstraints leftConst = new GridBagConstraints(); - GridBagConstraints rightConst = new GridBagConstraints(); - - - JLabel printerIconLabel = null; - JLabel printerInfoLabel = null; - JLabel printerNameLabel = null; - JLabel printerMakeLabel = null; - - JTable printerStatusTable = null; - - printerBox = new BoxLayout(printerPanel, BoxLayout.X_AXIS); - printerPanel.setLayout(printerBox); - printerPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - printerPanel.setBackground(GLPcolors.backgroundColor); - - // Add border around the panel. - - - // ------------------------------------------------------------ - // Left pane - // ------------------------------------------------------------ - leftPane.setLayout(leftLayout); - leftPane.setBackground(GLPcolors.backgroundColor); - - leftHeader.setLayout(new BorderLayout()); - leftHeader.setBackground(GLPcolors.highlightColor); - leftHeader.setBorder(BorderFactory.createEmptyBorder(3,3,3,3)); - - printerNameLabel = new JLabel(cp.getPrinterName()); - printerNameLabel.setForeground(Color.black); - leftHeader.add( printerNameLabel, BorderLayout.WEST); - leftConst.gridwidth = GridBagConstraints.RELATIVE; - leftConst.gridx = 0; - leftConst.gridy = 0; - leftConst.fill = GridBagConstraints.HORIZONTAL; - leftConst.weightx = 0.0; - leftConst.weighty = 0.0; - leftConst.ipady = 4; - leftLayout.setConstraints( leftHeader, leftConst ); - leftPane.add(leftHeader); - - String imageName = "./images/printer-" + - cp.getStateText() + ".gif"; - JButton printerButton; - try - { - URL iconURL = ClassLoader.getSystemResource(imageName); - ImageIcon icon = new ImageIcon(iconURL); - printerButton = new JButton( "
" + - cp.getPrinterName() + - "
", - icon ); - } - catch (NullPointerException e) - { - printerButton = new JButton( "
" + - cp.getPrinterName() + - "
"); - } - printerButton.setBorder(BorderFactory.createEmptyBorder(3,3,3,3)); - printerButton.setBackground(GLPcolors.backgroundColor); - printerButton.setActionCommand( cp.getPrinterName() ); - // printerButton.addActionListener(this); - printerButton.setToolTipText("Click to go to " + cp.getPrinterName() + - "'s extended informtion page."); - - leftConst.gridwidth = GridBagConstraints.REMAINDER; - leftConst.gridx = 0; - leftConst.gridy = 1; - leftConst.fill = GridBagConstraints.BOTH; - leftConst.weightx = 1.0; - leftConst.weighty = 1.0; - leftConst.ipady = 4; - leftLayout.setConstraints( printerButton, leftConst ); - leftPane.add(printerButton); - - - // ------------------------------------------------------------ - // Right pane - // ------------------------------------------------------------ - rightPane.setLayout(rightLayout); - rightPane.setBackground(GLPcolors.backgroundColor); - - rightHeader.setLayout(new BorderLayout()); - rightHeader.setBackground(GLPcolors.highlightColor); - rightHeader.setBorder(BorderFactory.createEmptyBorder(3,3,3,3)); - - printerMakeLabel = new JLabel(cp.getMakeAndModel()); - printerMakeLabel.setForeground(Color.black); - rightHeader.add( printerMakeLabel, BorderLayout.WEST); - - rightConst.gridwidth = GridBagConstraints.RELATIVE; - rightConst.gridx = 0; - rightConst.gridy = 0; - rightConst.fill = GridBagConstraints.HORIZONTAL; - rightConst.weightx = 0.0; - rightConst.weighty = 0.0; - rightConst.ipady = 4; - rightLayout.setConstraints( rightHeader, rightConst ); - rightPane.add(rightHeader); - - - Font labelFont = new Font("Serif",Font.BOLD, 12 ); - // Font textFont = new Font("Serif", Font.NORMAL, 12 ); - Font messageFont = new Font("Serif", Font.ITALIC, 12 ); - - JLabel pdServerLabel = new JLabel("Server"); - JLabel pdNameLabel = new JLabel("Name"); - JLabel pdLocationLabel = new JLabel("Location"); - JLabel pdStatusLabel = new JLabel("Status"); - JLabel pdMessageLabel = new JLabel("Message"); - - JLabel pdServerText = new JLabel(GLPvars.cupsServerName); - JLabel pdNameText = new JLabel(cp.getPrinterName()); - JLabel pdLocationText = new JLabel(cp.getLocation()); - JLabel pdStatusText = new JLabel(cp.getStateText()); - JLabel pdMessageText = new JLabel(cp.getStateReasons()); - - pdServerLabel.setFont(labelFont); - pdNameLabel.setFont(labelFont); - pdLocationLabel.setFont(labelFont); - pdStatusLabel.setFont(labelFont); - pdMessageLabel.setFont(labelFont); - pdMessageText.setFont(messageFont); - - pdServerLabel.setForeground(Color.black); - pdNameLabel.setForeground(Color.black); - pdLocationLabel.setForeground(Color.black); - pdStatusLabel.setForeground(Color.black); - pdMessageLabel.setForeground(Color.black); - - - JPanel tablePane; - if ((cp.getStateReasons().length() > 0) && - (!cp.getStateReasons().equals("none"))) - { - tablePane = new JPanel(new GridLayout(5,2,2,2)); - tablePane.add(pdServerLabel); - tablePane.add(pdServerText); - - tablePane.add(pdNameLabel); - tablePane.add(pdNameText); - - tablePane.add(pdLocationLabel); - tablePane.add(pdLocationText); - - tablePane.add(pdStatusLabel); - tablePane.add(pdStatusText); - - tablePane.add(pdMessageLabel); - tablePane.add(pdMessageText); - } - else - { - tablePane = new JPanel(new GridLayout(4,2,2,2)); - tablePane.add(pdServerLabel); - tablePane.add(pdServerText); - - tablePane.add(pdNameLabel); - tablePane.add(pdNameText); - - tablePane.add(pdLocationLabel); - tablePane.add(pdLocationText); - - tablePane.add(pdStatusLabel); - tablePane.add(pdStatusText); - - } - tablePane.setBackground(GLPcolors.backgroundColor); - - // printerStatusTable.setShowGrid(false); - rightConst.gridwidth = GridBagConstraints.REMAINDER; - rightConst.gridx = 0; - rightConst.gridy = 1; - rightConst.fill = GridBagConstraints.BOTH; - rightConst.weightx = 1.0; - rightConst.weighty = 1.0; - rightConst.ipady = 4; - rightLayout.setConstraints( tablePane, rightConst ); - rightPane.add(tablePane); - - printerPanel.add(leftPane); - printerPanel.add(rightPane); - - return(printerPanel); - } - - - public JPanel getPanel() - { - return(mainPanel); - } -} diff --git a/scripting/java/example/GLPprinters.class b/scripting/java/example/GLPprinters.class deleted file mode 100644 index 4322f43f8c6a8a21ed96d01bd289cceba4389804..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 8749 zc-pO433yahvi|Gd?(~vNHo|fPfruc1Bt#Jr8$<~P3?_hp#DEK(q!SuC-J!d~;*K&d zh~kFps4$?YxIlys62yHOaD~xvbly0l<1#Aq-YBCpYP)j zPF0<%I(4)6r(JshjH3Ns?86}s_TsN@d@uM10e=(lcLDzp@S}i#3iy|Rp9CCcKoCFz zG%xAo@G|9eQJRZfUi8KxH@O*;$4y?r>0acJ;i6t%5?kOXCD4P@s8qm-0!|VzTENKy z#t1k?z*s(lPL&_uA$j(n&YPP+%(rs)xvtdfEwYScQi1hJD~Y=ftxNAe36ST_Tp|@ zAm{iy`|$q;@_U%;bOSD`^nDVgYT#JBv` zj3;EsV0Iw7G!UKcZwe4{Di`^e`b$IpaAWE0cr+MpWG-*4E*c4iX8Oa-VJeR0rLkqa zSUPQXYKa*=P5xk5=nx^dE1#NWmh_l9&1T{avBfs+mCcp@6_J)Wp}(bve_6bAYBX41 z=5MrCl7~!=gk#K>e*~Lah%!f9?DLBJq)c^~z0p>q(qG$yu4Z>{~qHp0*I5Yiq@n9r8GZ1ZvM4JMv#Nfh?3kWP_Q%WZ(mU5xT ziy7|5K-`u)pu5~IvE!W`X^GYarUb>ttf`eVZTn)QWRHQ*@VS9E@fHCF-o`ry-o<_c z2kJl^apEj8#8x|HDbjXn7!9$Y4ZKBLPygnIJ4tX*Nym8>mY zMVA}2QmCtix`tK}daL7tkl+ltLa7;tug2(y4j$$bW3+xcDN5Lk47WW0*ND@E=W4MpdlJ*Dsa)Q2HhqCZWjS* zlLNA7&>ggn(C;YsCx+h1H++on<3LkROP*FLd+tiQ{D?$nVaG^qzPOo5ts~(AgYKrA z`BtV!qVa_W-9z^pbf18q3%Fmv1N5Ll>ji9(;V%Siq)lSiLk7OVK?7gmYunFB3(F$Q zZ9lWF4;!>u-0}$DIXx=pIjRFvOR`6m2AlkifmqVE5`!M26}&#GG1%auEe1VKPjnMq zAv-GSzJmafohD8uXMz)mGZZ zX*xL+tXo_Vj}$aU1oDLsj}>sS3WVze^##GOWUqu;K{M+x%Ai)+`m|`=E9LVkkuaO) zpgLY9n?+r&d zN@zDdn~eJ8#dbJ&kAQ3Kh&Zy!%Ib5hqJ8lNqK(g>=SBG!B>J3_nwvv>@Qd`4K`+xQ zE_&6V*F=@q1^iNSZ!hh0(HjQ6$<>73qPJbdlkbY$^iCy*3s6TPm{GeZP$zFqkCm=6 z7-PSx62StN`ek!3u6dmw)m*#qb$eFR{LRgLC4}O_BbSfdVU;4@=Z;5`FG!!Bc5>Ct zw&(4_W>sRz$n#=K)mR{IQC^vx>5s*hu^yh7)M|^)l!d80PPwE{;fVP?nIXGUIos(y zu;!}#VUCNa(!lJRTT;fR@RJgWa^z*#MFakLpuDL$zQS4}99LMuzpjr)ty;5p+ovb_ z2NfQJRTS{>71c#T5iuvT)?c@{F&b$J*H4xyzVi;<)r@oiB0a^&p{**)Hr;C?;w%1TksPyP6w!y&UFrG~Acr;$@{ zS+G97kU$ljJ2GBwV<}w?!4SU`u4RE>DENikv$vS(kp>AX$D;g4IZF@5sQ=x3-q_Z}}_sZ{x?aUAx?!#ej_EcvW0C0r+U+@Kuk3%gds;y+hpDmhWEhKB}(NDP_}2W53QQQMmG5+ zVzN16x|f+DM`^i|99BfKtT~ZLXil)%vMZDIuktSrObXXmabFqgh^@|wRVe4BGjB(Y z&rCXK76%(&msLHi=OL$)E;3`;(OoQ8x=Ek4zruJA|p__y|$dw0l>+joWo@duVm_(ZL>^7zwE<6Zps zM|Ex*&++#H!!LNWh3EOJ0kcQ8fkx5}Xd`p<9dHQg6p$vsCBQAfBfu*lU4S8=mw*hl zFLUHhWXbjfvbQN?zhpQC*$julfnM++gPoCuT%I$LgF)zxF zg9Q4w!Stn#Y)4*=nbw8@V&`^f?4<4IwlXGGM zC-IKaH8O6)$?W=V`OjjE&&_si#-gK`b_#={KF-nq8w*W$ANJH3IZ2bfZ5TV7&GdOz zIjN5`f5YKB?Hlaug3i{r<5VWcNhGx6G$wr#58IVrJPC~N;*bd`hn(Ia!^M-Xlm{ou zNU@yJ#c5}DbDD(NcJyk+qy)-jkBo9ACvX-MUTp`;1#<{a5!}bI%E3W7RcOZ!oGmzG z2P$klO|WYR&arW&C~ph(CQxPD<4Rz9b%)~a4&&21j5nCk&41|$%n&kV{7e}s%g*I= znB|iL3|mpdR#fm*8;g>Lt)yWqY1m2{wvy?ll47aoHre5`tN$PEcXzeloxq&xOw+yR zy2xo>6^en85A9Kqx&6Hz2de{3qtkIF8#T9DMIj%!;qX1(6M_qs8w*g! zMfFoEqjJWoy3lIW%0J$Dy_7k8D8hJ*!$g$f3{-LrnZwlin2d{1&ikjZgbFlc8m_=O zSi>B5q6*tF1G_O3ui;!Szq7dX)^K^9$0hV4>V*ZAhdLUHdK!fWDnlcm9;B(5M>7$l zYP8UNEG0jdQyng+Fs`5#xRO?3C9TEPbU&`4&A5SDv6`O8jkFhQ=qubrhj6n-xJC2e zRxKO1Y5BNa8-_cy60Fls!JXRaxJxU?-P#=7qbG$Jp{UN-gKZ$qs z1orDM;eh@o^L~I2^)L8=(&QfnR)tRM%ePSgI8Lw=sLIAZN0M+RiL@l)vNO!*P7)qF z(R|({kxu+&>+40n4Dw}?FRLBZHN|=x&Yxafl0Z#yDgoyetL&R^rkNbc7noKhy3ll_ ziqA!+qZJn?u)uVr@lWmYOBE_gpjIk%hMCcdx&-P?hnbNRNT9(~F>k7fS8%H7b#kPe zD!&w*W~vZ3-MmS{o6mP7&{&-;Z40GtClHhxzQ`(YzHBplCl>p1+7YTTbK214>)noU zsv1VDEw!?x+1g_EZo?8^u9=(CJZk1D3u9)k#Tz$sx$?A_xk)igJBe9liAi9&G9zV@ zLz(1ICS@vL#YcDsQDFv^vU3;atHq*>h zuD!~1nwjF-m1eqfZMxDUUAZ=0xi($7HeIxAsD$m@kP6?ub@d7bZmfIV0(gMs!SD1&@^aH9+cnf*+D zl-HR31>Iztf^IhR1g$j(ne60S%znz$Th0Co-)5Q$-)`n9e22(NVBG^~5Gv=+1n#;Q z^CT(Sad(Z&>2$W?o;KX;8*C0XxudzSn(=@HelD1=@P5Jk&_5v9OyEJm`3bBSoR`1` z!TkLHqIxr?CdH;5A$FrJc9SjkAzSRjw%EREW#a(l;5XD8A5$(qqdxeW`r8cLV&%2jj%t)~(6F!#@oQxUZ?=T0i2Jv545rc&BVC(;2ri9X`ppU^n^ihT4v zji;Yzg65@(T0c5N8%$?vg;b`EqRHAAI!p6WxppQ^(WcN;t&+~xW>JMUpQdSbRHZGU z8QPU}uC|(HY3pdVww~r_TWGGfld82>=zMKI)o35neC>0(Ks!hmYKQ0|?MJ#;*T}DX zsaDUSIz5l-^&!-#kE2C;B`wzHP)NUk!g@VL^bjr4;}q2|qqx3`TJ*KFLf=T2=v(Mg z{b{;fZ>KBtm*^^eAFb36&?@~Sx=#NCU9W#ZH|Pgxwf-I5sQ;bT=!fYhhm&r0WYAhi zU%J(iPq#US(j9!u-{7G2MrfJ*Ig-YAeun)3RN7^~$}aZPi@14yq9|3;pDa>w_Y^k= zTWhki+OSQ&Jhmevr!|46h2Vm>T}|-&v_oZft7NG|Dm}N33DY5~3AB|+u_=+j6)?3# zDou$L8UfQvq&pH&S!_D^S*a?L8osmI+U5A~cgZPgpLN_b)l$xLcD141=QN!=v757x z(eRykHi12+GiO%<&zVkE|9KH=ir*mR1Zo=z!}>i0r*Q7U<`hnpbKgK*P&WYGrn zr;W&`O(>*?P)d(t0zHOu+JY*29CPU@_-QM*GTRWP?O4X0+hxRsnA&hH?c`SF8Qem< zu#VbsFYU$#dKQn+b9jQ=m{xiLZS*21(o1-OUdF5R3ii>fc!yr&WO^N+aGP_G_TezS zMQQXl8T1Zi)4SA{_H#NN;1v254X5`wRo>^+_%)5C59oCIkgfPLr?~ZPx{2Efo$&%L ziZ99q-*pcLSnhnOisNFPV-t6s#r)N|850%HuFgC!CwYe0JbA+NG+t@Ns|mcua64XS z|NXM#Lv=I^CVvluK0z*hih=YQhSHZfksG#g^fk_;gE*VM#SHom=WzpfF@4WF|BDNf crExxE`I>gJ2F{L4kxy>Wj|{(6ALHNs8*L8f-T(jq diff --git a/scripting/java/example/GLPprinters.java b/scripting/java/example/GLPprinters.java deleted file mode 100644 index 9a86a7950..000000000 --- a/scripting/java/example/GLPprinters.java +++ /dev/null @@ -1,509 +0,0 @@ - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import java.net.URL; -import java.net.*; -import java.io.*; -import com.easysw.cups.*; - -public class GLPprinters implements ActionListener -{ - - private Cups cups = null; - public String cupsServerName = ""; - - private JScrollPane scrollPane = null; - private JPanel mainPanel = null; - private JPanel serverPanel = null; - private JPanel maskPanel = null; - - private GridBagLayout mainLayout = null; - private GridBagConstraints mainConst = null; - private GridBagLayout maskLayout = null; - private GridBagConstraints maskConst = null; - - private JLabel serverLabel = null; - - JTextField nameTextField = null; - protected static final String maskFieldString = "Printer Name:"; - protected static final String maskButtonString = "Apply"; - - private String currentMask = ""; - - - // Constructor - public GLPprinters() - { - cupsServerName = GLPvars.getServerName(); - load(); - } - - public void load() - { - String[] printer_names; - String default_printer; - int num_printers = 0; - int y = 0, i = 0; - URL u; - CupsPrinter cp; - - - // ----------------------------------------------------------- - // - // First get a list of printer names. - // - try - { - u = new URL("http://" + GLPvars.getServerName() + ":631/"); - cups = new Cups(u); - - // If authorization is required .... - cups.setUser(GLPvars.cupsUser); - cups.setPasswd(GLPvars.cupsPasswd); - - printer_names = cups.cupsGetPrinters(); - if (printer_names != null) - num_printers = printer_names.length; - else - num_printers = 0; - } - catch (IOException e) - { - mainPanel = new JPanel(); - mainPanel.setLayout(new BorderLayout()); - mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - mainPanel.setBackground(GLPcolors.backgroundColor); - JLabel errorLabel = new JLabel("Error loading printers from " + - GLPvars.getServerName()); - errorLabel.setForeground(Color.red); - mainPanel.add( errorLabel, BorderLayout.CENTER ); - scrollPane = new JScrollPane(mainPanel); - return; - } - - // ----------------------------------------------------------- - // - // Now get the printer objects - // - CupsPrinter[] printers = new CupsPrinter[num_printers]; - for (i=0; i < num_printers; i++) - { - try - { - u = new URL("http://" + GLPvars.getServerName() + - ":631/printers/" + printer_names[i] ); - cups = new Cups(u); - - // If authorization is required .... - cups.setUser(GLPvars.cupsUser); - cups.setPasswd(GLPvars.cupsPasswd); - - printers[i] = new CupsPrinter( cups, printer_names[i] ); - } - catch (IOException e) - { - // System.out.println("GLPprinters: IOException"); - // return(null); - } - } - - - // - // Keep track in case it changes. - // - cupsServerName = GLPvars.getServerName(); - - if (printer_names != null) - num_printers = printer_names.length; - else - num_printers = 0; - - // default_printer = c.cupsGetDefault(); - - // Create the main panel to contain the two sub panels. - mainPanel = new JPanel(); - mainLayout = new GridBagLayout(); - mainConst = new GridBagConstraints(); - - mainPanel.setLayout(mainLayout); - mainPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - mainPanel.setBackground(GLPcolors.backgroundColor); - - // -------------------------------------------------------------- - // - // Add the server name label - // - serverPanel = new JPanel(); - serverPanel.setLayout( new BorderLayout()); - serverPanel.setBackground(GLPcolors.backgroundColor); - serverLabel = new JLabel("Printers on " + GLPvars.getServerName()); - serverLabel.setForeground(GLPcolors.foregroundColor); - serverPanel.add(serverLabel, BorderLayout.NORTH ); - - mainConst.gridwidth = GridBagConstraints.RELATIVE; - mainConst.gridx = 0; - mainConst.gridy = y++; - mainConst.fill = GridBagConstraints.BOTH; - mainConst.weightx = 0.0; - mainConst.weighty = 0.0; - mainConst.ipadx = 4; - mainConst.ipady = 4; - mainLayout.setConstraints( serverPanel, mainConst ); - mainPanel.add(serverPanel); - - // -------------------------------------------------------------- - // - // Add the printer masking panel - // - maskPanel = new JPanel(); - maskLayout = new GridBagLayout(); - maskConst = new GridBagConstraints(); - - maskPanel.setLayout(maskLayout); - maskPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - maskPanel.setBackground(GLPcolors.backgroundColor); - - JPanel localMaskPanel = buildMaskPanel(); - maskConst.gridwidth = GridBagConstraints.RELATIVE; - maskConst.gridx = 0; - maskConst.gridy = 0; - maskConst.fill = GridBagConstraints.NONE; - maskConst.weightx = 0.0; - maskConst.weighty = 0.0; - maskConst.ipadx = 4; - maskConst.ipady = 4; - maskLayout.setConstraints( localMaskPanel, maskConst ); - maskPanel.add(localMaskPanel); - - // - // Add the masking panel to the main panel. - // - mainConst.gridwidth = GridBagConstraints.RELATIVE; - mainConst.gridx = 0; - mainConst.gridy = y++; - mainConst.fill = GridBagConstraints.BOTH; - mainConst.weightx = 0.0; - mainConst.weighty = 0.0; - mainConst.ipadx = 4; - mainConst.ipady = 4; - mainLayout.setConstraints( maskPanel, mainConst ); - mainPanel.add(maskPanel); - - - - // -------------------------------------------------------------- - // - // Add the printers - // - double weight = 1.0 / (double)printers.length; - for (i=0; i < printers.length; i++) - { - JPanel subPanel = printerInfoPanel( printers[i] ); - mainConst.gridwidth = GridBagConstraints.RELATIVE; - mainConst.gridx = 0; - mainConst.gridy = y++; - mainConst.fill = GridBagConstraints.BOTH; - mainConst.weightx = 1.0; - mainConst.weighty = weight; - mainConst.ipady = 4; - mainLayout.setConstraints( subPanel, mainConst ); - mainPanel.add(subPanel); - } - - // ------------------------------------------------ - // - // Put the whole thing into a scroll pane. - // - scrollPane = new JScrollPane(mainPanel); - } - - - - // ----------------------------------------------------------- - // - // Build an info panel for an individual printer. - // - private JPanel printerInfoPanel( CupsPrinter cp ) - { - JPanel printerPanel = new JPanel(); - BoxLayout printerBox; - - JPanel leftHeader = new JPanel(); - JPanel rightHeader = new JPanel(); - - JPanel leftPane = new JPanel(); - JPanel rightPane = new JPanel(); - - GridBagLayout leftLayout = new GridBagLayout(); - GridBagLayout rightLayout = new GridBagLayout(); - - GridBagConstraints leftConst = new GridBagConstraints(); - GridBagConstraints rightConst = new GridBagConstraints(); - - - JLabel printerIconLabel = null; - JLabel printerInfoLabel = null; - JLabel printerNameLabel = null; - JLabel printerMakeLabel = null; - - JTable printerStatusTable = null; - - printerBox = new BoxLayout(printerPanel, BoxLayout.X_AXIS); - printerPanel.setLayout(printerBox); - printerPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - printerPanel.setBackground(GLPcolors.backgroundColor); - - // Add border around the panel. - - - // ------------------------------------------------------------ - // Left pane - // ------------------------------------------------------------ - leftPane.setLayout(leftLayout); - leftPane.setBackground(GLPcolors.backgroundColor); - - leftHeader.setLayout(new BorderLayout()); - leftHeader.setBackground(GLPcolors.highlightColor); - leftHeader.setBorder(BorderFactory.createEmptyBorder(3,3,3,3)); - - printerNameLabel = new JLabel(cp.getPrinterName()); - printerNameLabel.setForeground(Color.black); - leftHeader.add( printerNameLabel, BorderLayout.WEST); - leftConst.gridwidth = GridBagConstraints.RELATIVE; - leftConst.gridx = 0; - leftConst.gridy = 0; - leftConst.fill = GridBagConstraints.HORIZONTAL; - leftConst.weightx = 0.0; - leftConst.weighty = 0.0; - leftConst.ipady = 4; - leftLayout.setConstraints( leftHeader, leftConst ); - leftPane.add(leftHeader); - - String imageName = "./images/printer-" + cp.getStateText() + ".gif"; - URL iconURL = ClassLoader.getSystemResource(imageName); - ImageIcon icon = new ImageIcon(iconURL); - JButton printerButton = new JButton( "
" + - cp.getPrinterName() + - "
", - icon ); - printerButton.setBorder(BorderFactory.createEmptyBorder(3,3,3,3)); - printerButton.setBackground(GLPcolors.backgroundColor); - printerButton.setActionCommand( cp.getPrinterName() ); - printerButton.addActionListener(this); - printerButton.setToolTipText("Click to go to " + cp.getPrinterName() + - "'s extended informtion page."); - - leftConst.gridwidth = GridBagConstraints.REMAINDER; - leftConst.gridx = 0; - leftConst.gridy = 1; - leftConst.fill = GridBagConstraints.BOTH; - leftConst.weightx = 1.0; - leftConst.weighty = 1.0; - leftConst.ipady = 4; - leftLayout.setConstraints( printerButton, leftConst ); - leftPane.add(printerButton); - - - // ------------------------------------------------------------ - // Right pane - // ------------------------------------------------------------ - rightPane.setLayout(rightLayout); - rightPane.setBackground(GLPcolors.backgroundColor); - - rightHeader.setLayout(new BorderLayout()); - rightHeader.setBackground(GLPcolors.highlightColor); - rightHeader.setBorder(BorderFactory.createEmptyBorder(3,3,3,3)); - - printerMakeLabel = new JLabel(cp.getMakeAndModel()); - printerMakeLabel.setForeground(Color.black); - rightHeader.add( printerMakeLabel, BorderLayout.WEST); - - rightConst.gridwidth = GridBagConstraints.RELATIVE; - rightConst.gridx = 0; - rightConst.gridy = 0; - rightConst.fill = GridBagConstraints.HORIZONTAL; - rightConst.weightx = 0.0; - rightConst.weighty = 0.0; - rightConst.ipady = 4; - rightLayout.setConstraints( rightHeader, rightConst ); - rightPane.add(rightHeader); - - - Font labelFont = new Font("Serif",Font.BOLD, 12 ); - // Font textFont = new Font("Serif", Font.NORMAL, 12 ); - Font messageFont = new Font("Serif", Font.ITALIC, 12 ); - - JLabel pdNameLabel = new JLabel("Name"); - JLabel pdLocationLabel = new JLabel("Location"); - JLabel pdStatusLabel = new JLabel("Status"); - JLabel pdMessageLabel = new JLabel("Message"); - - JLabel pdNameText = new JLabel(cp.getPrinterName()); - JLabel pdLocationText = new JLabel(cp.getLocation()); - JLabel pdStatusText = new JLabel(cp.getStateText()); - JLabel pdMessageText = new JLabel(cp.getStateReasons()); - - pdNameLabel.setFont(labelFont); - pdLocationLabel.setFont(labelFont); - pdStatusLabel.setFont(labelFont); - pdMessageLabel.setFont(labelFont); - pdMessageText.setFont(messageFont); - - pdNameLabel.setForeground(Color.black); - pdLocationLabel.setForeground(Color.black); - pdStatusLabel.setForeground(Color.black); - pdMessageLabel.setForeground(Color.black); - - JPanel tablePane; - if ((cp.getStateReasons().length() > 0) && - (!cp.getStateReasons().equals("none"))) - { - tablePane = new JPanel(new GridLayout(4,2,2,2)); - tablePane.add(pdNameLabel); - tablePane.add(pdNameText); - - tablePane.add(pdLocationLabel); - tablePane.add(pdLocationText); - - tablePane.add(pdStatusLabel); - tablePane.add(pdStatusText); - - tablePane.add(pdMessageLabel); - tablePane.add(pdMessageText); - } - else - { - tablePane = new JPanel(new GridLayout(3,2,2,2)); - tablePane.add(pdNameLabel); - tablePane.add(pdNameText); - - tablePane.add(pdLocationLabel); - tablePane.add(pdLocationText); - - tablePane.add(pdStatusLabel); - tablePane.add(pdStatusText); - - } - tablePane.setBackground(GLPcolors.backgroundColor); - - // printerStatusTable.setShowGrid(false); - rightConst.gridwidth = GridBagConstraints.REMAINDER; - rightConst.gridx = 0; - rightConst.gridy = 1; - rightConst.fill = GridBagConstraints.BOTH; - rightConst.weightx = 1.0; - rightConst.weighty = 1.0; - rightConst.ipady = 4; - rightLayout.setConstraints( tablePane, rightConst ); - rightPane.add(tablePane); - - printerPanel.add(leftPane); - printerPanel.add(rightPane); - - return(printerPanel); - } - - - - - - public JPanel buildMaskPanel() - { - - // Create the main panel to contain the two sub panels. - JPanel namePanel = new JPanel(); - GridBagLayout nameLayout = new GridBagLayout(); - GridBagConstraints nameConst = new GridBagConstraints(); - - namePanel.setLayout(nameLayout); - namePanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - namePanel.setBackground(GLPcolors.backgroundColor); - - - //Create a regular text field. - nameTextField = new JTextField(16); - nameTextField.setActionCommand(maskFieldString); - nameTextField.addActionListener(this); - nameTextField.setText(""); - - //Create some labels for the fields. - JLabel nameFieldLabel = new JLabel(maskFieldString); - nameFieldLabel.setForeground(GLPcolors.foregroundColor); - nameFieldLabel.setLabelFor(nameTextField); - - // Text - nameConst.gridwidth = GridBagConstraints.RELATIVE; - nameConst.gridx = 0; - nameConst.gridy = 0; - nameConst.fill = GridBagConstraints.HORIZONTAL; - nameConst.weightx = 0.0; - nameConst.weighty = 0.0; - nameConst.ipadx = 4; - nameConst.ipady = 4; - nameLayout.setConstraints( nameFieldLabel, nameConst ); - namePanel.add(nameFieldLabel); - - nameConst.gridwidth = GridBagConstraints.RELATIVE; - nameConst.gridx = 1; - nameConst.gridy = 0; - nameConst.fill = GridBagConstraints.HORIZONTAL; - nameConst.weightx = 0.0; - nameConst.weighty = 0.0; - nameConst.ipadx = 4; - nameConst.ipady = 4; - nameLayout.setConstraints( nameTextField, nameConst ); - namePanel.add(nameTextField); - - JButton applyButton = new JButton(maskButtonString); - applyButton.setBorder(BorderFactory.createCompoundBorder( - BorderFactory.createRaisedBevelBorder(), - BorderFactory.createEmptyBorder(2,2,2,2))); - applyButton.setActionCommand(maskButtonString); - applyButton.addActionListener(this); - nameConst.gridx = 2; - nameConst.gridy = 0; - nameConst.fill = GridBagConstraints.NONE; - nameLayout.setConstraints( applyButton, nameConst ); - nameConst.weightx = 0.0; - nameConst.weighty = 0.0; - nameConst.ipadx = 4; - nameConst.ipady = 4; - namePanel.add(applyButton); - - return(namePanel); - } - - - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(maskFieldString)) - { - String s = nameTextField.getText(); - if (s.length() > 1) - { - currentMask = s; - } - } - else if (e.getActionCommand().equals(maskButtonString)) - { - String s = nameTextField.getText(); - if (s.length() > 1) - { - currentMask = s; - } - } - else - { - GLPvars.selectedPrinterName = e.getActionCommand(); - GLPvars.tabs.updateDetailPanel(); - GLPvars.tabs.tabPanel.setSelectedIndex(2); - } - } - - - public JScrollPane getPanel() - { - return(scrollPane); - } -} diff --git a/scripting/java/example/GLPsearch.class b/scripting/java/example/GLPsearch.class deleted file mode 100644 index 2db6a39499a76b5b407854e1d7117bcc46152a78..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 2428 zc-o~^+fx%~6#uOx*(5Bta4Cpr)oMcoB2ZEBE(*qmKn1jTDJ;nX(Xfeo0qsrOYVXtO zQ)k)-XWBma(wBB1IJMK6zSx;Q_7AH4og|>e*y&8k@H=O}?|kQ+-#O>o{o}8ne+AHm z&x2^kU;tqZ37ip#37i#pRUj@fERYZw31SqlsW>Nc%#U$DCW1JR3j(jp;-nuJRa^?9 z0fPdU1+ECZp<>F9X+QKJS}>y`8AKaW0T`GSZBDd#(b57}#pN||nF(@ZL4~Ozt0JeM zDw9p>nKN12N$3lPf>8XbzNkktx;YmebF8#EcSu3yx>0O&?P<)NNf?fT+V#B?sgz~d zwt}Xj57Tg>F+ypbeyWnLWf`V3l}$QwR*5O_CbOSX*~p0s z%QcB%(F1AIF)Yi?F^9lYQMk*{o?;gMIm0=xXI!JO&a8uDS=UM$gK3FVJrp0c4c$u4 zcS$%6`*B1=1bZ}e2y_Z`A*x|7x;69&^a{L!eH!|(PsMc&7FfEr^~z0{*UapaDTO_K zBWdKEbk@}1z-1Y`5B79*_Z{f!?&{vVmo@5Av8Z7QH#FSDn;PB{E3g0?*`IW0XAMik z+jvLdT@AOyRC^NjT%6UPcbr^*G|EW*eZAe$oK>iiEyQjsXkeA1hHl@qm!e5GXGaGJ zviF{f_ceSVZ13QnNi za4>ec$sz&vC%!g^3Yx?1&l|x?T0WWfhBd=~&U@{~H5q!H({HAX8zZv{8pCA%F>^!g}^TJ(n{~vg;`4HeSAobkrJ-{mZW3$*v_|HeJqsT{!-9=L>5p z8?dNbOv^9Lov;myi?-nuwV*7H>bAX<61s-7rdP|xkl~y%W_35iCipUjIp?sA0rEY0 zvsm!R^BF$ds~SC(8qbay)}mp>)3$@{d~LS#bsOM6uNUO6qa-^^lJ|_bNv>K!_LO9A zN%GDWWM4t5ye0c_fOwEkf5L+b%Bzu8C=q1^n*=HZJObW`X9d1U#R^mbzd%4B7-^Nq z2dJdceRzf=k!5)Es1g^UYVom*icn1+wMS&DqGC%Pb@cipBlqD5jzgo?&)5mn6E`yx zjXbMR&0jrg(2P31$wSz|r*-jOAq@&Iyk->|42DK8-)g&V>> ze9K}K3pc|O0ms<2U(m qHcGMgl1uQ1b#q@~F+)62)- 0)) - { - lookupAddress = InetAddress.getByName(host); - GLPvars.addToServerList(lookupAddress.getHostName()); - } - else - { - } - } - catch (IOException e) - { - } - } - if (!is_done) - is_completed = true; - is_done = true; - } - - public void interrupt() - { - is_done = true; - } - - public boolean completed() - { - return(is_completed); - } - - public boolean done() - { - return(is_done); - } - - public int getValue() - { - return(count); - } - -} diff --git a/scripting/java/example/GLPsearchProgressPanel$1.class b/scripting/java/example/GLPsearchProgressPanel$1.class deleted file mode 100644 index aed39b445d383877ce56b450ab83962c0e42cd2c..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 2470 zc-oCtTT~NA82*NYY*-eBXw=BXNTUs?1W?g}XfcX~22Bl8kyhO#BZMZqbaw-2Z`RWL z{ocOx)F)p0Qfz~*r}oYE^tI>o)u+DnweQ-0b|Vo9J?5Ou%>U0n-+%dLX6KJPKi>q< zhOcC7LuVC2*ezoZ_R8qOJ~7%a<1us#u}6ppWc1>o&>a%u<6iX1IE<)hjtI?BFZyL1 z6T%Z1kT57?9iFTrA?C%95RQxHgoL<^0G<*vC&efsnqdj2WHjM)HAZnp%#DfW85z&w ztb}tC&Pz}kJk~_U47D?CiXDr^O|BZLiMXMU8{9PGs>ZWD3{{DXnl-_#Op5FeWVDQR zkfA=j+Jcr526t3XbB49CjK+`Wb4hLttI4d;s3|L>YjJK|(2X2VGi(XRCe>**qRv+2D0o*S@gCkM+RB$B)X4w_WkA!o5zVTm$xQ+9 zfrJkge1wk`e1cCEe1^{@e4*e=TwEQigYvK`%BmF2iR2_tSqzP3S&L;%i<3_VS6Fbj zp*$v$s-{vTh1%O`^KD;!GmVvI#8zAq7`)@$8d0-(Zu=T2L3RkpJ*z{;mKFEjIuqhtSTb8bon{{Q>L@p)fuou;HIaQ-W=`S8ioAHEYkiC5rB{Ci6vsNjRJtC5} zhm9nrChaT5w^B>sgfXoeCPNM7oUo6R*iRxH+6OBFVyFxc*hF|8*TX}E9DDG{kzEai z9o4h>oOWEz5n~&|1LgCR?{VBmUN_!f1ZUg#IR3VVm!)M1Uy=Jf3Y+R;OwPTxKDP2i z_c*0b@GQ5hKV;vTb>k1Hs4~sr<#iNQS#CpEjjNFm>aYW9`hNu4`)WG9OkX<8JC`Ty zocOY~&h<|fAsVYhKw?PItx4slOovm417A5prQ!lALw+i)THIM-r-2}SRJYNsww?Yy zam!QR0`aS$e=By7ypu-FBnyq)x(L>~<406{4{;mrqSiw_u$S64L>zne8{DX(ez&XF zb#NYATYo^sb+{TkZ^75FBoyF2-#h1GjkVsZcW*oD%7y|wt}eH$t8yMYi>CfcS{Nt^ z1xQ~*nRBywc&MGLWd2Hl@u%NS9e#Bzy#-ViL5p1hGNC&{wNELa=DzV7XS~)|TR`1) z__{p-&n=h%&&_X;yMcA1G;%Lu{WbU(;CJ~p6tL0NCCy_!i2;va>hw#l0yfP_%rBAc z)w}=PKwy+67qR&o>K9N?(+$)W(Aez_cyFL-lpnOR|p1?#1J^?bi^@@lemloeT|0kEl%M(jNm#> z;}?3n{EjjFMJsO8!{u+B#lO_w!8ulqB=aG~HY3eiaEWzN1QlqvH$w-Wrrt-RCOE&4 G)BOih&x{cO diff --git a/scripting/java/example/GLPsearchProgressPanel$2.class b/scripting/java/example/GLPsearchProgressPanel$2.class deleted file mode 100644 index 131a55844b63cb263312191c49eed9506d9ba44a..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 1188 zc-oCr+foxj5IsXemMjZ|Ajm}!A;1QZ2#OcPC`Q2O2B`|ggKwK;Og3&d)XpZrr|<PEPHlUE<)*4P4`Ui^yxF*J^TH~*KYvkkW&%EXcS$zrD6=@QX~{iw4)W1 zQcOjmBdKBIDj+Zhl;pMr_i=I_?R;9_u zRP*(QTjXnLCg{G3G7(2x5X;^*(h)LI!O|(;a&n15it60;pj+Yv;c%|UA1_Nsh{Z}Mr;T*`DLX{#jO#S2f za>J=sSL4nzgmjso#Q$WHp{LBfZCQk@SSeK-!lUCp#9OL0eG9V8a7|Ad7x_{SW0p8Y ztnGOFbdtPsmh;D)bxM5Chs-i4M7wFa)Mae}`>h;9Ty{^jUhtd3&%H#xXrq$<=DI?} z`}Az~Qc4|ySaY|@-3_xw%zJg?Vzq*%^vnYBh|1t{Nv@s6#*R4a8~@uixI^IE-PkFa z9uGYH{9}}!XpG)eH_fZad#UYXr(!e{C zH!%F`{4PTD%7Ldd#|RxDd`LQcg4W#Z7ep8i5cz-!S}P3cBeV^NjuAb9x)dG=e@6Qe zv?FvJqw_S#B%&lOwBbDwt`RYZ!U>GSqrXK1i)bQ^Jt8^clfQ{x(s5e#AQ)YN`U%o4 BB^m$# diff --git a/scripting/java/example/GLPsearchProgressPanel$ButtonListener.class b/scripting/java/example/GLPsearchProgressPanel$ButtonListener.class deleted file mode 100644 index 40f8c1c1eb42d57e38d865672896d6ad09318e28..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 1686 zc-oCs-*XdH7(F)$-DF)$2~b;`mVhZHsU#ubFG8yjC>9rpB!Dgc+AP<0nPeAtZwijD zeelHx$Ke4Tbr@%?IF2JT5EvYN@-}H&svgTthZ`La%h;q5e;LADLATO z7RShN*`KW7Ee&%xuHbDAI!=(2)_`R%#xwF#a8ko5lqlc-B{aN)(;CXCNa`~h&f**; zR~F7C1@CH@M@hqi)I5*(6ui%nXtBm?j%n25UZZMr5vNq+#WSUH+~e*tcRdXs;0VKH z?^F_p8$vj?Zh3;+++`SC4`_2XJ&QHN^SH+_oqFA{X{)v+Q+h|MELjT~+n&_dyDOv?7>0Z2PMd9* zCiN2gb95*({STQ>dnM~#CcW%&-KhFUHM$XHP&_Uw{EArTX3f8U!q!A{xjaL@uju*C zKq1xL>1H6?yZhUIa#bif*Db$KF3vt}&aG2HEL(fPv@70*{oCXT!xbI9ywuzClzJ7b z&RtU5vH_$w#-Nq$>IDNlHL1&BZsC*UaISzRR=$^n1>c=VCMSY2=={sQQsoMzL zq#nagY6s{Ed_nClywIA@Dujjz{dcN~U^LXkrfc{-eG7rR7>FuOgk?Mw{sWP_P|pRY zS25ZeeJ1uhBJ;7(M|Yr=R{|_H6u$oWVQcK!=wK6@yW*kX%qk|<7LModw+AV1V#`X9 zjmy;!T41z^t*e;#4GsE+PP7eeBSX?dn<~~t6(g$cZ6gob;*`;FSNvS38VeYv_A6+( zO0~U)NqmhozQHs-XYnmg<2(AEd=C@X;ot{+M)3-M#FzMqMt{Z){DNQUcMreeKE;3I bHvT~q4+#k%;qS~O4#~YB#S!}7coX;!Szxz{ diff --git a/scripting/java/example/GLPsearchProgressPanel.class b/scripting/java/example/GLPsearchProgressPanel.class deleted file mode 100644 index 2ccc411da14596677dcecb9d7928c54a17d4944a..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 2709 zc-oCtTXz#x6#h;UI!PEP4J}uJ&>LxJo3`M!c%iYyVrZj*YCzCQGEGyGnL0CR=~5A| zC?ei3Fa82w)J4*@>{_~(kG}W^{1y7na_^a3OqwV!`|PvN{=T!%-e;eg-|zkW3xH94 z>q7+RSzKVTz~TiKFZwZtBx@HXT=L>2KfJii;);Zq{gCkrPZS9$FVcQ=;<67JsH`or zmSt^8Le7spSY~mRMV>{01$k-ESzBVUBH>j(jvy()@Z%_wJTX};dSUTc^kTI#uGyo6 zYZBJ|80J`x<24DdOL#+I=Tyl7BSayS~hYvUSFFO*k0} zWxR>&0t2mg>Thf$M%<9`7Ty*JY)yc`ki#5Yr$YqudRoZ`&0B_=1fv(?iJ++( ztEyp2ct^&&cu&UrxGCcU);`2dfqm^R25){##z(j<<73>B@d<8A_*BMcjQt#Unq#V5 z_8vAylr<|dr5hR5h$$4ECF2WxNxe0v8y02aD|}6PiK?2#&F-02OiQ3^%l)G8+9YaR z036{r)LpGz1a{exvY=6=~`4T6cjB(m!bV- zBtVyv$vA-etJhm0=d-J;bhb#NhYj=*XS7wb5Zu%xPXi(ii8SEv z@CG`?EhoWMJ0@x=IkVCVoPojNOjb zT}BT%>`A)2aBl;9OYqQw$6dxg9zA93ugnkdXhRP=+5=@As`wlxiX+Jl1UaU=kT!9Y zX1!(f@yrJGv&MS{2Fe($Ogw>OWrQjdS74}&FfkoZc8TFl4D$g-HZWR(`$syqz!b?V z*h_LRJm`iG`|1DT0R0ghq(7QNl)S^3rrA8D{0e%ph(7w$=*KDsa07$5g=6$y4BAyU=ub@GFM5~+qIlX#I57%4;oCUEA8H|V*v4O}I@6e;S~a_FYj)j% zGk{&rXE56W;Asyyi)UK^-0cA|oNEDawFk^my0!vDdq5n|RRBleCJj`*;}=WqkL|+q UwoFipfdFYTC48LpVS63_0O)p+rT_o{ diff --git a/scripting/java/example/GLPsearchProgressPanel.java b/scripting/java/example/GLPsearchProgressPanel.java deleted file mode 100644 index 7d1734f82..000000000 --- a/scripting/java/example/GLPsearchProgressPanel.java +++ /dev/null @@ -1,195 +0,0 @@ -import javax.swing.JTable; -import javax.swing.ListSelectionModel; -import javax.swing.event.ListSelectionListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.JScrollPane; -import javax.swing.JPanel; -import javax.swing.JFrame; -import javax.swing.*; -import java.awt.*; -import java.awt.event.*; -import com.easysw.cups.*; - -public class GLPsearchProgressPanel -{ - private JProgressBar progressBar; - private Timer timer; - private JButton searchButton; - private JLabel progressLabel; - private GLPsearch tasks[]; - private JPanel panel = null; - - public GLPsearchProgressPanel() - { - //Create the demo's UI. - searchButton = new JButton("Search"); - searchButton.setActionCommand("Search"); - searchButton.addActionListener(new ButtonListener()); - - progressLabel = new JLabel("Search your local subnet for CUPS servers"); - progressLabel.setBackground(GLPcolors.backgroundColor); - progressLabel.setForeground(GLPcolors.foregroundColor); - - progressBar = new JProgressBar(0, 254); - progressBar.setValue(0); - progressBar.setBorderPainted(true); - progressBar.setOrientation(JProgressBar.HORIZONTAL); - progressBar.setBackground(GLPcolors.backgroundColor); - progressBar.setForeground( Color.blue ); - progressBar.setStringPainted(true); - - panel = new JPanel(); - panel.setLayout(new BorderLayout()); - panel.setBackground(GLPcolors.backgroundColor); - - panel.add(progressLabel,BorderLayout.NORTH); - panel.add(progressBar, BorderLayout.CENTER); - panel.add(searchButton, BorderLayout.EAST); - - //Create a timer. - timer = new Timer(300, new ActionListener() - { - - public void actionPerformed(ActionEvent evt) - { - int n = 0; - for (int i=0; i < 8; i++) - { - if (tasks[i] != null) - n += tasks[i].getValue(); - } - progressBar.setValue(n); - - - // - // See if all the threads completed yet. - // - int d = 0; - for (int j=0; j < 8; j++ ) - { - if (tasks[j] != null) - { - if (tasks[j].done()) - { - d++; - } - } - else d++; // Thread removed ??? - } - - if (d >= 8) - { - timer.stop(); - progressBar.setValue(progressBar.getMinimum()); - searchButton.setActionCommand("Search"); - searchButton.setText("Search"); - progressLabel.setText("Search local subnet for CUPS servers"); - - String[] servers = GLPvars.getServerList(); - if ((servers != null) && (servers.length > 0)) - { - GLPvars.searchTM = new GLPjobTableModel(servers.length,1); - GLPvars.searchTM.setColumnName(0,"Search Results"); - for (int i=0; i < servers.length; i++) - GLPvars.searchTM.setValueAt(servers[i],i,0); - GLPvars.searchTable = new JTable(GLPvars.searchTM); - - - GLPvars.searchTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - ListSelectionModel rowSM = GLPvars.searchTable.getSelectionModel(); - rowSM.addListSelectionListener(new ListSelectionListener() - { - public void valueChanged(ListSelectionEvent e) - { - //Ignore extra messages. - if (e.getValueIsAdjusting()) return; - - ListSelectionModel lsm = - (ListSelectionModel)e.getSource(); - if (lsm.isSelectionEmpty()) - { - //no rows are selected - } - else - { - int selectedRow = lsm.getMinSelectionIndex(); - String newServer = (String)GLPvars.searchTM.getValueAt(selectedRow,0); - GLPvars.setServerName(newServer); - GLPvars.tabs.updateServerPanel(GLPvars.cupsServerName); - } - } - }); - GLPvars.tabs.updateServerPanel(GLPvars.cupsServerName); - } - // DEBUG - - } // threads complete? - - - - } - }); - } - - - - - /** - * The actionPerformed method in this class - * is called when the user presses the start button. - */ - class ButtonListener implements ActionListener - { - - public void actionPerformed(ActionEvent evt) - { - - if (evt.getActionCommand().equals("Search")) - { - progressLabel.setText("Searching ....."); - // - // Create the search threads .... - // - tasks = new GLPsearch[8]; - for (int i=0; i < 8; i++) - tasks[i] = new GLPsearch(i+1); - - searchButton.setActionCommand("Stop"); - searchButton.setText("Stop"); - for (int i=0; i < 8; i++) - { - if (tasks[i] != null) - { - tasks[i].start(); - } - } - timer.start(); - } - else if (evt.getActionCommand().equals("Stop")) - { - progressLabel.setText("Search local subnet for CUPS servers"); - - for (int i=0; i < 8; i++) - { - if (tasks[i] != null) - { - tasks[i].interrupt(); - } - // tasks[i] = null; - } - - searchButton.setActionCommand("Search"); - searchButton.setText("Search"); - - } // Stop event - - } // actionPerformed - } // end of class - - public JPanel getPanel() - { - return(panel); - } - - -} diff --git a/scripting/java/example/GLPserver.class b/scripting/java/example/GLPserver.class deleted file mode 100644 index 2ad5f77db7df9b2c0fdab3ad1c512af54bfb8ca5..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 4304 zc-oCu33yc175?wbB(w0yMp(ic5bb0mRuq&(0@-MA5&}U&M3k4z%VfeVVdhO1Q7O2h z#RatrZbdCFXbXXvqy}v1Vq06gxwLdqTe?@<+J&xP+jH)F6DEt;$@iVRob{gb-}7!> z`Ok|l0a%28yRZq{owy3uGr57ujZAjf@o^V2u+xcMxXFQ=d2x#axAJ(K9k;tM8M~Qz zhl|ATwBr*l8= zXY#NekGQY^kFxAzJbRqUryMxIvQJn$yYM70pK_9yPcu2l9_4_KFd5+GUMBmQJZuRbb)kmOR)b?1m8TcWUq_tApumi_==L8?>gvFa}&Q93zk{zG7;|l_lqI#r9 zk2Gl^Js^C$?%zOrbqKjbT0EqBYMkQQn0w1gBRD3I$}rGaEiy{59y7uU>n6`CcqX5YZO+N8FrH%=?F)HI_=DJo36E9qfGCiQqPYgAmzWD97o4ebKiV=K$DC++y6iZ4MUOU)7u1?%)^EMP=cd>LP%bTx(xOqdiz zl8l$}RZ8}FEU>|^srWkDRYVXTE0a9eNTyar{N5_f=h6DZF+*V1Sca@zMDvH(=_~k# z9p6;(D!!%S+xU(h-&OHFyr$xHykS`#j}#8+O%8UrvjHBFiGT%MwKFFq2meQzL#%gKSeRY!I5p<MQnM-S6u(h#_i5R>V&CcWY9dM_Ok}SdMfSfr}>$&~uJ%B%@EG z1PT;Qe7cD?DHSG?)@lBz?yaH>2a@=h<32Z*@=Q%>jB=b*+jK5ioeOaj@kSdbr!znJ zn?{iGje}J7*y7QbRo@oV0?{!aJnLE)UPW~xGu*97G@yrkTx0qO*PEb91&2Lq3SvGz z;x<9xYI-Rt{H3EelfoZ6Inwt|j`Yc+(Z+3AjvdzMvqt(N&^Q}i*h;nnQfD5mgDL9@ zq|=-}s6@MIXE*6l>qLFgAViUfLt&D}#Kt6j7#XcL+aT;m;TV7;E!UZVizc~~($W%8 zhcUU8R)feqimajpvX784fo<|(J&EXCaxfWAWYS+Yy*hI+gMwO!0+iCRm(r83hE^ZL z`J@#|hL!d%J+LzD8&g(=g~pGAyvEW2EKK11QsyLZL6PKqgg9}y zY0oX$g>ricMRLEmM2VxMBrT3oCW}ha<0vc1!-a8NRFWCT;u3ot7c;q}m`#)+sYOm*A;sa~9-P6xiUCB?h#L)1%?x}^zRmg?8`;eO|)_@&G&YZ*p)Yi`9LE?;KL zw+&&rmGvQ1Ca@ykmRpg)%6uDTx61U9&ORv2vf_Lj+nU%Fd&svXP)+u0sIs-o(u?xb z6R0B`nszc$VqL`s@=!l6+O(8t37J>4n7Z~6-7HhnGg@;1SxH5jCeYY2f?&~sR+^U* zju#Pf%P=OUQO^OXSD^A>^Wa3t3DsEF|<91~}b}JX)4y6otD&^RttiWALE$&uU z;~r%V?o~Emud)gEDO+&A(uoI@C}l|?3d3qh1JtC_XzU`Sui+cpv=7$RT-!jET4#F- zO(jEUmN$BR0$1{_po^KnhNrPaYE?+BB2%j+sWmfIYvWn1vmI**bt+KBR6K?}JWj3i z0QIRSP>3gqcaSRj3{~z~s?Z^9!1L6gU!azIn6zW)vEr|x_!Vx$#q5n5V$x&lL>{M6 tI|hzXkBq~C1a-$jLfH^;>BVbVoI@kG=yb;D;Stpgxp{(UzwGSS{STcKYnuQ7 diff --git a/scripting/java/example/GLPserver.java b/scripting/java/example/GLPserver.java deleted file mode 100644 index ee24c8cca..000000000 --- a/scripting/java/example/GLPserver.java +++ /dev/null @@ -1,192 +0,0 @@ - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import java.net.URL; -import java.net.*; -import java.io.*; -import com.easysw.cups.*; - -public class GLPserver implements ActionListener -{ - - private JPanel serverPanel = null; - private JPanel searchPanel = null; - - private GLPjobTableModel tm = null; - private JTable table = null; - - protected JLabel currentLabel; - protected JLabel currentLabelValue; - protected JLabel actionLabel; - protected JTextField serverTextField; - - protected static final String serverFieldString = "New Server Name:"; - protected static final String applyButtonString = "Apply Changes"; - - - // Constructor - public GLPserver() - { - GLPvars.searchTM = new GLPjobTableModel(1,1); - GLPvars.searchTM.setColumnName( 0, "Search Results" ); - GLPvars.searchTM.setValueAt("No search results",0,0); - GLPvars.searchTable = new JTable(GLPvars.searchTM); - - load(); - } - - public void load() - { - GridBagLayout serverLayout; - GridBagConstraints serverConst; - - // Create the main panel to contain the two sub panels. - serverPanel = new JPanel(); - serverLayout = new GridBagLayout(); - serverConst = new GridBagConstraints(); - - serverPanel.setLayout(serverLayout); - serverPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); - serverPanel.setBackground(GLPcolors.backgroundColor); - - - //Create a regular text field. - serverTextField = new JTextField(32); - serverTextField.setActionCommand(serverFieldString); - serverTextField.addActionListener(this); - - //Create some labels for the fields. - JLabel serverFieldLabel = new JLabel(serverFieldString); - serverFieldLabel.setForeground(GLPcolors.foregroundColor); - serverFieldLabel.setLabelFor(serverTextField); - - currentLabel = new JLabel("Current Server Name: "); - currentLabel.setForeground(GLPcolors.foregroundColor); - currentLabelValue = new JLabel(GLPvars.getServerName()); - - serverConst.gridwidth = GridBagConstraints.RELATIVE; - serverConst.gridx = 0; - serverConst.gridy = 0; - serverConst.fill = GridBagConstraints.HORIZONTAL; - serverConst.weightx = 0.4; - serverConst.weighty = 0.0; - serverConst.ipadx = 4; - serverConst.ipady = 4; - serverLayout.setConstraints( currentLabel, serverConst ); - serverPanel.add(currentLabel); - - serverConst.gridwidth = GridBagConstraints.RELATIVE; - serverConst.gridx = 1; - serverConst.gridy = 0; - serverConst.fill = GridBagConstraints.HORIZONTAL; - serverConst.weightx = 0.4; - serverConst.weighty = 0.0; - serverConst.ipadx = 4; - serverConst.ipady = 4; - serverLayout.setConstraints( currentLabelValue, serverConst ); - serverPanel.add(currentLabelValue); - - // Text - serverConst.gridwidth = GridBagConstraints.RELATIVE; - serverConst.gridx = 0; - serverConst.gridy = 1; - serverConst.fill = GridBagConstraints.HORIZONTAL; - serverConst.weightx = 0.4; - serverConst.weighty = 0.0; - serverConst.ipadx = 4; - serverConst.ipady = 4; - serverLayout.setConstraints( serverFieldLabel, serverConst ); - serverPanel.add(serverFieldLabel); - - serverConst.gridwidth = GridBagConstraints.RELATIVE; - serverConst.gridx = 1; - serverConst.gridy = 1; - serverConst.fill = GridBagConstraints.HORIZONTAL; - serverConst.weightx = 0.4; - serverConst.weighty = 0.0; - serverConst.ipadx = 4; - serverConst.ipady = 4; - serverLayout.setConstraints( serverTextField, serverConst ); - serverPanel.add(serverTextField); - - JButton applyButton = new JButton(applyButtonString); - applyButton.setBorder(BorderFactory.createCompoundBorder( - BorderFactory.createRaisedBevelBorder(), - BorderFactory.createEmptyBorder(5,5,5,5))); - applyButton.setActionCommand(applyButtonString); - applyButton.addActionListener(this); - serverConst.gridx = 1; - serverConst.gridy = 2; - serverConst.fill = GridBagConstraints.NONE; - serverLayout.setConstraints( applyButton, serverConst ); - serverConst.weightx = 0.4; - serverConst.weighty = 0.0; - serverConst.ipadx = 4; - serverConst.ipady = 4; - serverPanel.add(applyButton); - - GLPsearchProgressPanel progress = new GLPsearchProgressPanel(); - searchPanel = progress.getPanel(); - serverConst.gridx = 1; - serverConst.gridy = 3; - serverConst.fill = GridBagConstraints.HORIZONTAL; - serverConst.weightx = 0.6; - serverConst.weighty = 0.3; - serverConst.ipadx = 4; - serverConst.ipady = 4; - serverLayout.setConstraints( searchPanel, serverConst ); - serverPanel.add(searchPanel); - - serverConst.gridx = 1; - serverConst.gridy = 4; - serverConst.fill = GridBagConstraints.HORIZONTAL; - serverConst.weightx = 1.0; - serverConst.weighty = 0.5; - serverConst.ipadx = 4; - serverConst.ipady = 4; - serverLayout.setConstraints( GLPvars.searchTable, serverConst ); - serverPanel.add(GLPvars.searchTable); - - } - - - public void actionPerformed(ActionEvent e) - { - if (e.getActionCommand().equals(serverFieldString)) - { - String s = serverTextField.getText(); - if (s.length() > 1) - { - GLPvars.setServerName(s); - serverTextField.setText(""); - currentLabelValue.setText(GLPvars.getServerName()); - } - } - else if (e.getActionCommand().equals(applyButtonString)) - { - String s = serverTextField.getText(); - if (s.length() > 1) - { - GLPvars.setServerName(s); - serverTextField.setText(""); - currentLabelValue.setText(GLPvars.getServerName()); - } - } - } - - public void updateServer( String server ) - { - GLPvars.setServerName(server); - load(); - serverTextField.setText(""); - currentLabelValue.setText(GLPvars.getServerName()); - } - - - public JPanel getPanel() - { - return(serverPanel); - } - -} diff --git a/scripting/java/example/GLPtabs$1.class b/scripting/java/example/GLPtabs$1.class deleted file mode 100644 index fcc52f67dc0a7249b96f423c97f8e938b28c0895..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 1097 zc-nnaZBx@g5Pl8{X~PvNFY+deh?*9qD87RzmKO^FnW^Ikzg^2s8zxO_axMB-{1?tZ zb^PED@JBiBr70o`$>eVL_SxNM_clL&eg6Sq9=3^oOeT=T6%$jqn!q(oCvY7zCT?KX z#7*2XNxiKXOIy==$(WeK9Rqg_EEu@Q(5os=FuTBzus7{JC5pik$%Rjzsz~LO2(avU zj#^>h)(Im0jvI< zY)VgM+tzh0hr!H3t>KsCh7$&e(#&f=jv?IVNa2!!MUDq}Xy6gYV>~hNl;ate3@mdz z$BKa$951oT@k)E-u*R{D4USE`HjwAo!Zwu_1)rtbLAmmtC;gl&f%cRU@soG^S3|ndYY%1!z5s_nv*L}xR(kC&g+ul(L z)OSi{=r1+uK|%UW>Fsy1qcq)MZ+GX$RJ59mQCL_t8x+urb#{_fF;rT}Ox=q30WVTQELjAv$Uy zuB8(#aZD*fr7zar%@+8dToaUyqN0Z;eGGZxwS`4&)9~*Qzwwaw1hSebc_hP1@Eb*6 B1)~4} diff --git a/scripting/java/example/GLPtabs.class b/scripting/java/example/GLPtabs.class deleted file mode 100644 index 7604add7a4fdf930784bbd1eea692cbbe3bc9e49..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 2611 zc-nnd*>@9V6#q?=W|Cn_OQCEPTlTap0XLQw1X7E|04+hFpx`9=NCWAlW+pATfjf%( z`mE19C`ZFN^c>%O@yU1J{R@0ne|Kh*G-c_9~sObWTEmX6mnL|rR0ZrQ4+VO{E)HEZ2SICBL%pEz;W%4Aed?uIlhb5wa& zl>^CD&5|CMLLD>Zg6*oZvov5jTP_ugHNc#5twJ%7G)psXp=8$-Bfd3CrH-e@{R4HP zHGGQrSqqsolF zNY0ANOwMvudSUcEaWAe!(PC6-mrmq|1SF6hSr}Ni&pX`|UVl85Elnqs<=k}U64}a( zlSq<``{69a3Rn)k@m#&gB;=JF;Pl1^{-PA=)o4NDFd027?d%qL6UUG=@faRA z@dTbU@f7x%*e|;SLJnfc#4rw-IE<%F9KlfyYyQKKj@M1RfmP0kh z5^pj4>EQG>-qG={iT4EHecUnef$ToSomPvD=3$K&)LszpGArZt)`-;`fRZE1aSOI3 z*=I%?Enwm!++u&6t{p$dC%&p=Y0F*>VA95HTa}YV%W;$=N&D2qXZYO27dUR>OMGSG zYf0ocI6Gk6GF4`EsdZ=QOO0x5`L2 ztZprIZQ?>!j!MHzG~_~<>6wzPYhYBQnL&?(JbWYnhPhLMWoGolEmq?%^}xwO4XQKni&Z?uA^z-v5~KXPQFHB z{BhnOe;he)<6GCRriAm-7 zesP!VSQQ&38qwTD+FsLaZ)mpHH8)dpiyvbUPJ{xH``B8=HVnkZ7ui z%Q}yNNoIGjiX8!5Dp*hc2zg9AL;5}9r2VW$2W#DpN~NX z9kG$M-GotW!34JQ8(|yrysZ%9HecI!v4fA4o%jyBaE~7#50SvH*n{8MKYy@${$!v0 z#qRkB`!oXwv>qJP`Z1&pVp!XcLs}AtwNp5vox?FrVO*QWgjT^BdOC{Ze&6sHLYsIj zrQK1*&XyX7{1WeKMA*&PfD4FXl965Hr^F@RJX`BTt|9J#KEGPKTdLOX7i|&X74W-= zdkc>u!<#XjSi(hvE+z!gsA7*_&9;bN!bONz>0+KPPSM2zZ=ORcKwQsNTx<*9tLsEO j&NS&soC@SN1ah9^KeULJ>C|Zf!8j`h7~~Fk^ND`}BGp;~ diff --git a/scripting/java/example/GLPtabs.java b/scripting/java/example/GLPtabs.java deleted file mode 100644 index 477320d69..000000000 --- a/scripting/java/example/GLPtabs.java +++ /dev/null @@ -1,117 +0,0 @@ - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.event.*; -import java.net.URL; -import java.net.*; -import java.io.*; -import com.easysw.cups.*; - -public class GLPtabs extends JPanel -{ - JTabbedPane tabPanel = null; - - // - // Panels for the various tabs. - // - JPanel serverPanel = null; - JScrollPane printersPanel = null; - JPanel detailPanel = null; - JPanel optionsPanel = null; - - GLPserver server = null; - GLPprinters printers = null; - GLPdetail detail = null; - GLPoptions options = null; - - - - // Constructor - public GLPtabs() - { - tabPanel = new JTabbedPane(); - tabPanel.setBackground(Color.white); - - serverPanel = new JPanel(); - server = new GLPserver(); - serverPanel = server.getPanel(); - tabPanel.add("Server", serverPanel); - tabPanel.setBackgroundAt(0,GLPcolors.tabBackgroundColor); - tabPanel.setForegroundAt(0,GLPcolors.tabForegroundColor); - - printersPanel = new JScrollPane(); - printers = new GLPprinters(); - printersPanel = printers.getPanel(); - tabPanel.add( "Printers", printersPanel ); - tabPanel.setBackgroundAt(1,GLPcolors.tabBackgroundColor); - tabPanel.setForegroundAt(1,GLPcolors.tabForegroundColor); - - - detail = new GLPdetail(); - detailPanel = detail.getPanel(); - tabPanel.add( "Destination", detailPanel ); - tabPanel.setBackgroundAt(2,GLPcolors.tabBackgroundColor); - tabPanel.setForegroundAt(2,GLPcolors.tabForegroundColor); - - options = new GLPoptions(); - optionsPanel = new JPanel(); - optionsPanel.setBackground(GLPcolors.backgroundColor); - tabPanel.add( "Options", optionsPanel ); - tabPanel.setBackgroundAt(3,GLPcolors.tabBackgroundColor); - tabPanel.setForegroundAt(3,GLPcolors.tabForegroundColor); - - tabPanel.setSelectedIndex(0); - - tabPanel.addChangeListener(new ChangeListener() - { - public void stateChanged( ChangeEvent e ) - { - Object source = e.getSource(); - if (!printers.cupsServerName.equals(GLPvars.getServerName())) - { - printers.load(); - printersPanel = printers.getPanel(); - tabPanel.setComponentAt(1,printersPanel); - } - } - }); - - JPanel jobsPanel = new JPanel(); - JPanel filePanel = new JPanel(); - } - - - - public void updateServerPanel(String s) - { - server.updateServer(s); - serverPanel = server.getPanel(); - tabPanel.setComponentAt(0,serverPanel); - } - - public void updateDetailPanel() - { - detail.topDetail(); - detailPanel = detail.getPanel(); - tabPanel.setComponentAt(2,detailPanel); - } - - public void updateOptionsPanel(CupsPrinter cp) - { - options.updateOptions(cp); - optionsPanel = options.getPanel(); - tabPanel.setComponentAt(3,optionsPanel); - } - - public boolean updatePrintersTab() - { - return(true); - } - - public JTabbedPane getPanel() - { - return(tabPanel); - } - -} diff --git a/scripting/java/example/GLPvars.class b/scripting/java/example/GLPvars.class deleted file mode 100644 index 7c9b46c349330ec63b35159232d50ddd488f4396..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 1592 zc-nPTT~`}b6x}x&$V`|J2!Tq2RQyb$Hd3pFg8dMsg$A0MK&w7Yl36e~WV&Vsus-`o zeDbw64_)Z0%cnl{fA}}leI^6pqh_sp&b{ZJv(MS*+{~+ge*Y7|Wjspb0LPG@UDVJxs+yA|5)8V%u*t1ht{f$b}#Wm~g? z;GnHw?pjXgPPJCEI<~7Y86o~y2@VKWS#4O&CV_ZIU@f$ofr3$`yKHGn2T?UuCkPcr zde!WOj$086@Abg8{ML43O=@M>j@KllYp;22+vWXGd@nYI{JG?=9VOZJ4%VKmdXimz zr!XppC2#k!Ym;WrKDg*~obZN1vRK+=txL?HkgYl$dwp-WY5Q>wP23bRTXuM|llfxl zb-m04r`^Vj=e;Cdw&jvY{X{deR=eHsPFngYd*|_D>HF8^)E8TB%q3m-_WYK;>`3J% z`?qiT!DWdtQO1Xyh3mB}ciRg>6K`OW!|#vaw(na{B$bI7yq&@W6W^e2qJa(0>TF^Y zn|NsAqJU_==P{}v`_!^;{V+d2XJQJICf>xfiA#9P#5;J`#Cv$(#0MyvD4|H_xWrTV z_nSL>j(okRUk4|}7M*En&v&83A!~v2lO2t7g_6A!*Ok(FXR@2%{|^{~Ax+@U5FU{( z#Cj^$tUuDEKpk}^I+IPLNhs3f6zNi=btvgKjje9Zr z41+I`p)4OFmB7QZH14vv6^vk&;h!;YFWe!Z0MAF^S1AvnE4+YlFS+)ko3WrE1 z@E45w&q@`Je17@&@A6aC=RS=Tg@#F4YJfTpH%o}O!&nP#i2c(=ENEC2ui01yBe z0009!2)Yn5q)5q{nV7DV`x2c8aADSz-i2bpnt|>##8X7yIA+uH4b!a~KovXD6eQQD QxKT0!L{Y^7$s_;(JJ*UWq5uE@ diff --git a/scripting/java/example/images/print-test-page.gif b/scripting/java/example/images/print-test-page.gif deleted file mode 100644 index 8268a1d14502044077743b88d1bcc1415d19846c..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 519 zc-jF60{Hz$Nk%w1VQc^w0OJ4v003rHRhc+Ah#VYu|NsB0s?2e5s>a6Mjg7nF;_f*) zh~wk#9UXW7|NsC0|NsC0EC2ui0Bisk000F35XecZy*TU5dksV=j)Z5PXo`a5sJ?J~ zvTZ5fcutdf@2fk}Z%EuI7CcK}xx5Gh1J9GWjH(7yL6LzJT1W*;fe^@OCu35%Gq6g6 z>mk=$2?Y$H^W^ES9BdL#2m}XJ9e8m7AcbQIMF4Yv6d@90cLf0m0tN+I1)T*50C)sp z6df7N6F+p}TR*1`+KBaUOHmH?EtlpoR(vx)==i{@eGeIp_26TdK&@Pye1 zLX-z+6PCd;SB|2x680oTOSSAz0c^bl68y4wD&(h;1O6qEOs~~V*J(n5} zMl5ww)hu`wH&&QsU=YHVM?d-MkY*-@n&oaDRRWWe0AE*s{Yh35VnUpwz-Em}XOc#! z7j>@eiiVIe0VZb+*j5XszEUg4p`%DH(S}*y^CnUxh7pGd<14vpEz!6>%QY4&ve>uB}(tM*u$=0 zh~*0aj!0x6HzDkv(CC0T1OcxjAXDO$YNXGu%!(~jZg(+7?vyLqy7<$y%2h8}_!c5O1#O@a zR!WRP_!jAB`?Z9$cdG_4C31H(A zdizN3T)OVI;oZx(uiw9b{pt&>?ju3M1^W$@co=a3AuVIfv^w~$y{pB-h-^IRve9Bg zZG=2w@aN}0nh$QUqw#^j(+Ej~1F`Ce!zK{J!PXLzHp!B$F;!J<`YG|1zggYpvXeMA z%FvQ4S$-^KZ{23iki0V_sP*gF|CtQpooYbnMxmBBKcy4M-C5$iA{&z@e5CS~(%)GY zwuySBIn~$SY5(E223JIZ}*y^LtUxh7o*d<14vpEz!6>%LuB}(tM*u$=0 zh~*myj!5JnHzDkv&}e`-1OcxjAXDO$YNXGu%!(}weV8v8{Hb9z$++MQBS{AMyne4< zPg!tsf`dqaWG`DLdy9O1et%1cW{D@23XFLUVl$E}mY<-ZqN56DR9c&K9d@8jryiYU zvOce{9C&d{6`PNLh*qjAvjj$XH@joJy)|yLZ(7L9e^IH1F zLyI0wx-^8frUUk5m6{($lP6iX&TwkxP?)kaCyX2}-JSFs9tCLZ!0u1?hk zx4T9zA5O7W3S386j!j09Ix3mZRpw$`N+@{m&Z!V1q&>o0?%loOjx9b{`_quYOaEm? zeBmB*TIHu7fAQF47gS^=HD6Vck>^l?Vfa!Pbqz-Mo=eSm=fP9kC6i!R8dex!Qr>`w z9*6ENg&|ewfq>OPD^Oa}{c(S6uiji|^0mQ_G<_92nSAtu+6 z!Xz0%BoKbnq+e+5r`BDI%qXK(Sk8qNLTowarFngYDGoeAaEaH2Q@|I9nu$$_A_SFr zxno678s`-Tl`Rn=T!+QMrhK8~IpiZ692QAY4l0u8RvAT_sG=?*I$EIbHE3x=j+G)2 YPqX2ntm^8kuqFTiJFzuv761SM diff --git a/scripting/java/example/images/restart-job.gif b/scripting/java/example/images/restart-job.gif deleted file mode 100644 index 8dc072759f1c42c4919306c8a1c97de1e568bc18..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 440 zc-jHD0Z0BvNk%w1VO9Va0OJ4v003rHRhc+Ah#VYu|NsAujk~I<%yDt5;^OYc#@#tN zh~wk#9UXW7|NsC0|NsC0EC2ui09F7O000F35XecZy*TTQ1NmS`aAawol_!R1>%Nk@ zj&N;jvUu&=>7bc0lxywR7wvh=^57d}!~nADm4ccQ5qKsB6@mbXkU*0+ zK@b3X$lTP!mm%Fgd-WVTY-6BZyM%7>>Ww1>ZKA(#qAI4L;Kxn1L}JP%I#BI^L4gY8 zoV%1L0VPJgej(_Yj|Cn%1q>`PwOfSe2w`V>HEBnbnOUV4g-69A^5qzd{n#t4(M iC(;>3%eLr>ws6bNh)cKO42pHps-2s+?cNy?002AYBETg8 diff --git a/scripting/java/example/images/show-active.gif b/scripting/java/example/images/show-active.gif deleted file mode 100644 index 0c1ef7d6c2ab991cdf692d6c2bdee9cd93d9d6b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 581 zc-jF)0=oT2Nk%w1VSWG?0OJ4v003rjajL4S%s4oRRaKcB9Cza4?*IS)#>U-^jk`HH zh~wk#9UXW7|NsC0|NsC0EC2ui0Db@$000F35XecZy*TU5yU)ZSj^y#3XsWJSSdwfk z&otn^X07kMb(g)MkoFr5k4Tha0mK9Zf`DW|DCnqF57nwF5C)j-iorBq3Yg1V&dwqEAMcbjaO5>EnP0U~^=ssOj6Q5cf|x~Fsk30$zN8BA#INX(`*-$>IT$!@Z@*`Xj~j*7|OH~egKHR#j*D28$C@F&;a<> z27tmznEV{#qe&pZXqos}wB`w*2@(4RZh7F7!C;$zh)|mNHb9L4X6z=sBk&EQD+v+v zgk$IIjUWn>R3`F>hYdasZ<2kvWYOiw7=_yo<9l5CEa zB8+A5*$!dZflbXCg4Q*J!fk9gbt4Kf$3MG%^MIXzXe?YjQc~8Ux54Mn35UqV6Z$Tm zLu(#M5*GALBRD#lhejr8ca3HMYY?C*weIA)LTFxs*5LTD%$LGm#d1Ru)-c_5Kq>N- zdkWYBpmq_jwR@oeMZS*~z+DFyl;2NaS(#3%ag!wA!&|7GRlNBld8iTU*H>!*!_L<9gkt7-?h diff --git a/scripting/java/example/images/show-completed.gif b/scripting/java/example/images/show-completed.gif deleted file mode 100644 index 7603191525eb11220bbd34488f920cb87c174942..0000000000000000000000000000000000000000 GIT binary patch literal 0 Hc-jL100001 literal 657 zc-jGx0&e|BNk%w1VU_?F0OJ4v003rjajL4S%s4oRRaKcB9Cza4?*IS)#>U-^jk`HH zh~wk#9UXW7|NsC0|NsC0EC2ui0G0q3000F35XecZy*TU5yZ@j>9As%8VXCfd+m5H{ z&U9^maE#u3@4vd;Z%8a!ax$ZG=~FCDnSekLkPHX~n^ZukU9+qLVQ~3k2;CLqS;80& z2*e=)5FFAoIpR&9+3^-+8zTZ2e;6b!Yi&nx00oJMGmr+42bF$z7;+qhhME_Nifk7n z2qIl}0SN+N15;J6RduZZQi1@Uv=Uo_Qv_VEeZK<3puM&vg|<_I1*`!F%N3Hy03^V( z&&6OIix&lN2)K4}mjDBoa&+e~U7QoT6A5r{WF&I+bJzN*n)G`P42UKT06=?n^i891 z=%7G;0kIe`Q0~JT4B?bXIFyK9mvjD{=oNGnuONjtx%Nf6{-%aJ`{YEmYrkSMNLQx;A5F{@Xz z84b+xU{g14fOWjGP*L^-9-ReTmGYdL^0RJJ?;lC*WRSF4LE zIrHKP;($B67q@D_Du>FwDO*UoCOvPa`L3L0Im9;sL<@M+O?Q$&PmA#qKxQa2ZtG{U z%KeBHf@JnCqjD8u%cgreE`$U2D^#Egbfy6*h7UG rYUo0T9@4-eh#{)rUWpEyk$Ci08>@BM~&35CH%?g+L?8 diff --git a/scripting/java/example/runit b/scripting/java/example/runit deleted file mode 100755 index 0abb92486..000000000 --- a/scripting/java/example/runit +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -java GLP diff --git a/scripting/java/src/com/easysw/cups/Base64Coder.java b/scripting/java/src/com/easysw/cups/Base64Coder.java deleted file mode 100644 index 0b2958df1..000000000 --- a/scripting/java/src/com/easysw/cups/Base64Coder.java +++ /dev/null @@ -1,145 +0,0 @@ -package com.easysw.cups; - -/** -* A Base64 Encoder/Decoder. -* -*

-* This class is used to encode and decode data in Base64 format as described in RFC 1521. -* -*

-* This is "Open Source" software and released under the GNU/LGPL license.
-* It is provided "as is" without warranty of any kind.
-* Copyright 2003: Christian d'Heureuse, Inventec Informatik AG, Switzerland.
-* Home page: www.source-code.biz
-* -*

-* Version history:
-* 2003-07-22 Christian d'Heureuse (chdh): Module created.
-* 2005-08-11 chdh: Lincense changed from GPL to LGPL.
-* 2006-11-21 chdh:
-*   Method encode(String) renamed to encodeString(String).
-*   Method decode(String) renamed to decodeString(String).
-*   New method encode(byte[],int) added.
-*   New method decode(String) added.
-*/ - -public class Base64Coder { - -// Mapping table from 6-bit nibbles to Base64 characters. -private static char[] map1 = new char[64]; - static { - int i=0; - for (char c='A'; c<='Z'; c++) map1[i++] = c; - for (char c='a'; c<='z'; c++) map1[i++] = c; - for (char c='0'; c<='9'; c++) map1[i++] = c; - map1[i++] = '+'; map1[i++] = '/'; } - -// Mapping table from Base64 characters to 6-bit nibbles. -private static byte[] map2 = new byte[128]; - static { - for (int i=0; iin. -* @return A character array with the Base64 encoded data. -*/ -public static char[] encode (byte[] in, int iLen) { - int oDataLen = (iLen*4+2)/3; // output length without padding - int oLen = ((iLen+2)/3)*4; // output length including padding - char[] out = new char[oLen]; - int ip = 0; - int op = 0; - while (ip < iLen) { - int i0 = in[ip++] & 0xff; - int i1 = ip < iLen ? in[ip++] & 0xff : 0; - int i2 = ip < iLen ? in[ip++] & 0xff : 0; - int o0 = i0 >>> 2; - int o1 = ((i0 & 3) << 4) | (i1 >>> 4); - int o2 = ((i1 & 0xf) << 2) | (i2 >>> 6); - int o3 = i2 & 0x3F; - out[op++] = map1[o0]; - out[op++] = map1[o1]; - out[op] = op < oDataLen ? map1[o2] : '='; op++; - out[op] = op < oDataLen ? map1[o3] : '='; op++; } - return out; } - -/** -* Decodes a string from Base64 format. -* @param s a Base64 String to be decoded. -* @return A String containing the decoded data. -* @throws IllegalArgumentException if the input is not valid Base64 encoded data. -*/ -public static String decodeString (String s) { - return new String(decode(s)); } - -/** -* Decodes a byte array from Base64 format. -* @param s a Base64 String to be decoded. -* @return An array containing the decoded data bytes. -* @throws IllegalArgumentException if the input is not valid Base64 encoded data. -*/ -public static byte[] decode (String s) { - return decode(s.toCharArray()); } - -/** -* Decodes a byte array from Base64 format. -* No blanks or line breaks are allowed within the Base64 encoded data. -* @param in a character array containing the Base64 encoded data. -* @return An array containing the decoded data bytes. -* @throws IllegalArgumentException if the input is not valid Base64 encoded data. -*/ -public static byte[] decode (char[] in) { - int iLen = in.length; - if (iLen%4 != 0) throw new IllegalArgumentException ("Length of Base64 encoded input string is not a multiple of 4."); - while (iLen > 0 && in[iLen-1] == '=') iLen--; - int oLen = (iLen*3) / 4; - byte[] out = new byte[oLen]; - int ip = 0; - int op = 0; - while (ip < iLen) { - int i0 = in[ip++]; - int i1 = in[ip++]; - int i2 = ip < iLen ? in[ip++] : 'A'; - int i3 = ip < iLen ? in[ip++] : 'A'; - if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127) - throw new IllegalArgumentException ("Illegal character in Base64 encoded data."); - int b0 = map2[i0]; - int b1 = map2[i1]; - int b2 = map2[i2]; - int b3 = map2[i3]; - if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0) - throw new IllegalArgumentException ("Illegal character in Base64 encoded data."); - int o0 = ( b0 <<2) | (b1>>>4); - int o1 = ((b1 & 0xf)<<4) | (b2>>>2); - int o2 = ((b2 & 3)<<6) | b3; - out[op++] = (byte)o0; - if (opCups object is used for connecting to servers, - * reading and writing data, and performing common CUPS operations. - * - * @author TDB - * @version 1.2 - * @since JDK1.3 - */ - -import java.io.*; -import java.util.*; -import java.net.*; - -public class Cups -{ - - static final int REQ_STATE_CREATE_HTTP = 0; - static final int REQ_STATE_WRITE_HTTP_HEADER = 1; - static final int REQ_STATE_WRITE_IPP_HEADER = 2; - static final int REQ_STATE_WRITE_IPP_ATTRS = 3; - static final int REQ_STATE_FINISH_IPP_ATTRS = 4; - static final int REQ_STATE_READ_RESPONSE = 5; - static final int REQ_STATE_DONE = 6; - static final String[] req_state_names = - { "Create HTTP", - "Write Http Header", - "Write IPP Header", - "Write IPP Attrs", - "Finish IPP Attrs", - "Read Response", - "Done" - }; - - - static final int FILEREQ_STATE_CREATE_HTTP = 0; - static final int FILEREQ_STATE_WRITE_HTTP_HEADER = 1; - static final int FILEREQ_STATE_WRITE_IPP_HEADER = 2; - static final int FILEREQ_STATE_WRITE_IPP_ATTRS = 3; - static final int FILEREQ_STATE_FINISH_IPP_ATTRS = 4; - static final int FILEREQ_STATE_WRITE_FILE_DATA = 5; - static final int FILEREQ_STATE_READ_RESPONSE = 6; - static final int FILEREQ_STATE_DONE = 7; - static final String[] filereq_state_names = - { "Create HTTP", - "Write Http Header", - "Write IPP Header", - "Write IPP Attrs", - "Finish IPP Attrs", - "Write File Data", - "Read Response", - "Done" - }; - - - IPP ipp; // IPP Request - IPPHttp http; // Connection to server - - - String protocol; // Protocol name - String address; // address/name of server - int port; // Port # - String path; // Path .... - String dest; // Name of destination printer - String instance; // Instance of printer - - // - // encrypt, user, and passwd are not fully implemented! - // - boolean encrypt; // Open encrypted connection. - String user; // User to login as. - String passwd; // Password if needed. - - String site; // URL of site. - - int last_error; // Last error # - String error_text; // Text for error - - /** - * Void constructor. - */ - public Cups() - { - http = null; - ipp = null; - - protocol = "http"; - address = "localhost"; - port = 631; - path = "/"; - site = "http://localhost:631/"; - dest = ""; - instance = ""; - user = ""; - passwd = ""; - encrypt = false; - } - - /** - * Constructor using a URL. - * - * @param p_url A URL object. - */ - public Cups( URL p_url ) - { - http = null; - ipp = null; - - protocol = p_url.getProtocol() + "://"; - address = p_url.getHost(); - port = p_url.getPort(); - path = p_url.getPath(); - - site = protocol + address; - if (port > 0) - site = site + ":" + port; - - if (path.length() > 0) - site = site + path; - - dest = ""; - instance = ""; - user = ""; - passwd = ""; - encrypt = false; - } - - - /** - * Set the value of the protocol member. Valid values - * are ipp or http. - * - * @param p_protocol String with protocol. - */ - public void setProtocol( String p_protocol ) - { - protocol = p_protocol; - site = protocol + "://" + address + ":" + port + path; - } - - /** - * Set the value of the server member. This is an - * IP address or a hostname. - * - * @param p_server IP address or hostname. - */ - public void setServer( String p_server ) - { - address = p_server; - site = protocol + "://" + address + ":" + port + path; - } - - - /** - * Set the value of the port member. - * - * @param p_port Port number. - */ - public void setPort( int p_port ) - { - port = p_port; - site = protocol + "://" + address + ":" + port + path; - } - - - /** - * Set the value of the user member. - * - * @param p_user User name. - */ - public void setUser( String p_user ) - { - user = p_user; - } - - - /** - * Set the value of the passwd member. - * - * @param p_passwd Password. - */ - public void setPasswd( String p_passwd ) - { - passwd = p_passwd; - } - - - /** - * Set the value of the dest member. - * - * @param p_dest Destination. - */ - public void setDest( String p_dest ) - { - dest = p_dest; - } - - - /** - * Set the value of the instance member. - * - * @param p_instance Instance. - */ - public void setInstance( String p_instance) - { - instance = p_instance; - } - - - /** - * Set the value of the encrypt member. - * - * @param p_enrypt Yes or no. - */ - public void setEncrypt( boolean p_encrypt ) - { - encrypt = p_encrypt; - } - - - /** - * Get the value of the encrypt member. - * - * @return boolean Encryption on or off. - */ - public boolean getEncrypt() - { - return(encrypt); - } - - - /** - * Set the value of the path member. This is the - * path that will be used in the POST method. - * - * @param p_path Path on server. - */ - public void setPath( String p_path ) - { - path = p_path; - site = protocol + "://" + address + ":" + port + path; - } - - - - public boolean doRequest(String from) throws IOException - { - // System.out.println("doRequest From: " + from ); - return(doRequest()); - } - - - - /** - * Do a CUPS request to the server. - * - * @param p_dest Destination name. - * @return boolean True on success, false otherwise - * @throw IOException - */ - public boolean doRequest() throws IOException - { - IPPAttribute attr; - int state = REQ_STATE_CREATE_HTTP; - int errors = 0; - - while (true) - { - switch( state ) - { - - case REQ_STATE_CREATE_HTTP: - String url_str = site + dest; - - try - { - if (user.length() > 0 && passwd.length() > 0) - http = new IPPHttp(url_str, "", user, passwd ); - else - http = new IPPHttp(url_str); - state++; - } - catch (IOException e) - { - throw(e); - } - break; - - - - case REQ_STATE_WRITE_HTTP_HEADER: - // - // Send the HTTP header. - // - switch( http.writeHeader( http.path, ipp.sizeInBytes() )) - { - case IPPHttp.HTTP_FORBIDDEN: - case IPPHttp.HTTP_NOT_FOUND: - case IPPHttp.HTTP_BAD_REQUEST: - case IPPHttp.HTTP_METHOD_NOT_ALLOWED: - case IPPHttp.HTTP_PAYMENT_REQUIRED: - case IPPHttp.HTTP_UPGRADE_REQUIRED: - case IPPHttp.HTTP_ERROR: - case IPPHttp.HTTP_UNAUTHORIZED: - errors++; - if (errors < 5) - { - if (!http.reConnect()) - { - System.out.println("Could not reConnect(0)!"); - return(false); - } - } - else - { - return(false); - } - break; - - default: state++; - } - break; - - - - case REQ_STATE_WRITE_IPP_HEADER: - // - // Send the request header. - // - byte[] header = new byte[8]; - header[0] = (byte)1; - header[1] = (byte)1; - header[2] = (byte)((ipp.request.operation_id & 0xff00) >> 8); - header[3] = (byte)(ipp.request.operation_id & 0xff); - header[4] = (byte)((ipp.request.request_id & 0xff000000) >> 24); - header[5] = (byte)((ipp.request.request_id & 0xff0000) >> 16); - header[6] = (byte)((ipp.request.request_id & 0xff00) >> 8); - header[7] = (byte)(ipp.request.request_id & 0xff); - http.write( header ); - if (http.checkForResponse() >= IPPHttp.HTTP_BAD_REQUEST) - { - errors++; - if (errors < 5) - { - if (http.reConnect()) - state = REQ_STATE_WRITE_HTTP_HEADER; - else - { - System.out.println("Could not reConnect(1)\n"); - return(false); - } - } - else - { - return(false); - } - } - else state++; - break; - - - case REQ_STATE_WRITE_IPP_ATTRS: - // - // Send the attributes list. - // - byte[] bytes; - int sz; - int last_group = -1; - boolean auth_error = false; - for (int i=0; i < ipp.attrs.size() && !auth_error; i++) - { - attr = (IPPAttribute)ipp.attrs.get(i); - sz = attr.sizeInBytes(last_group); - bytes = attr.getBytes(sz,last_group); - last_group = attr.group_tag; - http.write(bytes); - - // - // Check for server response between each attribute. - // - if (http.checkForResponse() >= IPPHttp.HTTP_BAD_REQUEST) - { - errors++; - if (errors < 5) - { - if (!http.reConnect()) - { - System.out.println("Could not reConnect(2)"); - return(false); - } - state = REQ_STATE_WRITE_HTTP_HEADER; - auth_error = true; - } - else - { - return(false); - } - } - - } - if (!auth_error) - state++; - break; - - - - case REQ_STATE_FINISH_IPP_ATTRS: - // - // Send the end of attributes tag. - // - byte[] footer = new byte[1]; - footer[0] = (byte)IPPDefs.TAG_END; - http.write( footer ); - - // - // Keep checking ..... - // - if (http.checkForResponse() >= IPPHttp.HTTP_BAD_REQUEST) - { - errors++; - if (errors < 5) - { - if (!http.reConnect()) - { - System.out.println("Could not reConnect(3)"); - return(false); - } - state = REQ_STATE_WRITE_HTTP_HEADER; - } - else - { - return(false); - } - } - else state++; - break; - - - - case REQ_STATE_READ_RESPONSE: - // - // Now read back response - // - int read_length; - read_length = http.read_header(); - switch( http.status ) - { - case IPPHttp.HTTP_OK: - break; - - case IPPHttp.HTTP_UNAUTHORIZED: - http.reConnect(); - state = REQ_STATE_WRITE_HTTP_HEADER; - errors = 0; - break; - - default: - errors++; - if (errors < 5) - { - if (!http.reConnect()) - { - System.out.println("Could not reConnect(4)"); - return(false); - } - state = REQ_STATE_WRITE_HTTP_HEADER; - } - else - { - System.out.println("Too many errors: " + errors ); - return(false); - } - break; - } - - if ((read_length > 0) && (state == REQ_STATE_READ_RESPONSE)) - { - http.read_buffer = http.read(read_length); - ipp = http.processResponse(); - state++; - } - break; - - case REQ_STATE_DONE: - // - // success. - // - http.conn.close(); - http = null; - return(true); - } - } - - } // End of doRequest - - - - /** - * Send a FILE to the CUPS server. - * - * @param file File to send. - * @return boolean True on success, false otherwise - * @throw IOException - */ - public boolean doRequest(File file) throws IOException - { - IPPAttribute attr; - int state = FILEREQ_STATE_CREATE_HTTP; - int errors = 0; - FileInputStream fis = null; - - while (true) - { - switch( state ) - { - - case FILEREQ_STATE_CREATE_HTTP: - String url_str = site + dest; - try - { - if (user.length() > 0 && passwd.length() > 0) - http = new IPPHttp(url_str, "", user, passwd ); - else - http = new IPPHttp(url_str); - state++; - } - catch (IOException e) - { - throw(e); - } - break; - - - - case FILEREQ_STATE_WRITE_HTTP_HEADER: - - if (fis != null) - { - fis.close(); - } - - // - // Open an input stream to the file. - // - try - { - fis = new FileInputStream(file); - } - catch (IOException e) - { - last_error = -1; - error_text = "Error opening file input stream."; - throw(e); - } - - // - // Send the HTTP header. - // - int ippSz = ipp.sizeInBytes() + (int)file.length(); - switch( http.writeHeader( http.path, ippSz )) - { - case IPPHttp.HTTP_FORBIDDEN: - case IPPHttp.HTTP_NOT_FOUND: - case IPPHttp.HTTP_BAD_REQUEST: - case IPPHttp.HTTP_METHOD_NOT_ALLOWED: - case IPPHttp.HTTP_PAYMENT_REQUIRED: - case IPPHttp.HTTP_UPGRADE_REQUIRED: - case IPPHttp.HTTP_ERROR: - case IPPHttp.HTTP_UNAUTHORIZED: - errors++; - if (errors < 5) - { - http.reConnect(); - } - else - return(false); - break; - - default: state++; - } - break; - - - - case FILEREQ_STATE_WRITE_IPP_HEADER: - // - // Send the request header. - // - byte[] header = new byte[8]; - header[0] = (byte)1; - header[1] = (byte)1; - header[2] = (byte)((ipp.request.operation_id & 0xff00) >> 8); - header[3] = (byte)(ipp.request.operation_id & 0xff); - header[4] = (byte)((ipp.request.request_id & 0xff000000) >> 24); - header[5] = (byte)((ipp.request.request_id & 0xff0000) >> 16); - header[6] = (byte)((ipp.request.request_id & 0xff00) >> 8); - header[7] = (byte)(ipp.request.request_id & 0xff); - http.write( header ); - if (http.checkForResponse() >= IPPHttp.HTTP_BAD_REQUEST) - { - errors++; - if (errors < 5) - { - http.reConnect(); - state = FILEREQ_STATE_WRITE_HTTP_HEADER; - } - else - return(false); - } - else state++; - break; - - - case FILEREQ_STATE_WRITE_IPP_ATTRS: - // - // Send the attributes list. - // - byte[] bytes; - int sz; - int last_group = -1; - boolean auth_error = false; - for (int i=0; i < ipp.attrs.size() && !auth_error; i++) - { - attr = (IPPAttribute)ipp.attrs.get(i); - sz = attr.sizeInBytes(last_group); - bytes = attr.getBytes(sz,last_group); - last_group = attr.group_tag; - http.write(bytes); - - // - // Check for server response between each attribute. - // - if (http.checkForResponse() >= IPPHttp.HTTP_BAD_REQUEST) - { - errors++; - if (errors < 5) - { - http.reConnect(); - state = FILEREQ_STATE_WRITE_HTTP_HEADER; - auth_error = true; - } - else - return(false); - } - - } - if (!auth_error) - state++; - break; - - - - case FILEREQ_STATE_FINISH_IPP_ATTRS: - // - // Send the end of attributes tag. - // - byte[] footer = new byte[1]; - footer[0] = (byte)IPPDefs.TAG_END; - http.write( footer ); - - // - // Keep checking ..... - // - if (http.checkForResponse() >= IPPHttp.HTTP_BAD_REQUEST) - { - errors++; - if (errors < 5) - { - http.reConnect(); - state = FILEREQ_STATE_WRITE_HTTP_HEADER; - } - else - return(false); - } - else state++; - break; - - - - case FILEREQ_STATE_WRITE_FILE_DATA: - // - // Send the file data - this could be improved on ALOT. - // - int count; - byte[] b = new byte[1024]; - while ((state == FILEREQ_STATE_WRITE_FILE_DATA) && - ((count = fis.read(b)) != -1)) - { - // - // Keep checking ..... - // - if (http.checkForResponse() >= IPPHttp.HTTP_BAD_REQUEST) - { - errors++; - if (errors < 5) - { - http.reConnect(); - state = FILEREQ_STATE_WRITE_HTTP_HEADER; - } - else - { - return(false); - } - } - else - { - if (count > 0) - http.write( b, count ); - } - - } // while - - if (state == FILEREQ_STATE_WRITE_FILE_DATA) - { - fis.close(); - fis = null; - state++; - } - break; - - - - case FILEREQ_STATE_READ_RESPONSE: - // - // Now read back response - // - int read_length; - read_length = http.read_header(); - switch( http.status ) - { - case IPPHttp.HTTP_OK: - break; - - case IPPHttp.HTTP_UNAUTHORIZED: - http.reConnect(); - state = FILEREQ_STATE_WRITE_HTTP_HEADER; - errors = 0; - break; - - default: - errors++; - if (errors < 5) - { - http.reConnect(); - state = FILEREQ_STATE_WRITE_HTTP_HEADER; - } - else - { - return(false); - } - break; - } - - if ((read_length > 0) && (state == FILEREQ_STATE_READ_RESPONSE)) - { - http.read_buffer = http.read(read_length); - ipp = http.processResponse(); - state++; - } - break; - - case FILEREQ_STATE_DONE: - // - // success. - // - http.conn.close(); - http = null; - return(true); - } - } - - } // End of doRequest(file) - - - - - - - - /** - * Get a list of jobs. - * - * @param showMyJobs Show only jobs for user. - * @param showCompleted Show completed OR active jobs. - * - * @return CupsJob[] Array of job objects, or null. - * @throw IOException - */ - public CupsJob[] cupsGetJobs( boolean showMyJobs, boolean showCompleted ) - throws IOException - { - - IPPAttribute a; - - String req_attrs[] = /* Requested attributes */ - { - "job-id", - "job-priority", - "job-k-octets", - "job-state", - "time-at-completed", - "time-at-creation", - "time-at-processing", - "job-printer-uri", - "document-format", - "job-name", - "job-originating-user-name" - }; - - - ipp = new IPP(); - ipp.request = new IPPRequest( 1, (short)IPPDefs.GET_JOBS ); - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_CHARSET, - "attributes-charset" ); - a.addString( "", "utf-8" ); - ipp.addAttribute(a); - - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_LANGUAGE, - "attributes-natural-language" ); - a.addString( "", "en" ); - ipp.addAttribute(a); - - - // - // Add the printer uri - // - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_URI, - "printer-uri" ); - - if (site != null) - a.addString( "", site ); - else - a.addString( "", "ipp://localhost/jobs" ); // Default ... - // a.dump_values(); - ipp.addAttribute(a); - - - // - // Add the requesting user name - // **FIX** This should be fixed to use the user member. - // - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_NAME, - "requesting-user-name" ); - a.addString( "", "root" ); - ipp.addAttribute(a); - - // - // Show only my jobs? - // - if (showMyJobs) - { - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_BOOLEAN, - "my-jobs" ); - a.addBoolean( true ); - ipp.addAttribute(a); - } - - // - // Show completed jobs? - // - if (showCompleted) - { - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_KEYWORD, - "which-jobs" ); - a.addString( "", "completed" ); - ipp.addAttribute(a); - } - - // - // Get ALL attributes - to get only listed ones, - // uncomment this and fill in req_attrs. - // - // a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_KEYWORD, - // "requested-attributes" ); - // a.addStrings( "", req_attrs ); - // ipp.addAttribute(a); - - // - // Do the request and process the response. - // - if (doRequest("cupsGetJobs")) - { - - - // - // First we have to figure out how many jobs there are - // so we can create the array. - // - - // - // Skip past leading attributes - // - int i = 0; - int group_tag = -1; - while ((i < ipp.attrs.size()) && (group_tag != IPPDefs.TAG_JOB)) - { - a = (IPPAttribute)ipp.attrs.get(i); - group_tag = a.group_tag; - if (group_tag != IPPDefs.TAG_JOB) - i++; - } - - int num_jobs = 0; - group_tag = IPPDefs.TAG_JOB; - while ((i < ipp.attrs.size()) && (group_tag == IPPDefs.TAG_JOB)) - { - a = (IPPAttribute)ipp.attrs.get(i++); - if ((a != null) && (a.name.compareTo("job-id") == 0)) - num_jobs++; - // a.dump_values(); - } - - if (num_jobs < 1) - return(null); - - - // - // Now create the array of the proper size. - // - int n = 0; - CupsJob[] jobs = new CupsJob[num_jobs]; - for (n=0; n < num_jobs; n++) - { - jobs[n] = new CupsJob(); - } - - - - - // - // Skip past leading attributes - // - group_tag = -1; - i = 0; - while ((i < ipp.attrs.size()) && (group_tag != IPPDefs.TAG_JOB)) - { - a = (IPPAttribute)ipp.attrs.get(i); - group_tag = a.group_tag; - if (group_tag != IPPDefs.TAG_JOB) - i++; - } - - // - // Now we actually fill the array with the job data. - // - n = 0; - for (;i < ipp.attrs.size(); i++) - { - a = (IPPAttribute)ipp.attrs.get(i); - - if (a.group_tag == IPPDefs.TAG_ZERO) - { - n++; - continue; - } - else - { - try - { - jobs[n].updateAttribute( a ); - } - catch (ArrayIndexOutOfBoundsException e) - { - return(jobs); - } - } - } - return( jobs ); - } - return(null); - - } // End of cupsGetJobs - - - - /** - * Get a list of printers. - * - * @return String[] Array of printers, or null. - * @throw IOException - */ - public String[] cupsGetPrinters() - throws IOException - { - - IPPAttribute a; - - ipp = new IPP(); - - // - // Fill in the required attributes - // - ipp.request = new IPPRequest( 1, (short)IPPDefs.CUPS_GET_PRINTERS ); - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_CHARSET, - "attributes-charset" ); - a.addString( "", "utf-8" ); - ipp.addAttribute(a); - - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_LANGUAGE, - "attributes-natural-language" ); - a.addString( "", "en" ); - ipp.addAttribute(a); - - - if (doRequest("cupsGetPrinters")) - { - int num_printers = 0; - for (int i=0; i < ipp.attrs.size(); i++) - { - a = (IPPAttribute)ipp.attrs.get(i); - if ((a.name.compareTo("printer-name") == 0) && - (a.value_tag == IPPDefs.TAG_NAME)) - { - num_printers++; - } - } - if (num_printers < 1) - return(null); - - String[] printers = new String[num_printers]; - IPPValue val; - int n = 0; - for (int i=0; i < ipp.attrs.size(); i++) - { - a = (IPPAttribute)ipp.attrs.get(i); - if (a.group_tag < 2) - continue; - - if ((a.name.compareTo("printer-name") == 0) && - (a.value_tag == IPPDefs.TAG_NAME)) - { - val = (IPPValue)a.values.get(0); - if (val != null) - { - printers[n] = val.text; - n++; - } - } - } - return( printers ); - - } // if doRequest ... - - return(null); - - } // End of cupsGetPrinters - - - - - /** - * Get default destination. - * - * @return String Name of default printer, or null. - * @throw IOException - */ - public String cupsGetDefault() - throws IOException - { - - IPPAttribute a; - - - ipp = new IPP(); - // - // Fill in the required attributes - // - ipp.request = new IPPRequest( 1, (short)IPPDefs.CUPS_GET_DEFAULT); - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_CHARSET, - "attributes-charset" ); - a.addString( "", "utf-8" ); - ipp.addAttribute(a); - - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_LANGUAGE, - "attributes-natural-language" ); - a.addString( "", "en" ); - ipp.addAttribute(a); - - - if (doRequest("cupsGetDefault")) - { - if ((ipp == null) || (ipp.attrs == null)) - return(null); - - int num_printers = 0; - for (int i=0; i < ipp.attrs.size(); i++) - { - a = (IPPAttribute)ipp.attrs.get(i); - if ((a.name.compareTo("printer-name") == 0) && - (a.value_tag == IPPDefs.TAG_NAME)) - { - IPPValue val = (IPPValue)a.values.get(0); - if (val != null) - { - return( val.text ); - } - } - } - } // if doRequest ... - - return(null); - - } // End of cupsGetDefault - - - - - - - /** - * Get printer attributes - * - * @param printer_name Name of printer to get info for. - * @return List List of attributes. - * @throw IOException - * - * @see CupsPrinter - */ - public List cupsGetPrinterAttributes( String printer_name ) - throws IOException - { - - IPPAttribute a; - - ipp = new IPP(); - - // - // Fill in the required attributes - // - ipp.request = new IPPRequest( 1, (short)IPPDefs.GET_PRINTER_ATTRIBUTES ); - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_CHARSET, - "attributes-charset" ); - a.addString( "", "utf-8" ); - ipp.addAttribute(a); - - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_LANGUAGE, - "attributes-natural-language" ); - a.addString( "", "en" ); - ipp.addAttribute(a); - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_URI, - "printer-uri" ); - String p_uri = "ipp://" + address + ":" + - port + "/printers/" + printer_name; - a.addString( "", p_uri ); - ipp.addAttribute(a); - - if (doRequest("cupsGetPrinterAttributes")) - { - return(ipp.attrs); - } - - return(null); - - } // End of cupsGetPrinterAttributes - - - - - /** - * Print a file. - * - * @param p_filename Path of file to print. - * @param p_attrs[] Array of print job attributes. - * - * @return CupsJob Object with job info. - * - * @throw IOException - * - * @see CupsJob - */ - public CupsJob cupsPrintFile( String p_filename, - IPPAttribute p_attrs[] ) - throws IOException - { - - CupsJob job; - IPPAttribute a; - File file; - - - file = new File(p_filename); - if (!file.exists()) - { - last_error = -1; - error_text = "File does not exist."; - return(null); - } - - if (!file.canRead()) - { - last_error = -1; - error_text = "File cannot be read."; - return(null); - } - - - ipp = new IPP(); - // - // Fill in the required attributes - // - ipp.request = new IPPRequest( 1, (short)IPPDefs.PRINT_JOB ); - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_CHARSET, - "attributes-charset" ); - a.addString( "", "utf-8" ); - ipp.addAttribute(a); - - // ------------ - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_LANGUAGE, - "attributes-natural-language" ); - a.addString( "", "en" ); - ipp.addAttribute(a); - - // ------------ - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_URI, - "printer-uri" ); - a.addString( "", site + dest ); - ipp.addAttribute(a); - - // ------------ - // **FIX** Fix this later. -/* - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_NAME, - "requesting-user-name" ); - // a.addString( "", p_username ); - a.addString( "", "root"); - ipp.addAttribute(a); -*/ - - // ------------ - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_NAME, - "job-name" ); - a.addString( "", file.getName() ); - ipp.addAttribute(a); - - if (p_attrs != null) - { - for (int i=0; i < p_attrs.length; i++) - { - a = p_attrs[i]; - ipp.addAttribute(a); - } - } - - if (doRequest(file)) - { - job = new CupsJob(); - for (int i=0; i < ipp.attrs.size(); i++) - { - a = (IPPAttribute)ipp.attrs.get(i); - job.updateAttribute(a); - } - return(job); - - } // if doRequest ... - - return(null); - - } // End of cupsPrintFile - - - - - - /** - * Cancel a job - send a job cancel request to the server. - * - * @param printer_name Destination. - * @param p_job_id ID of job. - * @param p_user_name Requesting user name. - * - * @throw IOException - */ - public int cupsCancelJob( String printer_name, - int p_job_id, - String p_user_name ) - throws IOException - { - - IPPAttribute a; - - ipp = new IPP(); - - // - // Fill in the required attributes - // - ipp.request = new IPPRequest( 1, (short)IPPDefs.CANCEL_JOB ); - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_CHARSET, - "attributes-charset" ); - a.addString( "", "utf-8" ); - ipp.addAttribute(a); - - // ------------ - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_LANGUAGE, - "attributes-natural-language" ); - a.addString( "", "en" ); - ipp.addAttribute(a); - - // ------------ - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_URI, - "printer-uri" ); - a.addString( "", site + dest ); - ipp.addAttribute(a); - - // ------------ - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_INTEGER, - "job-id" ); - a.addInteger( p_job_id ); - ipp.addAttribute(a); - - // ------------ - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_NAME, - "requesting-user-name" ); - a.addString( "", p_user_name ); - ipp.addAttribute(a); - - if (doRequest("cupsCancelJob")) - { - for (int i=0; i < ipp.attrs.size(); i++) - { - a = (IPPAttribute)ipp.attrs.get(i); - a.dump_values(); - } - return(0); - - } // if doRequest ... - - return(0); - - } // End of cupsCancelJob - - - - - public List cupsGetPrinterStatus(String printer_name) - throws IOException - { - IPPAttribute a; - String p_uri; - - ipp = new IPP(); - - // - // Fill in the required attributes - // - ipp.request = new IPPRequest(1,(short)IPPDefs.GET_PRINTER_ATTRIBUTES); - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_CHARSET, - "attributes-charset" ); - a.addString( "", "utf-8" ); - ipp.addAttribute(a); - - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_LANGUAGE, - "attributes-natural-language" ); - a.addString( "", "en" ); - ipp.addAttribute(a); - - a = new IPPAttribute( IPPDefs.TAG_OPERATION, IPPDefs.TAG_URI, - "printer-uri" ); - p_uri = "ipp://" + address + ":" + - port + "/printers/" + printer_name; - a.addString( "", p_uri ); - ipp.addAttribute(a); - - if (doRequest("cupsGetPrinterStatus")) - { - return(ipp.attrs); - } - return(null); - } - - - - - -} // End of Cups class - diff --git a/scripting/java/src/com/easysw/cups/CupsJob.java b/scripting/java/src/com/easysw/cups/CupsJob.java deleted file mode 100644 index 8636f315b..000000000 --- a/scripting/java/src/com/easysw/cups/CupsJob.java +++ /dev/null @@ -1,207 +0,0 @@ -package com.easysw.cups; - -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - - -/** - * A CupsJob object holds job data, and has methods to - * process cups job list responses into a usable form. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ - -// -import java.io.*; -import java.net.*; - -public class CupsJob -{ - public int job_id; - public String job_more_info; - public String job_uri; - public String job_printer_uri; - public long job_printer_up_time; - public String job_name; - public String job_originating_user_name; - public String document_format; - public String job_originating_host_name; - public int job_priority; - public int job_state; - public int job_media_sheets_completed; - public int job_k_octets; - public long time_at_creation; - public long time_at_processing; - public long time_at_completed; - public String job_hold_until; - public String job_sheets; - public String job_state_reasons; - - - /** - * Constructor - set some default values. - */ - public CupsJob() - { - job_id = -1; - job_more_info = ""; - job_uri = ""; - job_printer_uri = ""; - job_printer_up_time = 0; - job_name = ""; - job_originating_user_name = ""; - document_format = ""; - job_originating_host_name = ""; - job_priority = -1; - job_state = 0; - job_media_sheets_completed = 0; - job_k_octets = 0; - time_at_creation = 0; - time_at_processing = 0; - time_at_completed = 0; - job_hold_until = ""; - job_sheets = ""; - job_state_reasons = ""; - } - - - - - /** - * Process an attribute from a cups.doRequest() call - * and move the value into a local member. - * - * @see IPPDefs - * @see IPPValues - * @see IPPAttributes - */ - public void updateAttribute( IPPAttribute a ) - { - IPPValue val; - - // - // Kick out if no values are present. - // - if (a.values.size() < 1) - return; - - val = (IPPValue)a.values.get(0); - if (a.name.compareTo("job-more-info") == 0) - { - job_more_info = val.text; - } - else if (a.name.compareTo("job-uri") == 0) - { - job_uri = val.text; - } - else if (a.name.compareTo("job-printer-up-time") == 0) - { - job_printer_up_time = val.integer_value; - } - else if (a.name.compareTo("job-originating-user-name") == 0) - { - job_originating_user_name = val.text; - } - else if (a.name.compareTo("document-format") == 0) - { - document_format = val.text; - } - else if (a.name.compareTo("job-priority") == 0) - { - job_priority = val.integer_value; - } - else if (a.name.compareTo("job-originating-host-name") == 0) - { - job_originating_host_name = val.text; - } - else if (a.name.compareTo("job-id") == 0) - { - job_id = val.integer_value; - } - else if (a.name.compareTo("job-state") == 0) - { - job_state = val.integer_value; - } - else if (a.name.compareTo("job-media-sheets-completed") == 0) - { - job_media_sheets_completed = val.integer_value; - } - else if (a.name.compareTo("job-printer-uri") == 0) - { - job_printer_uri = val.text; - } - else if (a.name.compareTo("job-name") == 0) - { - job_name = val.text; - } - else if (a.name.compareTo("job-k-octets") == 0) - { - job_k_octets = val.integer_value; - } - else if (a.name.compareTo("time-at-creation") == 0) - { - time_at_creation = val.integer_value; - } - else if (a.name.compareTo("time-at-processing") == 0) - { - time_at_processing = val.integer_value; - } - else if (a.name.compareTo("time-at-completed") == 0) - { - time_at_completed = val.integer_value; - } - else if (a.name.compareTo("job-hold-until") == 0) - { - job_hold_until = val.text; - } - else if (a.name.compareTo("job-sheets") == 0) - { - job_sheets = val.text; - } - else if (a.name.compareTo("job-state-reasons") == 0) - { - job_state_reasons = val.text; - } - } - - - /** - * Convert a job status to a string. - * - * @see IPPDefs - */ - public String jobStatusText() - { - switch( job_state ) - { - case 3: return("Pending"); - case 4: return("Held"); - case 5: return("Processing"); - case 6: return("Stopped"); - case 7: return("Cancelled"); - case 8: return("Aborted"); - case 9: return("Completed"); - } - return("Unknown"); - } - - -} - -// eof .... diff --git a/scripting/java/src/com/easysw/cups/CupsPrinter.java b/scripting/java/src/com/easysw/cups/CupsPrinter.java deleted file mode 100644 index 5b3c1ba58..000000000 --- a/scripting/java/src/com/easysw/cups/CupsPrinter.java +++ /dev/null @@ -1,828 +0,0 @@ -package com.easysw.cups; - -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - -/** - * A CupsPrinter holds printer attribute / status information, - * and has methods to process CUPS server responses. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ - -import java.io.*; -import java.net.*; -import java.util.*; - -public class CupsPrinter -{ - - // - // Printer attributes / status members. - // - String printer_name; - - String printer_location; - String printer_info; - String printer_more_info; - - String[] printer_uri_supported; // Strings - String[] uri_authentication_supported; // Strings - String[] uri_security_supported; // Strings - - String attributes_charset; - String attributes_natural_language; - - int printer_state; - String printer_state_text; - String printer_state_reasons; - - boolean printer_is_accepting_jobs; - - long printer_up_time; - long printer_current_time; - - int queued_job_count; - - String[] pdl_override_supported; - String[] ipp_versions_supported; - - int[] operations_supported; // Integers - - boolean multiple_document_jobs_supported; - int multiple_operation_time_out; - int[] multiple_document_handling_supported; // Integers - - String charset_configured; - String natural_language_configured; - String generated_natural_language_supported; - String[] charset_supported; // Strings - - String document_format_default; - String[] document_format_supported; // Strings - - String[] compression_supported; // Strings - - int job_priority_default; - int job_priority_supported; - - int copies_default; - int lower_copies_supported; - int upper_copies_supported; - - boolean page_ranges_supported; - - int number_up_default; - int[] number_up_supported; // integers - - - int orientation_requested_default; - int[] orientation_requested_supported; // Integers - - int job_quota_period; - int job_k_limit; - int job_page_limit; - - String job_sheets_default; // Should this be a list too? - String[] job_sheets_supported; // Strings - - String device_uri; - - boolean color_supported; - int pages_per_minute; - - String printer_make_and_model; - - String media_default; - String[] media_supported; // Strings - - int finishings_default; - int[] finishings_supported; // Integers - - int printer_type; - - - - /** - * Constructor. Does not get status or attributes. - * - * @param c Cups object. - * - * @see Cups - */ - public CupsPrinter(Cups c) - { - setDefaults(); - } - - /** - * Constructor with name. Get status and attributes. - * - * @param c Cups object. - * @param name Name of printer. - * - * @see Cups - */ - public CupsPrinter(Cups c, String name) - { - setDefaults(); - printer_name = name; - - // - // - getStatus(c); - getAttributes(c); - } - - - - /** - * Initialize the members with mostly sane values. - * - */ - public void setDefaults() - { - printer_name = ""; - printer_location = ""; - printer_info = ""; - printer_more_info = ""; - printer_uri_supported = null; - uri_authentication_supported = null; - uri_security_supported = null; - attributes_charset = "us-ascii"; - attributes_natural_language = "en"; - printer_state = -1; - printer_state_text = ""; - printer_state_reasons = ""; - printer_is_accepting_jobs = false; - printer_up_time = 0; - printer_current_time = 0; - queued_job_count = 0; - pdl_override_supported = null; - ipp_versions_supported = null; - operations_supported = null; - multiple_document_jobs_supported = false; - multiple_operation_time_out = 0; - multiple_document_handling_supported = null; - charset_configured = ""; - natural_language_configured = ""; - generated_natural_language_supported = ""; - charset_supported = null; - document_format_default = ""; - document_format_supported = null; - compression_supported = null; - job_priority_default = -1; - job_priority_supported = -1; - copies_default = 1; - lower_copies_supported = 1; - upper_copies_supported = 1; - page_ranges_supported = false; - number_up_default = 0; - number_up_supported = null; - orientation_requested_default = 0; - orientation_requested_supported = null; - job_quota_period = 0; - job_k_limit = 0; - job_page_limit = 0; - job_sheets_default = "none,none"; - job_sheets_supported = null; - device_uri = ""; - color_supported = false; - pages_per_minute = 0; - printer_make_and_model = ""; - media_default = ""; - media_supported = null; - finishings_default = 0; - finishings_supported = null; - printer_type = 0; - } - - - /** - * Get the printer's status. - * - * @param c Cups object. - * - * @return Boolean True on success. - * - * @see Cups - */ - public boolean getStatus(Cups c) - { - List attrs; - IPPAttribute a; - String p_uri; - - try - { - attrs = c.cupsGetPrinterStatus(printer_name); - for (int i=0; i < attrs.size(); i++) - { - a = (IPPAttribute)attrs.get(i); - updateAttribute(a); - } - return(true); - } - catch (IOException e) - { - return(false); - } - } - - - - /** - * Get the printer's attributes. - * - * @param c Cups object. - * - * @return Boolean True on success. - * - * @see Cups - */ - public boolean getAttributes(Cups c) - { - List attrs; - IPPAttribute a; - String p_uri; - - try - { - attrs = c.cupsGetPrinterAttributes(printer_name); - for (int i=0; i < attrs.size(); i++) - { - a = (IPPAttribute)attrs.get(i); - updateAttribute(a); - } - return(true); - } - catch (IOException e) - { - return(false); - } - } - - - - - /** - * Process an attribute from the cups.doRequest() method and move - * the values into local members. - * - * @param a IPPAttribute. - * - * @see IPPAttributes - * @see IPPValues - */ - public void updateAttribute( IPPAttribute a ) - { - IPPValue v; - int i; - - // a.dump_values(); - - if (a.name.compareTo("printer-name") == 0) - { - v = (IPPValue)a.values.get(0); - printer_name = v.text; - } - else if (a.name.compareTo("printer-location") == 0) - { - v = (IPPValue)a.values.get(0); - printer_location = v.text; - } - else if (a.name.compareTo("printer-info") == 0) - { - v = (IPPValue)a.values.get(0); - printer_info = v.text; - } - else if (a.name.compareTo("printer-more-info") == 0) - { - v = (IPPValue)a.values.get(0); - printer_more_info = v.text; - } - else if (a.name.compareTo("printer-uri-supported") == 0) - { - printer_uri_supported = new String[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - printer_uri_supported[i] = v.text; - } - } - else if (a.name.compareTo("uri-authentication-supported") == 0) - { - uri_authentication_supported = new String[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - uri_authentication_supported[i] = v.text; - } - } - else if (a.name.compareTo("uri-security-supported") == 0) - { - uri_security_supported = new String[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - uri_security_supported[i] = v.text; - } - } - else if (a.name.compareTo("attributes-charset") == 0) - { - v = (IPPValue)a.values.get(0); - attributes_charset = v.text; - } - else if (a.name.compareTo("attributes-natural-language") == 0) - { - v = (IPPValue)a.values.get(0); - attributes_natural_language = v.text; - } - else if (a.name.compareTo("printer-state") == 0) - { - v = (IPPValue)a.values.get(0); - printer_state = v.integer_value; - switch( printer_state ) - { - case 3: printer_state_text = "idle"; - break; - case 4: printer_state_text = "processing"; - break; - case 5: printer_state_text = "stopped"; - break; - } - } - else if (a.name.compareTo("printer-state-reasons") == 0) - { - v = (IPPValue)a.values.get(0); - printer_state_reasons = v.text; - } - else if (a.name.compareTo("printer-is-accepting-jobs") == 0) - { - v = (IPPValue)a.values.get(0); - printer_is_accepting_jobs = v.boolean_value; - } - else if (a.name.compareTo("printer-up-time") == 0) - { - v = (IPPValue)a.values.get(0); - printer_up_time = v.integer_value; - } - else if (a.name.compareTo("printer-current-time") == 0) - { - v = (IPPValue)a.values.get(0); - printer_current_time = v.unix_time; // *** FIX *** - } - else if (a.name.compareTo("queue-job-count") == 0) - { - v = (IPPValue)a.values.get(0); - queued_job_count = v.integer_value; - } - else if (a.name.compareTo("pdl-override-supported") == 0) - { - pdl_override_supported = new String[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - pdl_override_supported[i] = v.text; - } - } - else if (a.name.compareTo("ipp-versions-supported") == 0) - { - ipp_versions_supported = new String[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - ipp_versions_supported[i] = v.text; - } - } - else if (a.name.compareTo("operations-supported") == 0) - { - operations_supported = new int[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - operations_supported[i] = v.integer_value; - } - } - else if (a.name.compareTo("multiple-document-jobs-supported") == 0) - { - v = (IPPValue)a.values.get(0); - multiple_document_jobs_supported = v.boolean_value; - } - else if (a.name.compareTo("multiple-operation-time-out") == 0) - { - v = (IPPValue)a.values.get(0); - multiple_operation_time_out = v.integer_value; - } - else if (a.name.compareTo("multiple-document-handling-supported") == 0) - { - multiple_document_handling_supported = new int[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - multiple_document_handling_supported[i] = v.integer_value; - } - } - else if (a.name.compareTo("charset-configured") == 0) - { - v = (IPPValue)a.values.get(0); - charset_configured = v.text; - } - else if (a.name.compareTo("natural-language-configured") == 0) - { - v = (IPPValue)a.values.get(0); - natural_language_configured = v.text; - } - else if (a.name.compareTo("generated-natural-language-supported") == 0) - { - // *** Should this be a list too? - v = (IPPValue)a.values.get(0); - generated_natural_language_supported = v.text; - } - else if (a.name.compareTo("charset-supported") == 0) - { - charset_supported = new String[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - charset_supported[i] = v.text; - } - } - else if (a.name.compareTo("document-format-default") == 0) - { - v = (IPPValue)a.values.get(0); - document_format_default = v.text; - } - else if (a.name.compareTo("document-format-supported") == 0) - { - document_format_supported = new String[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - document_format_supported[i] = v.text; - } - } - else if (a.name.compareTo("compression-supported") == 0) - { - compression_supported = new String[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - compression_supported[i] = v.text; - } - } - else if (a.name.compareTo("job-priority-default") == 0) - { - v = (IPPValue)a.values.get(0); - job_priority_default = v.integer_value; - } - else if (a.name.compareTo("job-priority-supported") == 0) - { - // *** Should be a list? *** - v = (IPPValue)a.values.get(0); - job_priority_supported = v.integer_value; - } - else if (a.name.compareTo("copies-default") == 0) - { - v = (IPPValue)a.values.get(0); - copies_default = v.integer_value; - } - else if (a.name.compareTo("copies-supported") == 0) - { - v = (IPPValue)a.values.get(0); - lower_copies_supported = v.lower; - upper_copies_supported = v.upper; - } - else if (a.name.compareTo("page-ranges-supported") == 0) - { - v = (IPPValue)a.values.get(0); - page_ranges_supported = v.boolean_value; - } - else if (a.name.compareTo("number-up-default") == 0) - { - v = (IPPValue)a.values.get(0); - number_up_default = v.integer_value; - } - else if (a.name.compareTo("number-up-supported") == 0) - { - number_up_supported = new int[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - number_up_supported[i] = v.integer_value; - } - } - else if (a.name.compareTo("orientation-requested-default") == 0) - { - v = (IPPValue)a.values.get(0); - orientation_requested_default = v.integer_value; - } - else if (a.name.compareTo("orientation-requested-supported") == 0) - { - orientation_requested_supported = new int[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - orientation_requested_supported[i] = v.integer_value; - } - } - else if (a.name.compareTo("job-quota-period") == 0) - { - v = (IPPValue)a.values.get(0); - job_quota_period = v.integer_value; - } - else if (a.name.compareTo("job-k-limit") == 0) - { - v = (IPPValue)a.values.get(0); - job_k_limit = v.integer_value; - } - else if (a.name.compareTo("job-page-limit") == 0) - { - v = (IPPValue)a.values.get(0); - job_page_limit = v.integer_value; - } - else if (a.name.compareTo("job-sheets-default") == 0) - { - v = (IPPValue)a.values.get(0); - job_sheets_default = v.text; - } - else if (a.name.compareTo("job-sheets-supported") == 0) - { - job_sheets_supported = new String[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - job_sheets_supported[i] = v.text; - } - } - else if (a.name.compareTo("device-uri") == 0) - { - v = (IPPValue)a.values.get(0); - device_uri = v.text; - } - else if (a.name.compareTo("color-supported") == 0) - { - v = (IPPValue)a.values.get(0); - color_supported = v.boolean_value; - } - else if (a.name.compareTo("pages-per-minute") == 0) - { - v = (IPPValue)a.values.get(0); - pages_per_minute = v.integer_value; - } - else if (a.name.compareTo("printer-make-and-model") == 0) - { - v = (IPPValue)a.values.get(0); - printer_make_and_model = v.text; - } - else if (a.name.compareTo("media-default") == 0) - { - v = (IPPValue)a.values.get(0); - media_default = v.text; - } - else if (a.name.compareTo("media-supported") == 0) - { - media_supported = new String[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - media_supported[i] = v.text; - } - } - else if (a.name.compareTo("finishings-default") == 0) - { - v = (IPPValue)a.values.get(0); - finishings_default = v.integer_value; - } - else if (a.name.compareTo("finishings-supported") == 0) - { - finishings_supported = new int[a.values.size()]; - for (i=0; i < a.values.size(); i++) - { - v = (IPPValue)a.values.get(i); - finishings_supported[i] = v.integer_value; - } - } - else if (a.name.compareTo("printer-type") == 0) - { - v = (IPPValue)a.values.get(0); - printer_type = v.integer_value; - } - - } // End of updateAttribute() - - - /** - * Get the printer name. - * - * @return String Printer Name. - */ - public String getPrinterName() - { - return(printer_name); - } - - /** - * Get the printer state text. - * - * @return String State text. - */ - public String getStateText() - { - return(printer_state_text); - } - - /** - * Get the printer state reasons. - * - * @return String State reason. - */ - public String getStateReasons() - { - return(printer_state_reasons); - } - - /** - * Get the printer location. - * - * @return String State location. - */ - public String getLocation() - { - return(printer_location); - } - - /** - * Get the printer make and model. - * - * @return String Make and model. - */ - public String getMakeAndModel() - { - return(printer_make_and_model); - } - - - - /** - * Get the default job sheets. - * - * @return String Default job sheets. - */ - public String getJobSheetsDefault() - { - return(job_sheets_default); - } - - /** - * Get the printer job sheets supported. - * - * @return String[] Array of supported job sheets. - */ - public String[] getJobSheetsSupported() - { - return(job_sheets_supported); - } - - - /** - * Get the default orientation. - * - * @return int Default page orientation. - */ - public int getOrientationDefault() - { - return(orientation_requested_default); - } - - /** - * Get the printer orientation supported. - * - * @return int[] Array of supported orientations. - */ - public int[] getOrientationSupported() - { - return(orientation_requested_supported); - } - - - /** - * Get the printer lower copies supported. - * - * @return int Lower of the range. - */ - public int getLowerCopiesSupported() - { - return(lower_copies_supported); - } - - - /** - * Get the printer upper copies supported. - * - * @return int Upper of the range. - */ - public int getUpperCopiesSupported() - { - return(upper_copies_supported); - } - - - /** - * Get the printer number of copies default. - * - * @return int Default number of copies. - */ - public int getCopiesDefault() - { - return(copies_default); - } - - - /** - * Get whether the printer supports page ranges. - * - * @return boolean True or false. - */ - public boolean getPageRangesSupported() - { - return(page_ranges_supported); - } - - - - /** - * Debug method. - */ - void dump() - { - int i; - - System.out.println("Printer Name: " + printer_name ); - System.out.println("Location: " + printer_location ); - System.out.println("Printer Info: " + printer_info ); - System.out.println("More Info: " + printer_more_info ); - - if (printer_uri_supported != null) - { - System.out.println("Printer URI's Supported: "); - for (i=0; i < printer_uri_supported.length; i++) - { - System.out.println(" " + printer_uri_supported[i] ); - } - } - - if (uri_authentication_supported != null) - { - System.out.println("URI Authentication Supported: "); - for (i=0; i < uri_authentication_supported.length; i++) - { - System.out.println(" " + uri_authentication_supported[i] ); - } - } - - if (uri_security_supported != null) - { - System.out.println("URI Security Supported: "); - for (i=0; i < uri_security_supported.length; i++) - { - System.out.println(" " + uri_security_supported[i] ); - } - } - - System.out.println("Attributes Charset: " + attributes_charset ); - System.out.println("Attributes Natural Language: " + attributes_natural_language ); - - System.out.println("Printer State: " + printer_state ); - System.out.println("Printer State Text: " + printer_state_text ); - System.out.println("Printer State Reasons: " + printer_state_reasons ); - - if (printer_is_accepting_jobs) - System.out.println("Accepting Jobs: Yes"); - else - System.out.println("Accepting Jobs: No"); - - -} - - - -} // End of CupsPrinter class - - diff --git a/scripting/java/src/com/easysw/cups/IPP.java b/scripting/java/src/com/easysw/cups/IPP.java deleted file mode 100644 index c5a4e1ba8..000000000 --- a/scripting/java/src/com/easysw/cups/IPP.java +++ /dev/null @@ -1,242 +0,0 @@ -package com.easysw.cups; - -/** - * @version 0.00 06-NOV-2001 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - -import java.util.*; - -/** - * An IPP object is used to hold the various - * attributes and status of an ipp request.. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ -public class IPP -{ - public IPPRequest request; // The request header - public IPPStatus status; // Status of request - public List attrs; // Attributes list. - - short state; // Current IPP state (of request???) - int current; // Index into attributes array. - int last; // Index into attributes array. - short current_tag; - - - // ------------------------------------------------------------------ - // - // Constructor - // - public IPP() - { - state = IPPDefs.IDLE; - attrs = new LinkedList(); - current = -1; - last = -1; - current_tag = IPPDefs.TAG_ZERO; - } - - - - /** - * Add an attribute to the attibutes list - * for later parsing. - * - * @param a IPPAttribute to add. - * @return true always returns true - * for now. - * - * @see IPPAttribute - * @see IPPValue - */ - public boolean addAttribute( IPPAttribute a ) - { - attrs.add(a); - return(true); - } - - /** - * Get the current attribute pointed at by - * current. - * - * @return IPPAttribute Return the current attribute. - * @return null Return null - * if current is 0. - */ - public IPPAttribute getCurrentAttribute() - { - if (current >= 0) - return( (IPPAttribute)attrs.get(current) ); - else - return( null ); - } - - // public void setCurrentAttribute( IPPAttribute p_attr ) - // { - // if (current >= 0) - // return( (IPPAttribute)attrs.get(current) ); - // } - - - /** - * - * Find the named attribute of the correct type. Both must match. - * This methos searches from the beginning of the attribute list, - * rather than from the current position. - * - * @param p_name String containing the name. - * @param p_type int attribute type. - * - * @return IPPAttribute Matching attribute if found. - * @return null null if not found. - */ - public IPPAttribute ippFindAttribute( String p_name, int p_type ) - { - if (p_name.length() < 1) - return(null); - current = -1; - return(ippFindNextAttribute(p_name, p_type)); - } - - - - - /** - * - * Find the named attribute of the correct type. Both must match. - * This methos searches from the current position in the attribute list. - * - * @param p_name String containing the name. - * @param p_type int attribute type. - * - * @return IPPAttribute Matching attribute if found. - * @return null null if not found. - */ - public IPPAttribute ippFindNextAttribute( String p_name, int p_type ) - { - int value_tag; - - if (p_name.length() < 1) - return(null); - - if ((current >= 0) && (current < (attrs.size() - 1))) - current++; - else - current = 0; - - for (int i = current; i < attrs.size(); i++) - { - IPPAttribute tmp = (IPPAttribute)attrs.get(i); - value_tag = (tmp.value_tag & IPPDefs.TAG_MASK); - if ((tmp.name.length() > 0) && (tmp.name == p_name) && - (value_tag == p_type || p_type == IPPDefs.TAG_ZERO || - (value_tag == IPPDefs.TAG_TEXTLANG && p_type == IPPDefs.TAG_TEXT) || - (value_tag == IPPDefs.TAG_NAMELANG && p_type == IPPDefs.TAG_NAME))) - { - current = i; - return(tmp); - } - } - return(null); - } - - - /** - * Get the size in bytes of an IPP request. - * - * @return int Number of bytes for the request. - */ - public int sizeInBytes() - { - IPPAttribute a; - int bytes = 8; - int last_group = IPPDefs.TAG_ZERO; - - for (int i=0; i < attrs.size(); i++) - { - a = (IPPAttribute)attrs.get(i); - bytes += a.sizeInBytes(last_group); - last_group = a.group_tag; - } - bytes++; // one for the end tag. - - return(bytes); - - } // End of IPP.sizeInBytes() - - - - - - int ippBytes() - { - int i = 0; - return(0); - } - - - - /** - * Set the IPP request ID. - * - * @param p_id short request id. - */ - public void setRequestID( short p_id ) - { - request.request_id = p_id; - } - - /** - * Set the IPP operation ID. - * - * @param p_operation_id short operation id. - */ - public void setRequestOperationID( short p_operation_id ) - { - request.operation_id = p_operation_id; - } - - - // - // Dump a list - for debugging. - // - public void dump_response() - { - IPPAttribute a; - int last_group = IPPDefs.TAG_ZERO; - - for (int i=0; i < attrs.size(); i++) - { - a = (IPPAttribute)attrs.get(i); - a.dump_values(); - last_group = a.group_tag; - } - return; - - } // End of IPP.dump_response() - - -} // End of IPP class - - - - -// -// End of IPP.java -// diff --git a/scripting/java/src/com/easysw/cups/IPPAttribute.java b/scripting/java/src/com/easysw/cups/IPPAttribute.java deleted file mode 100644 index 201e7b44b..000000000 --- a/scripting/java/src/com/easysw/cups/IPPAttribute.java +++ /dev/null @@ -1,607 +0,0 @@ -package com.easysw.cups; - -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007-2008 by Apple Inc. - * Copyright 1997-2002 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/". - */ -/** - * An IPPAttribute object hold attributes for communicating - * messages to / from the CUPS server. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ -import java.util.*; - -public class IPPAttribute -{ - int group_tag; - int value_tag; - String name; - List values; - - - - public IPPAttribute( int p_group_tag, int p_value_tag, - String p_name ) - { - group_tag = p_group_tag; - value_tag = p_value_tag; - name = p_name; - values = new ArrayList(); - - } // End of IPPAttribute constructor. - - - // - // Add a boolean value to the objects values list. - // - public boolean addBoolean( boolean p_bool ) - { - IPPValue val = new IPPValue( p_bool ); - values.add(val); - return(true); - } - - - // - // Add a set of boolean values to the objects values list. - // - public boolean addBooleans( boolean p_bools[] ) - { - if (p_bools.length < 1) - return(false); - - for (int i=0; i < p_bools.length; i++ ) - { - IPPValue val = new IPPValue( p_bools[i] ); - values.add(val); - } - return(true); - } - - - // - // Add an enum value to the objects values list. - // - public boolean addEnum( int p_int ) - { - IPPValue val = new IPPValue( p_int, true ); - values.add(val); - return(true); - } - - - // - // Add an integer value to the objects values list. - // - public boolean addInteger( int p_int ) - { - IPPValue val = new IPPValue( p_int ); - values.add(val); - return(true); - } - - - // - // Add a set of integer values to the objects values list. - // - public boolean addIntegers( int p_ints[] ) - { - if (p_ints.length < 1) - return(false); - - for (int i=0; i < p_ints.length; i++ ) - { - IPPValue val = new IPPValue( p_ints[i] ); - values.add(val); - } - return(true); - } - - - // - // Add a string value to the objects values list. - // - public boolean addString( String p_charset, String p_text ) - { - String l_value; - String final_value; - - // - // Force the value to English for POSIX locale. - // - if ((value_tag == IPPDefs.TAG_LANGUAGE) && (p_text == "C")) - { - l_value = "en"; - } - else - { - l_value = p_text; - } - - - // - // Convert language values to lowercase and _ to - as needed. - // - if ((value_tag == IPPDefs.TAG_LANGUAGE) || - (value_tag == IPPDefs.TAG_CHARSET)) - { - StringBuffer temp = new StringBuffer(l_value.length()); - char c; - for (int i = 0; i < l_value.length(); i++) - { - c = l_value.charAt(i); - if (c == '_') - c = '-'; - else if (Character.isUpperCase(c)) - c = Character.toLowerCase(c); - temp.append(c); - } - final_value = temp.toString(); - } - else - { - final_value = l_value; - } - IPPValue val = new IPPValue( p_charset, final_value ); - values.add(val); - return(true); - } - - - // - // Add a set of strings to the objects values list. - // - public boolean addStrings( String p_charset, String p_texts[] ) - { - if (p_texts.length < 1) - return(false); - - // - // Just call the singular string method to save on coding. - // - for (int i=0; i < p_texts.length; i++ ) - { - addString( p_charset, p_texts[i] ); - } - return(true); - } - - // - // Add an ipp date value to the objects values list. - // - public boolean addDate( char p_date[] ) - { - IPPValue val = new IPPValue( p_date ); - values.add(val); - return(true); - } - - // - // Add a range value to the objects values list. - // - public boolean addRange( int p_lower, int p_upper ) - { - IPPValue val = new IPPValue( p_lower, p_upper ); - values.add(val); - return(true); - } - - - // - // Add a set of range values to the objects values list. - // - public boolean addRanges( int p_lower[], int p_upper[] ) - { - // - // Avoid index out of bounds errors. - // - if (p_lower.length != p_upper.length) - return(false); - - for (int i=0; i < p_lower.length; i++ ) - addRange( p_lower[i], p_upper[i] ); - return(true); - } - - - // - // Add a resolution value to the objects values list. - // - public boolean addResolution( byte p_units, int p_xres, int p_yres ) - { - IPPValue val = new IPPValue( p_units, p_xres, p_yres ); - values.add(val); - return(true); - } - - - // - // Add a set of resolution values to the objects values list. - // - public boolean addResolutions( byte p_units, int p_xres[], int p_yres[] ) - { - if (p_xres.length != p_yres.length) - return(false); - - for (int i=0; i < p_xres.length; i++) - addResolution( p_units, p_xres[i], p_yres[i] ); - return(true); - } - - - // - // Set the attribute as a separator. - // - public boolean addSeparator() - { - value_tag = IPPDefs.TAG_ZERO; - group_tag = IPPDefs.TAG_ZERO; - return(true); - } - - - - // - // Calculate the size in bytes for an IPP requests attributes. - // - public int sizeInBytes(int last_group) - { - IPPValue val; - int bytes = 0; // Start with one for the group tag. - Charset utf8 = Charset::forName("UTF-8"); - ByteBuffer temp; - - // - // Add 1 if first time, or group tag changes. - // - if (last_group != group_tag) - bytes ++; - - bytes ++; // Add 1 for the value tag. - bytes += 2; // Add 2 for the name length field. - bytes += name.length(); // Add the length of the name. - - for (int i=0; i < values.size(); i++ ) - { - val = (IPPValue)values.get(i); - - if (i > 0) - { - // If an array of values, add 1 for another value tag, plus - // 2 for zero length name. - // - bytes += 3; - } - - switch (value_tag) - { - case IPPDefs.TAG_INTEGER : - case IPPDefs.TAG_ENUM : - bytes += 2; - bytes += 4; - break; - - case IPPDefs.TAG_BOOLEAN : - bytes += 2; - bytes ++; - break; - - case IPPDefs.TAG_TEXT: - case IPPDefs.TAG_NAME: - case IPPDefs.TAG_KEYWORD: - case IPPDefs.TAG_STRING: - case IPPDefs.TAG_URI: - case IPPDefs.TAG_URISCHEME: - case IPPDefs.TAG_CHARSET: - case IPPDefs.TAG_LANGUAGE: - case IPPDefs.TAG_MIMETYPE: - temp = utf8.encode(val.text); - bytes += 2; - if (temp.capacity() > 32767) - bytes += 32767; - else - bytes += temp.capacity(); - break; - - case IPPDefs.TAG_DATE : - bytes += 2; - bytes += 11; - break; - - case IPPDefs.TAG_RESOLUTION : - bytes += 2; - bytes += 9; - break; - - case IPPDefs.TAG_RANGE : - bytes += 2; - bytes += 8; - break; - - case IPPDefs.TAG_TEXTLANG : - case IPPDefs.TAG_NAMELANG : - temp = utf8.encode(val.text); - bytes += 6; // 2 overall len, 2 charset len, 2 text len - bytes += val.charset.length(); - if (temp.capacity() > 32767) - bytes += 32767; - else - bytes += temp.capacity(); - break; - - default : - bytes += 2; - if (val.data != null) - bytes += val.data.length; - break; - } - } - - // bytes++; // 1 byte for end of values tag. - - return(bytes); - - } // End of IPPAttribute.sizeInBytes() - - - // - // Get the characters of an attribute - // - public byte[] getBytes( int sz, int last_group ) - { - IPPValue val; - - int i,j, n; - int bi = 0; // Start with one for the group tag. - byte[] bytes = new byte[sz]; - Charset utf8 = Charset::forName("UTF-8"); - ByteBuffer temp; - - if (group_tag != last_group) - { - bytes[bi++] = (byte)group_tag; - last_group = group_tag; - } - bytes[bi++] = (byte)value_tag; - - bytes[bi++] = (byte)((name.length() & 0xff00) >> 8); - bytes[bi++] = (byte)(name.length() & 0xff); - for (j=0; j < name.length(); j++) - bytes[bi++] = (byte)name.charAt(j); - - for (i=0; i < values.size(); i++ ) - { - if (i > 0) - { - bytes[bi++] = (byte)value_tag; - bytes[bi++] = (byte)0; - bytes[bi++] = (byte)0; - } - - val = (IPPValue)values.get(i); - switch (value_tag) - { - case IPPDefs.TAG_INTEGER : - case IPPDefs.TAG_ENUM : - bytes[bi++] = (byte)0; - bytes[bi++] = (byte)4; - bytes[bi++] = (byte)((val.integer_value & 0xff000000) >> 24); - bytes[bi++] = (byte)((val.integer_value & 0xff0000) >> 16); - bytes[bi++] = (byte)((val.integer_value & 0xff00) >> 8); - bytes[bi++] = (byte)(val.integer_value & 0xff); - break; - - case IPPDefs.TAG_BOOLEAN : - bytes[bi++] = (byte)0; - bytes[bi++] = (byte)1; - if (val.boolean_value) - bytes[bi++] = (byte)1; - else - bytes[bi++] = (byte)0; - break; - - case IPPDefs.TAG_TEXT : - case IPPDefs.TAG_NAME : - case IPPDefs.TAG_KEYWORD : - case IPPDefs.TAG_STRING : - case IPPDefs.TAG_URI : - case IPPDefs.TAG_URISCHEME : - case IPPDefs.TAG_CHARSET : - case IPPDefs.TAG_LANGUAGE : - case IPPDefs.TAG_MIMETYPE : - temp = utf8.encode(val.text); - n = temp.capacity(); - - if (n > 32767) - n = 32767; - - bytes[bi++] = (byte)((n & 0x7f00) >> 8); - bytes[bi++] = (byte)(n & 0xff); - temp.get(bytes, bi, n); - bi += n; - break; - - case IPPDefs.TAG_DATE: - bytes[bi++] = (byte)0; - bytes[bi++] = (byte)11; - for (j=0; j < 11; j++) - bytes[bi++] = (byte)val.date_value[j]; - break; - - case IPPDefs.TAG_RESOLUTION : - bytes[bi++] = (byte)0; - bytes[bi++] = (byte)9; - bytes[bi++] = (byte)((val.xres & 0xff000000) >> 24); - bytes[bi++] = (byte)((val.xres & 0xff0000) >> 16); - bytes[bi++] = (byte)((val.xres & 0xff00) >> 8); - bytes[bi++] = (byte)(val.xres & 0xff); - bytes[bi++] = (byte)((val.yres & 0xff000000) >> 24); - bytes[bi++] = (byte)((val.yres & 0xff0000) >> 16); - bytes[bi++] = (byte)((val.yres & 0xff00) >> 8); - bytes[bi++] = (byte)(val.yres & 0xff); - bytes[bi++] = (byte)val.units; - break; - - case IPPDefs.TAG_RANGE : - bytes[bi++] = (byte)0; - bytes[bi++] = (byte)8; - bytes[bi++] = (byte)((val.lower & 0xff000000) >> 24); - bytes[bi++] = (byte)((val.lower & 0xff0000) >> 16); - bytes[bi++] = (byte)((val.lower & 0xff00) >> 8); - bytes[bi++] = (byte)(val.lower & 0xff); - bytes[bi++] = (byte)((val.upper & 0xff000000) >> 24); - bytes[bi++] = (byte)((val.upper & 0xff0000) >> 16); - bytes[bi++] = (byte)((val.upper & 0xff00) >> 8); - bytes[bi++] = (byte)(val.upper & 0xff); - break; - - case IPPDefs.TAG_TEXTLANG : - case IPPDefs.TAG_NAMELANG : - temp = utf8.encode(val.text); - n = temp.capacity() + val.charset.length() + 4; - - if (n > 32767) - n = 32767; - - bytes[bi++] = (byte)((n & 0x7f00) >> 8); - bytes[bi++] = (byte)(n & 0xff); - - n = val.charset.length(); - bytes[bi++] = (byte)((n & 0x7f00) >> 8); - bytes[bi++] = (byte)(n & 0xff); - for (j=0; j < val.charset.length(); j++) - bytes[bi++] = (byte)val.charset.charAt(j); - - n = temp.capacity(); - - if (n > 32767) - n = 32767; - - bytes[bi++] = (byte)((n & 0x7f00) >> 8); - bytes[bi++] = (byte)(n & 0xff); - temp.get(bytes, bi, n); - bi += n; - break; - - default : - if (val.data != null) - { - n = val.data.length; - bytes[bi++] = (byte)((n & 0xff00) >> 8); - bytes[bi++] = (byte)(n & 0xff); - for (j=0; j < val.data.length; j++) - bytes[bi++] = (byte)val.data[j]; - } - break; - } - } - - return(bytes); - - } // End of IPPAttribute.getBytes() - - - - - // - // - // - public void dump_values() - { - IPPValue val; - - if ((values == null) || (values.size() < 1)) - { - System.out.println( " ---- Separator ---- \n"); - return; - } - - for (int i=0; i < values.size(); i++ ) - { - val = (IPPValue)values.get(i); - - System.out.println("ATTR GTAG: " + group_tag ); - System.out.println("ATTR VTAG: " + value_tag ); - System.out.println("ATTR NAME: " + name ); - - // switch (value_tag & ~IPPDefs.TAG_COPY) - switch (value_tag) - { - case IPPDefs.TAG_INTEGER : - case IPPDefs.TAG_ENUM : - System.out.println( " INTEGER: " + val.integer_value ); - break; - - case IPPDefs.TAG_BOOLEAN : - System.out.println( " BOOLEAN: " + val.boolean_value ); - break; - - case IPPDefs.TAG_TEXT : - case IPPDefs.TAG_NAME : - case IPPDefs.TAG_KEYWORD : - case IPPDefs.TAG_STRING : - case IPPDefs.TAG_URI : - case IPPDefs.TAG_URISCHEME : - case IPPDefs.TAG_CHARSET : - case IPPDefs.TAG_LANGUAGE : - case IPPDefs.TAG_MIMETYPE : - System.out.println( " CHARSET: " + val.charset + - " TEXT: " + val.text ); - break; - - case IPPDefs.TAG_DATE : - System.out.println( " DATE: " + val.unix_time ); - break; - - case IPPDefs.TAG_RESOLUTION : - System.out.println( " UNITS: " + val.units + - " XRES: " + val.xres + - " YRES: " + val.yres ); - break; - - case IPPDefs.TAG_RANGE : - System.out.println( " LOWER: " + val.lower + - " UPPER: " + val.upper ); - break; - - case IPPDefs.TAG_TEXTLANG : - case IPPDefs.TAG_NAMELANG : - System.out.println( " CHARSET: " + val.charset + - " TEXT: " + val.text ); - break; - - case IPPDefs.TAG_ZERO: - System.out.println( " ---- Separator ---- \n"); - break; - - default : - break; - } - } - return; - - } - - - - -} // End of IPPAttribute class - - - - diff --git a/scripting/java/src/com/easysw/cups/IPPCalendar.java b/scripting/java/src/com/easysw/cups/IPPCalendar.java deleted file mode 100644 index 8ac4703e0..000000000 --- a/scripting/java/src/com/easysw/cups/IPPCalendar.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.easysw.cups; -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - -/** - * An IPPCalendar object is used for date/time conversion. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ - -import java.util.*; - -class IPPCalendar extends GregorianCalendar -{ - /** - * Get the time in milliseconds from the GregorianCalendar - * class. - * - * @return long Time in milliseconds of a date. - */ - public long getTimeInMillis() - { - return(super.getTimeInMillis()); - } - - /** - * Get the unix time in seconds from the GregorianCalendar - * class. - * - * @return int Unix Time in seconds of a date. - */ - public int getUnixTime() - { - return( (int)(getTimeInMillis() / 1000) ); - } - -} // end of class diff --git a/scripting/java/src/com/easysw/cups/IPPDefs.java b/scripting/java/src/com/easysw/cups/IPPDefs.java deleted file mode 100644 index 2da12efd7..000000000 --- a/scripting/java/src/com/easysw/cups/IPPDefs.java +++ /dev/null @@ -1,301 +0,0 @@ - -package com.easysw.cups; - -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - -import java.io.*; -import java.util.*; - -/** - * IPPDefs is a collection of constants for use - * in the IPP and CUPS classes. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ -public class IPPDefs -{ - - /* - * IPP version string... - */ - public static final byte VERSION[] = { 1, 0 }; - - - /* - * IPP registered port number... This is the default value - applications - * should use the ippPort() function so that you can customize things in - * /etc/services if needed! - */ - public static final int PORT = 631; - - - /* - * Common limits... - */ - public static final int MAX_NAME = 256; - public static final int MAX_VALUES = 10; /* Now just an allocation - increment */ - - - /* - * Format tags for attribute formats... - */ - public static final int TAG_ZERO = 0x00; - public static final int TAG_OPERATION = 0x01; - public static final int TAG_JOB = 0x02; - public static final int TAG_END = 0x03; - public static final int TAG_PRINTER = 0x04; - public static final int TAG_UNSUPPORTED_GROUP = 0x05; - public static final int TAG_SUBSCRIPTION = 0x06; - public static final int TAG_EVENT_NOTIFICATION = 0x07; - public static final int TAG_UNSUPPORTED_VALUE = 0x10; - public static final int TAG_DEFAULT = 0x11; - public static final int TAG_UNKNOWN = 0x12; - public static final int TAG_NOVALUE = 0x13; - public static final int TAG_NOTSETTABLE = 0x15; - public static final int TAG_DELETEATTR = 0x16; - public static final int TAG_ADMINDEFINE = 0x17; - public static final int TAG_INTEGER = 0x21; - public static final int TAG_BOOLEAN = 0x22; - public static final int TAG_ENUM = 0x23; - public static final int TAG_STRING = 0x30; - public static final int TAG_DATE = 0x31; - public static final int TAG_RESOLUTION = 0x32; - public static final int TAG_RANGE = 0x33; - public static final int TAG_BEGIN_COLLECTION = 0x34; - public static final int TAG_TEXTLANG = 0x35; - public static final int TAG_NAMELANG = 0x36; - public static final int TAG_END_COLLECTION = 0x37; - public static final int TAG_TEXT = 0x41; - public static final int TAG_NAME = 0x42; - public static final int TAG_KEYWORD = 0x44; - public static final int TAG_URI = 0x45; - public static final int TAG_URISCHEME = 0x46; - public static final int TAG_CHARSET = 0x47; - public static final int TAG_LANGUAGE = 0x48; - public static final int TAG_MIMETYPE = 0x49; - public static final int TAG_MEMBERNAME = 0x4A; - public static final int TAG_MASK = 0x7FFFFFFF; - public static final int TAG_COPY = 0x80000001; - - - /* - * Resolution units... - */ - public static final int RES_PER_INCH = 0x03; - public static final int RES_PER_CM = 0x04; - - - /* - * Finishings... - */ - public static final int FINISHINGS_NONE = 0x03; - public static final int FINISHINGS_STAPLE = 0x04; - public static final int FINISHINGS_PUNCH = 0x05; - public static final int FINISHINGS_COVER = 0x06; - public static final int FINISHINGS_BIND = 0x07; - public static final int FINISHINGS_SADDLE_STITCH = 0x08; - public static final int FINISHINGS_EDGE_STITCH = 0x09; - public static final int FINISHINGS_FOLD = 0x0A; - public static final int FINISHINGS_TRIM = 0x0B; - public static final int FINISHINGS_BALE = 0x0C; - public static final int FINISHINGS_BOOKLET_MAKER = 0x0D; - public static final int FINISHINGS_JOB_OFFSET = 0x0E; - public static final int FINISHINGS_STAPLE_TOP_LEFT = 0x14; - public static final int FINISHINGS_STAPLE_BOTTOM_LEFT = 0x15; - public static final int FINISHINGS_STAPLE_TOP_RIGHT = 0x16; - public static final int FINISHINGS_STAPLE_BOTTOM_RIGHT = 0x17; - public static final int FINISHINGS_EDGE_STITCH_LEFT = 0x18; - public static final int FINISHINGS_EDGE_STITCH_TOP = 0x19; - public static final int FINISHINGS_EDGE_STITCH_RIGHT = 0x1A; - public static final int FINISHINGS_EDGE_STITCH_BOTTOM = 0x1B; - public static final int FINISHINGS_STAPLE_DUAL_LEFT = 0x1C; - public static final int FINISHINGS_STAPLE_DUAL_TOP = 0x1D; - public static final int FINISHINGS_STAPLE_DUAL_RIGHT = 0x1E; - public static final int FINISHINGS_STAPLE_DUAL_BOTTOM = 0x1F; - public static final int FINISHINGS_BIND_LEFT = 0x32; - public static final int FINISHINGS_BIND_TOP = 0x33; - public static final int FINISHINGS_BIND_RIGHT = 0x34; - public static final int FINISHINGS_BIND_BOTTOM = 0x35; - - - /* - * Orientation... - */ - public static final int PORTRAIT = 0x03; - public static final int LANDSCAPE = 0x04; - public static final int REVERSE_LANDSCAPE = 0x05; - public static final int REVERSE_PORTRAIT = 0x06; - - - /* - * Qualities... - */ - public static final int QUALITY_DRAFT = 0x03; - public static final int QUALITY_NORMAL = 0x04; - public static final int QUALITY_HIGH = 0x05; - - - /* - * Job States.... - */ - public static final int JOB_PENDING = 0x03; - public static final int JOB_HELD = 0x04; - public static final int JOB_PROCESSING = 0x05; - public static final int JOB_STOPPED = 0x06; - public static final int JOB_CANCELLED = 0x07; - public static final int JOB_ABORTED = 0x08; - public static final int JOB_COMPLETED = 0x09; - - - /* - * Printer States.... - */ - public static final int PRINTER_IDLE = 0x03; - public static final int PRINTER_PROCESSING = 0x04; - public static final int PRINTER_STOPPED = 0x05; - - - /* - * IPP states... - */ - public static final int ERROR = 0xFFFFFFFF; - public static final int IDLE = 0x00; - public static final int HEADER = 0x01; - public static final int ATTRIBUTE = 0x02; - public static final int DATA = 0x03; - - - /* - * IPP operations... - */ - public static final int PRINT_JOB = 0x02; - public static final int PRINT_URI = 0x03; - public static final int VALIDATE_JOB = 0x04; - public static final int CREATE_JOB = 0x05; - public static final int SEND_DOCUMENT = 0x06; - public static final int SEND_URI = 0x07; - public static final int CANCEL_JOB = 0x08; - public static final int GET_JOB_ATTRIBUTES = 0x09; - public static final int GET_JOBS = 0x0A; - public static final int GET_PRINTER_ATTRIBUTES = 0x0B; - public static final int HOLD_JOB = 0x0C; - public static final int RELEASE_JOB = 0x0D; - public static final int RESTART_JOB = 0x0E; - public static final int PAUSE_PRINTER = 0x10; - public static final int RESUME_PRINTER = 0x11; - public static final int PURGE_JOBS = 0x12; - public static final int SET_PRINTER_ATTRIBUTES = 0x13; - public static final int SET_JOB_ATTRIBUTES = 0x14; - public static final int GET_PRINTER_SUPPORTED_VALUES = 0x15; - public static final int CREATE_PRINTER_SUBSCRIPTION = 0x16; - public static final int CREATE_JOB_SUBSCRIPTION = 0x17; - public static final int GET_SUBSCRIPTION_ATTRIBUTES = 0x18; - public static final int GET_SUBSCRIPTIONS = 0x19; - public static final int RENEW_SUBSCRIPTION = 0x1A; - public static final int CANCEL_SUBSCRIPTION = 0x1B; - public static final int GET_NOTIFICATIONS = 0x1C; - public static final int SEND_NOTIFICATIONS = 0x1D; - public static final int GET_PRINT_SUPPORT_FILES = 0x21; - public static final int ENABLE_PRINTER = 0x22; - public static final int DISABLE_PRINTER = 0x23; - public static final int PAUSE_PRINTER_AFTER_CURRENT_JOB = 0x24; - public static final int HOLD_NEW_JOBS = 0x25; - public static final int RELEASE_HELD_NEW_JOBS = 0x26; - public static final int DEACTIVATE_PRINTER = 0x27; - public static final int ACTIVATE_PRINTER = 0x28; - public static final int RESTART_PRINTER = 0x29; - public static final int SHUTDOWN_PRINTER = 0x2A; - public static final int STARTUP_PRINTER = 0x2B; - public static final int REPROCESS_JOB = 0x2C; - public static final int CANCEL_CURRENT_JOB = 0x2D; - public static final int SUSPEND_CURRENT_JOB = 0x2E; - public static final int RESUME_JOB = 0x2F; - public static final int PROMOTE_JOB = 0x30; - public static final int SCHEDULE_JOB_AFTER = 0x31; - public static final int PRIVATE = 0x4000; - public static final int CUPS_GET_DEFAULT = 0x4001; - public static final int CUPS_GET_PRINTERS = 0x4002; - public static final int CUPS_ADD_PRINTER = 0x4003; - public static final int CUPS_DELETE_PRINTER = 0x4004; - public static final int CUPS_GET_CLASSES = 0x4005; - public static final int CUPS_ADD_CLASS = 0x4006; - public static final int CUPS_DELETE_CLASS = 0x4007; - public static final int CUPS_ACCEPT_JOBS = 0x4008; - public static final int CUPS_REJECT_JOBS = 0x4009; - public static final int CUPS_SET_DEFAULT = 0x400A; - public static final int CUPS_GET_DEVICES = 0x400B; - public static final int CUPS_GET_PPDS = 0x400C; - public static final int CUPS_MOVE_JOB = 0x400D; - public static final int CUPS_ADD_DEVICE = 0x400E; - public static final int CUPS_DELETE_DEVICE = 0x400F; - - - - /* - * IPP status codes... - */ - public static final int OK = 0x00; - public static final int OK_SUBST = 0x01; - public static final int OK_CONFLICT = 0x02; - public static final int OK_IGNORED_SUBSCRIPTIONS = 0x03; - public static final int OK_IGNORED_NOTIFICATIONS = 0x04; - public static final int OK_TOO_MANY_EVENTS = 0x05; - public static final int OK_BUT_CANCEL_SUBSCRIPTION = 0x06; - public static final int REDIRECTION_OTHER_SITE = 0x300; - public static final int BAD_REQUEST = 0x400; - public static final int FORBIDDEN = 0x401; - public static final int NOT_AUTHENTICATED = 0x402; - public static final int NOT_AUTHORIZED = 0x403; - public static final int NOT_POSSIBLE = 0x404; - public static final int TIMEOUT = 0x405; - public static final int NOT_FOUND = 0x406; - public static final int GONE = 0x407; - public static final int REQUEST_ENTITY = 0x408; - public static final int REQUEST_VALUE = 0x409; - public static final int DOCUMENT_FORMAT = 0x40A; - public static final int ATTRIBUTES = 0x40B; - public static final int URI_SCHEME = 0x40C; - public static final int CHARSET = 0x40D; - public static final int CONFLICT = 0x40E; - public static final int COMPRESSION_NOT_SUPPORTED = 0x40F; - public static final int COMPRESSION_ERROR = 0x410; - public static final int DOCUMENT_FORMAT_ERROR = 0x411; - public static final int DOCUMENT_ACCESS_ERROR = 0x412; - public static final int ATTRIBUTES_NOT_SETTABLE = 0x413; - public static final int IGNORED_ALL_SUBSCRIPTIONS = 0x414; - public static final int TOO_MANY_SUBSCRIPTIONS = 0x415; - public static final int IGNORED_ALL_NOTIFICATIONS = 0x416; - public static final int PRINT_SUPPORT_FILE_NOT_FOUND = 0x417; - public static final int INTERNAL_ERROR = 0x500; - public static final int OPERATION_NOT_SUPPORTED = 0x501; - public static final int SERVICE_UNAVAILABLE = 0x502; - public static final int VERSION_NOT_SUPPORTED = 0x503; - public static final int DEVICE_ERROR = 0x504; - public static final int TEMPORARY_ERROR = 0x505; - public static final int NOT_ACCEPTING = 0x506; - public static final int PRINTER_BUSY = 0x507; - public static final int ERROR_JOB_CANCELLED = 0x508; - public static final int MULTIPLE_JOBS_NOT_SUPPORTED = 0x509; - public static final int PRINTER_IS_DEACTIVATED = 0x50A; - -} - - diff --git a/scripting/java/src/com/easysw/cups/IPPError.java b/scripting/java/src/com/easysw/cups/IPPError.java deleted file mode 100644 index 8a00e88c8..000000000 --- a/scripting/java/src/com/easysw/cups/IPPError.java +++ /dev/null @@ -1,150 +0,0 @@ -package com.easysw.cups; - -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - -/** - * An IPPError object is used for error conversion. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ - -import java.util.*; -import java.io.*; - - -public class IPPError -{ - private int error_number; - private String error_string; - - - /** - * Constructor that sets error_string after creation. - * - * @param error_number Error number to convert. - * @see IPPDefs - */ - public IPPError(int p_error) - { - error_number = p_error; - error_string = ippErrorString( error_number ); - } - - - /** - * Get the string associated with an error number. - * - * @param error Error number to convert. - * @see IPPDefs - */ - private String ippErrorString( int error ) - { - String unknown; - String status_oks[] = // "OK" status codes - { - "successful-ok", - "successful-ok-ignored-or-substituted-attributes", - "successful-ok-conflicting-attributes", - "successful-ok-ignored-subscriptions", - "successful-ok-ignored-notifications", - "successful-ok-too-many-events", - "successful-ok-but-cancel-subscription" - }; - - String status_400s[] = // Client errors - { - "client-error-bad-request", - "client-error-forbidden", - "client-error-not-authenticated", - "client-error-not-authorized", - "client-error-not-possible", - "client-error-timeout", - "client-error-not-found", - "client-error-gone", - "client-error-request-entity-too-large", - "client-error-request-value-too-long", - "client-error-document-format-not-supported", - "client-error-attributes-or-values-not-supported", - "client-error-uri-scheme-not-supported", - "client-error-charset-not-supported", - "client-error-conflicting-attributes", - "client-error-compression-not-supported", - "client-error-compression-error", - "client-error-document-format-error", - "client-error-document-access-error", - "client-error-attributes-not-settable", - "client-error-ignored-all-subscriptions", - "client-error-too-many-subscriptions", - "client-error-ignored-all-notifications", - "client-error-print-support-file-not-found" - }; - - String status_500s[] = // Server errors - { - "server-error-internal-error", - "server-error-operation-not-supported", - "server-error-service-unavailable", - "server-error-version-not-supported", - "server-error-device-error", - "server-error-temporary-error", - "server-error-not-accepting-jobs", - "server-error-busy", - "server-error-job-canceled", - "server-error-multiple-document-jobs-not-supported", - "server-error-printer-is-deactivated" - }; - - - // - // See if the error code is a known value... - // - if ((error >= IPPDefs.OK) && (error <= IPPDefs.OK_BUT_CANCEL_SUBSCRIPTION)) - { - return (status_oks[error]); - } - else if (error == IPPDefs.REDIRECTION_OTHER_SITE) - { - return ("redirection-other-site"); - } - else if ((error >= IPPDefs.BAD_REQUEST) && - (error <= IPPDefs.PRINT_SUPPORT_FILE_NOT_FOUND)) - { - return (status_400s[error - IPPDefs.BAD_REQUEST]); - } - else if ((error >= IPPDefs.INTERNAL_ERROR) && - (error <= IPPDefs.PRINTER_IS_DEACTIVATED)) - { - return (status_500s[error - IPPDefs.INTERNAL_ERROR]); - } - - // - // No, build an "unknown-xxxx" error string... - // - - unknown = "unknown" + error; - - return (unknown); - } - - -} // End of IPPError class - - - diff --git a/scripting/java/src/com/easysw/cups/IPPHttp.java b/scripting/java/src/com/easysw/cups/IPPHttp.java deleted file mode 100644 index 2ec200854..000000000 --- a/scripting/java/src/com/easysw/cups/IPPHttp.java +++ /dev/null @@ -1,1343 +0,0 @@ -package com.easysw.cups; - -/** - * @version 1.1 23-JAN-2007 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2007 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/". - */ - -/** - * An IPPHttp object is used for reading/writing to the cups - * server, and processing responses. - * - * @author TDB - * @version 1.1 - * @since JDK1.3 - */ - -import java.io.*; -import java.util.*; -import java.net.*; -import java.security.*; - -public class IPPHttp -{ - - /** - * Class constants - most not in use yet. - */ - public static final int HTTP_WAITING = 0x00; - public static final int HTTP_OPTIONS = 0x01; - public static final int HTTP_GET = 0x02; - public static final int HTTP_GET_SEND = 0x03; - public static final int HTTP_HEAD = 0x04; - public static final int HTTP_POST = 0x05; - public static final int HTTP_POST_RECV = 0x06; - public static final int HTTP_POST_SEND = 0x07; - public static final int HTTP_PUT = 0x08; - public static final int HTTP_PUT_RECV = 0x09; - public static final int HTTP_DELETE = 0x0A; - public static final int HTTP_TRACE = 0x0B; - public static final int HTTP_CLOSE = 0x0C; - public static final int HTTP_STATUS = 0x0D; - - public static final int HTTP_0_9 = 0x09; - public static final int HTTP_1_0 = 0x64; - public static final int HTTP_1_1 = 0x65; - - public static final int HTTP_KEEPALIVE_OFF = 0x00; - public static final int HTTP_KEEPALIVE_ON = 0x01; - - public static final int HTTP_ENCODE_LENGTH = 0x00; - public static final int HTTP_ENCODE_CHUNKED = 0x01; - - public static final int HTTP_ENCRYPT_IF_REQUESTED = 0x00; - public static final int HTTP_ENCRYPT_NEVER = 0x01; - public static final int HTTP_ENCRYPT_REQUIRED = 0x02; - public static final int HTTP_ENCRYPT_ALWAYS = 0x03; - - public static final int HTTP_AUTH_NONE = 0x00; - public static final int HTTP_AUTH_BASIC = 0x01; - public static final int HTTP_AUTH_MD5 = 0x02; - public static final int HTTP_AUTH_MD5_SESS = 0x03; - public static final int HTTP_AUTH_MD5_INT = 0x04; - public static final int HTTP_AUTH_MD5_SESS_INT = 0x05; - - public static final int HTTP_ERROR = 0xFFFFFFFF; - public static final int HTTP_CONTINUE = 0x64; - public static final int HTTP_SWITCHING_PROTOCOLS = 0x65; - public static final int HTTP_OK = 0xC8; - public static final int HTTP_CREATED = 0xC9; - public static final int HTTP_ACCEPTED = 0xCA; - public static final int HTTP_NOT_AUTHORITATIVE = 0xCB; - public static final int HTTP_NO_CONTENT = 0xCC; - public static final int HTTP_RESET_CONTENT = 0xCD; - public static final int HTTP_PARTIAL_CONTENT = 0xCE; - public static final int HTTP_MULTIPLE_CHOICES = 0x12C; - public static final int HTTP_MOVED_PERMANENTLY = 0x12D; - public static final int HTTP_MOVED_TEMPORARILY = 0x12E; - public static final int HTTP_SEE_OTHER = 0x12F; - public static final int HTTP_NOT_MODIFIED = 0x130; - public static final int HTTP_USE_PROXY = 0x131; - public static final int HTTP_BAD_REQUEST = 0x190; - public static final int HTTP_UNAUTHORIZED = 0x191; - public static final int HTTP_PAYMENT_REQUIRED = 0x192; - public static final int HTTP_FORBIDDEN = 0x193; - public static final int HTTP_NOT_FOUND = 0x194; - public static final int HTTP_METHOD_NOT_ALLOWED = 0x195; - public static final int HTTP_NOT_ACCEPTABLE = 0x196; - public static final int HTTP_PROXY_AUTHENTICATION = 0x197; - public static final int HTTP_REQUEST_TIMEOUT = 0x198; - public static final int HTTP_CONFLICT = 0x199; - public static final int HTTP_GONE = 0x19A; - public static final int HTTP_LENGTH_REQUIRED = 0x19B; - public static final int HTTP_PRECONDITION = 0x19C; - public static final int HTTP_REQUEST_TOO_LARGE = 0x19D; - public static final int HTTP_URI_TOO_LONG = 0x19E; - public static final int HTTP_UNSUPPORTED_MEDIATYPE = 0x19F; - public static final int HTTP_UPGRADE_REQUIRED = 0x1AA; - public static final int HTTP_SERVER_ERROR = 0x1F4; - public static final int HTTP_NOT_IMPLEMENTED = 0x1F5; - public static final int HTTP_BAD_GATEWAY = 0x1F6; - public static final int HTTP_SERVICE_UNAVAILABLE = 0x1F7; - public static final int HTTP_GATEWAY_TIMEOUT = 0x1F8; - - public static final int HTTP_NOT_SUPPORTED = 0x1F9; - - public static final int HTTP_FIELD_UNKNOWN = 0xFFFFFFFF; - public static final int HTTP_FIELD_ACCEPT_LANGUAGE = 0x00; - public static final int HTTP_FIELD_ACCEPT_RANGES = 0x01; - public static final int HTTP_FIELD_AUTHORIZATION = 0x02; - public static final int HTTP_FIELD_CONNECTION = 0x03; - public static final int HTTP_FIELD_CONTENT_ENCODING = 0x04; - public static final int HTTP_FIELD_CONTENT_LANGUAGE = 0x05; - public static final int HTTP_FIELD_CONTENT_LENGTH = 0x06; - public static final int HTTP_FIELD_CONTENT_LOCATION = 0x07; - public static final int HTTP_FIELD_CONTENT_MD5 = 0x08; - public static final int HTTP_FIELD_CONTENT_RANGE = 0x09; - public static final int HTTP_FIELD_CONTENT_TYPE = 0x0A; - public static final int HTTP_FIELD_CONTENT_VERSION = 0x0B; - public static final int HTTP_FIELD_DATE = 0x0C; - public static final int HTTP_FIELD_HOST = 0x0D; - public static final int HTTP_FIELD_IF_MODIFIED_SINCE = 0x0E; - public static final int HTTP_FIELD_IF_UNMODIFIED_SINCE = 0x0F; - public static final int HTTP_FIELD_KEEP_ALIVE = 0x10; - public static final int HTTP_FIELD_LAST_MODIFIED = 0x11; - public static final int HTTP_FIELD_LINK = 0x12; - public static final int HTTP_FIELD_LOCATION = 0x13; - public static final int HTTP_FIELD_RANGE = 0x14; - public static final int HTTP_FIELD_REFERER = 0x15; - public static final int HTTP_FIELD_RETRY_AFTER = 0x16; - public static final int HTTP_FIELD_TRANSFER_ENCODING = 0x17; - public static final int HTTP_FIELD_UPGRADE = 0x18; - public static final int HTTP_FIELD_USER_AGENT = 0x19; - public static final int HTTP_FIELD_WWW_AUTHENTICATE = 0x1A; - public static final int HTTP_FIELD_MAX = 0x1B; - - public static final String http_fields[] = - { - "Accept-Language", - "Accept-Ranges", - "Authorization", - "Connection", - "Content-Encoding", - "Content-Language", - "Content-Length", - "Content-Location", - "Content-MD5", - "Content-Range", - "Content-Type", - "Content-Version", - "Date", - "Host", - "If-Modified-Since", - "If-Unmodified-since", - "Keep-Alive", - "Last-Modified", - "Link", - "Location", - "Range", - "Referer", - "Retry-After", - "Transfer-Encoding", - "Upgrade", - "User-Agent", - "WWW-Authenticate" - }; - public static final String days[] = - { - "Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat" - }; - public static final String months[] = - { - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec" - }; - - - - // - // Private class members. - // - private URL url; // URL of connection. - - public Socket conn; // Connection socket. - public boolean connected; // True when connected. - - public BufferedInputStream is; // Input stream. - public BufferedReader br; - public BufferedOutputStream os; // Output stream. - - private boolean encrypted; - - public int write_content_length; - private char write_buffer[]; - private int write_buffer_head; - private int write_buffer_tail; - - public String read_header_date; - public String read_header_server; - public String read_header_charset; - public String read_header_content_language; - public String read_header_content_type; - public int read_header_content_length; - - public char read_buffer[]; - private int read_buffer_head; - private int read_buffer_tail; - - public int status; - public String status_text; - public String version; - public int error; - public int activity; - - public String hostname; // Hostname from URL - public int port; // Port from URL. - public String path; // Path from URL. - public String user; // User name - public String passwd; // Password - - public String auth_type; // none, basic, digest - public String realm; // For digest auth - public String opaque; // For digest auth - public String nonce; // For digest auth - public String resource; // For digest auth - public String method; // For digest auth - - public String http_request; - public int http_content_length; - - - - /** - * Constructor using URL. - * - * @param request_url URL of server to connect to. - * @throw IOException - * @throw UnknownHostException - */ - public IPPHttp( String request_url ) - throws IOException, UnknownHostException - { - - encrypted = false; - status = 0; - status_text = ""; - version = "1.0"; - connected = false; - user = ""; - passwd = ""; - - auth_type = ""; - realm = ""; - nonce = ""; - resource = ""; - method = ""; - - try - { - // - // Create the URL and split it up. - // - url = new URL(request_url); - hostname = url.getHost(); - port = url.getPort(); - path = url.getPath(); - - - // - // Open the socket and set the options. - // - conn = new Socket(hostname, port); - conn.setSoTimeout(200); - - // - // Create the input and output streams. - // - is = new BufferedInputStream(new DataInputStream(conn.getInputStream())); - os = new BufferedOutputStream(new DataOutputStream(conn.getOutputStream())); - connected = true; - } - catch(UnknownHostException unknownhostexception) - { - throw unknownhostexception; - } - catch(IOException ioexception) - { - throw ioexception; - } - } - - - - /** - * Constructor using URL, user and pass. - * - * @param request_url URL of server to connect to. - * @param p_auth_type String basic or digest. - * @param p_user String User name. - * @param p_passwd String password. - * @throw IOException - * @throw UnknownHostException - */ - public IPPHttp( String request_url, String p_auth_type, - String p_user, String p_passwd ) - throws IOException, UnknownHostException - { - encrypted = false; - status = 0; - status_text = ""; - version = "1.0"; - connected = false; - - user = p_user; - passwd = p_passwd; - auth_type = p_auth_type; - - realm = ""; - nonce = ""; - resource = ""; - method = ""; - - try - { - // - // Create the URL and split it up. - // - url = new URL(request_url); - hostname = url.getHost(); - port = url.getPort(); - path = url.getPath(); - - // - // Open the socket and set the options. - // - conn = new Socket(hostname, port); - conn.setSoTimeout(200); - - // - // Create the input and output streams. - // - is = new BufferedInputStream(new DataInputStream(conn.getInputStream())); - os = new BufferedOutputStream(new DataOutputStream(conn.getOutputStream())); - connected = true; - } - catch(UnknownHostException unknownhostexception) - { - throw unknownhostexception; - } - catch(IOException ioexception) - { - throw ioexception; - } - } - - - - - /** - * Re-establish a dropped connection. - * - * @return boolean True if connected. - * - * @throw IOException - */ - public boolean reConnect() throws IOException - { - connected = false; - status = 0; - status_text = ""; - try - { - // - // Open the socket and set the options. - // - conn = new Socket(hostname, port); - conn.setSoTimeout(200); - - // - // Create the input and output streams. - // - is = new BufferedInputStream(new DataInputStream(conn.getInputStream())); - os = new BufferedOutputStream(new DataOutputStream(conn.getOutputStream())); - connected = true; - return(connected); - - } - catch (IOException ioexception) - { - connected = false; - throw(ioexception); - } - } - - - - /** - * Set the user name. - * - * @param p_user String - user name. - */ - public void setUser(String p_user ) - { - user = p_user; - } - - - /** - * Set the password. - * - * @param p_passwd String - password. - */ - public void setPassword(String p_passwd ) - { - passwd = p_passwd; - } - - - - - /** - * Write the request header bytes to the server. - * - * @param request String - the request. - * @param content_length int - size of the total request. - * @throw IOException - */ - public int writeHeader(String request, int content_length ) - throws IOException - { - - http_request = request; - http_content_length = content_length; - - try - { - String s1 = "POST " + request + " HTTP/1.0\r\n"; - os.write(s1.getBytes(), 0, s1.length()); - - s1 = "Content-type: application/ipp\r\n"; - os.write(s1.getBytes(), 0, s1.length()); - - - // - // Do basic style authorization if needed. - // - if (auth_type.compareTo("basic") == 0) - { - s1 = user + ":" + passwd; - String auth_string = Base64Coder.encodeString(s1); - s1 = "Authorization: Basic " + auth_string + "\r\n"; - os.write(s1.getBytes(), 0, s1.length()); - } - else if (auth_type.compareTo("digest") == 0) - { - try - { - IPPMD5 md5 = IPPMD5.getInstance(); - String auth_string = md5.MD5Digest(user, passwd, realm, - "POST", path, nonce ); - s1 = "Authorization: Digest " + "username=\"" + user + "\", " + - "realm=\"" + realm + "\", " + - "nonce=\"" + nonce + "\", " + - "response=\"" + auth_string + "\"\r\n"; - - os.write(s1.getBytes(), 0, s1.length()); - } - catch(NoSuchAlgorithmException e) - { - System.out.println("No such algorithm: MD5."); - } - } - - s1 = "Content-length: " + content_length + "\r\n\r\n"; - os.write(s1.getBytes(), 0, s1.length()); - os.flush(); - } - catch(IOException ioexception) - { - error = HTTP_ERROR; - throw ioexception; - } - - - try - { - int local_status = 0; - - // - // Check for any response. - // - if (is.available() > 0) - { - StringBuffer http_version = new StringBuffer(32); - StringBuffer http_status = new StringBuffer(32); - StringBuffer http_text = new StringBuffer(256); - - String read_buffer; - status = 0; - is.mark(8192); - while (is.available() > 0) - { - read_buffer = read_line(); - - if (read_buffer.startsWith("HTTP/")) - { - int i,n; - String s2 = read_buffer.substring(5); - - - for (i=0;(i < s2.length() && s2.charAt(i) != ' '); i++) - { - http_version.append(s2.charAt(i)); - } - while (i < s2.length() && s2.charAt(i) == ' ') - i++; - for (;(i < s2.length() && s2.charAt(i) != '\n' && - s2.charAt(i) != '\r' && s2.charAt(i) != ' '); i++) - { - http_status.append(s2.charAt(i)); - } - - while (i < s2.length() && s2.charAt(i) == ' ') - i++; - for (n=0;(n < 256 && i < s2.length() && s2.charAt(i) != '\n' && - s2.charAt(i) != '\r' && s2.charAt(i) != ' '); i++) - { - http_text.append(s2.charAt(i)); - } - local_status = Integer.parseInt(http_status.toString(), 10); - } - } - is.reset(); - } - - // - // See if we need to reconnect and send authorization. - // - switch( local_status ) - { - // - // Not authorized. - // - case HTTP_UNAUTHORIZED: read_header(); - return( local_status ); - } - } - catch(IOException ioexception) - { - error = HTTP_ERROR; - throw ioexception; - } - return(0); - } - - - - - - - public int checkForResponse() - { - // - // Check for any response. - // - try - { - if (is.available() > 0) - { - StringBuffer http_version = new StringBuffer(32); - StringBuffer http_status = new StringBuffer(32); - StringBuffer http_text = new StringBuffer(256); - int local_status = 0; - String read_buffer; - - status = 0; - is.mark(8192); - while (is.available() > 0) - { - read_buffer = read_line(); - if (read_buffer.startsWith("HTTP/")) - { - int i,n; - String s2 = read_buffer.substring(5); - for (i=0;(i < s2.length() && s2.charAt(i) != ' '); i++) - { - http_version.append(s2.charAt(i)); - } - while (i < s2.length() && s2.charAt(i) == ' ') - i++; - for (;(i < s2.length() && s2.charAt(i) != '\n' && - s2.charAt(i) != '\r' && s2.charAt(i) != ' '); i++) - { - http_status.append(s2.charAt(i)); - } - - while (i < s2.length() && s2.charAt(i) == ' ') - i++; - for (n=0;(n < 256 && i < s2.length() && s2.charAt(i) != '\n' && - s2.charAt(i) != '\r' && s2.charAt(i) != ' '); i++) - { - http_text.append(s2.charAt(i)); - } - local_status = Integer.parseInt(http_status.toString(), 10); - status = local_status; - } - } - is.reset(); - - // - // See if we need to reconnect and send authorization. - // - switch( local_status ) - { - // - // Not authorized. - // - case HTTP_UNAUTHORIZED: read_header(); - return( local_status ); - } - } - } - catch (IOException e) - { - return(HTTP_ERROR); - } - return(0); - } - - - /** - * Write bytes to the output stream. - * - * @param bytes Array of bytes to write to the stream. - * @throw IOException - */ - public void write(byte bytes[]) - throws IOException - { - try - { - os.write(bytes, 0, bytes.length); - os.flush(); - } - catch(IOException ioexception) - { - error = HTTP_ERROR; - throw ioexception; - } - } - - - /** - * Write bytes to the output stream. - * - * @param bytes Array of bytes to write to the stream. - * @param length Number of bytes to write to the stream. - * @throw IOException - */ - public void write(byte bytes[], int length ) - throws IOException - { - try - { - os.write(bytes, 0, length); - os.flush(); - } - catch(IOException ioexception) - { - error = HTTP_ERROR; - throw ioexception; - } - } - - - - - - - - - - - /** - * Read the HTTP header from the input stream. - * - * @return int Content length of response. - * @return 0 Return zero on error. - * @throw IOException - */ - public int read_header() - throws IOException - { - boolean done = false; - read_header_content_length = 0; - - String read_buffer; - while (!done) - { - read_buffer = read_line(); - if (read_buffer.startsWith("HTTP/")) - { - int i,n; - String s2 = read_buffer.substring(5); - - StringBuffer http_version = new StringBuffer(32); - StringBuffer http_status = new StringBuffer(32); - StringBuffer http_text = new StringBuffer(256); - - for (i=0;(i < s2.length() && s2.charAt(i) != ' '); i++) - { - http_version.append(s2.charAt(i)); - } - while (i < s2.length() && s2.charAt(i) == ' ') - i++; - for (;(i < s2.length() && s2.charAt(i) != '\n' && - s2.charAt(i) != '\r' && s2.charAt(i) != ' '); i++) - { - http_status.append(s2.charAt(i)); - } - - while (i < s2.length() && s2.charAt(i) == ' ') - i++; - for (n=0;(n < 256 && i < s2.length() && s2.charAt(i) != '\n' && - s2.charAt(i) != '\r' && s2.charAt(i) != ' '); i++) - { - http_text.append(s2.charAt(i)); - } - version = http_version.toString(); - status = Integer.parseInt(http_status.toString(), 10); - status_text = http_text.toString(); - } - else if (read_buffer.startsWith("WWW-Authenticate: Basic")) - { - String s2=read_buffer.substring("WWW-Authenticate: Basic".length()); - auth_type = "basic"; - } - else if (read_buffer.startsWith("WWW-Authenticate: Digest")) - { - String s2=read_buffer.substring("WWW-Authenticate: Digest".length()); - auth_type = "digest"; - parseAuthenticate(s2); - } - else if (read_buffer.startsWith("Content-Length:")) - { - String s2 = read_buffer.substring(15); - read_header_content_length = Integer.parseInt(s2.trim(), 10); - } - else if (read_buffer.startsWith("Content-Language:")) - { - String s3 = read_buffer.substring(17); - read_header_content_language = s3.trim(); - } - else if (read_buffer.startsWith("Server:")) - { - String s4 = read_buffer.substring(7); - read_header_server = s4.trim(); - } - else if (read_buffer.startsWith("Date:")) - { - String s5 = read_buffer.substring(5); - read_header_date = s5.trim(); - } - else if (read_buffer.length() == 0) - { - done = true; - return( read_header_content_length ); - } - } - return( 0 ); - } - - - - /** - * Read a line from the input stream. - * - * @return String Line read. - * @throw IOException - */ - public String read_line() - throws IOException - { - StringBuffer sb = new StringBuffer(); - int c = 0; - - try - { - while ((c != -1) && (c != 10)) - { - c = is.read(); - switch( c ) - { - case -1: - case 10: - case 13: - break; - - default: sb.append((char)c); - } - } - } - catch (IOException e) - { - throw(e); - } - return(sb.toString()); - } - - - - - - /** - * Read up to count bytes from the input stream. - * - * @param count Number of bytes to read. - * @return char[] Character array of data read. - * @throw IOException - */ - public char[] read(int count) - throws IOException - { - char ac[] = new char[count]; - int j = 0; - try - { - for (int k = is.read(); k != -1 && j < count; k = is.read()) - { - ac[j++] = (char)k; - } - } - catch(IOException ioexception) - { - throw ioexception; - } - return(ac); - } - - - /** - * Process the HTTP response from the server. - * - * @return IPP IPP object containing response data. - * @see IPP - * @see IPPRequest - * @see IPPAttribute - * @see IPPValue - * @see IPPDefs - */ - public IPP processResponse() - { - IPP ipp; - IPPAttribute attr; // temp attribute - IPPValue val; // temp value - - short vtag; // Current value tag - short gtag; // Current group tag - - char[] buffer; - - ipp = new IPP(); - ipp.request = new IPPRequest(); - - int read_buffer_bytes = read_buffer.length; - int read_buffer_remaining = read_buffer_bytes; - int bufferidx = 0; - int n; - - - ipp.current = -1; // current attritue?? - ipp.last = -1; // last attr? - attr = null; - buffer = read_buffer; - gtag = -1; - vtag = -1; - - - // --------------------------------------------------------------- - // State machine to process response. - // - ipp.state = IPPDefs.IDLE; - while ((ipp.state != IPPDefs.TAG_END) && - (read_buffer_remaining > 0)) - { - switch (ipp.state) - { - case IPPDefs.IDLE : - ipp.state++; /* Avoid common problem... */ - - // - // Get the request header... - // - case IPPDefs.HEADER : - if (read_buffer_remaining < 8) - { - return (null); - } - - // - // Verify the major version number... - // - if (buffer[0] != (char)1) - { - return (null); - } - - // - // Then copy the request header over... - // - ipp.request.version[0] = buffer[bufferidx++]; - ipp.request.version[1] = buffer[bufferidx++]; - ipp.request.op_status = (short)((short)buffer[bufferidx] << 8) | - (short)buffer[bufferidx+1]; - bufferidx += 2; - - // - // Get the text version of the request status .... - // - ipp.status = new IPPStatus(ipp.request.op_status); - - ipp.request.request_id = (int)((int)buffer[bufferidx] << 24) | - ((int)buffer[bufferidx+1] << 16) | - ((int)buffer[bufferidx+2] << 8) | - ((int)buffer[bufferidx+3]); - bufferidx += 4; - read_buffer_remaining -= 8; - - ipp.state = IPPDefs.ATTRIBUTE; - ipp.current = -1; - ipp.current_tag = IPPDefs.TAG_ZERO; - break; - - case IPPDefs.ATTRIBUTE : - while (read_buffer_remaining > 0) - { - // - // Read the value tag first. - // - vtag = (short)buffer[bufferidx++]; - read_buffer_remaining--; - if (vtag == IPPDefs.TAG_END) - { - // - // No more attributes left... - // - ipp.state = IPPDefs.DATA; - if (attr != null) - { - ipp.addAttribute(attr); - attr = null; - } - break; - } - else if (vtag < IPPDefs.TAG_UNSUPPORTED_VALUE) - { - if (attr != null) - { - ipp.addAttribute(attr); - } - - // - // Group tag... Set the current group and continue... - // - gtag = vtag; - - // If still the same group .... - if (ipp.current_tag == gtag) - { - // - // Add a separator - // - attr = new IPPAttribute(IPPDefs.TAG_ZERO,IPPDefs.TAG_ZERO,""); - ipp.addAttribute(attr); - attr = null; - } - - - ipp.current_tag = gtag; - ipp.current = -1; - continue; - } - - // - // Get the name... - // - n = ((int)buffer[bufferidx] << 8) | (int)buffer[bufferidx+1]; - bufferidx += 2; - read_buffer_remaining -= 2; - - if (n == 0) - { - // - // Parse Error, can't add additional values to null attr - // - if (attr == null) - return (null); - - // - // More values for current attribute... - // - - // - // Make sure we aren't adding a new value of a different - // type... - // - - if (attr.value_tag == IPPDefs.TAG_STRING || - (attr.value_tag >= IPPDefs.TAG_TEXTLANG && - attr.value_tag <= IPPDefs.TAG_MIMETYPE)) - { - // - // String values can sometimes come across in different - // forms; accept sets of differing values... - // - if (vtag != IPPDefs.TAG_STRING && - (vtag < IPPDefs.TAG_TEXTLANG || vtag > IPPDefs.TAG_MIMETYPE)) - return (null); - } - else if (attr.value_tag != vtag) - return (null); - } - else - { - if (attr != null) - { - ipp.addAttribute(attr); - attr = null; - } - - // - // New Attribute - // - StringBuffer s = new StringBuffer(); - for (int i=0; i < n; i++) - { - s.append((char)buffer[bufferidx++]); - read_buffer_remaining--; - } - attr = new IPPAttribute( gtag, vtag, s.toString() ); - } - n = ((short)buffer[bufferidx] << 8) | (short)buffer[bufferidx+1]; - bufferidx += 2; - read_buffer_remaining -= 2; - - switch (vtag) - { - case IPPDefs.TAG_INTEGER : - case IPPDefs.TAG_ENUM : - n = (int)(((int)buffer[bufferidx] << 24) | - ((int)buffer[bufferidx+1] << 16) | - ((int)buffer[bufferidx+2] << 8) | - ((int)buffer[bufferidx+3])); - bufferidx += 4; - read_buffer_remaining -= 4; - attr.addInteger( n ); - break; - - case IPPDefs.TAG_BOOLEAN : - if ((byte)buffer[bufferidx++] > 0) - attr.addBoolean(true); - else - attr.addBoolean(false); - read_buffer_remaining --; - break; - - case IPPDefs.TAG_TEXT : - case IPPDefs.TAG_NAME : - case IPPDefs.TAG_KEYWORD : - case IPPDefs.TAG_STRING : - case IPPDefs.TAG_URI : - case IPPDefs.TAG_URISCHEME : - case IPPDefs.TAG_CHARSET : - case IPPDefs.TAG_LANGUAGE : - case IPPDefs.TAG_MIMETYPE : - StringBuffer s = new StringBuffer(); - for (int i=0; i < n; i++ ) - { - s.append( (char)buffer[bufferidx++] ); - read_buffer_remaining --; - } - attr.addString( "", s.toString() ); - break; - - - case IPPDefs.TAG_DATE : - char db[] = new char[11]; - for (int i=0; i < 11; i++ ) - { - db[i] = (char)buffer[bufferidx++]; - read_buffer_remaining --; - } - attr.addDate( db ); - break; - - - case IPPDefs.TAG_RESOLUTION : - if (read_buffer_remaining < 9) - return( null ); - - int x, y; - byte u; - x = (int)(((int)buffer[bufferidx] & 0xff000000) << 24) | - (((int)buffer[bufferidx+1] & 0x00ff0000) << 16) | - (((int)buffer[bufferidx+2] & 0x0000ff00) << 8) | - (((int)buffer[bufferidx+3] & 0x000000ff)); - bufferidx += 4; - read_buffer_remaining -= 4; - - y = (int)(((int)buffer[bufferidx] & 0xff000000) << 24) | - (((int)buffer[bufferidx+1] & 0x00ff0000) << 16) | - (((int)buffer[bufferidx+2] & 0x0000ff00) << 8) | - (((int)buffer[bufferidx+3] & 0x000000ff)); - bufferidx += 4; - read_buffer_remaining -= 4; - - u = (byte)buffer[bufferidx++]; - read_buffer_remaining--; - attr.addResolution( u, x, y ); - break; - - case IPPDefs.TAG_RANGE : - if (read_buffer_remaining < 8) - return (null); - - int lower, upper; - lower = (int)(((int)buffer[bufferidx] & 0xff000000) << 24) | - (((int)buffer[bufferidx+1] & 0x00ff0000) << 16) | - (((int)buffer[bufferidx+2] & 0x0000ff00) << 8) | - (((int)buffer[bufferidx+3] & 0x000000ff)); - bufferidx += 4; - read_buffer_remaining -= 4; - - upper = (int)(((int)buffer[bufferidx] & 0xff000000) << 24) | - (((int)buffer[bufferidx+1] & 0x00ff0000) << 16) | - (((int)buffer[bufferidx+2] & 0x0000ff00) << 8) | - (((int)buffer[bufferidx+3] & 0x000000ff)); - bufferidx += 4; - read_buffer_remaining -= 4; - - attr.addRange( (short)lower, (short)upper ); - break; - - case IPPDefs.TAG_TEXTLANG : - case IPPDefs.TAG_NAMELANG : - // - // text-with-language and name-with-language are composite - // values: - // - // charset-length - // charset - // text-length - // text - // - - n = ((int)buffer[bufferidx] << 8) | (int)buffer[bufferidx+1]; - bufferidx += 2; - - StringBuffer cs = new StringBuffer(); - for (int i=0; i < n; i++ ) - { - cs.append( (char)buffer[bufferidx++] ); - read_buffer_remaining --; - } - - n = ((int)buffer[bufferidx] << 8) | (int)buffer[bufferidx+1]; - bufferidx += 2; - - StringBuffer tx = new StringBuffer(); - for (int i=0; i < n; i++ ) - { - tx.append( (char)buffer[bufferidx++] ); - read_buffer_remaining --; - } - - attr.addString( cs.toString(), tx.toString() ); - break; - - - default : /* Other unsupported values */ - if (n > 0) - { - bufferidx += n; - read_buffer_remaining -= n; - } - break; - } - } // End of while - - if (attr != null) - { - ipp.addAttribute(attr); - attr = null; - } - break; - - case IPPDefs.DATA : - break; - - default : - break; /* anti-compiler-warning-code */ - } - } - return (ipp); -} - - - -// -// Parse a WWW-Authenticate: Digest request -// -public void parseAuthenticate( String p_auth ) -{ - String tmp; - StringBuffer val; - int i,n; - - tmp = p_auth; - while (tmp.length() > 0) - { - i = 0; - while (tmp.length() > 0 && (tmp.charAt(i) == ' ' || tmp.charAt(i) == '"')) - tmp = tmp.substring(1); - i = 0; - - if (tmp.startsWith("realm=")) - { - i = "realm=".length(); - tmp = tmp.substring(i); - i = 0; - while ((i < tmp.length()) && - (tmp.charAt(i) == ' ' || - tmp.charAt(i) == '"' || - tmp.charAt(i) == '=')) - { - i++; - } - val = new StringBuffer(1024); - while (i < tmp.length() && tmp.charAt(i) != '"') - val.append(tmp.charAt(i++)); - realm = val.toString(); - tmp = tmp.substring(i); - } - else if (tmp.startsWith("nonce=")) - { - i = "nonce=".length(); - tmp = tmp.substring(i); - i = 0; - while ((i < tmp.length()) && - (tmp.charAt(i) == ' ' || - tmp.charAt(i) == '"' || - tmp.charAt(i) == '=')) - { - i++; - } - val = new StringBuffer(1024); - while (i < tmp.length() && tmp.charAt(i) != '"') - val.append(tmp.charAt(i++)); - nonce = val.toString(); - tmp = tmp.substring(i); - } - else if (tmp.startsWith("opaque=")) - { - i = "opaque=".length(); - tmp = tmp.substring(i); - i = 0; - while ((i < tmp.length()) && - (tmp.charAt(i) == ' ' || - tmp.charAt(i) == '"' || - tmp.charAt(i) == '=')) - { - i++; - } - val = new StringBuffer(1024); - while (i < tmp.length() && tmp.charAt(i) != '"') - val.append(tmp.charAt(i++)); - opaque = val.toString(); - tmp = tmp.substring(i); - } - else - { - StringBuffer name = new StringBuffer(256); - while ((i < tmp.length()) && - (tmp.charAt(i) != ' ' || - tmp.charAt(i) != '"' || - tmp.charAt(i) != '=')) - { - name.append(tmp.charAt(i++)); - } - - i = name.toString().length(); - tmp = tmp.substring(i); - i = 0; - while ((i < tmp.length()) && - (tmp.charAt(i) == ' ' || - tmp.charAt(i) == '"' || - tmp.charAt(i) == '=')) - { - i++; - } - val = new StringBuffer(1024); - while (i < tmp.length() && tmp.charAt(i) != '"') - val.append(tmp.charAt(i++)); - //junk = val.toString(); - tmp = tmp.substring(i); - } - } -} - - - - - -} // End of IPPHttp class - - diff --git a/scripting/java/src/com/easysw/cups/IPPMD5.java b/scripting/java/src/com/easysw/cups/IPPMD5.java deleted file mode 100644 index e08e9537e..000000000 --- a/scripting/java/src/com/easysw/cups/IPPMD5.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.easysw.cups; - -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - -/** - * Digest MD5 password routines. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ -import java.security.*; - -public class IPPMD5 -{ - public MessageDigest md = null; - static private IPPMD5 md5 = null; - private static final char[] hexChars = {'0','1','2','3','4','5','6','7', - '8','9','a','b','c','d','e','f'}; - - /** - * Constructor is private so you must use the getInstance method - */ - private IPPMD5() throws NoSuchAlgorithmException - { - md = MessageDigest.getInstance("MD5"); - } - - - /** - * This returns the singleton instance - */ - public static IPPMD5 getInstance() throws NoSuchAlgorithmException - { - - if (md5 == null) - { - md5 = new IPPMD5(); - } - return (md5); - } - - - public String hashData(byte[] dataToHash) - { - return(hexStringFromBytes((calculateHash(dataToHash)))); - } - - - private byte[] calculateHash(byte[] dataToHash) - { - md.update(dataToHash, 0, dataToHash.length); - return(md.digest()); - } - - - public String hexStringFromBytes(byte[] b) - { - String hex = ""; - int msb; - int lsb = 0; - int i; - - // MSB maps to idx 0 - for (i = 0; i < b.length; i++) - { - msb = ((int)b[i] & 0x000000FF) / 16; - lsb = ((int)b[i] & 0x000000FF) % 16; - // System.out.println("I: " + i + " B: " + b[i] + " MSB: " + - // msb + " LSB: " + lsb ); - hex = hex + hexChars[msb] + hexChars[lsb]; - } - return(hex); - } - - - - - - public String MD5Digest( String user, String passwd, String realm, - String method, String resource, String nonce ) - { - String tmp; - String A1, A2; - String auth_string = ""; - - try - { - tmp = user + ":" + realm + ":" + passwd; - md = MessageDigest.getInstance("MD5"); - A1 = hexStringFromBytes(md.digest(tmp.getBytes())); - - tmp = method + ":" + resource; - md = MessageDigest.getInstance("MD5"); - A2 = hexStringFromBytes(md.digest(tmp.getBytes())); - - tmp = A1 + ":" + nonce + ":" + A2; - md = MessageDigest.getInstance("MD5"); - auth_string = hexStringFromBytes(md.digest(tmp.getBytes())); - return(auth_string); - } - catch (NoSuchAlgorithmException e) - { - } - return(""); - - } - - -} diff --git a/scripting/java/src/com/easysw/cups/IPPRequest.java b/scripting/java/src/com/easysw/cups/IPPRequest.java deleted file mode 100644 index 04d24a2aa..000000000 --- a/scripting/java/src/com/easysw/cups/IPPRequest.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.easysw.cups; - -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - -/** - * An IPPRequest object is used to hold the - * status and id's of a request. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ -public class IPPRequest -{ - char[] version; // Proto version number - int request_id; // Unique ID - - int op_status; - short operation_id; - short status_code; - - /** - * Constructor - */ - public IPPRequest() - { - version = new char[2]; - } - - /** - * Constructor using request id and operation id. - * - * @param p_request_id ID of request. - * @param p_operation_id Operation ID for request. - * - * @see IPPDefs - */ - public IPPRequest( int p_request_id, short p_operation_id ) - { - version = new char[2]; - version[0] = (char)1; - version[1] = (char)1; - request_id = p_request_id; - operation_id = p_operation_id; - } - - /** - * Set the current status of a request. - * - * @param p_status_code Status code. - * @see IPPDefs - */ - public void setStatus( short p_status_code ) - { - status_code = p_status_code; - } - - /** - * Set the operation status of a request. - * - * @param p_status_code Operation status code. - * @see IPPDefs - */ - public void setOpStatus( short p_status_code ) - { - op_status = p_status_code; - } - -} // End of IPPRequest class - - - - diff --git a/scripting/java/src/com/easysw/cups/IPPStatus.java b/scripting/java/src/com/easysw/cups/IPPStatus.java deleted file mode 100644 index 6d2eaf998..000000000 --- a/scripting/java/src/com/easysw/cups/IPPStatus.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.easysw.cups; - -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - -/** - * Class to convert a status code to text. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ - -public class IPPStatus -{ - int status; - String status_text; - - /** - * Constructor, access the status_text member - * after creation. - * - * @param p_status Status code to convert. - * @see IPPDefs - */ - public IPPStatus( int p_status ) - { - status = p_status; - switch( status ) - { - case IPPDefs.OK: - status_text = "OK"; - break; - case IPPDefs.OK_SUBST: - status_text = "OK, substituted"; - break; - case IPPDefs.OK_CONFLICT: - status_text = "OK, conflict"; - break; - case IPPDefs.OK_IGNORED_SUBSCRIPTIONS: - status_text = "OK, ignored subscriptions"; - break; - case IPPDefs.OK_IGNORED_NOTIFICATIONS: - status_text = "OK, ignored notifications"; - break; - case IPPDefs.OK_TOO_MANY_EVENTS: - status_text = "OK, too many events"; - break; - case IPPDefs.OK_BUT_CANCEL_SUBSCRIPTION: - status_text = "OK, but cancel subscription"; - break; - case IPPDefs.REDIRECTION_OTHER_SITE: - status_text = "Redirected to other site"; - break; - case IPPDefs.BAD_REQUEST: - status_text = "Bad request"; - break; - case IPPDefs.FORBIDDEN: - status_text = "Forbidden"; - break; - case IPPDefs.NOT_AUTHENTICATED: - status_text = "Not authenticated"; - break; - case IPPDefs.NOT_AUTHORIZED: - status_text = "Not authorized"; - break; - case IPPDefs.NOT_POSSIBLE: - status_text = "Not possible"; - break; - case IPPDefs.TIMEOUT: - status_text = "Timeout"; - break; - case IPPDefs.NOT_FOUND: - status_text = "Not found"; - break; - case IPPDefs.GONE: - status_text = "Gone"; - break; - case IPPDefs.REQUEST_ENTITY: - status_text = "Request entity"; - break; - case IPPDefs.REQUEST_VALUE: - status_text = "Request value"; - break; - case IPPDefs.DOCUMENT_FORMAT: - status_text = "Document format"; - break; - case IPPDefs.ATTRIBUTES: - status_text = "Attributes"; - break; - case IPPDefs.URI_SCHEME: - status_text = "URI scheme"; - break; - case IPPDefs.CHARSET: - status_text = "Charset"; - break; - case IPPDefs.CONFLICT: - status_text = "Conflict"; - break; - case IPPDefs.COMPRESSION_NOT_SUPPORTED: - status_text = "Compression not supported"; - break; - case IPPDefs.COMPRESSION_ERROR: - status_text = "Compression error"; - break; - case IPPDefs.DOCUMENT_FORMAT_ERROR: - status_text = "Document format error"; - break; - case IPPDefs.DOCUMENT_ACCESS_ERROR: - status_text = "Document access error"; - break; - case IPPDefs.ATTRIBUTES_NOT_SETTABLE: - status_text = "Attributes not settable"; - break; - case IPPDefs.IGNORED_ALL_SUBSCRIPTIONS: - status_text = "Ignored all subscriptions"; - break; - case IPPDefs.TOO_MANY_SUBSCRIPTIONS: - status_text = "Too many subscriptions"; - break; - case IPPDefs.IGNORED_ALL_NOTIFICATIONS: - status_text = "Ingored all notifications"; - break; - case IPPDefs.PRINT_SUPPORT_FILE_NOT_FOUND: - status_text = "Support file not found"; - break; - case IPPDefs.INTERNAL_ERROR: - status_text = "Internal error"; - break; - case IPPDefs.OPERATION_NOT_SUPPORTED: - status_text = "Operation not supported"; - break; - case IPPDefs.SERVICE_UNAVAILABLE: - status_text = "Service unavailable"; - break; - case IPPDefs.VERSION_NOT_SUPPORTED: - status_text = "Version not supported"; - break; - case IPPDefs.DEVICE_ERROR: - status_text = "Device error"; - break; - case IPPDefs.TEMPORARY_ERROR: - status_text = "Temporary error"; - break; - case IPPDefs.NOT_ACCEPTING: - status_text = "Not accepting"; - break; - case IPPDefs.PRINTER_BUSY: - status_text = "Printer busy"; - break; - case IPPDefs.ERROR_JOB_CANCELLED: - status_text = "Error, job cancelled"; - break; - case IPPDefs.MULTIPLE_JOBS_NOT_SUPPORTED: - status_text = "Multiple jobs not supported"; - break; - case IPPDefs.PRINTER_IS_DEACTIVATED: - status_text = "Printer is de-activated"; - break; - default: - status_text = "Unknown error"; - } - } - - - - - -} // End of IPPStatus class - - - diff --git a/scripting/java/src/com/easysw/cups/IPPURLConnection.java b/scripting/java/src/com/easysw/cups/IPPURLConnection.java deleted file mode 100644 index 505c50550..000000000 --- a/scripting/java/src/com/easysw/cups/IPPURLConnection.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.easysw.cups; - -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - -/** - * Implementation of the URLConnection interface. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ - -import java.util.*; -import java.io.*; -import java.net.*; - -public class IPPURLConnection extends URLConnection -{ - - /** - * Constructor. - */ - public IPPURLConnection( URL url ) - { - super(url); - } - - /** - * Determine if using proxy. - * - * @return boolean Always false for now. - */ - public boolean usingProxy() - { - return(false); - } - - /** - * Not used. - */ - public void connect() - { - return; - } - - /** - * Not used. - */ - public void disconnect() - { - return; - } - -} // end of class diff --git a/scripting/java/src/com/easysw/cups/IPPValue.java b/scripting/java/src/com/easysw/cups/IPPValue.java deleted file mode 100644 index 3c8ad684a..000000000 --- a/scripting/java/src/com/easysw/cups/IPPValue.java +++ /dev/null @@ -1,255 +0,0 @@ -package com.easysw.cups; - -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - -/** - * An IPPValue object is used to hold the - * different kinds of values in a generic object. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ -import java.util.*; - -public class IPPValue -{ - - int value_type; // Type of value for this object. - - int integer_value; // Integer value - boolean boolean_value; // Boolean value - - - char date_value[]; // Date/time value - long unix_time; // Unix time .... - - // - // Resolution Type - // - int xres; - int yres; - byte units; - - // - // Range Type - // - int lower; - int upper; - - // - // String Type - // - String charset; - String text; - - // - // Unknown Type - // - int length; - char data[]; - - - /** - * Byte constructor. - * - * @param p_byte Byte value. - */ - public IPPValue( byte p_byte ) - { - value_type = IPPDefs.TAG_INTEGER; - integer_value = (int)p_byte; - } - - /** - * Short constructor. - * - * @param p_short Short value. - */ - public IPPValue( short p_short ) - { - value_type = IPPDefs.TAG_INTEGER; - integer_value = (int)p_short; - } - - /** - * Integer constructor. - * - * @param p_int Integer value. - */ - public IPPValue( int p_int ) - { - value_type = IPPDefs.TAG_INTEGER; - integer_value = p_int; - } - - /** - * Enum constructor. - * - * @param p_int Integer value - force to IPP enum. - */ - public IPPValue( int p_int, boolean anything ) - { - value_type = IPPDefs.TAG_ENUM; - integer_value = p_int; - } - - /** - * Boolean constructor. - * - * @param p_boolean Boolean value. - */ - public IPPValue( boolean p_boolean ) - { - value_type = IPPDefs.TAG_BOOLEAN; - boolean_value = p_boolean; - } - - - /** - * Date constructor. Also set the unix_time member. - * - * @param p_date[] Character array with date value. - */ - public IPPValue( char p_date[] ) - { - value_type = IPPDefs.TAG_DATE; - date_value = p_date; - unix_time = IPPDateToTime(); - } - - - - /** - * String constructor. Set the string and - * charset values. - * - * @param p_charset Charset for string. - * @param p_text Text for string. - */ - public IPPValue( String p_charset, String p_text ) - { - value_type = IPPDefs.TAG_STRING; - charset = p_charset; - text = p_text; - } - - - /** - * Range constructor. Automatically swap as needed. - * - * @param p_lower Integer lower value. - * @param p_upper Integer upper value. - */ - public IPPValue( int p_lower, int p_upper ) - { - value_type = IPPDefs.TAG_RANGE; - if (p_lower < p_upper) - { - lower = p_lower; - upper = p_upper; - } - else - { - lower = p_upper; - upper = p_lower; - } - } - - - /** - * Resolution constructor. - * - * @param p_units Unit of measure. - * @param p_xres X resolution. - * @param p_yres Y resolution. - */ - public IPPValue( byte p_units, int p_xres, int p_yres ) - { - value_type = IPPDefs.TAG_RESOLUTION; - units = p_units; - xres = p_xres; - yres = p_yres; - } - - - /** - * Raw data constructor. - * - * @param p_length Size of array. - * @param p_data[] Data. - */ - public IPPValue( int p_length, char p_data[] ) - { - value_type = IPPDefs.TAG_UNKNOWN; - length = p_length; - data = p_data; - } - - - - /** - * Convert an IPP Date value to Unix Time. - * - * @return long Unix time in seconds. - * @see IPPCalender - */ - public long IPPDateToTime() - { - - // - // Compute the offset from GMT in milliseconds. - // - int raw_offset = (((int)date_value[9] * 3600) + ((int)date_value[10] * 60)) * 1000; - if (date_value[8] == '-') - raw_offset = 0 - raw_offset; - - // - // Get the timezone for that offset. - // - TimeZone tz = new SimpleTimeZone(raw_offset,"GMT"); - - // - // Create a subclassed gregorian calendar (sub classed so we have - // access to the getTimeInMillis() method). - // - IPPCalendar cl = new IPPCalendar(); - - int year = ((((int)date_value[0]) << 8) | (((int)date_value[1]) - 1900)); - int month = ((int)date_value[2]) - 1; - int day = (int)date_value[3]; - int hour = (int)date_value[4]; - int minute = (int)date_value[5]; - int second = (int)date_value[6]; - - // - // Now set the calendar to the matching time. - // - cl.setTimeZone( tz ); - cl.set( year, month, day, hour, minute, second ); - - // - // And finally get the unix time. - // - long the_time = cl.getTimeInMillis(); - the_time /= 1000; - - return(the_time); - } - -} // End of class diff --git a/scripting/java/src/com/easysw/cups/buildit b/scripting/java/src/com/easysw/cups/buildit deleted file mode 100755 index b6be69521..000000000 --- a/scripting/java/src/com/easysw/cups/buildit +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -rm -f cups.jar -for x in `cat class.list`; do - javac -classpath /usr/java/classes $x.java - cp -f $x.class classes/ - mv -f $x.class ../../../../classes/com/easysw/cups -done -jar cvf cups.jar ../../../../classes/com/easysw/cups -mv cups.jar ../../../.. diff --git a/scripting/java/src/com/easysw/cups/class.list b/scripting/java/src/com/easysw/cups/class.list deleted file mode 100644 index fec319bbf..000000000 --- a/scripting/java/src/com/easysw/cups/class.list +++ /dev/null @@ -1,14 +0,0 @@ -Base64Coder -IPPDefs -IPPError -IPPStatus -IPPCalendar -IPPValue -IPPAttribute -IPPRequest -IPPURLConnection -IPP -IPPHttp -CupsJob -Cups -CupsPrinter diff --git a/scripting/java/src/com/easysw/cups/cups.nfo b/scripting/java/src/com/easysw/cups/cups.nfo deleted file mode 100644 index 5cf42204c..000000000 --- a/scripting/java/src/com/easysw/cups/cups.nfo +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @version 1.00 06-NOV-2002 - * @author Apple Inc. - * - * Internet Printing Protocol definitions for the Common UNIX Printing - * System (CUPS). - * - * Copyright 2007 by Apple Inc. - * Copyright 1997-2002 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/". - */ - -/** - * An IPP object is used to hold the various - * attributes and status of an ipp request.. - * - * @author TDB - * @version 1.0 - * @since JDK1.3 - */ diff --git a/systemv/Makefile b/systemv/Makefile index 285e7a6ae..f73d80fcd 100644 --- a/systemv/Makefile +++ b/systemv/Makefile @@ -3,7 +3,7 @@ # # System V commands makefile for the Common UNIX Printing System (CUPS). # -# Copyright 2007 by Apple Inc. +# Copyright 2007-2008 by Apple Inc. # Copyright 1997-2006 by Easy Software Products, all rights reserved. # # These coded instructions, statements, and computer programs are the @@ -70,7 +70,7 @@ install: all $(INSTALL_BIN) lp $(BINDIR) $(INSTALL_BIN) lpoptions $(BINDIR) $(INSTALL_BIN) lpstat $(BINDIR) - $(INSTALL_BIN) -m 4755 -o root lppasswd $(BINDIR) || $(INSTALL_BIN) lppasswd $(BINDIR) + $(INSTALL_BIN) lppasswd $(BINDIR) if test "x$(SYMROOT)" != "x"; then \ $(INSTALL_DIR) $(SYMROOT); \ for file in $(TARGETS); do \ diff --git a/templates/Makefile b/templates/Makefile index 2036534be..f123241ea 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -125,7 +125,7 @@ install-languages: if test -d $$lang; then \ $(INSTALL_DIR) -m 755 $(DATADIR)/templates/$$lang; \ for file in $(FILES); do \ - $(INSTALL_DATA) $$lang/$$file $(DATADIR)/templates/$$lang || true; \ + $(INSTALL_DATA) $$lang/$$file $(DATADIR)/templates/$$lang 2>/dev/null || true; \ done \ fi \ done -- 2.39.2