SP 204: Add bypass tray support

The printer is annoying for this one.  Unless you actually print to the bypass
tray, it will ignore it, so this must be set in the printer options.  The tray
is also annoying to use in that it's a manual feed, accepting one sheet at a
time.

Anyway, add the option to specify the bypass tray in the PPD and filter.

Signed-off-by: James Bottomley <JBottomley@Parallels.com>
diff --git a/RICOH_Aficio_SP_204.ppd b/RICOH_Aficio_SP_204.ppd
index d4de0fe..1e19393 100644
--- a/RICOH_Aficio_SP_204.ppd
+++ b/RICOH_Aficio_SP_204.ppd
@@ -77,8 +77,9 @@
 *CloseUI: *MediaType
 *OpenUI *InputSlot/Media Source: PickOne
 *OrderDependency: 10 AnySetup *InputSlot
-*DefaultInputSlot: Auto
-*InputSlot Auto/Auto: "<</MediaPosition 0>>setpagedevice"
+*DefaultInputSlot: TRAY1
+*InputSlot MANUALFEED/Bypass Tray: "<</MediaPosition 0>>setpagedevice"
+*InputSlot TRAY1/Tray 1: "<</MediaPosition 1>>setpagedevice"
 *CloseUI: *InputSlot
 *OpenUI *Resolution/Resolution: PickOne
 *OrderDependency: 10 AnySetup *Resolution
diff --git a/pstoricohddst-gdi b/pstoricohddst-gdi
index 33f9156..f86f9b6 100755
--- a/pstoricohddst-gdi
+++ b/pstoricohddst-gdi
@@ -37,6 +37,7 @@
 
 pagesize="A4"
 resolution="600"
+mediasource="TRAY1"
 for opt in $options; do
 	case "$opt" in
 		PageSize=*)
@@ -45,6 +46,10 @@
 	    	Resolution=*)
 		resolution=${opt#Resolution=}
 		resolution=${resolution%dpi}
+		;;
+		InputSlot=*)
+		mediasource=${opt#InputSlot=}
+		;;
 	esac
 done
 
@@ -104,7 +109,7 @@
 		cat <<EOF
 @PJL SET PAGESTATUS=START$e
 @PJL SET COPIES=1$e
-@PJL SET MEDIASOURCE=AUTO$e
+@PJL SET MEDIASOURCE=$mediasource$e
 @PJL SET MEDIATYPE=PLAINRECYCLE$e
 @PJL SET PAPER=$pagesize$e
 @PJL SET PAPERWIDTH=$xs$e
@@ -169,7 +174,7 @@
 		cat <<EOF
 @PJL SET PAGESTATUS=START$e
 @PJL SET COPIES=1$e
-@PJL SET MEDIASOURCE=AUTO$e
+@PJL SET MEDIASOURCE=$mediasource$e
 @PJL SET MEDIATYPE=PLAINRECYCLE$e
 @PJL SET PAPER=$pagesize$e
 @PJL SET PAPERWIDTH=$xs$e