gdi32: Implement CreatePenIndirect on top of CreatePen.
Instead of the other way around. Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3dcb5db47f
commit
4590f6fb4f
|
@ -169,3 +169,11 @@ INT WINAPI GetObjectA( HGDIOBJ handle, INT count, void *buffer )
|
||||||
|
|
||||||
return GetObjectW( handle, count, buffer );
|
return GetObjectW( handle, count, buffer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* CreatePenIndirect (GDI32.@)
|
||||||
|
*/
|
||||||
|
HPEN WINAPI CreatePenIndirect( const LOGPEN *pen )
|
||||||
|
{
|
||||||
|
return CreatePen( pen->lopnStyle, pen->lopnWidth.x, pen->lopnColor );
|
||||||
|
}
|
||||||
|
|
|
@ -56,28 +56,12 @@ static const struct gdi_obj_funcs pen_funcs =
|
||||||
*/
|
*/
|
||||||
HPEN WINAPI CreatePen( INT style, INT width, COLORREF color )
|
HPEN WINAPI CreatePen( INT style, INT width, COLORREF color )
|
||||||
{
|
{
|
||||||
LOGPEN logpen;
|
PENOBJ *penPtr;
|
||||||
|
|
||||||
TRACE("%d %d %06x\n", style, width, color );
|
|
||||||
|
|
||||||
logpen.lopnStyle = style;
|
|
||||||
logpen.lopnWidth.x = width;
|
|
||||||
logpen.lopnWidth.y = 0;
|
|
||||||
logpen.lopnColor = color;
|
|
||||||
|
|
||||||
return CreatePenIndirect( &logpen );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* CreatePenIndirect (GDI32.@)
|
|
||||||
*/
|
|
||||||
HPEN WINAPI CreatePenIndirect( const LOGPEN * pen )
|
|
||||||
{
|
|
||||||
PENOBJ * penPtr;
|
|
||||||
HPEN hpen;
|
HPEN hpen;
|
||||||
|
|
||||||
if (pen->lopnStyle == PS_NULL)
|
TRACE( "%d %d %06x\n", style, width, color );
|
||||||
|
|
||||||
|
if (style == PS_NULL)
|
||||||
{
|
{
|
||||||
hpen = GetStockObject(NULL_PEN);
|
hpen = GetStockObject(NULL_PEN);
|
||||||
if (hpen) return hpen;
|
if (hpen) return hpen;
|
||||||
|
@ -85,12 +69,12 @@ HPEN WINAPI CreatePenIndirect( const LOGPEN * pen )
|
||||||
|
|
||||||
if (!(penPtr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*penPtr) ))) return 0;
|
if (!(penPtr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*penPtr) ))) return 0;
|
||||||
|
|
||||||
penPtr->logpen.elpPenStyle = pen->lopnStyle;
|
penPtr->logpen.elpPenStyle = style;
|
||||||
penPtr->logpen.elpWidth = abs(pen->lopnWidth.x);
|
penPtr->logpen.elpWidth = abs(width);
|
||||||
penPtr->logpen.elpColor = pen->lopnColor;
|
penPtr->logpen.elpColor = color;
|
||||||
penPtr->logpen.elpBrushStyle = BS_SOLID;
|
penPtr->logpen.elpBrushStyle = BS_SOLID;
|
||||||
|
|
||||||
switch (pen->lopnStyle)
|
switch (style)
|
||||||
{
|
{
|
||||||
case PS_SOLID:
|
case PS_SOLID:
|
||||||
case PS_DASH:
|
case PS_DASH:
|
||||||
|
|
Loading…
Reference in New Issue