Commit 15ef3941 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Add support for DC pens.

parent 842d4993
...@@ -216,7 +216,7 @@ const DC_FUNCTIONS dib_driver = ...@@ -216,7 +216,7 @@ const DC_FUNCTIONS dib_driver =
NULL, /* pSetBkColor */ NULL, /* pSetBkColor */
NULL, /* pSetBkMode */ NULL, /* pSetBkMode */
NULL, /* pSetDCBrushColor */ NULL, /* pSetDCBrushColor */
NULL, /* pSetDCPenColor */ dibdrv_SetDCPenColor, /* pSetDCPenColor */
NULL, /* pSetDIBColorTable */ NULL, /* pSetDIBColorTable */
NULL, /* pSetDIBits */ NULL, /* pSetDIBits */
NULL, /* pSetDIBitsToDevice */ NULL, /* pSetDIBitsToDevice */
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
*/ */
extern HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen ) DECLSPEC_HIDDEN; extern HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen ) DECLSPEC_HIDDEN;
extern COLORREF CDECL dibdrv_SetDCPenColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN;
static inline dibdrv_physdev *get_dibdrv_pdev( PHYSDEV dev ) static inline dibdrv_physdev *get_dibdrv_pdev( PHYSDEV dev )
{ {
......
...@@ -56,6 +56,9 @@ HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen ) ...@@ -56,6 +56,9 @@ HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen )
HeapFree( GetProcessHeap(), 0, elp ); HeapFree( GetProcessHeap(), 0, elp );
} }
if (hpen == GetStockObject( DC_PEN ))
logpen.lopnColor = GetDCPenColor( dev->hdc );
pdev->pen_color = pdev->dib.funcs->colorref_to_pixel(&pdev->dib, logpen.lopnColor); pdev->pen_color = pdev->dib.funcs->colorref_to_pixel(&pdev->dib, logpen.lopnColor);
pdev->defer |= DEFER_PEN; pdev->defer |= DEFER_PEN;
...@@ -73,3 +76,17 @@ HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen ) ...@@ -73,3 +76,17 @@ HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen )
return next->funcs->pSelectPen( next, hpen ); return next->funcs->pSelectPen( next, hpen );
} }
/***********************************************************************
* dibdrv_SetDCPenColor
*/
COLORREF CDECL dibdrv_SetDCPenColor( PHYSDEV dev, COLORREF color )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSetDCPenColor );
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
if (GetCurrentObject(dev->hdc, OBJ_PEN) == GetStockObject( DC_PEN ))
pdev->pen_color = pdev->dib.funcs->colorref_to_pixel(&pdev->dib, color);
return next->funcs->pSetDCPenColor( next, color );
}
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