From 9285915720cb50814b24e305753287e5f2093b42 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 10 Mar 2011 20:38:51 +0100 Subject: [PATCH] wineps: Add support for SetDCBrush/PenColor. --- dlls/wineps.drv/brush.c | 17 +++++++++++++++++ dlls/wineps.drv/pen.c | 13 +++++++++++++ dlls/wineps.drv/wineps.drv.spec | 2 ++ 3 files changed, 32 insertions(+) diff --git a/dlls/wineps.drv/brush.c b/dlls/wineps.drv/brush.c index c88ab491b5e..c7b350cab93 100644 --- a/dlls/wineps.drv/brush.c +++ b/dlls/wineps.drv/brush.c @@ -35,6 +35,9 @@ HBRUSH CDECL PSDRV_SelectBrush( PSDRV_PDEVICE *physDev, HBRUSH hbrush ) TRACE("hbrush = %p\n", hbrush); + if (hbrush == GetStockObject( DC_BRUSH )) + logbrush.lbColor = GetDCBrushColor( physDev->hdc ); + switch(logbrush.lbStyle) { case BS_SOLID: @@ -62,6 +65,20 @@ HBRUSH CDECL PSDRV_SelectBrush( PSDRV_PDEVICE *physDev, HBRUSH hbrush ) } +/*********************************************************************** + * SetDCBrushColor (WINEPS.@) + */ +COLORREF CDECL PSDRV_SetDCBrushColor( PSDRV_PDEVICE *physDev, COLORREF color ) +{ + if (GetCurrentObject( physDev->hdc, OBJ_BRUSH ) == GetStockObject( DC_BRUSH )) + { + PSDRV_CreateColor( physDev, &physDev->brush.color, color ); + physDev->brush.set = FALSE; + } + return color; +} + + /********************************************************************** * * PSDRV_SetBrush diff --git a/dlls/wineps.drv/pen.c b/dlls/wineps.drv/pen.c index 529c7385349..f8f4037ea3b 100644 --- a/dlls/wineps.drv/pen.c +++ b/dlls/wineps.drv/pen.c @@ -69,6 +69,8 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen ) physDev->pen.width = PSDRV_XWStoDS( physDev, physDev->pen.width ); if(physDev->pen.width < 0) physDev->pen.width = -physDev->pen.width; } + if (hpen == GetStockObject( DC_PEN )) + logpen.lopnColor = GetDCPenColor( physDev->hdc ); switch (logpen.lopnStyle & PS_JOIN_MASK) { @@ -124,6 +126,17 @@ HPEN CDECL PSDRV_SelectPen( PSDRV_PDEVICE *physDev, HPEN hpen ) } +/*********************************************************************** + * SetDCPenColor (WINEPS.@) + */ +COLORREF CDECL PSDRV_SetDCPenColor( PSDRV_PDEVICE *physDev, COLORREF color ) +{ + if (GetCurrentObject( physDev->hdc, OBJ_PEN ) == GetStockObject( DC_PEN )) + PSDRV_CreateColor( physDev, &physDev->pen.color, color ); + return color; +} + + /********************************************************************** * * PSDRV_SetPen diff --git a/dlls/wineps.drv/wineps.drv.spec b/dlls/wineps.drv/wineps.drv.spec index 38ada751851..d14d919274e 100644 --- a/dlls/wineps.drv/wineps.drv.spec +++ b/dlls/wineps.drv/wineps.drv.spec @@ -31,6 +31,8 @@ @ cdecl SelectFont(ptr long long) PSDRV_SelectFont @ cdecl SelectPen(ptr long) PSDRV_SelectPen @ cdecl SetBkColor(ptr long) PSDRV_SetBkColor +@ cdecl SetDCBrushColor(ptr long) PSDRV_SetDCBrushColor +@ cdecl SetDCPenColor(ptr long) PSDRV_SetDCPenColor @ cdecl SetDeviceClipping(ptr long long) PSDRV_SetDeviceClipping @ cdecl SetPixel(ptr long long long) PSDRV_SetPixel @ cdecl SetTextColor(ptr long) PSDRV_SetTextColor