Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

204 lines
7.2 KiB

  1. /\*% Error/ { next }
  2. /ModelName/ { print "*CodePage: 1252" }
  3. /\=FLIP_ON_/ {
  4. print
  5. print " *Command: CmdSelect"
  6. print " {"
  7. print " *Order: DOC_SETUP.7"
  8. if ($0 ~ /LONG_EDGE/)
  9. print " *Cmd: \"<1B7E3B000400000101>\""
  10. else
  11. print " *Cmd: \"<1B7E3B000400000201>\""
  12. print " }"
  13. next
  14. }
  15. /rcNameID/ || /OptionID/ {
  16. if ($2 !~ /^[0-9]/) { print; next }
  17. if ($2 == "258") $2="358" # 11x13.6
  18. else if ($2 == "259") $2="359" # A5->B5
  19. else if ($2 == "260") $2="360" # A5->A4
  20. else if ($2 == "261") $2="369" # B5->B4
  21. else if ($2 == "262") $2="367" # A4->B4
  22. else if ($2 == "263") $2="368" # A4->A3
  23. else if ($2 == "264") $2="361" # B4->B5
  24. else if ($2 == "265") $2="362" # B4->A4
  25. else if ($2 == "266") $2="363" # A3->A4
  26. else if ($2 == "267") $2="364" # Fanfold->A4
  27. else if ($2 == "268") $2="365" # Fanfold->B4
  28. else if ($2 == "269") $2="374" # A4 2Face(line)
  29. else if ($2 == "270") $2="375" # A4 2Face(dotted line)
  30. else if ($2 == "271") $2="376" # A4 2Face(no line)
  31. else if ($2 == "272") $2="377" # B5 2Face(line)
  32. else if ($2 == "273") $2="378" # B5 2Face(dotted line)
  33. else if ($2 == "274") $2="379" # B5 2Face(no line)
  34. else if ($2 == "275") $2="300" # Tray1
  35. else if ($2 == "276") $2="301" # Tray2
  36. else if ($2 == "277") $2="302" # Tray3
  37. else if ($2 == "278") $2="303" # SubTray
  38. else if ($2 == "279") $2="318" # Main
  39. else if ($2 == "280") $2="372" # Main (offset stack)
  40. else if ($2 == "281") $2="319" # Main (reduce white)
  41. else if ($2 == "282") $2="373" # Main (offset stack + reduce white)
  42. else if ($2 == "283") $2="304" # Standard
  43. else if ($2 == "284") $2="305" # Multi-up 2
  44. else if ($2 == "285") $2="306" # Multi-up 4
  45. else if ($2 == "286") $2="307" # Multi-up 6
  46. else if ($2 == "287") $2="308" # Multi-up 8
  47. else if ($2 == "288") $2="309" # Multi-up 9
  48. else if ($2 == "289") $2="310" # Multi-up 16
  49. else if ($2 == "290") $2="311" # Reduce 80%
  50. else if ($2 == "291") $2="312" # Reduce 75%
  51. else if ($2 == "292") $2="313" # Reduce 66.7%
  52. else if ($2 == "293") $2="314" # Reduce Fanfold->B4
  53. else if ($2 == "294") $2="315" # Reduce Fanfold->A4
  54. else if ($2 == "295") $2="316" # Expand 120%
  55. else if ($2 == "296") $2="317" # Expand 141%
  56. else $2="???";
  57. print " " $1 " " $2
  58. next
  59. }
  60. /PAGE_SETUP.1$/ { $2="DOC_SETUP.10"; print " *Order: " $2; next }
  61. /PAGE_SETUP.11$/ { $2="DOC_SETUP.11"; print " *Order: " $2; next }
  62. /CmdSendBlockData/ {
  63. print " *Command: CmdSendBlockData"
  64. print " {"
  65. print " " $4 " " $5
  66. print " *Params: LIST(RasterDataHeightInPixels, RasterDataWidthInBytes)"
  67. print " }"
  68. next
  69. }
  70. /{NumOfCopies}/ { gsub(/{NumOfCopies}/, "[1,999]{NumOfCopies}"); print; next }
  71. /Cmd.Move/ {
  72. print $1 " " $2
  73. print "{"
  74. print " " $4 " " $5
  75. if ($0 ~ /CmdXMoveAbs/)
  76. print " *Params: LIST(DestX)"
  77. else if ($0 ~ /CmdXMoveRel/)
  78. print " *Params: LIST(DestXRel)"
  79. else if ($0 ~ /CmdYMoveAbs/)
  80. print " *Params: LIST(DestY)"
  81. else if ($0 ~ /CmdYMoveRel/)
  82. print " *Params: LIST(DestYRel)"
  83. print "}"
  84. next
  85. }
  86. /Feature.*PaperSize/ { inps++; bcps=bc }
  87. /Command.*CmdSelect/ { if (inps) { incs++; next } }
  88. /Option:/ { Option=$2 }
  89. /[ ]*{$/ { bc++ }
  90. /[ ]*}$/ {
  91. bc--
  92. if (inps && bcps==bc) {
  93. inps=0
  94. print
  95. print "*InvalidCombination: LIST(InputBin.Option1, PaperSize.CUSTOMSIZE)"
  96. print "*InvalidCombination: LIST(InputBin.Option2, PaperSize.CUSTOMSIZE)"
  97. print "*InvalidCombination: LIST(InputBin.Option3, PaperSize.CUSTOMSIZE)"
  98. next
  99. }
  100. else if (incs) {
  101. print " *switch: Orientation"
  102. print " {"
  103. PutPSCmd("PORTRAIT", Option)
  104. PutPSCmd("LANDSCAPE_CC270", Option)
  105. print " }"
  106. incs=0
  107. next
  108. }
  109. }
  110. { if (!incs) print }
  111. function PutPSCmd(orientation, option) {
  112. print " *case: " orientation
  113. print " {"
  114. print " *Command: CmdSelect"
  115. print " {"
  116. print " *Order: DOC_SETUP.9"
  117. print " *Cmd: " GetPSCmd(orientation, option)
  118. print " }"
  119. print " }"
  120. }
  121. function GetPSCmd(orientation, option,
  122. E2F,PW,PH, E3B,LT, E51,N, E52,EL,EW,EH, E38,EX,W,H,T)
  123. {
  124. E51=""
  125. LT=""
  126. N=""
  127. EL="<0006>"
  128. EW=""
  129. EH=""
  130. EX="<00E2>"
  131. if (option == "A5") { W="<1F01>"; H="<2CBB>" }
  132. else if (option == "A5_TRANSVERSE") { W="<2CBB>"; H="<1F01>" }
  133. else if (option == "B5") { W="<2688>"; H="<3724>" }
  134. else if (option == "B5_TRANSVERSE") { W="<3724>"; H="<2688>" }
  135. else if (option == "A4") { W="<2CBB>"; H="<4000>" }
  136. else if (option == "A4_TRANSVERSE") { W="<4000>"; H="<2CBB>" }
  137. else if (option == "B4") { W="<3724>"; H="<4ED6>" }
  138. else if (option == "A3") { W="<4000>"; H="<5B3D>" }
  139. else if (option == "EXECUTIVE") { W="<26FF>"; H="<394A>" }
  140. else if (option == "LETTER") { W="<2E0A>"; H="<3C1A>" }
  141. else if (option == "LEGAL") { W="<2E0A>"; H="<4CFA>" }
  142. else if (option == "11X17") { W="<3C1A>"; H="<5DDA>" }
  143. else if (option == "ENV_10") { W="<156E>"; H="<33AA>" }
  144. else if (option == "ENV_C5") { W="<221A>"; H="<30F1>" }
  145. else if (option == "ENV_DL") { W="<1696>"; H="<2EF2>" }
  146. else if (option == "ENV_MONARCH") { W="<1406>"; H="<286A>" }
  147. else if (option == "JAPANESE_POSTCARD") { W="<145F>"; H="<1F01>" }
  148. else if (option == "Option18") { N="<03>"; W="<3C1A>"; H="<4AB8>" }
  149. else if (option == "Option19") { N="<07>"; W="<1F01>"; H="<2CBB>" }
  150. else if (option == "Option20") { N="<08>"; W="<1F01>"; H="<2CBB>" }
  151. else if (option == "Option21") {
  152. N="<08>";
  153. EL="<000E>"
  154. EW="<0000>&<88>"
  155. EH="<0000>7$"
  156. EX="<00E4>"; W="<268C>"; H="<3724>"
  157. }
  158. else if (option == "Option22") {
  159. N="<07>";
  160. EL="<000E>"
  161. EW="<0000>,<BB>"
  162. EH="<0000>@<00>"
  163. EX="<00E4>"; W=",<BC>"; H="?<F9>"
  164. }
  165. else if (option == "Option23") {
  166. N="<08>";
  167. EL="<000E>"
  168. EW="<0000>,<BB>"
  169. EH="<0000>@<00>"
  170. EX="<00E4>"; W=",<BC>"; H="?<F9>"
  171. }
  172. else if (option == "Option24") { N="<06>"; W="<3724>"; H="<4ED6>" }
  173. else if (option == "Option25") { N="<05>"; W="<3724>"; H="<4ED6>" }
  174. else if (option == "Option26") { N="<06>"; W="<4000>"; H="<5B3D>" }
  175. else if (option == "Option27") { N="<03>"; W="<3C1A>"; H="<4AB8>" }
  176. else if (option == "Option28") { N="<02>"; W="<3C1A>"; H="<4AB8>" }
  177. else if (option == "Option29") { LT="<00>"; W="<2CBB>"; H="<4000>" }
  178. else if (option == "Option30") { LT="<01>"; W="<2CBB>"; H="<4000>" }
  179. else if (option == "Option31") { LT="<08>"; W="<2CBB>"; H="<4000>" }
  180. else if (option == "Option32") { LT="<00>"; W="<2688>"; H="<3724>" }
  181. else if (option == "Option33") { LT="<01>"; W="<2688>"; H="<3724>" }
  182. else if (option == "Option34") { LT="<08>"; W="<2688>"; H="<3724>" }
  183. else if (option == "CUSTOMSIZE") {
  184. PW="\n+ %m[4976,32767]{PhysPaperWidth*1440/600}"
  185. PH="\n+ %m[8390,32767]{PhysPaperLength*1440/600}"
  186. E2F="\"<1B>~/<000700>8@\"" PW PH
  187. E52="\"<1B>~R" EL "<0000>8@8@\""
  188. E38="\"<1B>~8<0009>" EX EX "\"" PW PH "\"<02>\""
  189. return E2F "\n+ " E52 "\n+ " E38
  190. }
  191. else { W="????"; H="????" }
  192. if (orientation != "PORTRAIT") {
  193. T=W; W=H; H=T
  194. T=EW; EW=EH; EH=T
  195. }
  196. if (N) E51="<1B>~Q<0001>" N
  197. if (LT) E3B="<1B>~;<001D0000FD0201>" LT "<0000FF0000000000000000000000000000000000000000>\"\n+ \""
  198. E52="<1B>~R" EL "<0000>8@8@" EW EH
  199. E38="<1B>~8<0009>" EX EX W H "<02>"
  200. return "\"" E3B E51 E52 E38 "\""
  201. }