Commit 3fca78fb authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

wineps: Remove unused fields from print_ctx.

parent e70aa825
......@@ -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};
......
......@@ -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,
......
......@@ -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");
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment