ReactOS 0.4.16-dev-117-g38f21f9
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)
 
#define IntIsEffectiveWidePen(pbrLine)
 

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

◆ IntIsEffectiveWidePen

#define IntIsEffectiveWidePen (   pbrLine)
Value:
( \
(pbrLine)->lWidth > 1 && \
((pbrLine->flAttrs & BR_IS_OLDSTYLEPEN) || \
((pbrLine)->ulPenStyle & PS_TYPE_MASK) == PS_GEOMETRIC) \
)
#define BR_IS_OLDSTYLEPEN
Definition: brush.h:108
#define PS_GEOMETRIC
Definition: wingdi.h:583
#define PS_TYPE_MASK
Definition: wingdi.h:603

Definition at line 33 of file pen.h.

◆ 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  dc,
int  count,
POINT points 
)

Definition at line 19 of file line.c.

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

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}
Definition: brush.hpp:16
#define NULL
Definition: types.h:112
struct _BRUSH * PBRUSH
@ GDILoObjType_LO_EXTPEN_TYPE
Definition: gdi_private.h:45
Definition: types.h:83
POBJ NTAPI GDIOBJ_AllocObjWithHandle(ULONG ObjectType, ULONG cjSize)
Definition: gdiobj.c:1522
static VOID PEN_vInit(PPEN ppen)
Definition: pen.c:18

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}
@ GDILoObjType_LO_PEN_TYPE
Definition: gdi_private.h:44

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}
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
@ GDIObjType_BRUSH_TYPE
Definition: ntgdityp.h:136
POBJ NTAPI GDIOBJ_ReferenceObjectByHandle(HGDIOBJ hobj, UCHAR objt)
Definition: gdiobj.c:691

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