ReactOS  0.4.13-dev-551-gf37fb1f
pen.c
Go to the documentation of this file.
1 #include <precomp.h>
2 
3 #define NDEBUG
4 #include <debug.h>
5 
6 /*
7  * @implemented
8  */
9 HPEN WINAPI
11  const LOGPEN *lplgpn)
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 }
16 
17 /*
18  * @implemented
19  */
20 HPEN WINAPI
22  int nPenStyle,
23  int nWidth,
24  COLORREF crColor)
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 }
56 
HGDIOBJ WINAPI GetStockObject(_In_ int)
long x
Definition: polytest.cpp:48
HPEN APIENTRY NtGdiCreatePen(INT PenStyle, INT Width, COLORREF Color, IN HBRUSH hbr)
Definition: pen.c:322
POINT lopnWidth
Definition: wingdi.h:1824
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define PS_SOLID
Definition: wingdi.h:585
UINT lopnStyle
Definition: wingdi.h:1823
#define NULL_PEN
Definition: wingdi.h:903
COLORREF lopnColor
Definition: wingdi.h:1825
smooth NULL
Definition: ftsmooth.c:416
#define GDI_OBJECT_TYPE_PEN
Definition: gdi.h:54
DWORD COLORREF
Definition: windef.h:285
#define WINAPI
Definition: msvc.h:8
HPEN WINAPI CreatePen(int nPenStyle, int nWidth, COLORREF crColor)
Definition: pen.c:21
#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
HPEN WINAPI CreatePenIndirect(const LOGPEN *lplgpn)
Definition: pen.c:10
#define ATTR_NEW_COLOR
Definition: ntgdihdl.h:204