Huw Davies : wineps: Pass the collate setting as a CUPS option.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Oct 21 10:39:58 CDT 2015


Module: wine
Branch: master
Commit: 3f276c9be2a98cef198565f92b66163ef3ce2f11
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3f276c9be2a98cef198565f92b66163ef3ce2f11

Author: Huw Davies <huw at codeweavers.com>
Date:   Wed Oct 21 09:17:50 2015 +0100

wineps: Pass the collate setting as a CUPS option.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wineps.drv/ps.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dlls/wineps.drv/ps.c b/dlls/wineps.drv/ps.c
index a19dda3..a01346e 100644
--- a/dlls/wineps.drv/ps.c
+++ b/dlls/wineps.drv/ps.c
@@ -48,6 +48,8 @@ static const char *cups_duplexes[3] =
     cups_two_sided_long,    /* DMDUP_VERTICAL */
     cups_two_sided_short    /* DMDUP_HORIZONTAL */
 };
+static const char cups_collate_false[] = "%cupsJobTicket: collate=false\n";
+static const char cups_collate_true[] = "%cupsJobTicket: collate=true\n";
 
 static const char psheader[] = /* title llx lly urx ury orientation */
 "%%%%Creator: Wine PostScript Driver\n"
@@ -364,6 +366,14 @@ static void write_cups_job_ticket( PHYSDEV dev, const struct ticket_info *info )
                         physDev->Devmode->dmPublic.u1.s1.dmCopies );
         if (len > 0 && len < sizeof(buf))
             write_spool( dev, buf, len );
+
+        if (physDev->Devmode->dmPublic.dmFields & DM_COLLATE)
+        {
+            if (physDev->Devmode->dmPublic.dmCollate == DMCOLLATE_FALSE)
+                write_spool( dev, cups_collate_false, sizeof(cups_collate_false) - 1 );
+            else if (physDev->Devmode->dmPublic.dmCollate == DMCOLLATE_TRUE)
+                write_spool( dev, cups_collate_true, sizeof(cups_collate_true) - 1 );
+        }
     }
 }
 




More information about the wine-cvs mailing list