Commit f5c117fb authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Introduce NtGdiCreatePen.

parent 4590f6fb
......@@ -177,3 +177,12 @@ HPEN WINAPI CreatePenIndirect( const LOGPEN *pen )
{
return CreatePen( pen->lopnStyle, pen->lopnWidth.x, pen->lopnColor );
}
/***********************************************************************
* CreatePen (GDI32.@)
*/
HPEN WINAPI CreatePen( INT style, INT width, COLORREF color )
{
if (style < 0 || style > PS_INSIDEFRAME) style = PS_SOLID;
return NtGdiCreatePen( style, width, color, NULL );
}
......@@ -52,27 +52,15 @@ static const struct gdi_obj_funcs pen_funcs =
/***********************************************************************
* CreatePen (GDI32.@)
* NtGdiCreatePen (win32u.@)
*/
HPEN WINAPI CreatePen( INT style, INT width, COLORREF color )
HPEN WINAPI NtGdiCreatePen( INT style, INT width, COLORREF color, HBRUSH brush )
{
PENOBJ *penPtr;
HPEN hpen;
TRACE( "%d %d %06x\n", style, width, color );
if (style == PS_NULL)
{
hpen = GetStockObject(NULL_PEN);
if (hpen) return hpen;
}
if (!(penPtr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*penPtr) ))) return 0;
penPtr->logpen.elpPenStyle = style;
penPtr->logpen.elpWidth = abs(width);
penPtr->logpen.elpColor = color;
penPtr->logpen.elpBrushStyle = BS_SOLID;
if (brush) FIXME( "brush not supported\n" );
switch (style)
{
......@@ -84,14 +72,21 @@ HPEN WINAPI CreatePen( INT style, INT width, COLORREF color )
case PS_INSIDEFRAME:
break;
case PS_NULL:
penPtr->logpen.elpWidth = 1;
penPtr->logpen.elpColor = 0;
if ((hpen = GetStockObject( NULL_PEN ))) return hpen;
width = 1;
color = 0;
break;
default:
penPtr->logpen.elpPenStyle = PS_SOLID;
break;
return 0;
}
if (!(penPtr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*penPtr) ))) return 0;
penPtr->logpen.elpPenStyle = style;
penPtr->logpen.elpWidth = abs(width);
penPtr->logpen.elpColor = color;
penPtr->logpen.elpBrushStyle = BS_SOLID;
if (!(hpen = alloc_gdi_handle( &penPtr->obj, OBJ_PEN, &pen_funcs )))
HeapFree( GetProcessHeap(), 0, penPtr );
return hpen;
......
......@@ -68,7 +68,7 @@ HFONT WINAPI NtGdiHfontCreate( const ENUMLOGFONTEXDVW *enumex, ULONG unk2, UL
ULONG unk4, void *data );
HBRUSH WINAPI NtGdiCreateDIBBrush( const void* data, UINT coloruse );
HBRUSH WINAPI NtGdiCreatePatternBrushInternal( HBITMAP hbitmap, BOOL pen );
HPEN WINAPI NtGdiCreatePen( INT style, INT width, COLORREF color );
HPEN WINAPI NtGdiCreatePen( INT style, INT width, COLORREF color, HBRUSH brush );
HRGN WINAPI NtGdiCreateRectRgn( INT left, INT top, INT right, INT bottom );
HRGN WINAPI NtGdiCreateRoundRectRgn( INT left, INT top, INT right, INT bottom,
INT ellipse_width, INT ellipse_height );
......
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