From 550e67b8a257b9d4fe60ef6c2e7ebc2bfca6cc56 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 10 Dec 2018 19:53:30 -0600 Subject: [PATCH] Rebase against 76bc23d8c6c1b2857cb7a4d14c5931094a12a82a. --- patches/patchinstall.sh | 9 +- ...a-simple-test-for-printing-to-a-Post.patch | 159 ------------------ ...full-contents-of-DOCINFO-in-StartDoc.patch | 28 --- 3 files changed, 2 insertions(+), 194 deletions(-) delete mode 100644 patches/wineps.drv-PostScript_Fixes/0001-gdi32-tests-Add-a-simple-test-for-printing-to-a-Post.patch delete mode 100644 patches/wineps.drv-PostScript_Fixes/0002-gdi32-Trace-full-contents-of-DOCINFO-in-StartDoc.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 303c017a..aff4e9ac 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "ae5e029d2227b3a8024f597591f76fe0f37d52e3" + echo "76bc23d8c6c1b2857cb7a4d14c5931094a12a82a" } # Show version information @@ -7193,18 +7193,13 @@ fi # | * [#4836] Various improvements for wineps.drv for Adobe PageMaker compatibility # | # | Modified files: -# | * dlls/gdi32/printdrv.c, dlls/gdi32/tests/dc.c, dlls/wineps.drv/download.c, dlls/wineps.drv/escape.c, -# | dlls/wineps.drv/psdrv.h +# | * dlls/gdi32/tests/dc.c, dlls/wineps.drv/download.c, dlls/wineps.drv/escape.c, dlls/wineps.drv/psdrv.h # | if test "$enable_wineps_drv_PostScript_Fixes" -eq 1; then - patch_apply wineps.drv-PostScript_Fixes/0001-gdi32-tests-Add-a-simple-test-for-printing-to-a-Post.patch - patch_apply wineps.drv-PostScript_Fixes/0002-gdi32-Trace-full-contents-of-DOCINFO-in-StartDoc.patch patch_apply wineps.drv-PostScript_Fixes/0003-wineps.drv-Add-stubs-for-escapes-required-by-Adobe-P.patch patch_apply wineps.drv-PostScript_Fixes/0004-wineps.drv-Add-support-for-GETFACENAME-and-DOWNLOADF.patch patch_apply wineps.drv-PostScript_Fixes/0005-wineps.drv-PostScript-header-should-be-written-by-St.patch ( - printf '%s\n' '+ { "Dmitry Timoshkov", "gdi32/tests: Add a simple test for printing to a PostScript device.", 1 },'; - printf '%s\n' '+ { "Dmitry Timoshkov", "gdi32: Trace full contents of DOCINFO in StartDoc.", 1 },'; printf '%s\n' '+ { "Dmitry Timoshkov", "wineps.drv: Add stubs for escapes required by Adobe PageMaker.", 1 },'; printf '%s\n' '+ { "Dmitry Timoshkov", "wineps.drv: Add support for GETFACENAME and DOWNLOADFACE escapes.", 1 },'; printf '%s\n' '+ { "Dmitry Timoshkov", "wineps.drv: PostScript header should be written by StartDoc instead of StartPage.", 1 },'; diff --git a/patches/wineps.drv-PostScript_Fixes/0001-gdi32-tests-Add-a-simple-test-for-printing-to-a-Post.patch b/patches/wineps.drv-PostScript_Fixes/0001-gdi32-tests-Add-a-simple-test-for-printing-to-a-Post.patch deleted file mode 100644 index 1402627f..00000000 --- a/patches/wineps.drv-PostScript_Fixes/0001-gdi32-tests-Add-a-simple-test-for-printing-to-a-Post.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 8b546221cfb857a09dae4654efee19c8b771935e Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Wed, 13 Apr 2016 15:34:42 +0800 -Subject: gdi32/tests: Add a simple test for printing to a PostScript device. - ---- - dlls/gdi32/tests/dc.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 123 insertions(+), 1 deletion(-) - -diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c -index c9b7b31..4a50594 100644 ---- a/dlls/gdi32/tests/dc.c -+++ b/dlls/gdi32/tests/dc.c -@@ -2,7 +2,7 @@ - * Unit tests for dc functions - * - * Copyright (c) 2005 Huw Davies -- * Copyright (c) 2005 Dmitry Timoshkov -+ * Copyright (c) 2005,2016 Dmitry Timoshkov - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -1386,6 +1386,127 @@ static void test_printer_dc(void) - DeleteObject( bmp ); - } - -+static void print_something(HDC hdc) -+{ -+ static const char psadobe[10] = "%!PS-Adobe"; -+ char buf[1024], *p; -+ char temp_path[MAX_PATH], file_name[MAX_PATH]; -+ DOCINFOA di; -+ DWORD ret; -+ HANDLE hfile; -+ -+ GetTempPathA(sizeof(temp_path), temp_path); -+ GetTempFileNameA(temp_path, "ps", 0, file_name); -+ -+ di.cbSize = sizeof(di); -+ di.lpszDocName = "Let's dance"; -+ di.lpszOutput = file_name; -+ di.lpszDatatype = NULL; -+ di.fwType = 0; -+ ret = StartDocA(hdc, &di); -+ ok(ret > 0, "StartDoc failed: %d\n", ret); -+ -+ strcpy(buf + 2, "\n% ===> before DOWNLOADHEADER <===\n"); -+ *(WORD *)buf = strlen(buf + 2); -+ ret = Escape(hdc, POSTSCRIPT_PASSTHROUGH, 0, buf, NULL); -+ ok(ret == *(WORD *)buf, "POSTSCRIPT_PASSTHROUGH failed: %d\n", ret); -+ -+ 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"); -+ *(WORD *)buf = strlen(buf + 2); -+ ret = Escape(hdc, POSTSCRIPT_PASSTHROUGH, 0, buf, NULL); -+ ok(ret == *(WORD *)buf, "POSTSCRIPT_PASSTHROUGH failed: %d\n", ret); -+ -+ ret = EndDoc(hdc); -+ ok(ret == 1, "EndDoc failed\n"); -+ -+ hfile = CreateFileA(file_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); -+ ok(hfile != INVALID_HANDLE_VALUE, "CreateFile failed\n"); -+ memset(buf, 0, sizeof(buf)); -+ ret = ReadFile(hfile, buf, sizeof(buf), &ret, NULL); -+ ok(ret, "ReadFile failed\n"); -+ CloseHandle(hfile); -+ -+ /* skip the HP PCL language selector */ -+ buf[sizeof(buf) - 1] = 0; -+ p = buf; -+ while (*p) -+ { -+ if (!(p[0] == 0x1b && p[1] == '%') && memcmp(p, "@PJL", 4) != 0) -+ break; -+ -+ p = strchr(p, '\n'); -+ if (!p) break; -+ -+ 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); -+} -+ -+static void test_pscript_printer_dc(void) -+{ -+ HDC hdc; -+ char buf[256]; -+ DWORD query, ret; -+ -+ hdc = create_printer_dc(100, FALSE); -+ -+ if (!hdc) return; -+ -+ if (!is_postscript_printer(hdc)) -+ { -+ skip("Default printer is not a PostScript device\n"); -+ DeleteDC( hdc ); -+ return; -+ } -+ -+ query = GETFACENAME; -+ ret = Escape(hdc, QUERYESCSUPPORT, sizeof(query), (LPCSTR)&query, NULL); -+ ok(!ret, "GETFACENAME is supported\n"); -+ -+ 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; -+ ret = Escape(hdc, QUERYESCSUPPORT, sizeof(query), (LPCSTR)&query, NULL); -+ 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); -+ -+ print_something(hdc); -+ -+ DeleteDC(hdc); -+} -+ - START_TEST(dc) - { - pSetLayout = (void *)GetProcAddress( GetModuleHandleA("gdi32.dll"), "SetLayout"); -@@ -1400,4 +1521,5 @@ START_TEST(dc) - test_desktop_colorres(); - test_gamma(); - test_printer_dc(); -+ test_pscript_printer_dc(); - } --- -2.7.1 - diff --git a/patches/wineps.drv-PostScript_Fixes/0002-gdi32-Trace-full-contents-of-DOCINFO-in-StartDoc.patch b/patches/wineps.drv-PostScript_Fixes/0002-gdi32-Trace-full-contents-of-DOCINFO-in-StartDoc.patch deleted file mode 100644 index d0691322..00000000 --- a/patches/wineps.drv-PostScript_Fixes/0002-gdi32-Trace-full-contents-of-DOCINFO-in-StartDoc.patch +++ /dev/null @@ -1,28 +0,0 @@ -From c0cf857381cd4af33ce454a96d9e48f896ed5027 Mon Sep 17 00:00:00 2001 -From: Dmitry Timoshkov -Date: Wed, 13 Apr 2016 15:36:56 +0800 -Subject: gdi32: Trace full contents of DOCINFO in StartDoc. - ---- - dlls/gdi32/printdrv.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/dlls/gdi32/printdrv.c b/dlls/gdi32/printdrv.c -index 3cfdc47..d2f4076 100644 ---- a/dlls/gdi32/printdrv.c -+++ b/dlls/gdi32/printdrv.c -@@ -72,9 +72,9 @@ INT WINAPI StartDocW(HDC hdc, const DOCINFOW* doc) - INT ret; - DC *dc = get_dc_ptr( hdc ); - -- TRACE("DocName = %s Output = %s Datatype = %s\n", -+ TRACE("DocName %s, Output %s, Datatype %s, fwType %#x\n", - debugstr_w(doc->lpszDocName), debugstr_w(doc->lpszOutput), -- debugstr_w(doc->lpszDatatype)); -+ debugstr_w(doc->lpszDatatype), doc->fwType); - - if(!dc) return SP_ERROR; - --- -2.7.1 -