ReactOS 0.4.15-dev-7924-g5949c20
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 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 = 0;
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) || pbrLine->lWidth > 1)
35 {
36 /* Windows uses some heuristics to estimate the distance from the point that will be painted */
37 lWidth = pbrLine->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}
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:71
& 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().