Commit ed23e3de authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdi32: Initial SelectPen support.

parent f3824783
......@@ -15,6 +15,7 @@ C_SRCS = \
dc.c \
dib.c \
dibdrv/dc.c \
dibdrv/objects.c \
dibdrv/primitives.c \
driver.c \
enhmetafile.c \
......
......@@ -207,7 +207,7 @@ const DC_FUNCTIONS dib_driver =
NULL, /* pSelectClipPath */
NULL, /* pSelectFont */
NULL, /* pSelectPalette */
NULL, /* pSelectPen */
dibdrv_SelectPen, /* pSelectPen */
NULL, /* pSetArcDirection */
NULL, /* pSetBitmapBits */
NULL, /* pSetBkColor */
......
......@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
extern HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen ) DECLSPEC_HIDDEN;
static inline dibdrv_physdev *get_dibdrv_pdev( PHYSDEV dev )
{
return (dibdrv_physdev *)dev;
......
/*
* DIB driver GDI objects.
*
* Copyright 2011 Huw Davies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "gdi_private.h"
#include "dibdrv.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(dib);
/***********************************************************************
* dibdrv_SelectPen
*/
HPEN CDECL dibdrv_SelectPen( PHYSDEV dev, HPEN hpen )
{
PHYSDEV next = GET_NEXT_PHYSDEV( dev, pSelectPen );
dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
LOGPEN logpen;
TRACE("(%p, %p)\n", dev, hpen);
if (!GetObjectW( hpen, sizeof(logpen), &logpen ))
{
/* must be an extended pen */
EXTLOGPEN *elp;
INT size = GetObjectW( hpen, 0, NULL );
if (!size) return 0;
elp = HeapAlloc( GetProcessHeap(), 0, size );
GetObjectW( hpen, size, elp );
/* FIXME: add support for user style pens */
logpen.lopnStyle = elp->elpPenStyle;
logpen.lopnWidth.x = elp->elpWidth;
logpen.lopnWidth.y = 0;
logpen.lopnColor = elp->elpColor;
HeapFree( GetProcessHeap(), 0, elp );
}
pdev->pen_color = pdev->dib.funcs->colorref_to_pixel(&pdev->dib, logpen.lopnColor);
return next->funcs->pSelectPen( next, hpen );
}
......@@ -96,6 +96,9 @@ typedef struct dibdrv_physdev
{
struct gdi_physdev dev;
dib_info dib;
/* pen */
DWORD pen_color;
} dibdrv_physdev;
typedef struct tagDC_FUNCS
......
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