ReactOS  0.4.15-dev-1201-gb2cf5a4
pen.c File Reference
#include <precomp.h>
#include <debug.h>
Include dependency graph for pen.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

HPEN WINAPI CreatePenIndirect (const LOGPEN *lplgpn)
 
HPEN WINAPI CreatePen (int nPenStyle, int nWidth, COLORREF crColor)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 3 of file pen.c.

Function Documentation

◆ CreatePen()

HPEN WINAPI CreatePen ( int  nPenStyle,
int  nWidth,
COLORREF  crColor 
)

Definition at line 21 of file pen.c.

25 {
26 /* HPEN hPen;
27  PBRUSH_ATTR Pen_Attr;
28 */
29  if (nPenStyle < PS_SOLID) nPenStyle = PS_SOLID;
30  if (nPenStyle > PS_DASHDOTDOT)
31  {
32  if (nPenStyle == PS_NULL) return GetStockObject(NULL_PEN);
33  if (nPenStyle != PS_INSIDEFRAME) nPenStyle = PS_SOLID;
34  }
35 #if 0
36  hPen = hGetPEBHandle(hctPenHandle, nPenStyle);
37  if ( nWidth || nPenStyle || !hPen )
38  {
39  return NtGdiCreatePen(nPenStyle, nWidth, crColor, NULL);
40  }
41 
42  if ((GdiGetHandleUserData( hPen, GDI_OBJECT_TYPE_PEN, (PVOID) &Pen_Attr)) &&
43  ( Pen_Attr != NULL ))
44  {
45  if ( Pen_Attr->lbColor != crColor)
46  {
47  Pen_Attr->lbColor = crColor;
48  Pen_Attr->AttrFlags |= ATTR_NEW_COLOR;
49  }
50  return hPen;
51  }
52  DeleteObject(hPen);
53 #endif
54  return NtGdiCreatePen(nPenStyle, nWidth, crColor, NULL);
55 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
HPEN APIENTRY NtGdiCreatePen(INT PenStyle, INT Width, COLORREF Color, IN HBRUSH hbr)
Definition: pen.c:322
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define PS_SOLID
Definition: wingdi.h:585
#define NULL_PEN
Definition: wingdi.h:903
smooth NULL
Definition: ftsmooth.c:416
#define GDI_OBJECT_TYPE_PEN
Definition: gdi.h:54
#define PS_INSIDEFRAME
Definition: wingdi.h:592
PVOID GdiGetHandleUserData(_In_ HGDIOBJ hobj)
Definition: gditools.c:68
HGDIOBJ FASTCALL hGetPEBHandle(HANDLECACHETYPE, COLORREF)
Definition: misc.c:880
#define PS_NULL
Definition: wingdi.h:590
#define PS_DASHDOTDOT
Definition: wingdi.h:589
#define ATTR_NEW_COLOR
Definition: ntgdihdl.h:208

Referenced by CreatePenIndirect(), and test_logpen().

◆ CreatePenIndirect()

HPEN WINAPI CreatePenIndirect ( const LOGPEN lplgpn)

Definition at line 10 of file pen.c.

12 {
13  /* Note same behoir as Windows 2000/XP/VISTA, they do not care if plgpn is NULLī, it will crash */
14  return CreatePen(lplgpn->lopnStyle, lplgpn->lopnWidth.x, lplgpn->lopnColor);
15 }
long x
Definition: polytest.cpp:48
POINT lopnWidth
Definition: wingdi.h:1845
UINT lopnStyle
Definition: wingdi.h:1844
COLORREF lopnColor
Definition: wingdi.h:1846
HPEN WINAPI CreatePen(int nPenStyle, int nWidth, COLORREF crColor)
Definition: pen.c:21

Referenced by test_logpen().