Rebase against 7907ccfdcb39b30dc49c96c411332534525b6ea9

This commit is contained in:
Alistair Leslie-Hughes
2019-02-14 11:08:02 +11:00
parent b8de62375f
commit 32bac8b64c
17 changed files with 68 additions and 1444 deletions

View File

@@ -1,118 +0,0 @@
From c9912e16ab7c0c5add52913cdc38e98dc81f8690 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 13 Apr 2016 15:48:10 +0800
Subject: wineps.drv: Add stubs for escapes required by Adobe PageMaker.
---
dlls/gdi32/tests/dc.c | 7 -------
dlls/wineps.drv/escape.c | 41 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 7 deletions(-)
diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c
index 4a50594..939f33e 100644
--- a/dlls/gdi32/tests/dc.c
+++ b/dlls/gdi32/tests/dc.c
@@ -1413,9 +1413,7 @@ static void print_something(HDC hdc)
strcpy(buf, "deadbeef");
ret = ExtEscape(hdc, DOWNLOADHEADER, 0, NULL, sizeof(buf), buf );
-todo_wine
ok(ret == 1, "DOWNLOADHEADER failed\n");
-todo_wine
ok(strcmp(buf, "deadbeef") != 0, "DOWNLOADHEADER failed\n");
strcpy(buf + 2, "\n% ===> after DOWNLOADHEADER <===\n");
@@ -1475,22 +1473,18 @@ static void test_pscript_printer_dc(void)
query = DOWNLOADFACE;
ret = Escape(hdc, QUERYESCSUPPORT, sizeof(query), (LPCSTR)&query, NULL);
-todo_wine
ok(ret == 1, "DOWNLOADFACE is not supported\n");
query = OPENCHANNEL;
ret = Escape(hdc, QUERYESCSUPPORT, sizeof(query), (LPCSTR)&query, NULL);
-todo_wine
ok(ret == 1, "OPENCHANNEL is not supported\n");
query = DOWNLOADHEADER;
ret = Escape(hdc, QUERYESCSUPPORT, sizeof(query), (LPCSTR)&query, NULL);
-todo_wine
ok(ret == 1, "DOWNLOADHEADER is not supported\n");
query = CLOSECHANNEL;
ret = Escape(hdc, QUERYESCSUPPORT, sizeof(query), (LPCSTR)&query, NULL);
-todo_wine
ok(ret == 1, "CLOSECHANNEL is not supported\n");
query = POSTSCRIPT_PASSTHROUGH;
@@ -1498,7 +1492,6 @@ todo_wine
ok(ret == 1, "POSTSCRIPT_PASSTHROUGH is not supported\n");
ret = ExtEscape(hdc, GETFACENAME, 0, NULL, sizeof(buf), buf);
-todo_wine
ok(ret == 1, "GETFACENAME failed\n");
trace("face name: %s\n", buf);
diff --git a/dlls/wineps.drv/escape.c b/dlls/wineps.drv/escape.c
index 6e89837..2f3ddfc 100644
--- a/dlls/wineps.drv/escape.c
+++ b/dlls/wineps.drv/escape.c
@@ -100,14 +100,55 @@ INT PSDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data,
case CLIP_TO_PATH:
case END_PATH:
/*case DRAWPATTERNRECT:*/
+
+ /* PageMaker checks for it */
+ case DOWNLOADHEADER:
+
+ /* PageMaker doesn't check for DOWNLOADFACE and GETFACENAME but
+ * uses them, they are supposed to be supported by any PS printer.
+ */
+ case DOWNLOADFACE:
+
+ /* PageMaker checks for these as a part of process of detecting
+ * a "fully compatible" PS printer, but doesn't actually use them.
+ */
+ case OPENCHANNEL:
+ case CLOSECHANNEL:
return TRUE;
+ /* Windows PS driver reports 0, but still supports this escape */
+ case GETFACENAME:
+ return FALSE; /* suppress the FIXME below */
+
default:
FIXME("QUERYESCSUPPORT(%d) - not supported.\n", num);
return FALSE;
}
}
+ case OPENCHANNEL:
+ FIXME("OPENCHANNEL: stub\n");
+ return 1;
+
+ case CLOSECHANNEL:
+ FIXME("CLOSECHANNEL: stub\n");
+ return 1;
+
+ case DOWNLOADHEADER:
+ FIXME("DOWNLOADHEADER: stub\n");
+ /* should return name of the downloaded procset */
+ *(char *)out_data = 0;
+ return 1;
+
+ case GETFACENAME:
+ FIXME("GETFACENAME: stub\n");
+ lstrcpynA(out_data, "Courier", cbOutput);
+ return 1;
+
+ case DOWNLOADFACE:
+ FIXME("DOWNLOADFACE: stub\n");
+ return 1;
+
case MFCOMMENT:
{
FIXME("MFCOMMENT(%p, %d)\n", in_data, cbInput);
--
2.7.1

View File

@@ -1,84 +0,0 @@
From f723db2c924b592d8c6e073a2d1b566a035fde92 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Wed, 13 Apr 2016 15:58:36 +0800
Subject: wineps.drv: PostScript header should be written by StartDoc instead
of StartPage.
Otherwise a being created file has wrong signature if an application
directly injects PostScript code. This patch fixes printing from
Adobe PageMaker.
---
dlls/gdi32/tests/dc.c | 1 -
dlls/wineps.drv/escape.c | 18 ++++++++++++++----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c
index 939f33e..bab99e3 100644
--- a/dlls/gdi32/tests/dc.c
+++ b/dlls/gdi32/tests/dc.c
@@ -1444,7 +1444,6 @@ static void print_something(HDC hdc)
while (*p == '\r' || *p == '\n') p++;
}
-todo_wine
ok(p && !memcmp(p, psadobe, sizeof(psadobe)), "wrong signature: %.14s\n", p ? p : buf);
DeleteFileA(file_name);
diff --git a/dlls/wineps.drv/escape.c b/dlls/wineps.drv/escape.c
index 86a94fd..9cf0277 100644
--- a/dlls/wineps.drv/escape.c
+++ b/dlls/wineps.drv/escape.c
@@ -431,15 +431,14 @@ INT PSDRV_StartPage( PHYSDEV dev )
{
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
+ TRACE("%p\n", dev->hdc);
+
if(!physDev->job.OutOfPage) {
FIXME("Already started a page?\n");
return 1;
}
- if(physDev->job.PageNo++ == 0) {
- if(!PSDRV_WriteHeader( dev, physDev->job.doc_name ))
- return 0;
- }
+ physDev->job.PageNo++;
if(!PSDRV_WriteNewPage( dev ))
return 0;
@@ -455,6 +454,8 @@ INT PSDRV_EndPage( PHYSDEV dev )
{
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
+ TRACE("%p\n", dev->hdc);
+
if(physDev->job.OutOfPage) {
FIXME("Already ended a page?\n");
return 1;
@@ -515,6 +516,13 @@ INT PSDRV_StartDoc( PHYSDEV dev, const DOCINFOW *doc )
ClosePrinter(physDev->job.hprinter);
return 0;
}
+
+ if (!PSDRV_WriteHeader( dev, doc->lpszDocName )) {
+ WARN("Failed to write header\n");
+ ClosePrinter(physDev->job.hprinter);
+ return 0;
+ }
+
physDev->job.banding = FALSE;
physDev->job.OutOfPage = TRUE;
physDev->job.PageNo = 0;
@@ -534,6 +542,8 @@ INT PSDRV_EndDoc( PHYSDEV dev )
PSDRV_PDEVICE *physDev = get_psdrv_dev( dev );
INT ret = 1;
+ TRACE("%p\n", dev->hdc);
+
if(!physDev->job.id) {
FIXME("hJob == 0. Now what?\n");
return 0;
--
2.7.1