| Line No. | Rev | Author | Line |
|---|---|---|---|
| 1 | 32 | kaklik | /****************************************************************************** |
| 2 | PostScript Printer Language Support |
||
| 3 | |||
| 4 | Summary: |
||
| 5 | This file provides support for the PostScript printer language when using the |
||
| 6 | USB Embedded Host Printer Client Driver. |
||
| 7 | |||
| 8 | Description: |
||
| 9 | This file provides support for the PostScript printer language when using the |
||
| 10 | USB Embedded Host Printer Client Driver. |
||
| 11 | |||
| 12 | In general, PostScript is recommended for use with the USB Embedded Host |
||
| 13 | printer class when printing to a full sheet printer. Implementation of the |
||
| 14 | PostScript language across various printers is standard, ensuring uniform |
||
| 15 | output from printers produced by different manufacturers. |
||
| 16 | |||
| 17 | Notes: |
||
| 18 | The PostScript coordinate origin is located at the bottom left corner of the |
||
| 19 | paper. For consistency for the user, the coordinates are adjusted so the |
||
| 20 | origin is located at the top left corner. This matches the coordinate |
||
| 21 | system use by the Microchip Graphics library. |
||
| 22 | |||
| 23 | *******************************************************************************/ |
||
| 24 | //DOM-IGNORE-BEGIN |
||
| 25 | /****************************************************************************** |
||
| 26 | |||
| 27 | * FileName: usb_host_printer_postscript.h |
||
| 28 | * Dependencies: None |
||
| 29 | * Processor: PIC24/dsPIC30/dsPIC33/PIC32MX |
||
| 30 | * Compiler: C30 v3.10b/C32 v1.02 |
||
| 31 | * Company: Microchip Technology, Inc. |
||
| 32 | |||
| 33 | Software License Agreement |
||
| 34 | |||
| 35 | The software supplied herewith by Microchip Technology Incorporated |
||
| 36 | (the Company) for its PICmicro® Microcontroller is intended and |
||
| 37 | supplied to you, the Companys customer, for use solely and |
||
| 38 | exclusively on Microchip PICmicro Microcontroller products. The |
||
| 39 | software is owned by the Company and/or its supplier, and is |
||
| 40 | protected under applicable copyright laws. All rights are reserved. |
||
| 41 | Any use in violation of the foregoing restrictions may subject the |
||
| 42 | user to criminal sanctions under applicable laws, as well as to |
||
| 43 | civil liability for the breach of the terms and conditions of this |
||
| 44 | license. |
||
| 45 | |||
| 46 | THIS SOFTWARE IS PROVIDED IN AN AS IS CONDITION. NO WARRANTIES, |
||
| 47 | WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED |
||
| 48 | TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
||
| 49 | PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, |
||
| 50 | IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR |
||
| 51 | CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. |
||
| 52 | |||
| 53 | Change History: |
||
| 54 | Rev Description |
||
| 55 | ----- ----------------------------------------- |
||
| 56 | 2.6a- No change |
||
| 57 | 2.7a |
||
| 58 | *******************************************************************************/ |
||
| 59 | //DOM-IGNORE-END |
||
| 60 | |||
| 61 | |||
| 62 | // ***************************************************************************** |
||
| 63 | // ***************************************************************************** |
||
| 64 | // Section: Constants |
||
| 65 | // ***************************************************************************** |
||
| 66 | // ***************************************************************************** |
||
| 67 | |||
| 68 | // This is the string that the printer language support determination |
||
| 69 | // routine will look for to determine if the printer supports this |
||
| 70 | // printer language. This string is case sensive. |
||
| 71 | #define LANGUAGE_ID_STRING_POSTSCRIPT "POSTSCRIPT" |
||
| 72 | // These are the support flags that are set for this language. |
||
| 73 | #define LANGUAGE_SUPPORT_FLAGS_POSTSCRIPT USB_PRINTER_FUNCTION_SUPPORT_VECTOR_GRAPHICS |
||
| 74 | |||
| 75 | |||
| 76 | // ***************************************************************************** |
||
| 77 | // ***************************************************************************** |
||
| 78 | // Section: Function Prototypes |
||
| 79 | // ***************************************************************************** |
||
| 80 | // ***************************************************************************** |
||
| 81 | |||
| 82 | /**************************************************************************** |
||
| 83 | Function: |
||
| 84 | BYTE USBHostPrinterLanguagePostScript( BYTE address, |
||
| 85 | USB_PRINTER_COMMAND command, USB_DATA_POINTER data, DWORD size, BYTE transferFlags ) |
||
| 86 | |||
| 87 | Summary: |
||
| 88 | This function executes printer commands for a PostScript printer. |
||
| 89 | |||
| 90 | Description: |
||
| 91 | This function executes printer commands for a PostScript printer. When |
||
| 92 | the application issues a printer command, the printer client driver |
||
| 93 | determines what language to use to communicate with the printer, and |
||
| 94 | transfers the command to that language support routine. As much as |
||
| 95 | possible, commands are designed to produce the same output regardless |
||
| 96 | of what printer language is used. |
||
| 97 | |||
| 98 | Not all printer commands support data from both RAM and ROM. Unless |
||
| 99 | otherwise noted, the data pointer is assumed to point to RAM, regardless of |
||
| 100 | the value of transferFlags. Refer to the specific command to see if ROM |
||
| 101 | data is supported. |
||
| 102 | |||
| 103 | Preconditions: |
||
| 104 | None |
||
| 105 | |||
| 106 | Parameters: |
||
| 107 | BYTE address - Device's address on the bus |
||
| 108 | USB_PRINTER_COMMAND command - Command to execute. See the enumeration |
||
| 109 | USB_PRINTER_COMMAND for the list of |
||
| 110 | valid commands and their requirements. |
||
| 111 | USB_DATA_POINTER data - Pointer to the required data. Note that |
||
| 112 | the caller must set transferFlags |
||
| 113 | appropriately to indicate if the pointer is |
||
| 114 | a RAM pointer or a ROM pointer. |
||
| 115 | DWORD size - Size of the data. For some commands, this |
||
| 116 | parameter is used to hold the data itself. |
||
| 117 | BYTE transferFlags - Flags that indicate details about the |
||
| 118 | transfer operation. Refer to these flags |
||
| 119 | * USB_PRINTER_TRANSFER_COPY_DATA |
||
| 120 | * USB_PRINTER_TRANSFER_STATIC_DATA |
||
| 121 | * USB_PRINTER_TRANSFER_NOTIFY |
||
| 122 | * USB_PRINTER_TRANSFER_FROM_ROM |
||
| 123 | * USB_PRINTER_TRANSFER_FROM_RAM |
||
| 124 | |||
| 125 | Return Values: |
||
| 126 | USB_PRINTER_SUCCESS - The command was executed successfully. |
||
| 127 | USB_PRINTER_UNKNOWN_DEVICE - A printer with the indicated address is not |
||
| 128 | attached |
||
| 129 | USB_PRINTER_TOO_MANY_DEVICES - The printer status array does not have |
||
| 130 | space for another printer. |
||
| 131 | USB_PRINTER_OUT_OF_MEMORY - Not enough available heap space to |
||
| 132 | execute the command. |
||
| 133 | other - See possible return codes from the |
||
| 134 | function USBHostPrinterWrite(). |
||
| 135 | |||
| 136 | Remarks: |
||
| 137 | When developing new commands, keep in mind that the function |
||
| 138 | USBHostPrinterCommandReady() will be used before calling this function to |
||
| 139 | see if there is space available in the output transfer queue. |
||
| 140 | USBHostPrinterCommandReady() will routine TRUE if a single space is |
||
| 141 | available in the output queue. Therefore, each command can generate only |
||
| 142 | one output transfer. |
||
| 143 | |||
| 144 | Multiple printer languages may be used in a single application. The USB |
||
| 145 | Embedded Host Printer Client Driver will call the routine required for the |
||
| 146 | attached device. |
||
| 147 | ***************************************************************************/ |
||
| 148 | |||
| 149 | BYTE USBHostPrinterLanguagePostScript( BYTE address, |
||
| 150 | USB_PRINTER_COMMAND command, USB_DATA_POINTER data, DWORD size, BYTE transferFlags ); |
||
| 151 | |||
| 152 | |||
| 153 | /**************************************************************************** |
||
| 154 | Function: |
||
| 155 | BOOL USBHostPrinterLanguagePostScriptIsSupported( char *deviceID, |
||
| 156 | USB_PRINTER_FUNCTION_SUPPORT *support ) |
||
| 157 | |||
| 158 | Description: |
||
| 159 | This function determines if the printer with the given device ID string |
||
| 160 | supports the PostScript printer language. |
||
| 161 | |||
| 162 | Preconditions: |
||
| 163 | None |
||
| 164 | |||
| 165 | Parameters: |
||
| 166 | char *deviceID - Pointer to the "COMMAND SET:" portion of the device ID |
||
| 167 | string of the attached printer. |
||
| 168 | USB_PRINTER_FUNCTION_SUPPORT *support - Pointer to returned information |
||
| 169 | about what types of functions this printer supports. |
||
| 170 | |||
| 171 | Return Values: |
||
| 172 | TRUE - The printer supports PostScript. |
||
| 173 | FALSE - The printer does not support PostScript. |
||
| 174 | |||
| 175 | Remarks: |
||
| 176 | The caller must first locate the "COMMAND SET:" section of the device ID |
||
| 177 | string. To ensure that only the "COMMAND SET:" section of the device ID |
||
| 178 | string is checked, the ";" at the end of the section should be temporarily |
||
| 179 | replaced with a NULL. Otherwise, this function may find the printer |
||
| 180 | language string in the comments or other section, and incorrectly indicate |
||
| 181 | that the printer supports the language. |
||
| 182 | |||
| 183 | Device ID strings are case sensitive. |
||
| 184 | ***************************************************************************/ |
||
| 185 | |||
| 186 | BOOL USBHostPrinterLanguagePostScriptIsSupported( char *deviceID, |
||
| 187 | USB_PRINTER_FUNCTION_SUPPORT *support ); |
||
| 188 |
Powered by WebSVN v2.8.3