Alexandre Julliard : wineps: Add support for SetDCBrush/PenColor.
Alexandre Julliard
julliard at winehq.org
Fri Mar 11 10:23:36 CST 2011
Module: wine
Branch: master
Commit: 9285915720cb50814b24e305753287e5f2093b42
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9285915720cb50814b24e305753287e5f2093b42
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Mar 10 20:38:51 2011 +0100
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(+), 0 deletions(-)
diff --git a/dlls/wineps.drv/brush.c b/dlls/wineps.drv/brush.c
index c88ab49..c7b350c 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 529c738..f8f4037 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 38ada75..d14d919 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
More information about the wine-cvs
mailing list