gdi32: Add support for DC pens.

This commit is contained in:
Huw Davies 2011-04-07 13:47:59 +01:00 committed by Alexandre Julliard
parent 842d49939d
commit 15ef394159
3 changed files with 19 additions and 1 deletions

View File

@ -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 */

View File

@ -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 )
{ {

View File

@ -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 )
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 );
}