ReactOS  0.4.14-dev-833-g5f692ed
pen.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PEN_UnlockPen(pPenObj)   GDIOBJ_vUnlockObject((POBJ)pPenObj)
 
#define PEN_ShareUnlockPen(ppen)   GDIOBJ_vDereferenceObject((POBJ)ppen)
 

Typedefs

typedef BRUSH PEN
 
typedef BRUSHPPEN
 

Functions

PPEN NTAPI PEN_AllocPenWithHandle (VOID)
 
PPEN NTAPI PEN_AllocExtPenWithHandle (VOID)
 
PPEN FASTCALL PEN_ShareLockPen (HPEN hpen)
 
INT NTAPI PEN_GetObject (_In_ PPEN pPen, _In_ INT Count, _Out_ PLOGPEN Buffer)
 
VOID FASTCALL AddPenLinesBounds (PDC, int, POINT *)
 

Macro Definition Documentation

◆ PEN_ShareUnlockPen

#define PEN_ShareUnlockPen (   ppen)    GDIOBJ_vDereferenceObject((POBJ)ppen)

Definition at line 18 of file pen.h.

◆ PEN_UnlockPen

#define PEN_UnlockPen (   pPenObj)    GDIOBJ_vUnlockObject((POBJ)pPenObj)

Definition at line 17 of file pen.h.

Typedef Documentation

◆ PEN

typedef BRUSH PEN

Definition at line 5 of file pen.h.

◆ PPEN

typedef BRUSH * PPEN

Definition at line 5 of file pen.h.

Function Documentation

◆ AddPenLinesBounds()

VOID FASTCALL AddPenLinesBounds ( PDC  ,
int  ,
POINT  
)

Definition at line 17 of file line.c.

18 {
19  DWORD join, endcap;
20  RECTL bounds, rect;
21  LONG lWidth;
22  PBRUSH pbrLine;
23 
24  /* Get BRUSH from current pen. */
25  pbrLine = dc->dclevel.pbrLine;
26  ASSERT(pbrLine);
27 
28  lWidth = pbrLine->lWidth;
29 
30  // Setup bounds
31  bounds.left = bounds.top = INT_MAX;
32  bounds.right = bounds.bottom = INT_MIN;
33 
34  if (((pbrLine->ulPenStyle & PS_TYPE_MASK) & PS_GEOMETRIC) || lWidth > 1)
35  {
36  /* Windows uses some heuristics to estimate the distance from the point that will be painted */
37  lWidth = lWidth + 2;
38  endcap = (PS_ENDCAP_MASK & pbrLine->ulPenStyle);
39  join = (PS_JOIN_MASK & pbrLine->ulPenStyle);
40  if (join == PS_JOIN_MITER)
41  {
42  lWidth *= 5;
43  if (endcap == PS_ENDCAP_SQUARE) lWidth = (lWidth * 3 + 1) / 2;
44  }
45  else
46  {
47  if (endcap == PS_ENDCAP_SQUARE) lWidth -= lWidth / 4;
48  else lWidth = (lWidth + 1) / 2;
49  }
50  }
51 
52  while (count-- > 0)
53  {
54  rect.left = points->x - lWidth;
55  rect.top = points->y - lWidth;
56  rect.right = points->x + lWidth + 1;
57  rect.bottom = points->y + lWidth + 1;
58  RECTL_bUnionRect(&bounds, &bounds, &rect);
59  points++;
60  }
61 
62  DPRINT("APLB dc %p l %d t %d\n",dc,rect.left,rect.top);
63  DPRINT(" r %d b %d\n",rect.right,rect.bottom);
64 
65  {
66  RECTL rcRgn = dc->erclClip; // Use the clip box for now.
67 
68  if (RECTL_bIntersectRect( &rcRgn, &rcRgn, &bounds ))
69  IntUpdateBoundsRect(dc, &rcRgn);
70  else
71  IntUpdateBoundsRect(dc, &bounds);
72  }
73 }
#define PS_ENDCAP_SQUARE
Definition: wingdi.h:594
#define INT_MAX
Definition: limits.h:40
GLuint GLuint GLsizei count
Definition: gl.h:1545
long bottom
Definition: polytest.cpp:53
#define PS_JOIN_MITER
Definition: wingdi.h:597
#define PS_GEOMETRIC
Definition: wingdi.h:582
& rect
Definition: startmenu.cpp:1413
long right
Definition: polytest.cpp:53
long LONG
Definition: pedump.c:60
long top
Definition: polytest.cpp:53
LOCAL int join(int *aux, int a, int b)
Definition: match.c:560
void DPRINT(...)
Definition: polytest.cpp:61
long left
Definition: polytest.cpp:53
Definition: types.h:100
BOOL FASTCALL RECTL_bUnionRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:18
BOOL FASTCALL RECTL_bIntersectRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:55
unsigned long DWORD
Definition: ntddk_ex.h:95
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
GLsizei const GLfloat * points
Definition: glext.h:8112
#define INT_MIN
Definition: limits.h:39
#define PS_TYPE_MASK
Definition: wingdi.h:602
#define PS_ENDCAP_MASK
Definition: wingdi.h:601
#define PS_JOIN_MASK
Definition: wingdi.h:599
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:689
static const WCHAR dc[]

Referenced by IntGdiLineTo(), and IntGdiPolyline().

◆ PEN_AllocExtPenWithHandle()

PPEN NTAPI PEN_AllocExtPenWithHandle ( VOID  )

Definition at line 44 of file pen.c.

46 {
47  PPEN ppen;
48 
50  if (ppen == NULL)
51  {
52  return NULL;
53  }
54 
55  PEN_vInit(ppen);
56  return ppen;
57 }
struct _BRUSH * PBRUSH
Definition: types.h:82
smooth NULL
Definition: ftsmooth.c:416
Definition: brush.hpp:15
static VOID PEN_vInit(PPEN ppen)
Definition: pen.c:18
POBJ NTAPI GDIOBJ_AllocObjWithHandle(ULONG ObjectType, ULONG cjSize)
Definition: gdiobj.c:1485

Referenced by IntGdiExtCreatePen().

◆ PEN_AllocPenWithHandle()

PPEN NTAPI PEN_AllocPenWithHandle ( VOID  )

Definition at line 27 of file pen.c.

29 {
30  PPEN ppen;
31 
33  if (ppen == NULL)
34  {
35  return NULL;
36  }
37 
38  PEN_vInit(ppen);
39  return ppen;
40 }
struct _BRUSH * PBRUSH
Definition: types.h:82
smooth NULL
Definition: ftsmooth.c:416
Definition: brush.hpp:15
static VOID PEN_vInit(PPEN ppen)
Definition: pen.c:18
POBJ NTAPI GDIOBJ_AllocObjWithHandle(ULONG ObjectType, ULONG cjSize)
Definition: gdiobj.c:1485

Referenced by IntCreateStockPen(), and IntGdiExtCreatePen().

◆ PEN_GetObject()

INT NTAPI PEN_GetObject ( _In_ PPEN  pPen,
_In_ INT  Count,
_Out_ PLOGPEN  Buffer 
)

◆ PEN_ShareLockPen()

PPEN FASTCALL PEN_ShareLockPen ( HPEN  hpen)

Definition at line 61 of file pen.c.

62 {
65  {
66  return NULL;
67  }
68 
70 }
POBJ NTAPI GDIOBJ_ReferenceObjectByHandle(HGDIOBJ hobj, UCHAR objt)
Definition: gdiobj.c:688
smooth NULL
Definition: ftsmooth.c:416
Definition: types.h:100
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31

Referenced by DC_vInitDc(), DC_vSetOwner(), DC_vUpdateLineBrush(), IntArc(), IntGdiSetSolidPenColor(), IntRoundRect(), and NtGdiEllipse().