Module: wine Branch: master Commit: 3fca78fbe42907e74fa3397246904863e759ffda URL: https://gitlab.winehq.org/wine/wine/-/commit/3fca78fbe42907e74fa339724690486...
Author: Piotr Caban piotr@codeweavers.com Date: Wed May 17 18:20:52 2023 +0200
wineps: Remove unused fields from print_ctx.
---
dlls/wineps.drv/color.c | 28 ---------------------------- dlls/wineps.drv/init.c | 42 ++++++------------------------------------ dlls/wineps.drv/ps.c | 1 - dlls/wineps.drv/psdrv.h | 7 ------- 4 files changed, 6 insertions(+), 72 deletions(-)
diff --git a/dlls/wineps.drv/color.c b/dlls/wineps.drv/color.c index 26c235a8c6c..db14319cbd6 100644 --- a/dlls/wineps.drv/color.c +++ b/dlls/wineps.drv/color.c @@ -24,34 +24,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
-/********************************************************************** - * PSDRV_CopyColor - * - * Copies col2 into col1. Return FALSE on error. - */ -BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2) -{ - - switch(col2->type) { - case PSCOLOR_GRAY: - col1->value.gray.i = col2->value.gray.i; - break; - - case PSCOLOR_RGB: - col1->value.rgb.r = col2->value.rgb.r; - col1->value.rgb.g = col2->value.rgb.g; - col1->value.rgb.b = col2->value.rgb.b; - break; - - default: - ERR("Unknown colour type %d\n", col1->type); - return FALSE; - } - - col1->type = col2->type; - return TRUE; -} - PSRGB rgb_to_grayscale_scale( void ) { static const PSRGB scale = {0.3, 0.59, 0.11}; diff --git a/dlls/wineps.drv/init.c b/dlls/wineps.drv/init.c index 9cbea031d48..9d59830c60d 100644 --- a/dlls/wineps.drv/init.c +++ b/dlls/wineps.drv/init.c @@ -412,7 +412,7 @@ static void PSDRV_UpdateDevCaps( print_ctx *ctx ) { PAGESIZE *page; RESOLUTION *res; - INT width = 0, height = 0, resx = 0, resy = 0; + INT resx = 0, resy = 0;
dump_devmode(&ctx->Devmode->dmPublic);
@@ -460,63 +460,33 @@ static void PSDRV_UpdateDevCaps( print_ctx *ctx ) if(&page->entry == &ctx->pi->ppd->PageSizes) { FIXME("Can't find page\n"); SetRectEmpty(&ctx->ImageableArea); - ctx->PageSize.cx = 0; - ctx->PageSize.cy = 0; } else if(page->ImageableArea) { /* ctx sizes in device units; ppd sizes in 1/72" */ SetRect(&ctx->ImageableArea, page->ImageableArea->llx * ctx->logPixelsX / 72, page->ImageableArea->ury * ctx->logPixelsY / 72, page->ImageableArea->urx * ctx->logPixelsX / 72, page->ImageableArea->lly * ctx->logPixelsY / 72); - ctx->PageSize.cx = page->PaperDimension->x * - ctx->logPixelsX / 72; - ctx->PageSize.cy = page->PaperDimension->y * - ctx->logPixelsY / 72; } else { ctx->ImageableArea.left = ctx->ImageableArea.bottom = 0; - ctx->ImageableArea.right = ctx->PageSize.cx = + ctx->ImageableArea.right = page->PaperDimension->x * ctx->logPixelsX / 72; - ctx->ImageableArea.top = ctx->PageSize.cy = + ctx->ImageableArea.top = page->PaperDimension->y * ctx->logPixelsY / 72; } } else if((ctx->Devmode->dmPublic.dmFields & DM_PAPERLENGTH) && (ctx->Devmode->dmPublic.dmFields & DM_PAPERWIDTH)) { /* ctx sizes in device units; Devmode sizes in 1/10 mm */ ctx->ImageableArea.left = ctx->ImageableArea.bottom = 0; - ctx->ImageableArea.right = ctx->PageSize.cx = + ctx->ImageableArea.right = ctx->Devmode->dmPublic.dmPaperWidth * ctx->logPixelsX / 254; - ctx->ImageableArea.top = ctx->PageSize.cy = + ctx->ImageableArea.top = ctx->Devmode->dmPublic.dmPaperLength * ctx->logPixelsY / 254; } else { FIXME("Odd dmFields %lx\n", ctx->Devmode->dmPublic.dmFields); SetRectEmpty(&ctx->ImageableArea); - ctx->PageSize.cx = 0; - ctx->PageSize.cy = 0; }
- TRACE("ImageableArea = %s: PageSize = %ldx%ld\n", wine_dbgstr_rect(&ctx->ImageableArea), - ctx->PageSize.cx, ctx->PageSize.cy); - - /* these are in device units */ - width = ctx->ImageableArea.right - ctx->ImageableArea.left; - height = ctx->ImageableArea.top - ctx->ImageableArea.bottom; - - if(ctx->Devmode->dmPublic.dmOrientation == DMORIENT_PORTRAIT) { - ctx->horzRes = width; - ctx->vertRes = height; - } else { - ctx->horzRes = height; - ctx->vertRes = width; - } - - /* these are in mm */ - ctx->horzSize = (ctx->horzRes * 25.4) / ctx->logPixelsX; - ctx->vertSize = (ctx->vertRes * 25.4) / ctx->logPixelsY; - - TRACE("devcaps: horzSize = %dmm, vertSize = %dmm, " - "horzRes = %d, vertRes = %d\n", - ctx->horzSize, ctx->vertSize, - ctx->horzRes, ctx->vertRes); + TRACE("ImageableArea = %s\n", wine_dbgstr_rect(&ctx->ImageableArea)); }
print_ctx *create_print_ctx( HDC hdc, const WCHAR *device, diff --git a/dlls/wineps.drv/ps.c b/dlls/wineps.drv/ps.c index 007250e55db..421f01302bf 100644 --- a/dlls/wineps.drv/ps.c +++ b/dlls/wineps.drv/ps.c @@ -635,7 +635,6 @@ BOOL PSDRV_WriteSetColor(print_ctx *ctx, PSCOLOR *color) { char buf[256];
- PSDRV_CopyColor(&ctx->inkColor, color); switch(color->type) { case PSCOLOR_RGB: push_lc_numeric("C"); diff --git a/dlls/wineps.drv/psdrv.h b/dlls/wineps.drv/psdrv.h index afeaa5fec0c..dd63c0000cf 100644 --- a/dlls/wineps.drv/psdrv.h +++ b/dlls/wineps.drv/psdrv.h @@ -338,20 +338,14 @@ typedef struct PSPEN pen; PSBRUSH brush; PSCOLOR bkColor; - PSCOLOR inkColor; /* Last colour set */ JOB job; PSDRV_DEVMODE *Devmode; PRINTERINFO *pi; - SIZE PageSize; /* Physical page size in device units */ RECT ImageableArea; /* Imageable area in device units */ /* NB both PageSize and ImageableArea are not rotated in landscape mode, so PageSize.cx is generally < PageSize.cy */ - int horzRes; /* device caps */ - int vertRes; - int horzSize; - int vertSize; int logPixelsX; int logPixelsY;
@@ -446,7 +440,6 @@ extern void PSDRV_AddClip( print_ctx *ctx, HRGN hrgn ) DECLSPEC_HIDDEN; extern void PSDRV_SetClip( print_ctx *ctx ) DECLSPEC_HIDDEN; extern void PSDRV_ResetClip( print_ctx *ctx ) DECLSPEC_HIDDEN;
-extern BOOL PSDRV_CopyColor(PSCOLOR *col1, PSCOLOR *col2) DECLSPEC_HIDDEN; extern void PSDRV_CreateColor( print_ctx *ctx, PSCOLOR *pscolor, COLORREF wincolor ) DECLSPEC_HIDDEN; extern PSRGB rgb_to_grayscale_scale( void ) DECLSPEC_HIDDEN;