ReactOS  0.4.11-dev-721-g95bc44e
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

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

Definition at line 10 of file intgdi.h.

Referenced by IntGdiFillRgn().

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

Definition at line 4 of file intgdi.h.

Referenced by IntPatBlt(), and NtGdiStretchDIBitsInternal().

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

Definition at line 5 of file intgdi.h.

Referenced by GreStretchBltMask(), and NtGdiMaskBlt().

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

Definition at line 7 of file intgdi.h.

Referenced by NtGdiPatBlt().

Function Documentation

VOID FASTCALL CreateStockObjects ( void  )

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

Definition at line 247 of file stockobj.c.

Referenced by DriverEntry().

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 
275  for (Object = 0; Object < NB_STOCK_OBJECTS; Object++)
276  {
277  if (NULL != StockObjects[Object])
278  {
280  }
281  }
282 
283  DPRINT("Completed creation of stock objects\n");
284 }
static LOGPEN BlackPen
Definition: stockobj.c:59
HBRUSH APIENTRY IntGdiCreateSolidBrush(COLORREF crColor)
Definition: brush.cpp:279
#define NB_STOCK_OBJECTS
Definition: ntgdityp.h:189
long x
Definition: polytest.cpp:48
#define WHITE_PEN
Definition: wingdi.h:903
#define NULL_BRUSH
Definition: wingdi.h:899
POINT lopnWidth
Definition: wingdi.h:1823
#define WHITE_BRUSH
Definition: wingdi.h:900
static VOID FASTCALL CreateStockFonts(void)
Definition: stockobj.c:145
HGDIOBJ StockObjects[NB_STOCK_OBJECTS]
Definition: stockobj.c:100
PALETTE * gppalDefault
Definition: palette.c:17
static LOGPEN NullPen
Definition: stockobj.c:62
BOOL NTAPI GDIOBJ_ConvertToStockObj(HGDIOBJ *phObj)
Definition: gdiobj.c:1450
UINT lopnStyle
Definition: wingdi.h:1822
#define NULL_PEN
Definition: wingdi.h:902
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
COLORREF lopnColor
Definition: wingdi.h:1824
smooth NULL
Definition: ftsmooth.c:416
#define LTGRAY_BRUSH
Definition: wingdi.h:898
void DPRINT(...)
Definition: polytest.cpp:61
#define GRAY_BRUSH
Definition: wingdi.h:896
#define DEFAULT_BITMAP
Definition: ntgdityp.h:192
#define BLACK_BRUSH
Definition: wingdi.h:894
#define DEFAULT_PALETTE
Definition: wingdi.h:911
static HPEN FASTCALL IntCreateStockPen(DWORD dwPenStyle, DWORD dwWidth, ULONG ulBrushStyle, ULONG ulColor)
Definition: stockobj.c:105
#define RGB(r, g, b)
Definition: wingdi.h:2917
#define for
Definition: utility.h:88
static IUnknown Object
Definition: main.c:512
static LOGPEN WhitePen
Definition: stockobj.c:56
#define DKGRAY_BRUSH
Definition: wingdi.h:895
BASEOBJECT BaseObject
Definition: palette.h:36
void * HGDIOBJ
Definition: windef.h:257
#define BLACK_PEN
Definition: wingdi.h:901
unsigned int UINT
Definition: ndis.h:50
#define BS_SOLID
Definition: wingdi.h:1067
HBRUSH NTAPI IntGdiCreateNullBrush(VOID)
Definition: brush.cpp:270
HBITMAP NTAPI GreCreateBitmap(_In_ ULONG nWidth, _In_ ULONG nHeight, _In_ ULONG cPlanes, _In_ ULONG cBitsPixel, _In_opt_ PVOID pvBits)
Definition: bitmaps.c:158
VOID FASTCALL CreateSysColorObjects ( VOID  )

Definition at line 329 of file stockobj.c.

Referenced by DriverEntry().

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 }
HBRUSH APIENTRY IntGdiCreateSolidBrush(COLORREF crColor)
Definition: brush.cpp:279
PSERVERINFO gpsi
Definition: main.c:27
GLenum GLclampf GLint i
Definition: glfuncs.h:14
BOOL NTAPI GDIOBJ_ConvertToStockObj(HGDIOBJ *phObj)
Definition: gdiobj.c:1450
smooth NULL
Definition: ftsmooth.c:416
static const COLORREF SysColors[]
Definition: stockobj.c:16
#define NUM_SYSCOLORS
Definition: SetSysColors.c:10
unsigned int UINT
Definition: ndis.h:50
PPOINT GDI_Bezier ( const POINT Points,
INT  count,
PINT  nPtsOut 
)
BOOL NTAPI GreGradientFill ( HDC  hdc,
PTRIVERTEX  pVertex,
ULONG  nVertex,
PVOID  pMesh,
ULONG  nMesh,
ULONG  ulMode 
)

Definition at line 871 of file fillshap.c.

Referenced by NtGdiGradientFill(), and UserDrawCaption().

878 {
879  PDC pdc;
880  SURFACE *psurf;
881  EXLATEOBJ exlo;
882  RECTL rclExtent;
883  POINTL ptlDitherOrg;
884  ULONG i;
885  BOOL bRet;
886 
887  /* Check parameters */
888  if (ulMode & GRADIENT_FILL_TRIANGLE)
889  {
891 
892  for (i = 0; i < nMesh; i++, pTriangle++)
893  {
894  if (pTriangle->Vertex1 >= nVertex ||
895  pTriangle->Vertex2 >= nVertex ||
896  pTriangle->Vertex3 >= nVertex)
897  {
899  return FALSE;
900  }
901  }
902  }
903  else
904  {
906  for (i = 0; i < nMesh; i++, pRect++)
907  {
908  if (pRect->UpperLeft >= nVertex || pRect->LowerRight >= nVertex)
909  {
911  return FALSE;
912  }
913  }
914  }
915 
916  /* Lock the output DC */
917  pdc = DC_LockDc(hdc);
918  if(!pdc)
919  {
921  return FALSE;
922  }
923 
924  if (!pdc->dclevel.pSurface)
925  {
926  /* Memory DC with no surface selected */
927  DC_UnlockDc(pdc);
928  return TRUE; // CHECKME
929  }
930 
931  /* Calculate extent */
932  rclExtent.left = rclExtent.right = pVertex->x;
933  rclExtent.top = rclExtent.bottom = pVertex->y;
934  for (i = 0; i < nVertex; i++)
935  {
936  rclExtent.left = min(rclExtent.left, (pVertex + i)->x);
937  rclExtent.right = max(rclExtent.right, (pVertex + i)->x);
938  rclExtent.top = min(rclExtent.top, (pVertex + i)->y);
939  rclExtent.bottom = max(rclExtent.bottom, (pVertex + i)->y);
940  }
941  IntLPtoDP(pdc, (LPPOINT)&rclExtent, 2);
942 
943  rclExtent.left += pdc->ptlDCOrig.x;
944  rclExtent.right += pdc->ptlDCOrig.x;
945  rclExtent.top += pdc->ptlDCOrig.y;
946  rclExtent.bottom += pdc->ptlDCOrig.y;
947 
948  if (RECTL_bIsEmptyRect(&rclExtent))
949  {
950  DC_UnlockDc(pdc);
951  return TRUE;
952  }
953 
954  ptlDitherOrg.x = ptlDitherOrg.y = 0;
955  IntLPtoDP(pdc, (LPPOINT)&ptlDitherOrg, 1);
956 
957  ptlDitherOrg.x += pdc->ptlDCOrig.x;
958  ptlDitherOrg.y += pdc->ptlDCOrig.y;
959 
960  if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
961  {
962  IntUpdateBoundsRect(pdc, &rclExtent);
963  }
964 
965  DC_vPrepareDCsForBlit(pdc, &rclExtent, NULL, NULL);
966 
967  psurf = pdc->dclevel.pSurface;
968 
969  EXLATEOBJ_vInitialize(&exlo, &gpalRGB, psurf->ppal, 0, 0, 0);
970 
971  bRet = IntEngGradientFill(&psurf->SurfObj,
972  (CLIPOBJ *)&pdc->co,
973  &exlo.xlo,
974  pVertex,
975  nVertex,
976  pMesh,
977  nMesh,
978  &rclExtent,
979  &ptlDitherOrg,
980  ulMode);
981 
982  EXLATEOBJ_vCleanup(&exlo);
983  DC_vFinishBlit(pdc, NULL);
984  DC_UnlockDc(pdc);
985 
986  return bRet;
987 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
Definition: rect.h:44
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG nMesh
Definition: winddi.h:3649
ULONG UpperLeft
Definition: wingdi.h:2782
ULONG LowerRight
Definition: wingdi.h:2783
#define max(a, b)
Definition: svc.c:63
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID pMesh
Definition: winddi.h:3649
#define TRUE
Definition: types.h:120
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
struct _PALETTE *const ppal
Definition: surface.h:11
long bottom
Definition: polytest.cpp:53
LONG y
Definition: windef.h:320
XLATEOBJ xlo
Definition: xlateobj.h:21
long right
Definition: polytest.cpp:53
GLenum GLclampf GLint i
Definition: glfuncs.h:14
LONG y
Definition: wingdi.h:2762
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
#define FALSE
Definition: types.h:117
long top
Definition: polytest.cpp:53
SURFOBJ SurfObj
Definition: surface.h:8
struct _GRADIENT_RECT * PGRADIENT_RECT
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
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
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
long left
Definition: polytest.cpp:53
Definition: polytest.cpp:40
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG x
Definition: wingdi.h:2761
LONG x
Definition: windef.h:319
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL _In_ ULONG ulMode
Definition: winddi.h:3649
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define min(a, b)
Definition: monoChain.cc:55
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:497
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:685
unsigned int ULONG
Definition: retypes.h:1
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG nVertex
Definition: winddi.h:3649
PALETTE gpalRGB
Definition: palette.c:17
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
struct _GRADIENT_TRIANGLE * PGRADIENT_TRIANGLE
BOOL FASTCALL GreMoveTo ( HDC  hdc,
INT  x,
INT  y,
LPPOINT  pptOut 
)

Definition at line 110 of file line.c.

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

114 {
115  BOOL Ret;
116  PDC dc;
117  if (!(dc = DC_LockDc(hdc)))
118  {
120  return FALSE;
121  }
122  Ret = IntGdiMoveToEx(dc, x, y, pptOut);
123  DC_UnlockDc(dc);
124  return Ret;
125 }
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
HDC dc
Definition: cylfrac.c:34
#define FALSE
Definition: types.h:117
HDC hdc
Definition: msvc.h:53
Definition: polytest.cpp:40
unsigned int BOOL
Definition: ntddk_ex.h:94
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
BOOL FASTCALL IntGdiMoveToEx(DC *dc, int X, int Y, LPPOINT Point)
Definition: line.c:80
INT INT y
Definition: msvc.h:62
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
INT x
Definition: msvc.h:62
HBITMAP FASTCALL IntCreateCompatibleBitmap ( _In_ PDC  Dc,
_In_ INT  Width,
_In_ INT  Height,
_In_ UINT  Bpp,
_In_ UINT  Planes 
)
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.

Referenced by IntArc().

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 }
_Check_return_ _CRTIMP double __cdecl ceil(_In_ double x)
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:113
static Rect NTAPI rect(int x, int y, int width, int height)
Definition: drawing.c:84
int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen, BOOL Chord)
Definition: drawing.c:962
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: partlist.h:32
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:29
BOOL FASTCALL IntDrawEllipse ( PDC  dc,
INT  XLeft,
INT  YLeft,
INT  Width,
INT  Height,
PBRUSH  pbrush 
)

Definition at line 1364 of file drawing.c.

Referenced by NtGdiEllipse().

1370 {
1371  return (BOOL)app_draw_ellipse(dc, rect( XLeft, YLeft, Width, Height), pbrush);
1372 }
static Rect NTAPI rect(int x, int y, int width, int height)
Definition: drawing.c:84
unsigned int BOOL
Definition: ntddk_ex.h:94
static int NTAPI app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
Definition: drawing.c:124
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.

Referenced by IntRoundRect().

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 }
#define abs(i)
Definition: fconv.c:206
#define TRUE
Definition: types.h:120
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
#define app_fill_rect(dc, r, BrushObj, Pen)
Definition: drawing.c:107
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static Rect NTAPI rect(int x, int y, int width, int height)
Definition: drawing.c:84
#define FALSE
Definition: types.h:117
int app_draw_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrushPen, BOOL Chord)
Definition: drawing.c:962
static LPHIST_ENTRY Bottom
Definition: history.c:54
static int NTAPI app_draw_ellipse(DC *g, Rect r, PBRUSH pbrush)
Definition: drawing.c:124
static LPHIST_ENTRY Top
Definition: history.c:53
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.

Referenced by IntArc().

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 BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:114
_Check_return_ _CRTIMP double __cdecl ceil(_In_ double x)
#define ERROR_INTERNAL_ERROR
Definition: winerror.h:840
HANDLE hbrush
Definition: ntgdihdl.h:292
#define BRUSH_ShareLockBrush(hBrush)
Definition: brush.h:113
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:113
static Rect NTAPI rect(int x, int y, int width, int height)
Definition: drawing.c:84
#define FALSE
Definition: types.h:117
Definition: types.h:100
int FASTCALL app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL Chord)
Definition: drawing.c:785
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: partlist.h:32
int ret
#define DPRINT1
Definition: precomp.h:8
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:29
BOOL FASTCALL IntFillEllipse ( PDC  dc,
INT  XLeft,
INT  YLeft,
INT  Width,
INT  Height,
PBRUSH  pbrush 
)

Definition at line 1376 of file drawing.c.

Referenced by NtGdiEllipse().

1382 {
1383  return (BOOL)app_fill_ellipse(dc, rect( XLeft, YLeft, Width, Height), pbrush);
1384 }
static Rect NTAPI rect(int x, int y, int width, int height)
Definition: drawing.c:84
unsigned int BOOL
Definition: ntddk_ex.h:94
static int FASTCALL app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush)
Definition: drawing.c:617
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.

Referenced by IntRoundRect().

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 }
#define abs(i)
Definition: fconv.c:206
#define TRUE
Definition: types.h:120
#define app_fill_rect(dc, r, BrushObj, Pen)
Definition: drawing.c:107
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static Rect NTAPI rect(int x, int y, int width, int height)
Definition: drawing.c:84
#define FALSE
Definition: types.h:117
int FASTCALL app_fill_arc(DC *g, Rect r, int start_angle, int end_angle, PBRUSH pbrush, BOOL Chord)
Definition: drawing.c:785
static int FASTCALL app_fill_ellipse(DC *g, Rect r, PBRUSH pbrush)
Definition: drawing.c:617
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53
HDC FASTCALL IntGdiCreateDC ( PUNICODE_STRING  Driver,
PUNICODE_STRING  Device,
PVOID  pUMdhpdev,
CONST PDEVMODEW  InitData,
BOOL  CreateAsIC 
)

Definition at line 1032 of file dclife.c.

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

1038 {
1039  HDC hdc;
1040 
1041  hdc = GreOpenDCW(pustrDevice,
1042  pdmInit,
1043  NULL,
1044  CreateAsIC ? DCTYPE_INFO :
1045  (Driver ? DC_TYPE_DIRECT : DC_TYPE_DIRECT),
1046  TRUE,
1047  NULL,
1048  NULL,
1049  pUMdhpdev);
1050 
1051  return hdc;
1052 }
#define HDC
Definition: msvc.h:22
#define TRUE
Definition: types.h:120
HDC NTAPI GreOpenDCW(PUNICODE_STRING pustrDevice, DEVMODEW *pdmInit, PUNICODE_STRING pustrLogAddr, ULONG iType, BOOL bDisplay, HANDLE hspool, VOID *pDriverInfo2, VOID *pUMdhpdev)
Definition: dclife.c:632
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
Definition: dc.h:43
#define DC_TYPE_DIRECT
Definition: ntgdihdl.h:123
BOOL FASTCALL IntGdiLineTo ( DC dc,
int  XEnd,
int  YEnd 
)

Definition at line 148 of file line.c.

Referenced by IntGdiArcInternal(), and NtGdiLineTo().

151 {
152  SURFACE *psurf;
153  BOOL Ret = TRUE;
154  PBRUSH pbrLine;
155  RECTL Bounds;
156  POINT Points[2];
157  PDC_ATTR pdcattr = dc->pdcattr;
158  ASSERT_DC_PREPARED(dc);
159 
160  if (PATH_IsPathOpen(dc->dclevel))
161  {
162  Ret = PATH_LineTo(dc, XEnd, YEnd);
163  }
164  else
165  {
166  psurf = dc->dclevel.pSurface;
167  if (NULL == psurf)
168  {
170  return FALSE;
171  }
172 
173  Points[0].x = pdcattr->ptlCurrent.x;
174  Points[0].y = pdcattr->ptlCurrent.y;
175  Points[1].x = XEnd;
176  Points[1].y = YEnd;
177 
178  IntLPtoDP(dc, Points, 2);
179 
180  /* The DCOrg is in device coordinates */
181  Points[0].x += dc->ptlDCOrig.x;
182  Points[0].y += dc->ptlDCOrig.y;
183  Points[1].x += dc->ptlDCOrig.x;
184  Points[1].y += dc->ptlDCOrig.y;
185 
186  Bounds.left = min(Points[0].x, Points[1].x);
187  Bounds.top = min(Points[0].y, Points[1].y);
188  Bounds.right = max(Points[0].x, Points[1].x);
189  Bounds.bottom = max(Points[0].y, Points[1].y);
190 
191  /* Get BRUSH from current pen. */
192  pbrLine = dc->dclevel.pbrLine;
193  ASSERT(pbrLine);
194 
195  if (dc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
196  {
197  DPRINT("Bounds dc %p l %d t %d\n",dc,Bounds.left,Bounds.top);
198  DPRINT(" r %d b %d\n",Bounds.right,Bounds.bottom);
199  AddPenLinesBounds(dc, 2, Points);
200  }
201 
202  if (!(pbrLine->flAttrs & BR_IS_NULL))
203  {
204  Ret = IntEngLineTo(&psurf->SurfObj,
205  (CLIPOBJ *)&dc->co,
206  &dc->eboLine.BrushObject,
207  Points[0].x, Points[0].y,
208  Points[1].x, Points[1].y,
209  &Bounds,
210  ROP2_TO_MIX(pdcattr->jROP2));
211  }
212 
213  }
214 
215  if (Ret)
216  {
217  pdcattr->ptlCurrent.x = XEnd;
218  pdcattr->ptlCurrent.y = YEnd;
219  pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
220  CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
222  }
223 
224  return Ret;
225 }
#define ROP2_TO_MIX(Rop2)
Definition: inteng.h:40
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
long bottom
Definition: polytest.cpp:53
LONG y
Definition: windef.h:320
#define DIRTY_PTFXCURRENT
Definition: ntgdihdl.h:154
long right
Definition: polytest.cpp:53
#define FALSE
Definition: types.h:117
long top
Definition: polytest.cpp:53
SURFOBJ SurfObj
Definition: surface.h:8
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
long left
Definition: polytest.cpp:53
ULONG ulDirty_
Definition: ntgdihdl.h:291
Definition: types.h:100
#define PATH_IsPathOpen(dclevel)
Definition: path.h:74
#define DIRTY_STYLESTATE
Definition: ntgdihdl.h:155
unsigned int BOOL
Definition: ntddk_ex.h:94
BYTE jROP2
Definition: ntgdihdl.h:304
#define BR_IS_NULL
Definition: brush.h:101
LONG x
Definition: windef.h:319
BOOL FASTCALL PATH_LineTo(PDC dc, INT x, INT y)
Definition: path.c:570
void IntEngLineTo(SURFOBJ *, CLIPOBJ, PBRUSHOBJ, int x1, int y1, int x2, int y2, RECTL *, MIX mix)
Definition: polytest.cpp:107
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
#define ASSERT_DC_PREPARED(pdc)
Definition: dc.h:299
POINTL ptfxCurrent
Definition: ntgdihdl.h:309
#define DIRTY_PTLCURRENT
Definition: ntgdihdl.h:153
#define min(a, b)
Definition: monoChain.cc:55
#define CoordLPtoDP(pdc, ppt)
Definition: coord.h:10
VOID FASTCALL AddPenLinesBounds(PDC dc, int count, POINT *points)
Definition: line.c:17
INT INT y
Definition: msvc.h:62
POINTL ptlCurrent
Definition: ntgdihdl.h:308
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
INT x
Definition: msvc.h:62
BOOL FASTCALL IntGdiMoveToEx ( DC dc,
int  X,
int  Y,
LPPOINT  Point 
)

Definition at line 80 of file line.c.

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

84 {
85  PDC_ATTR pdcattr = dc->pdcattr;
86  if ( Point )
87  {
88  if ( pdcattr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit!
89  {
90  Point->x = pdcattr->ptfxCurrent.x; // ret prev before change.
91  Point->y = pdcattr->ptfxCurrent.y;
92  IntDPtoLP ( dc, Point, 1); // Reconvert back.
93  }
94  else
95  {
96  Point->x = pdcattr->ptlCurrent.x;
97  Point->y = pdcattr->ptlCurrent.y;
98  }
99  }
100  pdcattr->ptlCurrent.x = X;
101  pdcattr->ptlCurrent.y = Y;
102  pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
103  CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
105 
106  return TRUE;
107 }
#define IntDPtoLP(pdc, ppt, count)
Definition: coord.h:12
#define TRUE
Definition: types.h:120
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define Y(i)
Definition: t_vb_render.c:49
LONG y
Definition: windef.h:320
#define DIRTY_PTFXCURRENT
Definition: ntgdihdl.h:154
ULONG ulDirty_
Definition: ntgdihdl.h:291
#define DIRTY_STYLESTATE
Definition: ntgdihdl.h:155
LONG x
Definition: windef.h:319
POINTL ptfxCurrent
Definition: ntgdihdl.h:309
#define DIRTY_PTLCURRENT
Definition: ntgdihdl.h:153
#define CoordLPtoDP(pdc, ppt)
Definition: coord.h:10
POINTL ptlCurrent
Definition: ntgdihdl.h:308
#define X(b, s)
BOOL FASTCALL IntGdiPolyBezier ( DC dc,
LPPOINT  pt,
DWORD  Count 
)

Definition at line 228 of file line.c.

Referenced by IntGdiPolyBezierTo(), and NtGdiPolyPolyDraw().

231 {
232  BOOL ret = FALSE; // Default to FAILURE
233 
234  if ( PATH_IsPathOpen(dc->dclevel) )
235  {
236  return PATH_PolyBezier ( dc, pt, Count );
237  }
238 
239  /* We'll convert it into line segments and draw them using Polyline */
240  {
241  POINT *Pts;
242  INT nOut;
243 
244  Pts = GDI_Bezier ( pt, Count, &nOut );
245  if ( Pts )
246  {
247  ret = IntGdiPolyline(dc, Pts, nOut);
249  }
250  }
251 
252  return ret;
253 }
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
int32_t INT
Definition: typedefs.h:56
#define FALSE
Definition: types.h:117
#define TAG_BEZIER
Definition: tags.h:13
#define PATH_IsPathOpen(dclevel)
Definition: path.h:74
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL FASTCALL IntGdiPolyline(DC *dc, LPPOINT pt, int Count)
Definition: line.c:293
int nOut
Definition: unzcrash.c:44
POINT * GDI_Bezier(const POINT *Points, INT count, INT *nPtsOut)
Definition: bezier.c:189
BOOL FASTCALL PATH_PolyBezier(PDC dc, const POINT *pts, DWORD cbPoints)
Definition: path.c:1106
int ret
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
BOOL FASTCALL IntGdiPolyBezierTo ( DC dc,
LPPOINT  pt,
DWORD  Count 
)

Definition at line 256 of file line.c.

Referenced by NtGdiPolyPolyDraw().

259 {
260  BOOL ret = FALSE; // Default to failure
261  PDC_ATTR pdcattr = dc->pdcattr;
262 
263  if ( PATH_IsPathOpen(dc->dclevel) )
264  ret = PATH_PolyBezierTo ( dc, pt, Count );
265  else /* We'll do it using PolyBezier */
266  {
267  POINT *npt;
269  sizeof(POINT) * (Count + 1),
270  TAG_BEZIER);
271  if ( npt )
272  {
273  npt[0].x = pdcattr->ptlCurrent.x;
274  npt[0].y = pdcattr->ptlCurrent.y;
275  memcpy(npt + 1, pt, sizeof(POINT) * Count);
276  ret = IntGdiPolyBezier(dc, npt, Count+1);
278  }
279  }
280  if ( ret )
281  {
282  pdcattr->ptlCurrent.x = pt[Count-1].x;
283  pdcattr->ptlCurrent.y = pt[Count-1].y;
284  pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
285  CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
287  }
288 
289  return ret;
290 }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
LONG y
Definition: windef.h:320
#define DIRTY_PTFXCURRENT
Definition: ntgdihdl.h:154
#define FALSE
Definition: types.h:117
BOOL FASTCALL PATH_PolyBezierTo(PDC dc, const POINT *pts, DWORD cbPoints)
Definition: path.c:1083
#define TAG_BEZIER
Definition: tags.h:13
ULONG ulDirty_
Definition: ntgdihdl.h:291
#define PATH_IsPathOpen(dclevel)
Definition: path.h:74
#define DIRTY_STYLESTATE
Definition: ntgdihdl.h:155
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG x
Definition: windef.h:319
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
POINTL ptfxCurrent
Definition: ntgdihdl.h:309
#define DIRTY_PTLCURRENT
Definition: ntgdihdl.h:153
BOOL FASTCALL IntGdiPolyBezier(DC *dc, LPPOINT pt, DWORD Count)
Definition: line.c:228
#define CoordLPtoDP(pdc, ppt)
Definition: coord.h:10
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
POINTL ptlCurrent
Definition: ntgdihdl.h:308
BOOL FASTCALL IntGdiPolyline ( DC dc,
LPPOINT  pt,
int  Count 
)

Definition at line 293 of file line.c.

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

296 {
297  SURFACE *psurf;
298  BRUSH *pbrLine;
299  LPPOINT Points;
300  BOOL Ret = TRUE;
301  LONG i;
302  PDC_ATTR pdcattr = dc->pdcattr;
303 
304  if (!dc->dclevel.pSurface)
305  {
306  return TRUE;
307  }
308 
310  psurf = dc->dclevel.pSurface;
311 
312  /* Get BRUSHOBJ from current pen. */
313  pbrLine = dc->dclevel.pbrLine;
314  ASSERT(pbrLine);
315 
316  if (!(pbrLine->flAttrs & BR_IS_NULL))
317  {
318  Points = EngAllocMem(0, Count * sizeof(POINT), GDITAG_TEMP);
319  if (Points != NULL)
320  {
321  RtlCopyMemory(Points, pt, Count * sizeof(POINT));
322  IntLPtoDP(dc, Points, Count);
323 
324  /* Offset the array of points by the DC origin */
325  for (i = 0; i < Count; i++)
326  {
327  Points[i].x += dc->ptlDCOrig.x;
328  Points[i].y += dc->ptlDCOrig.y;
329  }
330 
331  if (dc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
332  {
333  AddPenLinesBounds(dc, Count, Points);
334  }
335 
336  Ret = IntEngPolyline(&psurf->SurfObj,
337  (CLIPOBJ *)&dc->co,
338  &dc->eboLine.BrushObject,
339  Points,
340  Count,
341  ROP2_TO_MIX(pdcattr->jROP2));
342 
343  EngFreeMem(Points);
344  }
345  else
346  {
347  Ret = FALSE;
348  }
349  }
350 
351  DC_vFinishBlit(dc, NULL);
352 
353  return Ret;
354 }
#define ROP2_TO_MIX(Rop2)
Definition: inteng.h:40
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define GDITAG_TEMP
Definition: tags.h:166
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
#define EngFreeMem
Definition: polytest.cpp:56
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
ULONG flAttrs
Definition: brush.h:19
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
SURFOBJ SurfObj
Definition: surface.h:8
smooth NULL
Definition: ftsmooth.c:416
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: brush.hpp:15
BYTE jROP2
Definition: ntgdihdl.h:304
#define BR_IS_NULL
Definition: brush.h:101
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
BOOL APIENTRY IntEngPolyline(SURFOBJ *DestSurf, CLIPOBJ *Clip, BRUSHOBJ *Brush, CONST LPPOINT pt, LONG dCount, MIX mix)
Definition: lineto.c:703
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:497
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
VOID FASTCALL AddPenLinesBounds(PDC dc, int count, POINT *points)
Definition: line.c:17
BOOL FASTCALL IntGdiPolylineTo ( DC dc,
LPPOINT  pt,
DWORD  Count 
)

Definition at line 357 of file line.c.

Referenced by NtGdiPolyPolyDraw().

360 {
361  BOOL ret = FALSE; // Default to failure
362  PDC_ATTR pdcattr = dc->pdcattr;
363 
364  if (PATH_IsPathOpen(dc->dclevel))
365  {
366  ret = PATH_PolylineTo(dc, pt, Count);
367  }
368  else /* Do it using Polyline */
369  {
371  sizeof(POINT) * (Count + 1),
372  TAG_SHAPE);
373  if ( pts )
374  {
375  pts[0].x = pdcattr->ptlCurrent.x;
376  pts[0].y = pdcattr->ptlCurrent.y;
377  memcpy( pts + 1, pt, sizeof(POINT) * Count);
378  ret = IntGdiPolyline(dc, pts, Count + 1);
380  }
381  }
382  if ( ret )
383  {
384  pdcattr->ptlCurrent.x = pt[Count-1].x;
385  pdcattr->ptlCurrent.y = pt[Count-1].y;
386  pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
387  CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
389  }
390 
391  return ret;
392 }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define TAG_SHAPE
Definition: tags.h:14
LONG y
Definition: windef.h:320
#define DIRTY_PTFXCURRENT
Definition: ntgdihdl.h:154
#define FALSE
Definition: types.h:117
ULONG ulDirty_
Definition: ntgdihdl.h:291
#define PATH_IsPathOpen(dclevel)
Definition: path.h:74
#define DIRTY_STYLESTATE
Definition: ntgdihdl.h:155
BOOL FASTCALL PATH_PolylineTo(PDC dc, const POINT *pts, DWORD cbPoints)
Definition: path.c:1216
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL FASTCALL IntGdiPolyline(DC *dc, LPPOINT pt, int Count)
Definition: line.c:293
LONG x
Definition: windef.h:319
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
POINTL ptfxCurrent
Definition: ntgdihdl.h:309
#define DIRTY_PTLCURRENT
Definition: ntgdihdl.h:153
#define CoordLPtoDP(pdc, ppt)
Definition: coord.h:10
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
POINTL ptlCurrent
Definition: ntgdihdl.h:308
BOOL FASTCALL IntGdiPolyPolyline ( DC dc,
LPPOINT  pt,
PULONG  PolyPoints,
DWORD  Count 
)

Definition at line 396 of file line.c.

Referenced by NtGdiPolyPolyDraw().

400 {
401  ULONG i;
402  LPPOINT pts;
403  PULONG pc;
404  BOOL ret = FALSE; // Default to failure
405  pts = pt;
406  pc = PolyPoints;
407 
408  if (PATH_IsPathOpen(dc->dclevel))
409  {
410  return PATH_PolyPolyline( dc, pt, PolyPoints, Count );
411  }
412  for (i = 0; i < Count; i++)
413  {
414  ret = IntGdiPolyline ( dc, pts, *pc );
415  if (ret == FALSE)
416  {
417  return ret;
418  }
419  pts+=*pc++;
420  }
421 
422  return ret;
423 }
#define pt(x, y)
Definition: drawing.c:79
BOOL FASTCALL PATH_PolyPolyline(PDC dc, const POINT *pts, const DWORD *counts, DWORD polylines)
Definition: path.c:1290
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define FALSE
Definition: types.h:117
#define PATH_IsPathOpen(dclevel)
Definition: path.h:74
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL FASTCALL IntGdiPolyline(DC *dc, LPPOINT pt, int Count)
Definition: line.c:293
int ret
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
WORD APIENTRY IntGdiSetHookFlags ( HDC  hDC,
WORD  Flags 
)

Definition at line 418 of file dcutil.c.

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

419 {
420  WORD wRet;
421  DC *dc = DC_LockDc(hDC);
422 
423  if (NULL == dc)
424  {
426  return 0;
427  }
428 
429  wRet = dc->fs & DC_FLAG_DIRTY_RAO; // FIXME: Wrong flag!
430 
431  /* Info in "Undocumented Windows" is slightly confusing. */
432  DPRINT("DC %p, Flags %04x\n", hDC, Flags);
433 
435  {
436  /* hVisRgn has to be updated */
437  dc->fs |= DC_FLAG_DIRTY_RAO;
438  }
439  else if (Flags & DCHF_VALIDATEVISRGN || 0 == Flags)
440  {
441  //dc->fs &= ~DC_FLAG_DIRTY_RAO;
442  }
443 
444  DC_UnlockDc(dc);
445 
446  return wRet;
447 }
unsigned short WORD
Definition: ntddk_ex.h:93
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
HDC dc
Definition: cylfrac.c:34
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
HDC hDC
Definition: wglext.h:521
Definition: polytest.cpp:40
#define DC_FLAG_DIRTY_RAO
Definition: ntgdihdl.h:132
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define DCHF_INVALIDATEVISRGN
Definition: gdi_driver.h:266
#define DCHF_VALIDATEVISRGN
Definition: gdi_driver.h:267
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
UINT APIENTRY IntGetDIBColorTable ( HDC  hDC,
UINT  StartIndex,
UINT  Entries,
RGBQUAD Colors 
)
UINT APIENTRY IntGetPaletteEntries ( HPALETTE  hpal,
UINT  StartIndex,
UINT  Entries,
LPPALETTEENTRY  pe 
)

Definition at line 852 of file palette.c.

Referenced by NtGdiDoPalette().

857 {
858  PPALETTE palGDI;
859  UINT numEntries;
860 
861  palGDI = (PPALETTE) PALETTE_ShareLockPalette(hpal);
862  if (NULL == palGDI)
863  {
864  return 0;
865  }
866 
867  numEntries = palGDI->NumColors;
868  if (NULL != pe)
869  {
870  if (numEntries < StartIndex + Entries)
871  {
872  Entries = numEntries - StartIndex;
873  }
874  if (numEntries <= StartIndex)
875  {
877  return 0;
878  }
879  memcpy(pe, palGDI->IndexedColors + StartIndex, Entries * sizeof(PALETTEENTRY));
880  }
881  else
882  {
883  Entries = numEntries;
884  }
885 
887  return Entries;
888 }
struct _PALETTE * PPALETTE
PALETTEENTRY * IndexedColors
Definition: palette.h:42
smooth NULL
Definition: ftsmooth.c:416
#define PALETTE_ShareLockPalette(hpal)
Definition: palette.h:57
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ULONG NumColors
Definition: palette.h:41
LIST_ENTRY Entries[5]
Definition: ExDoubleList.c:8
#define PALETTE_ShareUnlockPalette(ppal)
Definition: palette.h:59
unsigned int UINT
Definition: ndis.h:50
UINT APIENTRY IntGetSystemPaletteEntries ( HDC  hDC,
UINT  StartIndex,
UINT  Entries,
LPPALETTEENTRY  pe 
)

Definition at line 891 of file palette.c.

Referenced by NtGdiDoPalette().

895 {
896  PPALETTE palGDI = NULL;
897  PDC dc = NULL;
898  UINT EntriesSize = 0;
899  UINT Ret = 0;
900 
901  if (Entries == 0)
902  {
904  return 0;
905  }
906 
907  if (pe != NULL)
908  {
909  EntriesSize = Entries * sizeof(pe[0]);
910  if (Entries != EntriesSize / sizeof(pe[0]))
911  {
912  /* Integer overflow! */
914  return 0;
915  }
916  }
917 
918  if (!(dc = DC_LockDc(hDC)))
919  {
921  return 0;
922  }
923 
924  palGDI = PALETTE_ShareLockPalette(dc->dclevel.hpal);
925  if (palGDI != NULL)
926  {
927  if (pe != NULL)
928  {
929  if (StartIndex >= palGDI->NumColors)
930  Entries = 0;
931  else if (Entries > palGDI->NumColors - StartIndex)
932  Entries = palGDI->NumColors - StartIndex;
933 
934  memcpy(pe,
935  palGDI->IndexedColors + StartIndex,
936  Entries * sizeof(pe[0]));
937 
938  Ret = Entries;
939  }
940  else
941  {
942  Ret = dc->ppdev->gdiinfo.ulNumPalReg;
943  }
944  }
945 
946  if (palGDI != NULL)
948 
949  if (dc != NULL)
950  DC_UnlockDc(dc);
951 
952  return Ret;
953 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
PALETTEENTRY * IndexedColors
Definition: palette.h:42
HDC dc
Definition: cylfrac.c:34
smooth NULL
Definition: ftsmooth.c:416
#define PALETTE_ShareLockPalette(hpal)
Definition: palette.h:57
HDC hDC
Definition: wglext.h:521
Definition: polytest.cpp:40
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ULONG NumColors
Definition: palette.h:41
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
LIST_ENTRY Entries[5]
Definition: ExDoubleList.c:8
#define PALETTE_ShareUnlockPalette(ppal)
Definition: palette.h:59
unsigned int UINT
Definition: ndis.h:50
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
UINT APIENTRY IntSetDIBColorTable ( HDC  hDC,
UINT  StartIndex,
UINT  Entries,
CONST RGBQUAD Colors 
)
VOID FASTCALL IntSetSysColors ( UINT  nColors,
CONST INT Elements,
CONST COLORREF Colors 
)

Definition at line 300 of file stockobj.c.

Referenced by NtUserSetSysColors().

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 }
PSERVERINFO gpsi
Definition: main.c:27
GLenum GLclampf GLint i
Definition: glfuncs.h:14
Colors
Definition: ansiprsr.h:4
VOID NTAPI IntGdiSetSolidBrushColor(_In_ HBRUSH hbr, _In_ COLORREF crColor)
Definition: brush.cpp:306
#define NUM_SYSCOLORS
Definition: SetSysColors.c:10
unsigned int UINT
Definition: ndis.h:50
#define Elements(x)
Definition: compiler.h:496
DWORD APIENTRY NtDxEngGetRedirectionBitmap ( DWORD  Unknown0)

Definition at line 973 of file ntstubs.c.

975 {
976  STUB;
977  return 0;
978 }
#define STUB
Definition: kernel32.h:27
NTSTATUS APIENTRY NtGdiFlushUserBatch ( VOID  )

Definition at line 168 of file gdibatch.c.

Referenced by DriverEntry(), and NtGdiDeleteObjectApp().

169 {
170  PTEB pTeb = NtCurrentTeb();
171  ULONG GdiBatchCount = pTeb->GdiBatchCount;
172 
173  if( (GdiBatchCount > 0) && (GdiBatchCount <= (GDIBATCHBUFSIZE/4)))
174  {
175  HDC hDC = (HDC) pTeb->GdiTebBatch.HDC;
176 
177  /* If hDC is zero and the buffer fills up with delete objects we need
178  to run anyway.
179  */
180  if (hDC || GdiBatchCount)
181  {
182  PCHAR pHdr = (PCHAR)&pTeb->GdiTebBatch.Buffer[0];
183  PDC pDC = NULL;
184 
186  {
187  pDC = DC_LockDc(hDC);
188  }
189 
190  // No need to init anything, just go!
191  for (; GdiBatchCount > 0; GdiBatchCount--)
192  {
193  ULONG Size;
194  // Process Gdi Batch!
195  Size = GdiFlushUserBatch(pDC, (PGDIBATCHHDR) pHdr);
196  if (!Size) break;
197  pHdr += Size;
198  }
199 
200  if (pDC)
201  {
202  DC_UnlockDc(pDC);
203  }
204 
205  // Exit and clear out for the next round.
206  pTeb->GdiTebBatch.Offset = 0;
207  pTeb->GdiBatchCount = 0;
208  pTeb->GdiTebBatch.HDC = 0;
209  }
210  }
211 
212  // FIXME: On Windows XP the function returns &pTeb->RealClientId, maybe VOID?
213  return STATUS_SUCCESS;
214 }
signed char * PCHAR
Definition: retypes.h:7
#define HDC
Definition: msvc.h:22
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
Definition: gdiobj.c:1141
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
ULONG Buffer[GDI_BATCH_BUFFER_SIZE]
Definition: compat.h:482
ULONG FASTCALL GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
Definition: gdibatch.c:67
#define GDIBATCHBUFSIZE
Definition: ntgdityp.h:197
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
UINTN Size
Definition: acefiex.h:555
#define PCHAR
Definition: match.c:90
HDC hDC
Definition: wglext.h:521
Definition: polytest.cpp:40
if(!(yy_init))
Definition: macro.lex.yy.c:717
GDI_TEB_BATCH GdiTebBatch
Definition: compat.h:506
ULONG GdiBatchCount
Definition: compat.h:536
Definition: compat.h:484
ULONG Offset
Definition: compat.h:480
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2710
HANDLE HDC
Definition: compat.h:481

Variable Documentation

HSEMAPHORE hsemDriverMgmt
HDC hSystemBM