Putin Evgeny : wineps.drv: Add orientation field to postscript header.

Alexandre Julliard julliard at winehq.org
Wed Nov 28 14:14:06 CST 2012


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

Author: Putin Evgeny <evcalipt at etersoft.ru>
Date:   Tue Nov 13 14:07:34 2012 +0400

wineps.drv: Add orientation field to postscript header.

---

 dlls/wineps.drv/ps.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/wineps.drv/ps.c b/dlls/wineps.drv/ps.c
index 35a55f0..2f482d4 100644
--- a/dlls/wineps.drv/ps.c
+++ b/dlls/wineps.drv/ps.c
@@ -49,11 +49,12 @@ static const char *cups_duplexes[3] =
     cups_two_sided_short    /* DMDUP_HORIZONTAL */
 };
 
-static const char psheader[] = /* title llx lly urx ury */
+static const char psheader[] = /* title llx lly urx ury orientation */
 "%%%%Creator: Wine PostScript Driver\n"
 "%%%%Title: %s\n"
 "%%%%BoundingBox: %d %d %d %d\n"
 "%%%%Pages: (atend)\n"
+"%%%%Orientation: %s\n"
 "%%%%EndComments\n";
 
 static const char psbeginprolog[] =
@@ -366,6 +367,8 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title )
     DUPLEX *duplex = find_duplex( physDev->pi->ppd, physDev->Devmode );
     int llx, lly, urx, ury;
     int ret, len;
+    const char * dmOrientation;
+
     struct ticket_info ticket_info = { page, duplex };
 
     TRACE("%s\n", debugstr_w(title));
@@ -397,7 +400,8 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title )
     ury = physDev->ImageableArea.top * 72.0 / physDev->logPixelsY;
     /* FIXME should do something better with BBox */
 
-    sprintf(buf, psheader, escaped_title, llx, lly, urx, ury);
+    dmOrientation = (physDev->Devmode->dmPublic.u1.s1.dmOrientation == DMORIENT_LANDSCAPE ? "Landscape" : "Portrait");
+    sprintf(buf, psheader, escaped_title, llx, lly, urx, ury, dmOrientation);
 
     HeapFree(GetProcessHeap(), 0, escaped_title);
 




More information about the wine-cvs mailing list