ReactOS 0.4.15-dev-7842-g558ab78
intgdi.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define WIN32_ROP3_TO_ENG_ROP4(dwRop4)   ((((dwRop4) & 0x00FF0000) >> 16) | (((dwRop4) & 0x00FF0000) >> 8))
 
#define WIN32_ROP4_TO_ENG_ROP4(dwRop4)   ((dwRop4) >> 16)
 
#define WIN32_ROP4_USES_SOURCE(Rop)   ((((Rop) & 0xCCCC0000) >> 2) != ((Rop) & 0x33330000))
 
#define FIXUP_ROP2(rop2)   ((((rop2) - 1) & 0xF) + 1)
 

Functions

BOOL FASTCALL IntGdiLineTo (DC *dc, int XEnd, int YEnd)
 
BOOL FASTCALL IntGdiMoveToEx (DC *dc, int X, int Y, LPPOINT Point)
 
BOOL FASTCALL IntGdiPolyBezier (DC *dc, LPPOINT pt, DWORD Count)
 
BOOL FASTCALL IntGdiPolyline (DC *dc, LPPOINT pt, int Count)
 
BOOL FASTCALL IntGdiPolyBezierTo (DC *dc, LPPOINT pt, DWORD Count)
 
BOOL FASTCALL IntGdiPolyPolyline (DC *dc, LPPOINT pt, PULONG PolyPoints, DWORD Count)
 
BOOL FASTCALL IntGdiPolylineTo (DC *dc, LPPOINT pt, DWORD Count)
 
BOOL FASTCALL GreMoveTo (HDC hdc, INT x, INT y, LPPOINT pptOut)
 
BOOL NTAPI GreGradientFill (HDC hdc, PTRIVERTEX pVertex, ULONG nVertex, PVOID pMesh, ULONG nMesh, ULONG ulMode)
 
HDC FASTCALL IntGdiCreateDC (PUNICODE_STRING Driver, PUNICODE_STRING Device, PVOID pUMdhpdev, CONST PDEVMODEW InitData, BOOL CreateAsIC)
 
VOID FASTCALL IntSetSysColors (UINT nColors, CONST INT *Elements, CONST COLORREF *Colors)
 
HGDIOBJ FASTCALL IntGetSysColorBrush (INT Object)
 
DWORD FASTCALL IntGetSysColor (INT nIndex)
 
NTSTATUS APIENTRY NtGdiFlushUserBatch (VOID)
 
DWORD APIENTRY NtDxEngGetRedirectionBitmap (DWORD Unknown0)
 
HBITMAP FASTCALL IntCreateCompatibleBitmap (_In_ PDC Dc, _In_ INT Width, _In_ INT Height, _In_ UINT Bpp, _In_ UINT Planes)
 
WORD APIENTRY IntGdiSetHookFlags (HDC hDC, WORD Flags)
 
UINT APIENTRY IntSetDIBColorTable (HDC hDC, UINT StartIndex, UINT Entries, CONST RGBQUAD *Colors)
 
UINT APIENTRY IntGetDIBColorTable (HDC hDC, UINT StartIndex, UINT Entries, RGBQUAD *Colors)
 
UINT APIENTRY IntGetPaletteEntries (HPALETTE hpal, UINT StartIndex, UINT Entries, LPPALETTEENTRY pe)
 
UINT APIENTRY IntGetSystemPaletteEntries (HDC hDC, UINT StartIndex, UINT Entries, LPPALETTEENTRY pe)
 
VOID FASTCALL CreateStockObjects (VOID)
 
VOID FASTCALL CreateSysColorObjects (VOID)
 
PPOINT GDI_Bezier (const POINT *Points, INT count, PINT nPtsOut)
 
BOOL FASTCALL IntFillArc (PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, double StartArc, double EndArc, ARCTYPE arctype)
 
BOOL FASTCALL IntDrawArc (PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, double StartArc, double EndArc, ARCTYPE arctype, PBRUSH pbrush)
 
BOOL FASTCALL IntFillEllipse (PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush)
 
BOOL FASTCALL IntDrawEllipse (PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush)
 
BOOL FASTCALL IntFillRoundRect (PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrush)
 
BOOL FASTCALL IntDrawRoundRect (PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrush)
 

Variables

HDC hSystemBM
 
HSEMAPHORE hsemDriverMgmt
 

Macro Definition Documentation

◆ FIXUP_ROP2

#define FIXUP_ROP2 (   rop2)    ((((rop2) - 1) & 0xF) + 1)

Definition at line 10 of file intgdi.h.

◆ WIN32_ROP3_TO_ENG_ROP4

#define WIN32_ROP3_TO_ENG_ROP4 (   dwRop4)    ((((dwRop4) & 0x00FF0000) >> 16) | (((dwRop4) & 0x00FF0000) >> 8))

Definition at line 4 of file intgdi.h.

◆ WIN32_ROP4_TO_ENG_ROP4

#define WIN32_ROP4_TO_ENG_ROP4 (   dwRop4)    ((dwRop4) >> 16)

Definition at line 5 of file intgdi.h.

◆ WIN32_ROP4_USES_SOURCE

#define WIN32_ROP4_USES_SOURCE (   Rop)    ((((Rop) & 0xCCCC0000) >> 2) != ((Rop) & 0x33330000))

Definition at line 7 of file intgdi.h.

Function Documentation

◆ CreateStockObjects()

VOID FASTCALL CreateStockObjects ( void  )

Creates a bunch of stock objects: brushes, pens, fonts.

Definition at line 247 of file stockobj.c.

248{
249 UINT Object;
250
251 DPRINT("Beginning creation of stock objects\n");
252
253 /* Create GDI Stock Objects from the logical structures we've defined */
254
256 StockObjects[DC_BRUSH] = IntGdiCreateSolidBrush(RGB(255,255,255));
262
267
268 StockObjects[20] = NULL; /* TODO: Unknown internal stock object */
270
272
274
276 {
277 if (NULL != StockObjects[Object])
278 {
280 }
281 }
282
283 DPRINT("Completed creation of stock objects\n");
284}
HBITMAP NTAPI GreCreateBitmap(_In_ ULONG nWidth, _In_ ULONG nHeight, _In_ ULONG cPlanes, _In_ ULONG cBitsPixel, _In_opt_ PVOID pvBits)
Definition: bitmaps.c:172
HBRUSH APIENTRY IntGdiCreateSolidBrush(COLORREF crColor)
Definition: brush.cpp:290
HBRUSH NTAPI IntGdiCreateNullBrush(VOID)
Definition: brush.cpp:281
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
#define NULL
Definition: types.h:112
#define RGB(r, g, b)
Definition: precomp.h:71
#define for
Definition: utility.h:88
unsigned int UINT
Definition: ndis.h:50
#define DEFAULT_BITMAP
Definition: ntgdityp.h:195
#define NB_STOCK_OBJECTS
Definition: ntgdityp.h:192
#define DPRINT
Definition: sndvol32.h:71
static HPEN FASTCALL IntCreateStockPen(DWORD dwPenStyle, DWORD dwWidth, ULONG ulBrushStyle, ULONG ulColor)
Definition: stockobj.c:105
static LOGPEN NullPen
Definition: stockobj.c:62
static VOID FASTCALL CreateStockFonts(void)
Definition: stockobj.c:145
HGDIOBJ StockObjects[NB_STOCK_OBJECTS]
Definition: stockobj.c:100
static LOGPEN WhitePen
Definition: stockobj.c:56
static LOGPEN BlackPen
Definition: stockobj.c:59
BASEOBJECT BaseObject
Definition: palette.h:36
COLORREF lopnColor
Definition: wingdi.h:1847
POINT lopnWidth
Definition: wingdi.h:1846
UINT lopnStyle
Definition: wingdi.h:1845
long x
Definition: polytest.cpp:48
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
BOOL NTAPI GDIOBJ_ConvertToStockObj(HGDIOBJ *phObj)
Definition: gdiobj.c:1455
PALETTE * gppalDefault
Definition: palette.c:20
void * HGDIOBJ
Definition: windef.h:252
#define DEFAULT_PALETTE
Definition: wingdi.h:913
#define LTGRAY_BRUSH
Definition: wingdi.h:900
#define DKGRAY_BRUSH
Definition: wingdi.h:897
#define WHITE_PEN
Definition: wingdi.h:905
#define WHITE_BRUSH
Definition: wingdi.h:902
#define GRAY_BRUSH
Definition: wingdi.h:898
#define NULL_BRUSH
Definition: wingdi.h:901
#define BLACK_PEN
Definition: wingdi.h:903
#define NULL_PEN
Definition: wingdi.h:904
#define BLACK_BRUSH
Definition: wingdi.h:896
#define BS_SOLID
Definition: wingdi.h:1086

Referenced by DriverEntry().

◆ CreateSysColorObjects()

VOID FASTCALL CreateSysColorObjects ( VOID  )

Definition at line 329 of file stockobj.c.

330{
331 UINT i;
332
333 for (i = 0; i < NUM_SYSCOLORS; i++)
334 {
335 gpsi->argbSystem[i] = SysColors[i];
336 }
337
338 /* Create the syscolor brushes */
339 for (i = 0; i < NUM_SYSCOLORS; i++)
340 {
341 if (gpsi->ahbrSystem[i] == NULL)
342 {
343 gpsi->ahbrSystem[i] = IntGdiCreateSolidBrush(SysColors[i]);
344 if (gpsi->ahbrSystem[i] != NULL)
345 {
346 GDIOBJ_ConvertToStockObj((HGDIOBJ*)&gpsi->ahbrSystem[i]);
347 }
348 }
349 }
350}
#define NUM_SYSCOLORS
Definition: SetSysColors.c:10
PSERVERINFO gpsi
Definition: imm.c:18
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const COLORREF SysColors[]
Definition: stockobj.c:16

Referenced by DriverEntry().

◆ GDI_Bezier()

PPOINT GDI_Bezier ( const POINT Points,
INT  count,
PINT  nPtsOut 
)

◆ GreGradientFill()

BOOL NTAPI GreGradientFill ( HDC  hdc,
PTRIVERTEX  pVertex,
ULONG  nVertex,
PVOID  pMesh,
ULONG  nMesh,
ULONG  ulMode 
)

Definition at line 940 of file fillshap.c.

947{
948 PDC pdc;
949 SURFACE *psurf;
950 EXLATEOBJ exlo;
951 RECTL rclExtent;
952 POINTL ptlDitherOrg;
953 ULONG i;
954 BOOL bRet;
955
956 /* Check parameters */
957 if (ulMode & GRADIENT_FILL_TRIANGLE)
958 {
960
961 for (i = 0; i < nMesh; i++, pTriangle++)
962 {
963 if (pTriangle->Vertex1 >= nVertex ||
964 pTriangle->Vertex2 >= nVertex ||
965 pTriangle->Vertex3 >= nVertex)
966 {
968 return FALSE;
969 }
970 }
971 }
972 else
973 {
975 for (i = 0; i < nMesh; i++, pRect++)
976 {
977 if (pRect->UpperLeft >= nVertex || pRect->LowerRight >= nVertex)
978 {
980 return FALSE;
981 }
982 }
983 }
984
985 /* Lock the output DC */
986 pdc = DC_LockDc(hdc);
987 if(!pdc)
988 {
990 return FALSE;
991 }
992
993 if (!pdc->dclevel.pSurface)
994 {
995 /* Memory DC with no surface selected */
996 DC_UnlockDc(pdc);
997 return TRUE; // CHECKME
998 }
999
1000 /* Calculate extent */
1001 rclExtent.left = rclExtent.right = pVertex->x;
1002 rclExtent.top = rclExtent.bottom = pVertex->y;
1003 for (i = 0; i < nVertex; i++)
1004 {
1005 rclExtent.left = min(rclExtent.left, (pVertex + i)->x);
1006 rclExtent.right = max(rclExtent.right, (pVertex + i)->x);
1007 rclExtent.top = min(rclExtent.top, (pVertex + i)->y);
1008 rclExtent.bottom = max(rclExtent.bottom, (pVertex + i)->y);
1009 }
1010 IntLPtoDP(pdc, (LPPOINT)&rclExtent, 2);
1011
1012 rclExtent.left += pdc->ptlDCOrig.x;
1013 rclExtent.right += pdc->ptlDCOrig.x;
1014 rclExtent.top += pdc->ptlDCOrig.y;
1015 rclExtent.bottom += pdc->ptlDCOrig.y;
1016
1017 if (RECTL_bIsEmptyRect(&rclExtent))
1018 {
1019 DC_UnlockDc(pdc);
1020 return TRUE;
1021 }
1022
1023 ptlDitherOrg.x = ptlDitherOrg.y = 0;
1024 IntLPtoDP(pdc, (LPPOINT)&ptlDitherOrg, 1);
1025
1026 ptlDitherOrg.x += pdc->ptlDCOrig.x;
1027 ptlDitherOrg.y += pdc->ptlDCOrig.y;
1028
1029 if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
1030 {
1031 IntUpdateBoundsRect(pdc, &rclExtent);
1032 }
1033
1034 DC_vPrepareDCsForBlit(pdc, &rclExtent, NULL, NULL);
1035
1036 psurf = pdc->dclevel.pSurface;
1037
1038 EXLATEOBJ_vInitialize(&exlo, &gpalRGB, psurf->ppal, 0, 0, 0);
1039
1040 bRet = IntEngGradientFill(&psurf->SurfObj,
1041 (CLIPOBJ *)&pdc->co,
1042 &exlo.xlo,
1043 pVertex,
1044 nVertex,
1045 pMesh,
1046 nMesh,
1047 &rclExtent,
1048 &ptlDitherOrg,
1049 ulMode);
1050
1051 EXLATEOBJ_vCleanup(&exlo);
1052 DC_vFinishBlit(pdc, NULL);
1053 DC_UnlockDc(pdc);
1054
1055 return bRet;
1056}
static BOOLEAN IntLPtoDP(DC *pdc, PPOINTL ppt, UINT count)
Definition: coord.h:182
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:505
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:614
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:238
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:694
@ DC_ACCUM_APP
Definition: dc.h:25
@ DC_ACCUM_WMGR
Definition: dc.h:24
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:220
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
unsigned int BOOL
Definition: ntddk_ex.h:94
HDC hdc
Definition: main.c:9
#define min(a, b)
Definition: monoChain.cc:55
Definition: polytest.cpp:41
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
XLATEOBJ xlo
Definition: xlateobj.h:21
ULONG LowerRight
Definition: wingdi.h:2806
ULONG UpperLeft
Definition: wingdi.h:2805
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
SURFOBJ SurfObj
Definition: surface.h:8
struct _PALETTE *const ppal
Definition: surface.h:11
#define max(a, b)
Definition: svc.c:63
uint32_t ULONG
Definition: typedefs.h:59
BOOL APIENTRY IntEngGradientFill(IN SURFOBJ *psoDest, IN CLIPOBJ *pco, IN XLATEOBJ *pxlo, IN TRIVERTEX *pVertex, IN ULONG nVertex, IN PVOID pMesh, IN ULONG nMesh, IN RECTL *prclExtents, IN POINTL *pptlDitherOrg, IN ULONG ulMode)
Definition: gradient.c:553
PALETTE gpalRGB
Definition: palette.c:20
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
Definition: rect.h:44
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID pMesh
Definition: winddi.h:3653
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG nVertex
Definition: winddi.h:3652
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL _In_ ULONG ulMode
Definition: winddi.h:3657
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX * pVertex
Definition: winddi.h:3651
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG nMesh
Definition: winddi.h:3654
struct _GRADIENT_RECT * PGRADIENT_RECT
struct _GRADIENT_TRIANGLE * PGRADIENT_TRIANGLE
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
Definition: xlateobj.c:358
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649

Referenced by NtGdiGradientFill(), and UserDrawCaption().

◆ GreMoveTo()

BOOL FASTCALL GreMoveTo ( HDC  hdc,
INT  x,
INT  y,
LPPOINT  pptOut 
)

Definition at line 108 of file line.c.

112{
113 BOOL Ret;
114 PDC dc;
115 if (!(dc = DC_LockDc(hdc)))
116 {
118 return FALSE;
119 }
120 Ret = IntGdiMoveToEx(dc, x, y, pptOut);
122 return Ret;
123}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static const WCHAR dc[]
_In_ UINT _Out_ PPOINTL pptOut
Definition: ntgdi.h:2198
BOOL FASTCALL IntGdiMoveToEx(DC *dc, int X, int Y, LPPOINT Point)
Definition: line.c:78

Referenced by IntDrawDiagEdge(), IntDrawMenuBarTemp(), IntDrawRectEdge(), MENU_DrawMenuItem(), NC_DoNCPaint(), TEXT_DrawUnderscore(), and UserDrawCaptionBar().

◆ IntCreateCompatibleBitmap()

HBITMAP FASTCALL IntCreateCompatibleBitmap ( _In_ PDC  Dc,
_In_ INT  Width,
_In_ INT  Height,
_In_ UINT  Bpp,
_In_ UINT  Planes 
)

◆ IntDrawArc()

BOOL FASTCALL IntDrawArc ( PDC  dc,
INT  XLeft,
INT  YLeft,
INT  Width,
INT  Height,
double  StartArc,
double  EndArc,
ARCTYPE  arctype,
PBRUSH  pbrush 
)

Definition at line 1342 of file drawing.c.

1351{
1352 int Start = (int)ceil(StartArc);
1353 int End = (int)ceil(EndArc);
1354 BOOL Chord = (arctype == GdiTypeChord);
1355 // Sort out alignment here.
1356 return app_draw_arc(dc, rect( XLeft, YLeft, Width, Height),
1357 (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -End : -Start,
1358 (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End,
1359 pbrush, Chord);
1360}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen, BOOL Chord)
Definition: drawing.c:962
_Check_return_ _CRTIMP double __cdecl ceil(_In_ double x)
@ GdiTypeChord
Definition: ntgdityp.h:22
@ DCPATH_CLOCKWISE
Definition: path.h:8
& rect
Definition: startmenu.cpp:1413
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
@ Start
Definition: partlist.h:33
BOOL WINAPI Chord(_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom, _In_ INT xRadial1, _In_ INT yRadial1, _In_ INT xRadial2, _In_ INT yRadial2)
Definition: arc.c:119

Referenced by IntArc().

◆ IntDrawEllipse()

BOOL FASTCALL IntDrawEllipse ( PDC  dc,
INT  XLeft,
INT  YLeft,
INT  Width,
INT  Height,
PBRUSH  pbrush 
)

Definition at line 1364 of file drawing.c.

1370{
1371 return (BOOL)app_draw_ellipse(dc, rect( XLeft, YLeft, Width, Height), pbrush);
1372}
static int NTAPI app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
Definition: drawing.c:124

Referenced by NtGdiEllipse().

◆ IntDrawRoundRect()

BOOL FASTCALL IntDrawRoundRect ( PDC  dc,
INT  Left,
INT  Top,
INT  Right,
INT  Bottom,
INT  Wellipse,
INT  Hellipse,
PBRUSH  pbrush 
)

Definition at line 1454 of file drawing.c.

1462{
1463 Rect r;
1464 int rx, ry; /* Radius in x and y directions */
1465 int w = pbrushPen->lWidth;
1466
1467 r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top));
1468 rx = Wellipse/2;
1469 ry = Hellipse/2;
1470
1471 if (Wellipse > r.width)
1472 {
1473 if (Hellipse > r.height) // > W > H
1474 app_draw_ellipse(dc, r, pbrushPen);
1475 else // > W < H
1476 {
1477 app_draw_arc(dc, rect( r.x, r.y, r.width - 1, Hellipse - 1),
1478 0, 180, pbrushPen, FALSE);
1479 app_draw_arc(dc, rect(r.x, Bottom - Hellipse, r.width - 1, Hellipse - 1),
1480 180, 360, pbrushPen, FALSE);
1481 }
1482 }
1483 else if(Hellipse > r.height) // < W > H
1484 {
1485 app_draw_arc(dc, rect(r.x, r.y, Wellipse - 1, r.height - 1),
1486 90, 270, pbrushPen, FALSE);
1487 app_draw_arc(dc, rect(Right - Wellipse, r.y, Wellipse - 1, r.height - 1),
1488 270, 90, pbrushPen, FALSE);
1489 }
1490 else // < W < H
1491 {
1492 app_draw_arc(dc, rect(r.x, r.y, rx+rx, ry+ry),
1493 90, 180, pbrushPen, FALSE);
1494
1495 app_draw_arc(dc, rect(r.x,r.y+r.height-ry-ry,rx+rx,ry+ry),
1496 180, 270, pbrushPen, FALSE);
1497
1498 app_draw_arc(dc, rect(r.x+r.width-rx-rx, r.y+r.height-ry-ry, rx+rx, ry+ry),
1499 270, 360, pbrushPen, FALSE);
1500
1501 app_draw_arc(dc, rect(r.x+r.width-rx-rx,r.y,rx+rx,ry+ry),
1502 0, 90, pbrushPen, FALSE);
1503 }
1504 if ( Hellipse < r.height)
1505 {
1506 app_fill_rect(dc, rect(r.x, r.y+ry+1, w, r.height-ry-ry), pbrushPen, TRUE);
1507
1508
1509 app_fill_rect(dc, rect(r.x+r.width-w, r.y+ry+1, w, r.height-ry-ry),
1510 pbrushPen, TRUE);
1511 }
1512 if ( Wellipse < r.width)
1513 {
1514 app_fill_rect(dc, rect(r.x+rx, r.y+r.height-w, r.width-rx-rx, w),
1515 pbrushPen, TRUE);
1516
1517 app_fill_rect(dc, rect(r.x+rx, r.y, r.width-rx-rx, w), pbrushPen, TRUE);
1518 }
1519 return TRUE;
1520}
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53
#define app_fill_rect(dc, r, BrushObj, Pen)
Definition: drawing.c:107
#define abs(i)
Definition: fconv.c:206
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102

Referenced by IntRoundRect().

◆ IntFillArc()

BOOL FASTCALL IntFillArc ( PDC  dc,
INT  XLeft,
INT  YLeft,
INT  Width,
INT  Height,
double  StartArc,
double  EndArc,
ARCTYPE  arctype 
)

Definition at line 1306 of file drawing.c.

1314{
1315 PDC_ATTR pdcattr;
1316 PBRUSH pbrush;
1317 int Start = (int)ceil(StartArc);
1318 int End = (int)ceil(EndArc);
1319 BOOL Chord = (arctype == GdiTypeChord), ret;
1320
1321 pdcattr = dc->pdcattr;
1322
1323 pbrush = BRUSH_ShareLockBrush(pdcattr->hbrush);
1324 if (!pbrush)
1325 {
1326 DPRINT1("FillArc Fail\n");
1328 return FALSE;
1329 }
1330 // Sort out alignment here.
1331 ret = app_fill_arc(dc, rect( XLeft, YLeft, Width, Height),
1332 (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -End : -Start,
1333 (dc->dclevel.flPath & DCPATH_CLOCKWISE) ? -Start : -End,
1334 pbrush, Chord);
1335
1336 BRUSH_ShareUnlockBrush(pbrush);
1337 return ret;
1338}
#define DPRINT1
Definition: precomp.h:8
int FASTCALL app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL Chord)
Definition: drawing.c:785
#define BRUSH_ShareLockBrush(hBrush)
Definition: brush.h:117
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:118
Definition: types.h:101
HANDLE hbrush
Definition: ntgdihdl.h:295
int ret
#define ERROR_INTERNAL_ERROR
Definition: winerror.h:840

Referenced by IntArc().

◆ IntFillEllipse()

BOOL FASTCALL IntFillEllipse ( PDC  dc,
INT  XLeft,
INT  YLeft,
INT  Width,
INT  Height,
PBRUSH  pbrush 
)

Definition at line 1376 of file drawing.c.

1382{
1383 return (BOOL)app_fill_ellipse(dc, rect( XLeft, YLeft, Width, Height), pbrush);
1384}
static int FASTCALL app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush)
Definition: drawing.c:617

Referenced by NtGdiEllipse().

◆ IntFillRoundRect()

BOOL FASTCALL IntFillRoundRect ( PDC  dc,
INT  Left,
INT  Top,
INT  Right,
INT  Bottom,
INT  Wellipse,
INT  Hellipse,
PBRUSH  pbrush 
)

Definition at line 1388 of file drawing.c.

1396{
1397 Rect r;
1398 int rx, ry; /* Radius in x and y directions */
1399
1400 // x y Width Height
1401 r = rect( Left, Top, abs(Right-Left), abs(Bottom-Top));
1402 rx = Wellipse/2;
1403 ry = Hellipse/2;
1404
1405 if (Wellipse > r.width)
1406 {
1407 if (Hellipse > r.height) // > W > H
1408 app_fill_ellipse(dc, r, pbrush);
1409 else // > W < H
1410 {
1411 app_fill_arc(dc, rect( r.x, r.y, r.width - 1, Hellipse),
1412 0, 180, pbrush,FALSE);
1413 app_fill_arc(dc, rect(r.x, Bottom - Hellipse - 1, r.width - 1, Hellipse),
1414 180, 360, pbrush, FALSE);
1415 }
1416 }
1417 else if(Hellipse > r.height) // < W > H
1418 {
1419 app_fill_arc(dc, rect(r.x, r.y, Wellipse, r.height - 1),
1420 90, 270, pbrush, FALSE);
1421 app_fill_arc(dc, rect(Right - Wellipse - 1, r.y, Wellipse, r.height - 1),
1422 270, 90, pbrush,FALSE);
1423 }
1424 else // < W < H
1425 {
1426 app_fill_arc(dc, rect(r.x, r.y, rx+rx, ry+ry),
1427 90, 180, pbrush, FALSE);
1428
1429 app_fill_arc(dc, rect(r.x, r.y+r.height-ry-ry, rx+rx, ry+ry),
1430 180, 270, pbrush, FALSE);
1431
1432 app_fill_arc(dc, rect(r.x+r.width-rx-rx, r.y+r.height-ry-ry, rx+rx, ry+ry),
1433 270, 360, pbrush,FALSE);
1434
1435 app_fill_arc(dc, rect(r.x+r.width-rx-rx, r.y, rx+rx, ry+ry),
1436 0, 90, pbrush,FALSE);
1437 }
1438 if (Wellipse < r.width)
1439 {
1440 app_fill_rect(dc, rect(r.x+rx, r.y, r.width-rx-rx, ry+1), pbrush, FALSE);
1441 app_fill_rect(dc, rect(r.x+rx, r.y+r.height-ry+1, r.width-rx-rx, ry-1), pbrush, FALSE);
1442 }
1443 if (Hellipse < r.height)
1444 {
1445 app_fill_rect(dc, rect(r.x, r.y+ry+1, r.width, r.height-ry-ry), pbrush, FALSE);
1446 }
1447
1448 return TRUE;
1449}

Referenced by IntRoundRect().

◆ IntGdiCreateDC()

HDC FASTCALL IntGdiCreateDC ( PUNICODE_STRING  Driver,
PUNICODE_STRING  Device,
PVOID  pUMdhpdev,
CONST PDEVMODEW  InitData,
BOOL  CreateAsIC 
)

Definition at line 1040 of file dclife.c.

1046{
1047 HDC hdc;
1048
1049 hdc = GreOpenDCW(pustrDevice,
1050 pdmInit,
1051 NULL,
1052 CreateAsIC ? DCTYPE_INFO :
1054 TRUE,
1055 NULL,
1056 NULL,
1057 pUMdhpdev);
1058
1059 return hdc;
1060}
@ DCTYPE_DIRECT
Definition: dc.h:41
@ DCTYPE_INFO
Definition: dc.h:43
HDC NTAPI GreOpenDCW(PUNICODE_STRING pustrDevice, DEVMODEW *pdmInit, PUNICODE_STRING pustrLogAddr, ULONG iType, BOOL bDisplay, HANDLE hspool, VOID *pDriverInfo2, PVOID *pUMdhpdev)
Definition: dclife.c:640
static HDC
Definition: imagelist.c:92
_Must_inspect_result_ _In_ WDFDRIVER Driver
Definition: wdfcontrol.h:83

Referenced by co_IntInitializeDesktopGraphics(), DceCreateDisplayDC(), EngpRegisterGraphicsDevice(), IntGdiCreateDisplayDC(), and UserLoadImage().

◆ IntGdiLineTo()

BOOL FASTCALL IntGdiLineTo ( DC dc,
int  XEnd,
int  YEnd 
)

Definition at line 146 of file line.c.

149{
150 SURFACE *psurf;
151 BOOL Ret = TRUE;
152 PBRUSH pbrLine;
153 RECTL Bounds;
154 POINT Points[2];
155 PDC_ATTR pdcattr;
156 PPATH pPath;
157
159
160 pdcattr = dc->pdcattr;
161
162 if (PATH_IsPathOpen(dc->dclevel))
163 {
164 Ret = PATH_LineTo(dc, XEnd, YEnd);
165 }
166 else
167 {
168 psurf = dc->dclevel.pSurface;
169 if (NULL == psurf)
170 {
172 return FALSE;
173 }
174
175 Points[0].x = pdcattr->ptlCurrent.x;
176 Points[0].y = pdcattr->ptlCurrent.y;
177 Points[1].x = XEnd;
178 Points[1].y = YEnd;
179
180 IntLPtoDP(dc, Points, 2);
181
182 /* The DCOrg is in device coordinates */
183 Points[0].x += dc->ptlDCOrig.x;
184 Points[0].y += dc->ptlDCOrig.y;
185 Points[1].x += dc->ptlDCOrig.x;
186 Points[1].y += dc->ptlDCOrig.y;
187
188 Bounds.left = min(Points[0].x, Points[1].x);
189 Bounds.top = min(Points[0].y, Points[1].y);
190 Bounds.right = max(Points[0].x, Points[1].x);
191 Bounds.bottom = max(Points[0].y, Points[1].y);
192
193 /* Get BRUSH from current pen. */
194 pbrLine = dc->dclevel.pbrLine;
195 ASSERT(pbrLine);
196
197 if (dc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
198 {
199 DPRINT("Bounds dc %p l %d t %d\n",dc,Bounds.left,Bounds.top);
200 DPRINT(" r %d b %d\n",Bounds.right,Bounds.bottom);
201 AddPenLinesBounds(dc, 2, Points);
202 }
203
204 if (!(pbrLine->flAttrs & BR_IS_NULL))
205 {
206 if (IntIsEffectiveWidePen(pbrLine))
207 {
208 /* Clear the path */
209 PATH_Delete(dc->dclevel.hPath);
210 dc->dclevel.hPath = NULL;
211
212 /* Begin a path */
213 pPath = PATH_CreatePath(2);
214 dc->dclevel.flPath |= DCPATH_ACTIVE;
215 dc->dclevel.hPath = pPath->BaseObject.hHmgr;
217 IntLPtoDP(dc, &pPath->pos, 1);
218
219 PATH_MoveTo(dc, pPath);
220 PATH_LineTo(dc, XEnd, YEnd);
221
222 /* Close the path */
223 pPath->state = PATH_Closed;
224 dc->dclevel.flPath &= ~DCPATH_ACTIVE;
225
226 /* Actually stroke a path */
227 Ret = PATH_StrokePath(dc, pPath);
228
229 /* Clear the path */
230 PATH_UnlockPath(pPath);
231 PATH_Delete(dc->dclevel.hPath);
232 dc->dclevel.hPath = NULL;
233 }
234 else
235 {
236 Ret = IntEngLineTo(&psurf->SurfObj,
237 (CLIPOBJ *)&dc->co,
238 &dc->eboLine.BrushObject,
239 Points[0].x, Points[0].y,
240 Points[1].x, Points[1].y,
241 &Bounds,
242 ROP2_TO_MIX(pdcattr->jROP2));
243 }
244 }
245 }
246
247 if (Ret)
248 {
249 pdcattr->ptlCurrent.x = XEnd;
250 pdcattr->ptlCurrent.y = YEnd;
251 pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
252 CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
254 }
255
256 return Ret;
257}
#define CoordLPtoDP(pdc, ppt)
Definition: coord.h:187
#define ASSERT_DC_PREPARED(pdc)
Definition: dc.h:300
#define BR_IS_NULL
Definition: brush.h:105
#define ROP2_TO_MIX(Rop2)
Definition: inteng.h:40
#define ASSERT(a)
Definition: mode.c:44
#define DIRTY_PTLCURRENT
Definition: ntgdihdl.h:131
#define DIRTY_STYLESTATE
Definition: ntgdihdl.h:133
#define DIRTY_PTFXCURRENT
Definition: ntgdihdl.h:132
#define PATH_UnlockPath(pPath)
Definition: path.h:71
#define PATH_IsPathOpen(dclevel)
Definition: path.h:72
@ PATH_Closed
Definition: path.h:20
@ DCPATH_ACTIVE
Definition: path.h:6
#define IntIsEffectiveWidePen(pbrLine)
Definition: pen.h:33
void IntEngLineTo(SURFOBJ *, CLIPOBJ, PBRUSHOBJ, int x1, int y1, int x2, int y2, RECTL *, MIX mix)
Definition: polytest.cpp:107
POINTL ptlCurrent
Definition: ntgdihdl.h:311
ULONG ulDirty_
Definition: ntgdihdl.h:294
POINTL ptfxCurrent
Definition: ntgdihdl.h:312
BYTE jROP2
Definition: ntgdihdl.h:307
Definition: path.h:35
POINT pos
Definition: path.h:58
BASEOBJECT BaseObject
Definition: path.h:36
FLONG state
Definition: path.h:52
long y
Definition: polytest.cpp:48
VOID FASTCALL IntGetCurrentPositionEx(PDC dc, LPPOINT pt)
Definition: line.c:128
VOID FASTCALL AddPenLinesBounds(PDC dc, int count, POINT *points)
Definition: line.c:17
BOOL FASTCALL PATH_Delete(HPATH hPath)
Definition: path.c:90
BOOL FASTCALL PATH_LineTo(PDC dc, INT x, INT y)
Definition: path.c:583
BOOL FASTCALL PATH_StrokePath(DC *dc, PPATH pPath)
Definition: path.c:1597
PPATH FASTCALL PATH_CreatePath(int count)
Definition: path.c:35
BOOL FASTCALL PATH_MoveTo(PDC dc, PPATH pPath)
Definition: path.c:554

Referenced by IntGdiArcInternal(), and NtGdiLineTo().

◆ IntGdiMoveToEx()

BOOL FASTCALL IntGdiMoveToEx ( DC dc,
int  X,
int  Y,
LPPOINT  Point 
)

Definition at line 78 of file line.c.

82{
83 PDC_ATTR pdcattr = dc->pdcattr;
84 if ( Point )
85 {
86 if ( pdcattr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit!
87 {
88 Point->x = pdcattr->ptfxCurrent.x; // ret prev before change.
89 Point->y = pdcattr->ptfxCurrent.y;
90 IntDPtoLP ( dc, Point, 1); // Reconvert back.
91 }
92 else
93 {
94 Point->x = pdcattr->ptlCurrent.x;
95 Point->y = pdcattr->ptlCurrent.y;
96 }
97 }
98 pdcattr->ptlCurrent.x = X;
99 pdcattr->ptlCurrent.y = Y;
100 pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
101 CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
103
104 return TRUE;
105}
static BOOLEAN IntDPtoLP(DC *pdc, PPOINTL ppt, UINT count)
Definition: coord.h:192
#define Y(I)
#define X(b, s)

Referenced by _Success_(), add_log_points_new_stroke(), GreMoveTo(), IntGdiAngleArc(), IntGdiArcInternal(), NtGdiPolyDraw(), PATH_PolyDraw(), and PATH_StrokePath().

◆ IntGdiPolyBezier()

BOOL FASTCALL IntGdiPolyBezier ( DC dc,
LPPOINT  pt,
DWORD  Count 
)

Definition at line 260 of file line.c.

263{
264 BOOL ret = FALSE; // Default to FAILURE
265
266 if ( PATH_IsPathOpen(dc->dclevel) )
267 {
268 return PATH_PolyBezier ( dc, pt, Count );
269 }
270
271 /* We'll convert it into line segments and draw them using Polyline */
272 {
273 POINT *Pts;
274 INT nOut;
275
276 Pts = GDI_Bezier ( pt, Count, &nOut );
277 if ( Pts )
278 {
279 ret = IntGdiPolyline(dc, Pts, nOut);
281 }
282 }
283
284 return ret;
285}
POINT * GDI_Bezier(const POINT *Points, INT count, INT *nPtsOut)
Definition: bezier.c:189
#define pt(x, y)
Definition: drawing.c:79
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
int Count
Definition: noreturn.cpp:7
int32_t INT
Definition: typedefs.h:58
BOOL FASTCALL IntGdiPolyline(DC *dc, LPPOINT pt, int Count)
Definition: line.c:325
BOOL FASTCALL PATH_PolyBezier(PDC dc, const POINT *pts, DWORD cbPoints)
Definition: path.c:1154
#define TAG_BEZIER
Definition: tags.h:13

Referenced by IntGdiPolyBezierTo(), and NtGdiPolyPolyDraw().

◆ IntGdiPolyBezierTo()

BOOL FASTCALL IntGdiPolyBezierTo ( DC dc,
LPPOINT  pt,
DWORD  Count 
)

Definition at line 288 of file line.c.

291{
292 BOOL ret = FALSE; // Default to failure
293 PDC_ATTR pdcattr = dc->pdcattr;
294
295 if ( PATH_IsPathOpen(dc->dclevel) )
297 else /* We'll do it using PolyBezier */
298 {
299 POINT *npt;
301 sizeof(POINT) * (Count + 1),
302 TAG_BEZIER);
303 if ( npt )
304 {
305 npt[0].x = pdcattr->ptlCurrent.x;
306 npt[0].y = pdcattr->ptlCurrent.y;
307 memcpy(npt + 1, pt, sizeof(POINT) * Count);
308 ret = IntGdiPolyBezier(dc, npt, Count+1);
310 }
311 }
312 if ( ret )
313 {
314 pdcattr->ptlCurrent.x = pt[Count-1].x;
315 pdcattr->ptlCurrent.y = pt[Count-1].y;
316 pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
317 CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
319 }
320
321 return ret;
322}
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
BOOL FASTCALL IntGdiPolyBezier(DC *dc, LPPOINT pt, DWORD Count)
Definition: line.c:260
BOOL FASTCALL PATH_PolyBezierTo(PDC dc, const POINT *pts, DWORD cbPoints)
Definition: path.c:1131

Referenced by NtGdiPolyPolyDraw().

◆ IntGdiPolyline()

BOOL FASTCALL IntGdiPolyline ( DC dc,
LPPOINT  pt,
int  Count 
)

Definition at line 325 of file line.c.

328{
329 SURFACE *psurf;
330 BRUSH *pbrLine;
331 LPPOINT Points;
332 BOOL Ret = TRUE;
333 LONG i;
334 PDC_ATTR pdcattr = dc->pdcattr;
335 PPATH pPath;
336
337 if (!dc->dclevel.pSurface)
338 {
339 return TRUE;
340 }
341
343 psurf = dc->dclevel.pSurface;
344
345 /* Get BRUSHOBJ from current pen. */
346 pbrLine = dc->dclevel.pbrLine;
347 ASSERT(pbrLine);
348
349 if (!(pbrLine->flAttrs & BR_IS_NULL))
350 {
351 Points = EngAllocMem(0, Count * sizeof(POINT), GDITAG_TEMP);
352 if (Points != NULL)
353 {
354 RtlCopyMemory(Points, pt, Count * sizeof(POINT));
355 IntLPtoDP(dc, Points, Count);
356
357 /* Offset the array of points by the DC origin */
358 for (i = 0; i < Count; i++)
359 {
360 Points[i].x += dc->ptlDCOrig.x;
361 Points[i].y += dc->ptlDCOrig.y;
362 }
363
364 if (dc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
365 {
366 AddPenLinesBounds(dc, Count, Points);
367 }
368
369 if (IntIsEffectiveWidePen(pbrLine))
370 {
371 /* Clear the path */
372 PATH_Delete(dc->dclevel.hPath);
373 dc->dclevel.hPath = NULL;
374
375 /* Begin a path */
376 pPath = PATH_CreatePath(Count);
377 dc->dclevel.flPath |= DCPATH_ACTIVE;
378 dc->dclevel.hPath = pPath->BaseObject.hHmgr;
379 pPath->pos = pt[0];
380 IntLPtoDP(dc, &pPath->pos, 1);
381
382 PATH_MoveTo(dc, pPath);
383 for (i = 1; i < Count; ++i)
384 {
385 PATH_LineTo(dc, pt[i].x, pt[i].y);
386 }
387
388 /* Close the path */
389 pPath->state = PATH_Closed;
390 dc->dclevel.flPath &= ~DCPATH_ACTIVE;
391
392 /* Actually stroke a path */
393 Ret = PATH_StrokePath(dc, pPath);
394
395 /* Clear the path */
396 PATH_UnlockPath(pPath);
397 PATH_Delete(dc->dclevel.hPath);
398 dc->dclevel.hPath = NULL;
399 }
400 else
401 {
402 Ret = IntEngPolyline(&psurf->SurfObj,
403 (CLIPOBJ *)&dc->co,
404 &dc->eboLine.BrushObject,
405 Points,
406 Count,
407 ROP2_TO_MIX(pdcattr->jROP2));
408 }
409 EngFreeMem(Points);
410 }
411 else
412 {
413 Ret = FALSE;
414 }
415 }
416
418
419 return Ret;
420}
Definition: brush.hpp:16
BOOL APIENTRY IntEngPolyline(SURFOBJ *DestSurf, CLIPOBJ *Clip, BRUSHOBJ *Brush, CONST LPPOINT pt, LONG dCount, MIX mix)
Definition: lineto.c:703
long LONG
Definition: pedump.c:60
#define EngFreeMem
Definition: polytest.cpp:56
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
ULONG flAttrs
Definition: brush.h:19
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define GDITAG_TEMP
Definition: tags.h:167

Referenced by IntGdiPolyBezier(), IntGdiPolylineTo(), IntGdiPolyPolyline(), NtGdiPolyDraw(), and PATH_StrokePath().

◆ IntGdiPolylineTo()

BOOL FASTCALL IntGdiPolylineTo ( DC dc,
LPPOINT  pt,
DWORD  Count 
)

Definition at line 423 of file line.c.

426{
427 BOOL ret = FALSE; // Default to failure
428 PDC_ATTR pdcattr = dc->pdcattr;
429
430 if (PATH_IsPathOpen(dc->dclevel))
431 {
433 }
434 else /* Do it using Polyline */
435 {
437 sizeof(POINT) * (Count + 1),
438 TAG_SHAPE);
439 if ( pts )
440 {
441 pts[0].x = pdcattr->ptlCurrent.x;
442 pts[0].y = pdcattr->ptlCurrent.y;
443 memcpy( pts + 1, pt, sizeof(POINT) * Count);
444 ret = IntGdiPolyline(dc, pts, Count + 1);
446 }
447 }
448 if ( ret )
449 {
450 pdcattr->ptlCurrent.x = pt[Count-1].x;
451 pdcattr->ptlCurrent.y = pt[Count-1].y;
452 pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
453 CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
455 }
456
457 return ret;
458}
BOOL FASTCALL PATH_PolylineTo(PDC dc, const POINT *pts, DWORD cbPoints)
Definition: path.c:1264
#define TAG_SHAPE
Definition: tags.h:14

Referenced by NtGdiPolyPolyDraw().

◆ IntGdiPolyPolyline()

BOOL FASTCALL IntGdiPolyPolyline ( DC dc,
LPPOINT  pt,
PULONG  PolyPoints,
DWORD  Count 
)

Definition at line 462 of file line.c.

466{
467 ULONG i;
468 LPPOINT pts;
469 PULONG pc;
470 BOOL ret = FALSE; // Default to failure
471 pts = pt;
472 pc = PolyPoints;
473
474 if (PATH_IsPathOpen(dc->dclevel))
475 {
476 return PATH_PolyPolyline( dc, pt, PolyPoints, Count );
477 }
478 for (i = 0; i < Count; i++)
479 {
480 ret = IntGdiPolyline ( dc, pts, *pc );
481 if (ret == FALSE)
482 {
483 return ret;
484 }
485 pts+=*pc++;
486 }
487
488 return ret;
489}
uint32_t * PULONG
Definition: typedefs.h:59
BOOL FASTCALL PATH_PolyPolyline(PDC dc, const POINT *pts, const DWORD *counts, DWORD polylines)
Definition: path.c:1338

Referenced by NtGdiPolyPolyDraw().

◆ IntGdiSetHookFlags()

WORD APIENTRY IntGdiSetHookFlags ( HDC  hDC,
WORD  Flags 
)

Definition at line 422 of file dcutil.c.

423{
424 WORD wRet;
425 DC *dc = DC_LockDc(hDC);
426
427 if (NULL == dc)
428 {
430 return 0;
431 }
432
433 wRet = dc->fs & DC_DIRTY_RAO; // FIXME: Wrong flag!
434
435 /* Info in "Undocumented Windows" is slightly confusing. */
436 DPRINT("DC %p, Flags %04x\n", hDC, Flags);
437
439 {
440 /* hVisRgn has to be updated */
441 dc->fs |= DC_DIRTY_RAO;
442 }
443 else if (Flags & DCHF_VALIDATEVISRGN || 0 == Flags)
444 {
445 //dc->fs &= ~DC_DIRTY_RAO;
446 }
447
449
450 return wRet;
451}
static HDC hDC
Definition: 3dtext.c:33
@ DC_DIRTY_RAO
Definition: dc.h:23
unsigned short WORD
Definition: ntddk_ex.h:93
#define DCHF_INVALIDATEVISRGN
Definition: gdi_driver.h:267
#define DCHF_VALIDATEVISRGN
Definition: gdi_driver.h:268
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by DceDeleteClipRgn(), DceResetActiveDCEs(), and UserGetDCEx().

◆ IntGetDIBColorTable()

UINT APIENTRY IntGetDIBColorTable ( HDC  hDC,
UINT  StartIndex,
UINT  Entries,
RGBQUAD Colors 
)

◆ IntGetPaletteEntries()

UINT APIENTRY IntGetPaletteEntries ( HPALETTE  hpal,
UINT  StartIndex,
UINT  Entries,
LPPALETTEENTRY  pe 
)

Definition at line 850 of file palette.c.

855{
856 PPALETTE palGDI;
857 UINT numEntries;
858
859 palGDI = (PPALETTE) PALETTE_ShareLockPalette(hpal);
860 if (NULL == palGDI)
861 {
862 return 0;
863 }
864
865 numEntries = palGDI->NumColors;
866 if (NULL != pe)
867 {
868 if (numEntries < StartIndex + Entries)
869 {
870 Entries = numEntries - StartIndex;
871 }
872 if (numEntries <= StartIndex)
873 {
875 return 0;
876 }
877 memcpy(pe, palGDI->IndexedColors + StartIndex, Entries * sizeof(PALETTEENTRY));
878 }
879 else
880 {
881 Entries = numEntries;
882 }
883
885 return Entries;
886}
static const ENTRY Entries[]
ULONG NumColors
Definition: palette.h:41
PALETTEENTRY * IndexedColors
Definition: palette.h:42
struct _PALETTE * PPALETTE
#define PALETTE_ShareLockPalette(hpal)
Definition: palette.h:57
#define PALETTE_ShareUnlockPalette(ppal)
Definition: palette.h:59

Referenced by NtGdiDoPalette().

◆ IntGetSysColor()

◆ IntGetSysColorBrush()

◆ IntGetSystemPaletteEntries()

UINT APIENTRY IntGetSystemPaletteEntries ( HDC  hDC,
UINT  StartIndex,
UINT  Entries,
LPPALETTEENTRY  pe 
)

Definition at line 889 of file palette.c.

893{
894 PPALETTE palGDI = NULL;
895 PDC dc = NULL;
896 UINT EntriesSize = 0;
897 UINT Ret = 0;
898
899 if (Entries == 0)
900 {
902 return 0;
903 }
904
905 if (pe != NULL)
906 {
907 EntriesSize = Entries * sizeof(pe[0]);
908 if (Entries != EntriesSize / sizeof(pe[0]))
909 {
910 /* Integer overflow! */
912 return 0;
913 }
914 }
915
916 if (!(dc = DC_LockDc(hDC)))
917 {
919 return 0;
920 }
921
922 palGDI = PALETTE_ShareLockPalette(dc->dclevel.hpal);
923 if (palGDI != NULL)
924 {
925 if (pe != NULL)
926 {
927 if (StartIndex >= palGDI->NumColors)
928 Entries = 0;
929 else if (Entries > palGDI->NumColors - StartIndex)
930 Entries = palGDI->NumColors - StartIndex;
931
932 memcpy(pe,
933 palGDI->IndexedColors + StartIndex,
934 Entries * sizeof(pe[0]));
935
936 Ret = Entries;
937 }
938 else
939 {
940 Ret = dc->ppdev->gdiinfo.ulNumPalReg;
941 }
942 }
943
944 if (palGDI != NULL)
946
947 if (dc != NULL)
949
950 return Ret;
951}

Referenced by NtGdiDoPalette().

◆ IntSetDIBColorTable()

UINT APIENTRY IntSetDIBColorTable ( HDC  hDC,
UINT  StartIndex,
UINT  Entries,
CONST RGBQUAD Colors 
)

◆ IntSetSysColors()

VOID FASTCALL IntSetSysColors ( UINT  nColors,
CONST INT Elements,
CONST COLORREF Colors 
)

Definition at line 300 of file stockobj.c.

301{
302 UINT i;
303
304 for (i = 0; i < nColors; i++)
305 {
306 if ((UINT)(*Elements) < NUM_SYSCOLORS)
307 {
308 gpsi->argbSystem[*Elements] = *Colors;
309 IntGdiSetSolidBrushColor(gpsi->ahbrSystem[*Elements], *Colors);
310 }
311 Elements++;
312 Colors++;
313 }
314}
Colors
Definition: ansiprsr.h:4
VOID NTAPI IntGdiSetSolidBrushColor(_In_ HBRUSH hbr, _In_ COLORREF crColor)
Definition: brush.cpp:317

Referenced by NtUserSetSysColors().

◆ NtDxEngGetRedirectionBitmap()

DWORD APIENTRY NtDxEngGetRedirectionBitmap ( DWORD  Unknown0)

Definition at line 983 of file ntstubs.c.

985{
986 STUB;
987 return 0;
988}
#define STUB
Definition: kernel32.h:27

◆ NtGdiFlushUserBatch()

NTSTATUS APIENTRY NtGdiFlushUserBatch ( VOID  )

Definition at line 487 of file gdibatch.c.

488{
489 PTEB pTeb = NtCurrentTeb();
490 ULONG GdiBatchCount = pTeb->GdiBatchCount;
491
492 if( (GdiBatchCount > 0) && (GdiBatchCount <= (GDIBATCHBUFSIZE/4)))
493 {
494 HDC hDC = (HDC) pTeb->GdiTebBatch.HDC;
495
496 /* If hDC is zero and the buffer fills up with delete objects we need
497 to run anyway.
498 */
499 if (hDC || GdiBatchCount)
500 {
501 PCHAR pHdr = (PCHAR)&pTeb->GdiTebBatch.Buffer[0];
502 PDC pDC = NULL;
503
505 {
506 pDC = DC_LockDc(hDC);
507 }
508
509 // No need to init anything, just go!
510 for (; GdiBatchCount > 0; GdiBatchCount--)
511 {
512 ULONG Size;
513 // Process Gdi Batch!
514 Size = GdiFlushUserBatch(pDC, (PGDIBATCHHDR) pHdr);
515 if (!Size) break;
516 pHdr += Size;
517 }
518
519 if (pDC)
520 {
521 DC_UnlockDc(pDC);
522 }
523
524 // Exit and clear out for the next round.
525 pTeb->GdiTebBatch.Offset = 0;
526 pTeb->GdiBatchCount = 0;
527 pTeb->GdiTebBatch.HDC = 0;
528 }
529 }
530
531 // FIXME: On Windows XP the function returns &pTeb->RealClientId, maybe VOID?
532 return STATUS_SUCCESS;
533}
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
@ GDILoObjType_LO_DC_TYPE
Definition: gdi_private.h:34
ULONG FASTCALL GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
Definition: gdibatch.c:70
#define NtCurrentTeb
if(dx< 0)
Definition: linetemp.h:194
#define PCHAR
Definition: match.c:90
#define GDIBATCHBUFSIZE
Definition: ntgdityp.h:200
#define STATUS_SUCCESS
Definition: shellext.h:65
ULONG Buffer[GDI_BATCH_BUFFER_SIZE]
Definition: compat.h:833
HANDLE HDC
Definition: compat.h:832
ULONG Offset
Definition: compat.h:831
Definition: compat.h:836
GDI_TEB_BATCH GdiTebBatch
Definition: compat.h:857
ULONG GdiBatchCount
Definition: compat.h:887
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
Definition: gdiobj.c:1146

Referenced by DriverEntry().

Variable Documentation

◆ hsemDriverMgmt

HSEMAPHORE hsemDriverMgmt
extern

◆ hSystemBM

HDC hSystemBM
extern