ReactOS  0.4.15-dev-2977-ge996662
path.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _EXTPATHDATA
 
struct  _PATH
 
struct  _EPATHOBJ
 

Macros

#define PATHTYPE_KEEPME   1
 
#define PATHTYPE_STACK   2
 
#define PATH_AllocPath()   ((PPATH) GDIOBJ_AllocObj(GDIObjType_PATH_TYPE))
 
#define PATH_AllocPathWithHandle()   ((PPATH) GDIOBJ_AllocObjWithHandle (GDI_OBJECT_TYPE_PATH, sizeof(PATH)))
 
#define PATH_LockPath(hPath)   ((PPATH)GDIOBJ_ShareLockObj((HGDIOBJ)hPath, GDI_OBJECT_TYPE_PATH))
 
#define PATH_UnlockPath(pPath)   GDIOBJ_vDereferenceObject((POBJ)pPath)
 
#define PATH_IsPathOpen(dclevel)   ( ((dclevel).hPath) && ((dclevel).flPath & DCPATH_ACTIVE) )
 

Typedefs

typedef HGDIOBJ HPATH
 
typedef HGDIOBJPHPATH
 
typedef enum tagGdiPathState GdiPathState
 
typedef struct _EXTPATHDATA EXTPATHDATA
 
typedef struct _EXTPATHDATAPEXTPATHDATA
 
typedef struct _PATH PATH
 
typedef struct _PATHPPATH
 
typedef struct _EPATHOBJ EPATHOBJ
 
typedef struct _EPATHOBJPEPATHOBJ
 

Enumerations

enum  _DCPATHFLAGS { DCPATH_ACTIVE = 0x0001, DCPATH_SAVE = 0x0002, DCPATH_CLOCKWISE = 0x0004, DCPATH_SAVESTATE = 0x80000000 }
 
enum  tagGdiPathState { PATH_Null, PATH_Open, PATH_Closed }
 

Functions

BOOL FASTCALL PATH_Arc (PDC dc, INT x1, INT y1, INT x2, INT y2, INT xStart, INT yStart, INT xEnd, INT yEnd, INT direction, INT lines)
 
BOOL PATH_Ellipse (PDC dc, INT x1, INT y1, INT x2, INT y2)
 
VOID FASTCALL PATH_EmptyPath (PPATH pPath)
 
BOOL FASTCALL PATH_LineTo (PDC dc, INT x, INT y)
 
BOOL FASTCALL PATH_PolyBezier (PDC dc, const POINT *pts, DWORD cbPoints)
 
BOOL FASTCALL PATH_PolyBezierTo (PDC dc, const POINT *pts, DWORD cbPoints)
 
BOOL FASTCALL PATH_PolyDraw (PDC dc, const POINT *pts, const BYTE *types, DWORD cbPoints)
 
BOOL FASTCALL PATH_PolylineTo (PDC dc, const POINT *pts, DWORD cbPoints)
 
BOOL FASTCALL PATH_PolyPolygon (PDC dc, const POINT *pts, const INT *counts, UINT polygons)
 
BOOL FASTCALL PATH_PolyPolyline (PDC dc, const POINT *pts, const DWORD *counts, DWORD polylines)
 
BOOL FASTCALL PATH_Rectangle (PDC dc, INT x1, INT y1, INT x2, INT y2)
 
BOOL PATH_RoundRect (DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height)
 
BOOL FASTCALL PATH_PathToRegion (PPATH pPath, INT nPolyFillMode, PREGION Rgn)
 
BOOL FASTCALL PATH_ExtTextOut (PDC dc, INT x, INT y, UINT flags, const RECTL *lprc, LPCWSTR str, UINT count, const INT *dx)
 
BOOL FASTCALL PATH_AddEntry (PPATH pPath, const POINT *pPoint, BYTE flags)
 
BOOL FASTCALL PATH_AddFlatBezier (PPATH pPath, POINT *pt, BOOL closed)
 
BOOL FASTCALL PATH_FillPath (PDC dc, PPATH pPath)
 
BOOL FASTCALL PATH_FillPathEx (PDC dc, PPATH pPath, PBRUSH pbrFill)
 
PPATH FASTCALL PATH_FlattenPath (PPATH pPath)
 
BOOL FASTCALL PATH_ReserveEntries (PPATH pPath, INT numEntries)
 
BOOL FASTCALL PATH_StrokePath (DC *dc, PPATH pPath)
 
VOID FASTCALL IntGdiCloseFigure (PPATH pPath)
 
BOOL FASTCALL PATH_Delete (HPATH hPath)
 
VOID FASTCALL IntGetCurrentPositionEx (PDC dc, LPPOINT pt)
 
BOOL PATH_RestorePath (DC *, DC *)
 
BOOL PATH_SavePath (DC *, DC *)
 
BOOL IntGdiFillRgn (PDC pdc, PREGION prgn, PBRUSH pbrFill)
 
PPATH FASTCALL IntGdiWidenPath (PPATH pPath, UINT penWidth, UINT penStyle, FLOAT eMiterLimit)
 

Macro Definition Documentation

◆ PATH_AllocPath

#define PATH_AllocPath ( )    ((PPATH) GDIOBJ_AllocObj(GDIObjType_PATH_TYPE))

Definition at line 68 of file path.h.

◆ PATH_AllocPathWithHandle

#define PATH_AllocPathWithHandle ( )    ((PPATH) GDIOBJ_AllocObjWithHandle (GDI_OBJECT_TYPE_PATH, sizeof(PATH)))

Definition at line 69 of file path.h.

◆ PATH_IsPathOpen

#define PATH_IsPathOpen (   dclevel)    ( ((dclevel).hPath) && ((dclevel).flPath & DCPATH_ACTIVE) )

Definition at line 74 of file path.h.

◆ PATH_LockPath

#define PATH_LockPath (   hPath)    ((PPATH)GDIOBJ_ShareLockObj((HGDIOBJ)hPath, GDI_OBJECT_TYPE_PATH))

Definition at line 70 of file path.h.

◆ PATH_UnlockPath

#define PATH_UnlockPath (   pPath)    GDIOBJ_vDereferenceObject((POBJ)pPath)

Definition at line 71 of file path.h.

◆ PATHTYPE_KEEPME

#define PATHTYPE_KEEPME   1

Definition at line 24 of file path.h.

◆ PATHTYPE_STACK

#define PATHTYPE_STACK   2

Definition at line 25 of file path.h.

Typedef Documentation

◆ EPATHOBJ

◆ EXTPATHDATA

◆ GdiPathState

◆ HPATH

typedef HGDIOBJ HPATH

Definition at line 14 of file path.h.

◆ PATH

typedef struct _PATH PATH

◆ PEPATHOBJ

◆ PEXTPATHDATA

◆ PHPATH

typedef HGDIOBJ * PHPATH

Definition at line 14 of file path.h.

◆ PPATH

typedef struct _PATH * PPATH

Enumeration Type Documentation

◆ _DCPATHFLAGS

Enumerator
DCPATH_ACTIVE 
DCPATH_SAVE 
DCPATH_CLOCKWISE 
DCPATH_SAVESTATE 

Definition at line 4 of file path.h.

5 {
6  DCPATH_ACTIVE = 0x0001,
7  DCPATH_SAVE = 0x0002,
8  DCPATH_CLOCKWISE = 0x0004,
9 
10  /* ReactOS only */
11  DCPATH_SAVESTATE = 0x80000000
12 };

◆ tagGdiPathState

Enumerator
PATH_Null 
PATH_Open 
PATH_Closed 

Definition at line 16 of file path.h.

17 {
18  PATH_Null,
19  PATH_Open,
21 } GdiPathState;
Definition: path.h:18
enum tagGdiPathState GdiPathState
Definition: path.h:19

Function Documentation

◆ IntGdiCloseFigure()

VOID FASTCALL IntGdiCloseFigure ( PPATH  pPath)

Definition at line 108 of file path.c.

109 {
110  ASSERT(pPath->state == PATH_Open);
111 
112  // FIXME: Shouldn't we draw a line to the beginning of the figure?
113  // Set PT_CLOSEFIGURE on the last entry and start a new stroke
114  if (pPath->numEntriesUsed)
115  {
116  pPath->pFlags[pPath->numEntriesUsed - 1] |= PT_CLOSEFIGURE;
117  pPath->newStroke = TRUE;
118  }
119 }
#define TRUE
Definition: types.h:120
int numEntriesUsed
Definition: path.h:55
BYTE * pFlags
Definition: path.h:54
#define ASSERT(a)
Definition: mode.c:44
Definition: path.h:19
BOOL newStroke
Definition: path.h:57
#define PT_CLOSEFIGURE
Definition: wingdi.h:886
FLONG state
Definition: path.h:52

Referenced by NtGdiCloseFigure(), PATH_add_outline(), PATH_Arc(), PATH_Ellipse(), PATH_Rectangle(), and PATH_RoundRect().

◆ IntGdiFillRgn()

BOOL IntGdiFillRgn ( PDC  pdc,
PREGION  prgn,
PBRUSH  pbrFill 
)

◆ IntGdiWidenPath()

PPATH FASTCALL IntGdiWidenPath ( PPATH  pPath,
UINT  penWidth,
UINT  penStyle,
FLOAT  eMiterLimit 
)

Definition at line 1772 of file path.c.

1773 {
1774  INT i, j, numStrokes, numOldStrokes, penWidthIn, penWidthOut;
1775  PPATH flat_path, pNewPath, *pStrokes = NULL, *pOldStrokes, pUpPath, pDownPath;
1776  BYTE *type;
1777  DWORD joint, endcap;
1778 
1779  endcap = (PS_ENDCAP_MASK & penStyle);
1780  joint = (PS_JOIN_MASK & penStyle);
1781 
1782  if (!(flat_path = PATH_FlattenPath(pPath)))
1783  {
1784  ERR("PATH_FlattenPath\n");
1785  return NULL;
1786  }
1787 
1788  penWidthIn = penWidth / 2;
1789  penWidthOut = penWidth / 2;
1790  if (penWidthIn + penWidthOut < penWidth)
1791  penWidthOut++;
1792 
1793  numStrokes = 0;
1794 
1795  for (i = 0, j = 0; i < flat_path->numEntriesUsed; i++, j++)
1796  {
1797  POINT point;
1798  if ((i == 0 || (flat_path->pFlags[i - 1] & PT_CLOSEFIGURE)) &&
1799  (flat_path->pFlags[i] != PT_MOVETO))
1800  {
1801  ERR("Expected PT_MOVETO %s, got path flag %c\n",
1802  i == 0 ? "as first point" : "after PT_CLOSEFIGURE",
1803  flat_path->pFlags[i]);
1804  if (pStrokes)
1805  ExFreePoolWithTag(pStrokes, TAG_PATH);
1806  PATH_UnlockPath(flat_path);
1807  PATH_Delete(flat_path->BaseObject.hHmgr);
1808  return NULL;
1809  }
1810  switch(flat_path->pFlags[i])
1811  {
1812  case PT_MOVETO:
1813  if (numStrokes > 0)
1814  {
1815  pStrokes[numStrokes - 1]->state = PATH_Closed;
1816  }
1817  numOldStrokes = numStrokes;
1818  numStrokes++;
1819  j = 0;
1820  if (numStrokes == 1)
1821  pStrokes = ExAllocatePoolWithTag(PagedPool, sizeof(*pStrokes), TAG_PATH);
1822  else
1823  {
1824  pOldStrokes = pStrokes; // Save old pointer.
1825  pStrokes = ExAllocatePoolWithTag(PagedPool, numStrokes * sizeof(*pStrokes), TAG_PATH);
1826  if (!pStrokes)
1827  {
1828  ExFreePoolWithTag(pOldStrokes, TAG_PATH);
1829  PATH_UnlockPath(flat_path);
1830  PATH_Delete(flat_path->BaseObject.hHmgr);
1831  return NULL;
1832  }
1833  RtlCopyMemory(pStrokes, pOldStrokes, numOldStrokes * sizeof(PPATH));
1834  ExFreePoolWithTag(pOldStrokes, TAG_PATH); // Free old pointer.
1835  }
1836  if (!pStrokes)
1837  {
1838  PATH_UnlockPath(flat_path);
1839  PATH_Delete(flat_path->BaseObject.hHmgr);
1840  return NULL;
1841  }
1842  pStrokes[numStrokes - 1] = ExAllocatePoolWithTag(PagedPool, sizeof(PATH), TAG_PATH);
1843  if (!pStrokes[numStrokes - 1])
1844  {
1845  ASSERT(FALSE); // FIXME
1846  }
1847  PATH_InitGdiPath(pStrokes[numStrokes - 1]);
1848  pStrokes[numStrokes - 1]->state = PATH_Open;
1849  case PT_LINETO:
1850  case (PT_LINETO | PT_CLOSEFIGURE):
1851  point.x = flat_path->pPoints[i].x;
1852  point.y = flat_path->pPoints[i].y;
1853  PATH_AddEntry(pStrokes[numStrokes - 1], &point, flat_path->pFlags[i]);
1854  break;
1855  case PT_BEZIERTO:
1856  /* Should never happen because of the FlattenPath call */
1857  ERR("Should never happen\n");
1858  break;
1859  default:
1860  ERR("Got path flag %c\n", flat_path->pFlags[i]);
1861  if (pStrokes)
1862  ExFreePoolWithTag(pStrokes, TAG_PATH);
1863  PATH_UnlockPath(flat_path);
1864  PATH_Delete(flat_path->BaseObject.hHmgr);
1865  return NULL;
1866  }
1867  }
1868 
1869  pNewPath = PATH_CreatePath( flat_path->numEntriesUsed );
1870 
1871  for (i = 0; i < numStrokes; i++)
1872  {
1873  pUpPath = ExAllocatePoolWithTag(PagedPool, sizeof(PATH), TAG_PATH);
1874  PATH_InitGdiPath(pUpPath);
1875  pUpPath->state = PATH_Open;
1876  pDownPath = ExAllocatePoolWithTag(PagedPool, sizeof(PATH), TAG_PATH);
1877  PATH_InitGdiPath(pDownPath);
1878  pDownPath->state = PATH_Open;
1879 
1880  for (j = 0; j < pStrokes[i]->numEntriesUsed; j++)
1881  {
1882  /* Beginning or end of the path if not closed */
1883  if ((!(pStrokes[i]->pFlags[pStrokes[i]->numEntriesUsed - 1] & PT_CLOSEFIGURE)) && (j == 0 || j == pStrokes[i]->numEntriesUsed - 1))
1884  {
1885  /* Compute segment angle */
1886  INT xo, yo, xa, ya;
1887  double theta;
1888  POINT pt;
1889  POINT corners[2];
1890  if (j == 0)
1891  {
1892  xo = pStrokes[i]->pPoints[j].x;
1893  yo = pStrokes[i]->pPoints[j].y;
1894  xa = pStrokes[i]->pPoints[1].x;
1895  ya = pStrokes[i]->pPoints[1].y;
1896  }
1897  else
1898  {
1899  xa = pStrokes[i]->pPoints[j - 1].x;
1900  ya = pStrokes[i]->pPoints[j - 1].y;
1901  xo = pStrokes[i]->pPoints[j].x;
1902  yo = pStrokes[i]->pPoints[j].y;
1903  }
1904  theta = atan2(ya - yo, xa - xo);
1905  switch(endcap)
1906  {
1907  case PS_ENDCAP_SQUARE :
1908  pt.x = xo + round(sqrt(2) * penWidthOut * cos(M_PI_4 + theta));
1909  pt.y = yo + round(sqrt(2) * penWidthOut * sin(M_PI_4 + theta));
1910  PATH_AddEntry(pUpPath, &pt, (j == 0 ? PT_MOVETO : PT_LINETO));
1911  pt.x = xo + round(sqrt(2) * penWidthIn * cos(- M_PI_4 + theta));
1912  pt.y = yo + round(sqrt(2) * penWidthIn * sin(- M_PI_4 + theta));
1913  PATH_AddEntry(pUpPath, &pt, PT_LINETO);
1914  break;
1915  case PS_ENDCAP_FLAT :
1916  pt.x = xo + round(penWidthOut * cos(theta + M_PI_2));
1917  pt.y = yo + round(penWidthOut * sin(theta + M_PI_2));
1918  PATH_AddEntry(pUpPath, &pt, (j == 0 ? PT_MOVETO : PT_LINETO));
1919  pt.x = xo - round(penWidthIn * cos(theta + M_PI_2));
1920  pt.y = yo - round(penWidthIn * sin(theta + M_PI_2));
1921  PATH_AddEntry(pUpPath, &pt, PT_LINETO);
1922  break;
1923  case PS_ENDCAP_ROUND :
1924  default :
1925  corners[0].x = xo - penWidthIn;
1926  corners[0].y = yo - penWidthIn;
1927  corners[1].x = xo + penWidthOut;
1928  corners[1].y = yo + penWidthOut;
1929  PATH_DoArcPart(pUpPath , corners, theta + M_PI_2 , theta + 3 * M_PI_4, (j == 0 ? PT_MOVETO : FALSE));
1930  PATH_DoArcPart(pUpPath , corners, theta + 3 * M_PI_4 , theta + M_PI, FALSE);
1931  PATH_DoArcPart(pUpPath , corners, theta + M_PI, theta + 5 * M_PI_4, FALSE);
1932  PATH_DoArcPart(pUpPath , corners, theta + 5 * M_PI_4 , theta + 3 * M_PI_2, FALSE);
1933  break;
1934  }
1935  }
1936  /* Corpse of the path */
1937  else
1938  {
1939  /* Compute angle */
1940  INT previous, next;
1941  double xa, ya, xb, yb, xo, yo;
1942  double alpha, theta, miterWidth;
1943  DWORD _joint = joint;
1944  POINT pt;
1945  PPATH pInsidePath, pOutsidePath;
1946  if (j > 0 && j < pStrokes[i]->numEntriesUsed - 1)
1947  {
1948  previous = j - 1;
1949  next = j + 1;
1950  }
1951  else if (j == 0)
1952  {
1953  previous = pStrokes[i]->numEntriesUsed - 1;
1954  next = j + 1;
1955  }
1956  else
1957  {
1958  previous = j - 1;
1959  next = 0;
1960  }
1961  xo = pStrokes[i]->pPoints[j].x;
1962  yo = pStrokes[i]->pPoints[j].y;
1963  xa = pStrokes[i]->pPoints[previous].x;
1964  ya = pStrokes[i]->pPoints[previous].y;
1965  xb = pStrokes[i]->pPoints[next].x;
1966  yb = pStrokes[i]->pPoints[next].y;
1967  theta = atan2(yo - ya, xo - xa);
1968  alpha = atan2(yb - yo, xb - xo) - theta;
1969  if (alpha > 0) alpha -= M_PI;
1970  else alpha += M_PI;
1971  if (_joint == PS_JOIN_MITER && eMiterLimit < fabs(1 / sin(alpha / 2)))
1972  {
1973  _joint = PS_JOIN_BEVEL;
1974  }
1975  if (alpha > 0)
1976  {
1977  pInsidePath = pUpPath;
1978  pOutsidePath = pDownPath;
1979  }
1980  else if (alpha < 0)
1981  {
1982  pInsidePath = pDownPath;
1983  pOutsidePath = pUpPath;
1984  }
1985  else
1986  {
1987  continue;
1988  }
1989  /* Inside angle points */
1990  if (alpha > 0)
1991  {
1992  pt.x = xo - round(penWidthIn * cos(theta + M_PI_2));
1993  pt.y = yo - round(penWidthIn * sin(theta + M_PI_2));
1994  }
1995  else
1996  {
1997  pt.x = xo + round(penWidthIn * cos(theta + M_PI_2));
1998  pt.y = yo + round(penWidthIn * sin(theta + M_PI_2));
1999  }
2000  PATH_AddEntry(pInsidePath, &pt, PT_LINETO);
2001  if (alpha > 0)
2002  {
2003  pt.x = xo + round(penWidthIn * cos(M_PI_2 + alpha + theta));
2004  pt.y = yo + round(penWidthIn * sin(M_PI_2 + alpha + theta));
2005  }
2006  else
2007  {
2008  pt.x = xo - round(penWidthIn * cos(M_PI_2 + alpha + theta));
2009  pt.y = yo - round(penWidthIn * sin(M_PI_2 + alpha + theta));
2010  }
2011  PATH_AddEntry(pInsidePath, &pt, PT_LINETO);
2012  /* Outside angle point */
2013  switch(_joint)
2014  {
2015  case PS_JOIN_MITER :
2016  miterWidth = fabs(penWidthOut / cos(M_PI_2 - fabs(alpha) / 2));
2017  pt.x = xo + round(miterWidth * cos(theta + alpha / 2));
2018  pt.y = yo + round(miterWidth * sin(theta + alpha / 2));
2019  PATH_AddEntry(pOutsidePath, &pt, PT_LINETO);
2020  break;
2021  case PS_JOIN_BEVEL :
2022  if (alpha > 0)
2023  {
2024  pt.x = xo + round(penWidthOut * cos(theta + M_PI_2));
2025  pt.y = yo + round(penWidthOut * sin(theta + M_PI_2));
2026  }
2027  else
2028  {
2029  pt.x = xo - round(penWidthOut * cos(theta + M_PI_2));
2030  pt.y = yo - round(penWidthOut * sin(theta + M_PI_2));
2031  }
2032  PATH_AddEntry(pOutsidePath, &pt, PT_LINETO);
2033  if (alpha > 0)
2034  {
2035  pt.x = xo - round(penWidthOut * cos(M_PI_2 + alpha + theta));
2036  pt.y = yo - round(penWidthOut * sin(M_PI_2 + alpha + theta));
2037  }
2038  else
2039  {
2040  pt.x = xo + round(penWidthOut * cos(M_PI_2 + alpha + theta));
2041  pt.y = yo + round(penWidthOut * sin(M_PI_2 + alpha + theta));
2042  }
2043  PATH_AddEntry(pOutsidePath, &pt, PT_LINETO);
2044  break;
2045  case PS_JOIN_ROUND :
2046  default :
2047  if (alpha > 0)
2048  {
2049  pt.x = xo + round(penWidthOut * cos(theta + M_PI_2));
2050  pt.y = yo + round(penWidthOut * sin(theta + M_PI_2));
2051  }
2052  else
2053  {
2054  pt.x = xo - round(penWidthOut * cos(theta + M_PI_2));
2055  pt.y = yo - round(penWidthOut * sin(theta + M_PI_2));
2056  }
2057  PATH_AddEntry(pOutsidePath, &pt, PT_BEZIERTO);
2058  pt.x = xo + round(penWidthOut * cos(theta + alpha / 2));
2059  pt.y = yo + round(penWidthOut * sin(theta + alpha / 2));
2060  PATH_AddEntry(pOutsidePath, &pt, PT_BEZIERTO);
2061  if (alpha > 0)
2062  {
2063  pt.x = xo - round(penWidthOut * cos(M_PI_2 + alpha + theta));
2064  pt.y = yo - round(penWidthOut * sin(M_PI_2 + alpha + theta));
2065  }
2066  else
2067  {
2068  pt.x = xo + round(penWidthOut * cos(M_PI_2 + alpha + theta));
2069  pt.y = yo + round(penWidthOut * sin(M_PI_2 + alpha + theta));
2070  }
2071  PATH_AddEntry(pOutsidePath, &pt, PT_BEZIERTO);
2072  break;
2073  }
2074  }
2075  }
2076  type = add_points( pNewPath, pUpPath->pPoints, pUpPath->numEntriesUsed, PT_LINETO );
2077  type[0] = PT_MOVETO;
2078  reverse_points( pDownPath->pPoints, pDownPath->numEntriesUsed );
2079  type = add_points( pNewPath, pDownPath->pPoints, pDownPath->numEntriesUsed, PT_LINETO );
2080  if (pStrokes[i]->pFlags[pStrokes[i]->numEntriesUsed - 1] & PT_CLOSEFIGURE) type[0] = PT_MOVETO;
2081 
2082  PATH_DestroyGdiPath(pStrokes[i]);
2083  ExFreePoolWithTag(pStrokes[i], TAG_PATH);
2084  PATH_DestroyGdiPath(pUpPath);
2085  ExFreePoolWithTag(pUpPath, TAG_PATH);
2086  PATH_DestroyGdiPath(pDownPath);
2087  ExFreePoolWithTag(pDownPath, TAG_PATH);
2088  }
2089  if (pStrokes) ExFreePoolWithTag(pStrokes, TAG_PATH);
2090 
2091  PATH_UnlockPath(flat_path);
2092  PATH_Delete(flat_path->BaseObject.hHmgr);
2093  pNewPath->state = PATH_Closed;
2094  PATH_UnlockPath(pNewPath);
2095  return pNewPath;
2096 }
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
Definition: complex.cpp:188
#define M_PI_4
Definition: port.h:153
BOOL FASTCALL PATH_AddEntry(PPATH pPath, const POINT *pPoint, BYTE flags)
Definition: path.c:262
#define PS_ENDCAP_SQUARE
Definition: wingdi.h:594
valarray< _Tp > atan2(const valarray< _Tp > &__x, const valarray< _Tp > &__y)
Definition: _valarray.h:928
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define pt(x, y)
Definition: drawing.c:79
PPATH FASTCALL PATH_CreatePath(int count)
Definition: path.c:35
Definition: path.h:34
#define round(x)
Definition: path.c:1769
#define PS_JOIN_BEVEL
Definition: wingdi.h:596
static void reverse_points(POINT *points, UINT count)
Definition: path.c:494
#define PS_JOIN_MITER
Definition: wingdi.h:597
int32_t INT
Definition: typedefs.h:58
POINTL point
Definition: edittest.c:50
LONG y
Definition: windef.h:330
#define FALSE
Definition: types.h:117
PPATH FASTCALL PATH_FlattenPath(PPATH pPath)
Definition: path.c:1407
#define TAG_PATH
Definition: tags.h:25
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
POINT * pPoints
Definition: path.h:53
#define PATH_UnlockPath(pPath)
Definition: path.h:71
int numEntriesUsed
Definition: path.h:55
#define PS_ENDCAP_ROUND
Definition: wingdi.h:593
static BYTE * add_points(PPATH path, const POINT *points, DWORD count, BYTE type)
Definition: path.c:480
BYTE * pFlags
Definition: path.h:54
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 GLint GLint j
Definition: glfuncs.h:250
#define ASSERT(a)
Definition: mode.c:44
VOID FASTCALL PATH_DestroyGdiPath(PPATH pPath)
Definition: path.c:80
#define PS_JOIN_ROUND
Definition: wingdi.h:598
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG x
Definition: windef.h:329
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define M_PI_2
Definition: port.h:185
unsigned char BYTE
Definition: xxhash.c:193
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
#define ERR(fmt,...)
Definition: debug.h:110
static unsigned __int64 next
Definition: rand_nt.c:6
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
Definition: path.h:19
#define PS_ENDCAP_FLAT
Definition: wingdi.h:595
#define PS_ENDCAP_MASK
Definition: wingdi.h:601
#define PS_JOIN_MASK
Definition: wingdi.h:599
#define M_PI
Definition: macros.h:263
#define NULL
Definition: types.h:112
VOID FASTCALL PATH_InitGdiPath(PPATH pPath)
Definition: path.c:142
#define PT_CLOSEFIGURE
Definition: wingdi.h:886
#define PT_LINETO
Definition: wingdi.h:884
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740
#define PT_MOVETO
Definition: wingdi.h:883
BASEOBJECT BaseObject
Definition: path.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
FLONG state
Definition: path.h:52
static BOOL PATH_DoArcPart(PPATH pPath, POINT corners[], double angleStart, double angleEnd, BYTE startEntryType)
Definition: path.c:890
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define PT_BEZIERTO
Definition: wingdi.h:885
BOOL FASTCALL PATH_Delete(HPATH hPath)
Definition: path.c:90

Referenced by PATH_WidenPath().

◆ IntGetCurrentPositionEx()

VOID FASTCALL IntGetCurrentPositionEx ( PDC  dc,
LPPOINT  pt 
)

Definition at line 128 of file line.c.

129 {
130  PDC_ATTR pdcattr = dc->pdcattr;
131 
132  if ( pt )
133  {
134  if (pdcattr->ulDirty_ & DIRTY_PTFXCURRENT)
135  {
136  pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
137  CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
139  }
140  pt->x = pdcattr->ptlCurrent.x;
141  pt->y = pdcattr->ptlCurrent.y;
142  }
143 }
#define pt(x, y)
Definition: drawing.c:79
LONG y
Definition: windef.h:330
#define DIRTY_PTFXCURRENT
Definition: ntgdihdl.h:154
ULONG ulDirty_
Definition: ntgdihdl.h:298
#define DIRTY_STYLESTATE
Definition: ntgdihdl.h:155
LONG x
Definition: windef.h:329
POINTL ptfxCurrent
Definition: ntgdihdl.h:316
#define CoordLPtoDP(pdc, ppt)
Definition: coord.h:187
static const WCHAR dc[]
POINTL ptlCurrent
Definition: ntgdihdl.h:315

Referenced by NtGdiBeginPath(), PATH_Arc(), PATH_LineTo(), PATH_MoveTo(), PATH_PolyDraw(), and PATH_StrokePath().

◆ PATH_AddEntry()

BOOL FASTCALL PATH_AddEntry ( PPATH  pPath,
const POINT pPoint,
BYTE  flags 
)

Definition at line 262 of file path.c.

266 {
267  ASSERT(pPath != NULL);
268 
269  /* FIXME: If newStroke is true, perhaps we want to check that we're
270  * getting a PT_MOVETO
271  */
272  TRACE("(%d,%d) - %d\n", pPoint->x, pPoint->y, flags);
273 
274  /* Reserve enough memory for an extra path entry */
275  if (!PATH_ReserveEntries(pPath, pPath->numEntriesUsed + 1))
276  return FALSE;
277 
278  /* Store information in path entry */
279  pPath->pPoints[pPath->numEntriesUsed] = *pPoint;
280  pPath->pFlags[pPath->numEntriesUsed] = flags;
281 
282  /* Increment entry count */
283  pPath->numEntriesUsed++;
284 
285  return TRUE;
286 }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
POINT * pPoints
Definition: path.h:53
int numEntriesUsed
Definition: path.h:55
BYTE * pFlags
Definition: path.h:54
#define TRACE(s)
Definition: solgame.cpp:4
#define ASSERT(a)
Definition: mode.c:44
GLbitfield flags
Definition: glext.h:7161
#define NULL
Definition: types.h:112
BOOL FASTCALL PATH_ReserveEntries(PPATH pPath, INT numEntries)
Definition: path.c:296

Referenced by IntGdiWidenPath(), PATH_add_outline(), PATH_AddFlatBezier(), PATH_Arc(), PATH_BezierTo(), PATH_FlattenPath(), PATH_LineTo(), and PATH_PolyPolyline().

◆ PATH_AddFlatBezier()

BOOL FASTCALL PATH_AddFlatBezier ( PPATH  pPath,
POINT pt,
BOOL  closed 
)

Definition at line 1378 of file path.c.

1382 {
1383  POINT *pts;
1384  BOOL ret = FALSE;
1385  INT no, i;
1386 
1387  pts = GDI_Bezier(pt, 4, &no);
1388  if (!pts) return FALSE;
1389 
1390  for (i = 1; i < no; i++)
1391  {
1392  if (!(ret = PATH_AddEntry(pPath, &pts[i], (i == no - 1 && closed) ? PT_LINETO | PT_CLOSEFIGURE : PT_LINETO)))
1393  break;
1394  }
1395 
1397  return ret;
1398 }
BOOL FASTCALL PATH_AddEntry(PPATH pPath, const POINT *pPoint, BYTE flags)
Definition: path.c:262
#define pt(x, y)
Definition: drawing.c:79
int32_t INT
Definition: typedefs.h:58
DWORD ret
Definition: path.c:47
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TAG_BEZIER
Definition: tags.h:13
static WCHAR no[MAX_STRING_RESOURCE_LEN]
Definition: object.c:2340
POINT * GDI_Bezier(const POINT *Points, INT count, INT *nPtsOut)
Definition: bezier.c:189
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
#define PT_CLOSEFIGURE
Definition: wingdi.h:886
#define PT_LINETO
Definition: wingdi.h:884
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by PATH_FlattenPath().

◆ PATH_Arc()

BOOL FASTCALL PATH_Arc ( PDC  dc,
INT  x1,
INT  y1,
INT  x2,
INT  y2,
INT  xStart,
INT  yStart,
INT  xEnd,
INT  yEnd,
INT  direction,
INT  lines 
)

Definition at line 955 of file path.c.

967 {
968  double angleStart, angleEnd, angleStartQuadrant, angleEndQuadrant = 0.0;
969  /* Initialize angleEndQuadrant to silence gcc's warning */
970  FLOATL x, y;
971  POINT corners[2], pointStart, pointEnd;
972  POINT centre, pointCurPos;
973  BOOL start, end, Ret = TRUE;
974  INT temp;
975  BOOL clockwise;
976  PPATH pPath;
977 
978  /* FIXME: This function should check for all possible error returns */
979  /* FIXME: Do we have to respect newStroke? */
980 
981  ASSERT(dc);
982 
983  pPath = PATH_LockPath(dc->dclevel.hPath);
984  if (!pPath) return FALSE;
985 
986  if (direction)
987  clockwise = ((direction == AD_CLOCKWISE) !=0 );
988  else
989  clockwise = ((dc->dclevel.flPath & DCPATH_CLOCKWISE) != 0);
990 
991  /* Check for zero height / width */
992  /* FIXME: Only in GM_COMPATIBLE? */
993  if (x1 == x2 || y1 == y2)
994  {
995  Ret = TRUE;
996  goto ArcExit;
997  }
998  /* Convert points to device coordinates */
999  corners[0].x = x1; corners[0].y = y1;
1000  corners[1].x = x2; corners[1].y = y2;
1001  pointStart.x = xStart; pointStart.y = yStart;
1002  pointEnd.x = xEnd; pointEnd.y = yEnd;
1003  INTERNAL_LPTODP(dc, corners, 2);
1004  INTERNAL_LPTODP(dc, &pointStart, 1);
1005  INTERNAL_LPTODP(dc, &pointEnd, 1);
1006 
1007  /* Make sure first corner is top left and second corner is bottom right */
1008  if (corners[0].x > corners[1].x)
1009  {
1010  temp = corners[0].x;
1011  corners[0].x = corners[1].x;
1012  corners[1].x = temp;
1013  }
1014  if (corners[0].y > corners[1].y)
1015  {
1016  temp = corners[0].y;
1017  corners[0].y = corners[1].y;
1018  corners[1].y = temp;
1019  }
1020 
1021  /* Compute start and end angle */
1022  PATH_NormalizePoint(corners, &pointStart, &x, &y);
1023  angleStart = atan2(*(FLOAT*)&y, *(FLOAT*)&x);
1024  PATH_NormalizePoint(corners, &pointEnd, &x, &y);
1025  angleEnd = atan2(*(FLOAT*)&y, *(FLOAT*)&x);
1026 
1027  /* Make sure the end angle is "on the right side" of the start angle */
1028  if (clockwise)
1029  {
1030  if (angleEnd <= angleStart)
1031  {
1032  angleEnd += 2 * M_PI;
1033  ASSERT(angleEnd >= angleStart);
1034  }
1035  }
1036  else
1037  {
1038  if (angleEnd >= angleStart)
1039  {
1040  angleEnd -= 2 * M_PI;
1041  ASSERT(angleEnd <= angleStart);
1042  }
1043  }
1044 
1045  /* In GM_COMPATIBLE, don't include bottom and right edges */
1046  if (dc->pdcattr->iGraphicsMode == GM_COMPATIBLE)
1047  {
1048  corners[1].x--;
1049  corners[1].y--;
1050  }
1051 
1052  /* arcto: Add a PT_MOVETO only if this is the first entry in a stroke */
1053  if (lines == GdiTypeArcTo && pPath->newStroke) // -1
1054  {
1055  pPath->newStroke = FALSE;
1056  IntGetCurrentPositionEx(dc, &pointCurPos);
1057  CoordLPtoDP(dc, &pointCurPos);
1058  if (!PATH_AddEntry(pPath, &pointCurPos, PT_MOVETO))
1059  {
1060  Ret = FALSE;
1061  goto ArcExit;
1062  }
1063  }
1064 
1065  /* Add the arc to the path with one Bezier spline per quadrant that the
1066  * arc spans */
1067  start = TRUE;
1068  end = FALSE;
1069  do
1070  {
1071  /* Determine the start and end angles for this quadrant */
1072  if (start)
1073  {
1074  angleStartQuadrant = angleStart;
1075  if (clockwise)
1076  angleEndQuadrant = (floor(angleStart / M_PI_2) + 1.0) * M_PI_2;
1077  else
1078  angleEndQuadrant = (ceil(angleStart / M_PI_2) - 1.0) * M_PI_2;
1079  }
1080  else
1081  {
1082  angleStartQuadrant = angleEndQuadrant;
1083  if (clockwise)
1084  angleEndQuadrant += M_PI_2;
1085  else
1086  angleEndQuadrant -= M_PI_2;
1087  }
1088 
1089  /* Have we reached the last part of the arc? */
1090  if ((clockwise && angleEnd < angleEndQuadrant) ||
1091  (!clockwise && angleEnd > angleEndQuadrant))
1092  {
1093  /* Adjust the end angle for this quadrant */
1094  angleEndQuadrant = angleEnd;
1095  end = TRUE;
1096  }
1097 
1098  /* Add the Bezier spline to the path */
1099  PATH_DoArcPart(pPath,
1100  corners,
1101  angleStartQuadrant,
1102  angleEndQuadrant,
1103  start ? (lines == GdiTypeArcTo ? PT_LINETO : PT_MOVETO) : FALSE); // -1
1104  start = FALSE;
1105  }
1106  while (!end);
1107 
1108  if (lines == GdiTypeArcTo)
1109  {
1110  update_current_pos( pPath );
1111  }
1112  else /* chord: close figure. pie: add line and close figure */
1113  if (lines == GdiTypeChord) // 1
1114  {
1115  IntGdiCloseFigure(pPath);
1116  }
1117  else if (lines == GdiTypePie) // 2
1118  {
1119  centre.x = (corners[0].x + corners[1].x) / 2;
1120  centre.y = (corners[0].y + corners[1].y) / 2;
1121  if (!PATH_AddEntry(pPath, &centre, PT_LINETO | PT_CLOSEFIGURE))
1122  Ret = FALSE;
1123  }
1124 ArcExit:
1125  PATH_UnlockPath(pPath);
1126  return Ret;
1127 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
_Check_return_ _CRTIMP double __cdecl ceil(_In_ double x)
BOOL FASTCALL PATH_AddEntry(PPATH pPath, const POINT *pPoint, BYTE flags)
Definition: path.c:262
valarray< _Tp > atan2(const valarray< _Tp > &__x, const valarray< _Tp > &__y)
Definition: _valarray.h:928
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define TRUE
Definition: types.h:120
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
Definition: path.h:34
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
int32_t INT
Definition: typedefs.h:58
#define PATH_LockPath(hPath)
Definition: path.h:70
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID FASTCALL IntGdiCloseFigure(PPATH pPath)
Definition: path.c:108
#define AD_CLOCKWISE
Definition: wingdi.h:667
static void update_current_pos(PPATH path)
Definition: path.c:519
#define PATH_UnlockPath(pPath)
Definition: path.h:71
VOID FASTCALL IntGetCurrentPositionEx(PDC dc, LPPOINT pt)
Definition: line.c:128
eMaj lines
Definition: tritemp.h:206
#define ASSERT(a)
Definition: mode.c:44
#define GM_COMPATIBLE
Definition: wingdi.h:863
GLuint GLuint end
Definition: gl.h:1545
#define M_PI_2
Definition: port.h:185
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
FLOAT FLOATL
Definition: winddi.h:114
static calc_node_t temp
Definition: rpn_ieee.c:38
GLuint start
Definition: gl.h:1545
BOOL newStroke
Definition: path.h:57
#define M_PI
Definition: macros.h:263
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
#define CoordLPtoDP(pdc, ppt)
Definition: coord.h:187
#define PT_CLOSEFIGURE
Definition: wingdi.h:886
#define PT_LINETO
Definition: wingdi.h:884
float FLOAT
Definition: typedefs.h:69
#define PT_MOVETO
Definition: wingdi.h:883
static const WCHAR dc[]
static BOOL PATH_DoArcPart(PPATH pPath, POINT corners[], double angleStart, double angleEnd, BYTE startEntryType)
Definition: path.c:890
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)
static VOID PATH_NormalizePoint(POINTL corners[], const POINTL *pPoint, FLOATL *pX, FLOATL *pY)
Definition: path.c:401
static BOOLEAN INTERNAL_LPTODP(DC *dc, LPPOINT points, UINT count)
Definition: coord.h:47

Referenced by IntGdiArcInternal().

◆ PATH_Delete()

BOOL FASTCALL PATH_Delete ( HPATH  hPath)

Definition at line 90 of file path.c.

91 {
92  PPATH pPath;
93  if (!hPath) return FALSE;
94  pPath = PATH_LockPath(hPath);
95  if (!pPath) return FALSE;
96  PATH_DestroyGdiPath(pPath);
98 #if DBG
99  PathCount--;
100  TRACE("Delete Path %d\n",PathCount);
101 #endif
102  return TRUE;
103 }
#define TRUE
Definition: types.h:120
Definition: path.h:34
#define PATH_LockPath(hPath)
Definition: path.h:70
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
Definition: gdiobj.c:1111
VOID FASTCALL PATH_DestroyGdiPath(PPATH pPath)
Definition: path.c:80
BASEOBJECT BaseObject
Definition: path.h:36

Referenced by DC_vCleanup(), IntGdiCleanDC(), IntGdiWidenPath(), NtGdiAbortPath(), NtGdiBeginPath(), NtGdiFillPath(), NtGdiFlattenPath(), NtGdiPathToRegion(), NtGdiSelectClipPath(), NtGdiStrokeAndFillPath(), NtGdiStrokePath(), NtGdiWidenPath(), and PATH_FlattenPath().

◆ PATH_Ellipse()

BOOL PATH_Ellipse ( PDC  dc,
INT  x1,
INT  y1,
INT  x2,
INT  y2 
)

Definition at line 782 of file path.c.

788 {
789  PPATH pPath;
790  POINT points[13];
791  RECTL rect;
792  BYTE *type;
793  LONG xRadius, yRadius, xOffset, yOffset;
795 
796  TRACE("PATH_Ellipse: %p -> (%d, %d) - (%d, %d)\n",
797  dc, x1, y1, x2, y2);
798 
799  if (!PATH_CheckRect(dc, &rect, x1, y1, x2, y2))
800  {
801  return TRUE;
802  }
803 
804  xRadius = RECTL_lGetWidth(&rect) / 2;
805  yRadius = RECTL_lGetHeight(&rect) / 2;
806 
807  /* Get the four points which box our ellipse */
808  left.x = rect.left; left.y = rect.top + yRadius;
809  top.x = rect.left + xRadius; top.y = rect.top;
810  right.x = rect.right; right.y = rect.bottom - yRadius;
811  bottom.x = rect.right - xRadius; bottom.y = rect.bottom;
812 
813  /*
814  * See here to understand what's happening
815  * https://stackoverflow.com/questions/1734745/how-to-create-circle-with-b%C3%A9zier-curves
816  */
817  xOffset = EngMulDiv(RECTL_lGetWidth(&rect), 55428475, 200000000); /* w * 0.55428475 / 2 */
818  yOffset = EngMulDiv(RECTL_lGetHeight(&rect), 55428475, 200000000); /* h * 0.55428475 / 2 */
819  TRACE("xOffset %d, yOffset %d, Rect WxH: %dx%d.\n",
821 
822  pPath = PATH_LockPath(dc->dclevel.hPath);
823  if (!pPath)
824  return FALSE;
825 
826  /* Starting point: Right */
827  points[0] = right;
828 
829  /* first curve - going up, left */
830  points[1] = right;
831  points[1].y -= yOffset;
832  points[2] = top;
833  points[2].x += xOffset;
834 
835  /* top */
836  points[3] = top;
837 
838  /* second curve - going left, down*/
839  points[4] = top;
840  points[4].x -= xOffset;
841  points[5] = left;
842  points[5].y -= yOffset;
843 
844  /* Left */
845  points[6] = left;
846 
847  /* Third curve - going down, right */
848  points[7] = left;
849  points[7].y += yOffset;
850  points[8] = bottom;
851  points[8].x -= xOffset;
852 
853  /* bottom */
854  points[9] = bottom;
855 
856  /* Fourth curve - Going right, up */
857  points[10] = bottom;
858  points[10].x += xOffset;
859  points[11] = right;
860  points[11].y += yOffset;
861 
862  /* Back to starting point */
863  points[12] = right;
864 
865  if (dc->dclevel.flPath & DCPATH_CLOCKWISE) reverse_points( points, 13 );
866  if (!(type = add_points( pPath, points, 13, PT_BEZIERTO )))
867  {
868  ERR("PATH_Ellipse No add\n");
869  PATH_UnlockPath(pPath);
870  return FALSE;
871  }
872  type[0] = PT_MOVETO;
873 
874  IntGdiCloseFigure(pPath);
875  PATH_UnlockPath(pPath);
876  return TRUE;
877 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
#define TRUE
Definition: types.h:120
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
Definition: path.h:34
static void reverse_points(POINT *points, UINT count)
Definition: path.c:494
& rect
Definition: startmenu.cpp:1413
#define PATH_LockPath(hPath)
Definition: path.h:70
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
VOID FASTCALL IntGdiCloseFigure(PPATH pPath)
Definition: path.c:108
GLint GLint bottom
Definition: glext.h:7726
FORCEINLINE LONG RECTL_lGetWidth(_In_ const RECTL *prcl)
Definition: rect.h:93
#define PATH_UnlockPath(pPath)
Definition: path.h:71
static BYTE * add_points(PPATH path, const POINT *points, DWORD count, BYTE type)
Definition: path.c:480
#define TRACE(s)
Definition: solgame.cpp:4
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLsizei const GLfloat * points
Definition: glext.h:8112
static BOOL PATH_CheckRect(DC *dc, RECTL *rect, INT x1, INT y1, INT x2, INT y2)
Definition: path.c:433
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
unsigned char BYTE
Definition: xxhash.c:193
#define ERR(fmt,...)
Definition: debug.h:110
int xOffset
Definition: appswitch.c:59
ENGAPI INT APIENTRY EngMulDiv(_In_ INT a, _In_ INT b, _In_ INT c)
Definition: math.c:26
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
FORCEINLINE LONG RECTL_lGetHeight(_In_ const RECTL *prcl)
Definition: rect.h:86
#define PT_MOVETO
Definition: wingdi.h:883
static const WCHAR dc[]
int yOffset
Definition: appswitch.c:59
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define PT_BEZIERTO
Definition: wingdi.h:885

Referenced by NtGdiEllipse().

◆ PATH_EmptyPath()

VOID FASTCALL PATH_EmptyPath ( PPATH  pPath)

Definition at line 246 of file path.c.

247 {
248  ASSERT(pPath != NULL);
249 
250  pPath->state = PATH_Null;
251  pPath->numEntriesUsed = 0;
252 }
Definition: path.h:18
int numEntriesUsed
Definition: path.h:55
#define ASSERT(a)
Definition: mode.c:44
#define NULL
Definition: types.h:112
FLONG state
Definition: path.h:52

Referenced by PATH_CreatePath().

◆ PATH_ExtTextOut()

BOOL FASTCALL PATH_ExtTextOut ( PDC  dc,
INT  x,
INT  y,
UINT  flags,
const RECTL lprc,
LPCWSTR  str,
UINT  count,
const INT dx 
)

Definition at line 2335 of file path.c.

2344 {
2345  PPATH pPath;
2346  unsigned int idx, ggo_flags = GGO_NATIVE;
2347  POINT offset = {0, 0};
2348 
2349  pPath = PATH_LockPath(dc->dclevel.hPath);
2350  if (!pPath)
2351  {
2352  return FALSE;
2353  }
2354 
2355  if (pPath->state != PATH_Open)
2356  {
2357  ERR("PATH_ExtTextOut not open\n");
2358  return FALSE;
2359  }
2360 
2361  if (!count) return TRUE;
2362  if (flags & ETO_GLYPH_INDEX) ggo_flags |= GGO_GLYPH_INDEX;
2363 
2364  for (idx = 0; idx < count; idx++)
2365  {
2366  MAT2 identity = { {0, 1}, {0, 0}, {0, 0}, {0, 1} };
2367  GLYPHMETRICS gm;
2368  DWORD dwSize;
2369  void *outline;
2370 
2372  str[idx],
2373  ggo_flags,
2374  &gm,
2375  0,
2376  NULL,
2377  &identity,
2378  TRUE);
2379  if (dwSize == GDI_ERROR)
2380  {
2381  PATH_UnlockPath(pPath);
2382  return FALSE;
2383  }
2384 
2385  /* Add outline only if char is printable */
2386  if (dwSize)
2387  {
2389  if (!outline)
2390  {
2391  PATH_UnlockPath(pPath);
2392  return FALSE;
2393  }
2394 
2396  str[idx],
2397  ggo_flags,
2398  &gm,
2399  dwSize,
2400  outline,
2401  &identity,
2402  TRUE);
2403 
2404  PATH_add_outline(dc, pPath, x + offset.x, y + offset.y, outline, dwSize);
2405 
2407  }
2408 
2409  if (dx)
2410  {
2411  if (flags & ETO_PDY)
2412  {
2413  offset.x += dx[idx * 2];
2414  offset.y += dx[idx * 2 + 1];
2415  }
2416  else
2417  offset.x += dx[idx];
2418  }
2419  else
2420  {
2421  offset.x += gm.gmCellIncX;
2422  offset.y += gm.gmCellIncY;
2423  }
2424  }
2425  PATH_UnlockPath(pPath);
2426  return TRUE;
2427 }
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
Definition: path.h:34
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
short gmCellIncY
Definition: wingdi.h:2445
Definition: wingdi.h:2471
#define PATH_LockPath(hPath)
Definition: path.h:70
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
#define TAG_PATH
Definition: tags.h:25
const WCHAR * str
#define GGO_NATIVE
Definition: wingdi.h:849
#define PATH_UnlockPath(pPath)
Definition: path.h:71
GLintptr offset
Definition: glext.h:5920
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define GGO_GLYPH_INDEX
Definition: wingdi.h:854
Definition: mesh.c:5329
short gmCellIncX
Definition: wingdi.h:2444
#define ERR(fmt,...)
Definition: debug.h:110
static BOOL FASTCALL PATH_add_outline(PDC dc, PPATH pPath, INT x, INT y, TTPOLYGONHEADER *header, DWORD size)
Definition: path.c:2238
Definition: path.h:19
ULONG FASTCALL ftGdiGetGlyphOutline(PDC dc, WCHAR wch, UINT iFormat, LPGLYPHMETRICS pgm, ULONG cjBuf, PVOID pvBuf, LPMAT2 pmat2, BOOL bIgnoreRotation)
Definition: freetype.c:3761
#define NULL
Definition: types.h:112
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint dx
Definition: linetemp.h:97
#define ETO_PDY
Definition: wingdi.h:656
static const WCHAR dc[]
FLONG state
Definition: path.h:52
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define GDI_ERROR
Definition: wingdi.h:1308
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56

Referenced by IntExtTextOutW().

◆ PATH_FillPath()

BOOL FASTCALL PATH_FillPath ( PDC  dc,
PPATH  pPath 
)

Definition at line 1506 of file path.c.

1509 {
1510  return PATH_FillPathEx(dc, pPath, NULL);
1511 }
BOOL FASTCALL PATH_FillPathEx(PDC dc, PPATH pPath, PBRUSH pbrFill)
Definition: path.c:1515
#define NULL
Definition: types.h:112
static const WCHAR dc[]

Referenced by NtGdiFillPath(), and NtGdiStrokeAndFillPath().

◆ PATH_FillPathEx()

BOOL FASTCALL PATH_FillPathEx ( PDC  dc,
PPATH  pPath,
PBRUSH  pbrFill 
)

Definition at line 1515 of file path.c.

1519 {
1520  INT mapMode, graphicsMode;
1521  SIZE ptViewportExt, ptWindowExt;
1522  POINTL ptViewportOrg, ptWindowOrg;
1523  XFORML xform;
1524  PREGION Rgn;
1525  PDC_ATTR pdcattr = dc->pdcattr;
1526 
1527  /* Allocate a temporary region */
1528  Rgn = IntSysCreateRectpRgn(0, 0, 0, 0);
1529  if (!Rgn)
1530  {
1532  return FALSE;
1533  }
1534 
1535  if (!PATH_PathToRegion(pPath, pdcattr->jFillMode, Rgn))
1536  {
1537  TRACE("PFP : Fail P2R\n");
1538  /* EngSetLastError ? */
1539  REGION_Delete(Rgn);
1540  return FALSE;
1541  }
1542 
1543  /* Since PaintRgn interprets the region as being in logical coordinates
1544  * but the points we store for the path are already in device
1545  * coordinates, we have to set the mapping mode to MM_TEXT temporarily.
1546  * Using SaveDC to save information about the mapping mode / world
1547  * transform would be easier but would require more overhead, especially
1548  * now that SaveDC saves the current path.
1549  */
1550 
1551  /* Save the information about the old mapping mode */
1552  mapMode = pdcattr->iMapMode;
1553  ptViewportExt = pdcattr->szlViewportExt;
1554  ptViewportOrg = pdcattr->ptlViewportOrg;
1555  ptWindowExt = pdcattr->szlWindowExt;
1556  ptWindowOrg = pdcattr->ptlWindowOrg;
1557 
1558  /* Save world transform
1559  * NB: The Windows documentation on world transforms would lead one to
1560  * believe that this has to be done only in GM_ADVANCED; however, my
1561  * tests show that resetting the graphics mode to GM_COMPATIBLE does
1562  * not reset the world transform.
1563  */
1564  MatrixS2XForm(&xform, &dc->pdcattr->mxWorldToPage);
1565 
1566  /* Set MM_TEXT */
1568  pdcattr->ptlViewportOrg.x = 0;
1569  pdcattr->ptlViewportOrg.y = 0;
1570  pdcattr->ptlWindowOrg.x = 0;
1571  pdcattr->ptlWindowOrg.y = 0;
1572 
1573  graphicsMode = pdcattr->iGraphicsMode;
1574  pdcattr->iGraphicsMode = GM_ADVANCED;
1576  pdcattr->iGraphicsMode = graphicsMode;
1577 
1578  /* Paint the region */
1579  IntGdiFillRgn(dc, Rgn, pbrFill);
1580  REGION_Delete(Rgn);
1581  /* Restore the old mapping mode */
1582  IntGdiSetMapMode(dc, mapMode);
1583  pdcattr->szlViewportExt = ptViewportExt;
1584  pdcattr->ptlViewportOrg = ptViewportOrg;
1585  pdcattr->szlWindowExt = ptWindowExt;
1586  pdcattr->ptlWindowOrg = ptWindowOrg;
1587 
1588  /* Go to GM_ADVANCED temporarily to restore the world transform */
1589  graphicsMode = pdcattr->iGraphicsMode;
1590  pdcattr->iGraphicsMode = GM_ADVANCED;
1592  pdcattr->iGraphicsMode = graphicsMode;
1593  return TRUE;
1594 }
BOOL NTAPI GreModifyWorldTransform(PDC pdc, const XFORML *pxform, DWORD dwMode)
Definition: coord.c:461
int APIENTRY IntGdiSetMapMode(PDC dc, int MapMode)
Definition: coord.c:828
POINTL ptlViewportOrg
Definition: ntgdihdl.h:347
#define MWT_SET
Definition: ntgdityp.h:180
#define TRUE
Definition: types.h:120
INT iMapMode
Definition: ntgdihdl.h:342
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
int32_t INT
Definition: typedefs.h:58
LONG y
Definition: windef.h:330
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2426
#define FALSE
Definition: types.h:117
BOOL FASTCALL PATH_PathToRegion(PPATH pPath, INT Mode, PREGION Rgn)
Definition: path.c:1451
Definition: region.h:7
#define TRACE(s)
Definition: solgame.cpp:4
LONG x
Definition: windef.h:329
BYTE jFillMode
Definition: ntgdihdl.h:313
#define MatrixS2XForm(x, m)
Definition: coord.h:200
SIZEL szlWindowExt
Definition: ntgdihdl.h:346
BOOL IntGdiFillRgn(_In_ PDC pdc, _In_ PREGION prgn, _In_opt_ PBRUSH pbrFill)
Definition: bitblt.c:1182
#define MWT_IDENTITY
Definition: wingdi.h:943
#define MM_TEXT
Definition: wingdi.h:872
SIZEL szlViewportExt
Definition: ntgdihdl.h:348
static const WCHAR dc[]
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2468
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
POINTL ptlWindowOrg
Definition: ntgdihdl.h:345
#define GM_ADVANCED
Definition: wingdi.h:864
INT iGraphicsMode
Definition: ntgdihdl.h:310

Referenced by PATH_FillPath().

◆ PATH_FlattenPath()

PPATH FASTCALL PATH_FlattenPath ( PPATH  pPath)

Definition at line 1407 of file path.c.

1408 {
1409  PPATH newPath;
1410  INT srcpt;
1411  TRACE("PATH_FlattenPath\n");
1412  if (!(newPath = PATH_CreatePath(pPath->numEntriesUsed))) return NULL;
1413 
1414  for (srcpt = 0; srcpt < pPath->numEntriesUsed; srcpt++)
1415  {
1416  switch(pPath->pFlags[srcpt] & ~PT_CLOSEFIGURE)
1417  {
1418  case PT_MOVETO:
1419  case PT_LINETO:
1420  if (!PATH_AddEntry(newPath, &pPath->pPoints[srcpt], pPath->pFlags[srcpt]))
1421  {
1422  PATH_UnlockPath(newPath);
1423  PATH_Delete(newPath->BaseObject.hHmgr);
1424  return NULL;
1425  }
1426  break;
1427  case PT_BEZIERTO:
1428  if(!PATH_AddFlatBezier(newPath, &pPath->pPoints[srcpt - 1], pPath->pFlags[srcpt + 2] & PT_CLOSEFIGURE))
1429  {
1430  PATH_UnlockPath(newPath);
1431  PATH_Delete(newPath->BaseObject.hHmgr);
1432  return NULL;
1433  }
1434  srcpt += 2;
1435  break;
1436  }
1437  }
1438  TRACE("PATH_FlattenPath good\n");
1439  newPath->state = pPath->state;
1440  return newPath;
1441 }
BOOL FASTCALL PATH_AddEntry(PPATH pPath, const POINT *pPoint, BYTE flags)
Definition: path.c:262
PPATH FASTCALL PATH_CreatePath(int count)
Definition: path.c:35
Definition: path.h:34
int32_t INT
Definition: typedefs.h:58
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
POINT * pPoints
Definition: path.h:53
#define PATH_UnlockPath(pPath)
Definition: path.h:71
int numEntriesUsed
Definition: path.h:55
BYTE * pFlags
Definition: path.h:54
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112
BOOL FASTCALL PATH_AddFlatBezier(PPATH pPath, POINT *pt, BOOL closed)
Definition: path.c:1378
#define PT_CLOSEFIGURE
Definition: wingdi.h:886
#define PT_LINETO
Definition: wingdi.h:884
#define PT_MOVETO
Definition: wingdi.h:883
BASEOBJECT BaseObject
Definition: path.h:36
FLONG state
Definition: path.h:52
#define PT_BEZIERTO
Definition: wingdi.h:885
BOOL FASTCALL PATH_Delete(HPATH hPath)
Definition: path.c:90

Referenced by IntGdiWidenPath(), NtGdiFillPath(), NtGdiFlattenPath(), NtGdiPathToRegion(), NtGdiSelectClipPath(), NtGdiStrokeAndFillPath(), and NtGdiStrokePath().

◆ PATH_LineTo()

BOOL FASTCALL PATH_LineTo ( PDC  dc,
INT  x,
INT  y 
)

Definition at line 583 of file path.c.

587 {
588  BOOL Ret;
589  PPATH pPath;
590  POINT point, pointCurPos;
591 
592  pPath = PATH_LockPath(dc->dclevel.hPath);
593  if (!pPath) return FALSE;
594 
595  point.x = x;
596  point.y = y;
597 
598  // Coalesce a MoveTo point.
599  if ( !PATH_MoveTo(dc, pPath) )
600  {
601  /* Add a PT_MOVETO if necessary */
602  if (pPath->newStroke)
603  {
604  TRACE("Line To : New Stroke\n");
605  pPath->newStroke = FALSE;
606  IntGetCurrentPositionEx(dc, &pointCurPos);
607  CoordLPtoDP(dc, &pointCurPos);
608  if (!PATH_AddEntry(pPath, &pointCurPos, PT_MOVETO))
609  {
610  PATH_UnlockPath(pPath);
611  return FALSE;
612  }
613  }
614  }
615  Ret = add_log_points_new_stroke( dc, pPath, &point, 1, PT_LINETO );
616  PATH_UnlockPath(pPath);
617  return Ret;
618 }
BOOL FASTCALL PATH_AddEntry(PPATH pPath, const POINT *pPoint, BYTE flags)
Definition: path.c:262
BOOL FASTCALL PATH_MoveTo(PDC dc, PPATH pPath)
Definition: path.c:554
Definition: path.h:34
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
POINTL point
Definition: edittest.c:50
#define PATH_LockPath(hPath)
Definition: path.h:70
LONG y
Definition: windef.h:330
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PATH_UnlockPath(pPath)
Definition: path.h:71
VOID FASTCALL IntGetCurrentPositionEx(PDC dc, LPPOINT pt)
Definition: line.c:128
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL add_log_points_new_stroke(DC *dc, PPATH path, const POINT *points, DWORD count, BYTE type)
Definition: path.c:533
LONG x
Definition: windef.h:329
BOOL newStroke
Definition: path.h:57
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define CoordLPtoDP(pdc, ppt)
Definition: coord.h:187
#define PT_LINETO
Definition: wingdi.h:884
#define PT_MOVETO
Definition: wingdi.h:883
static const WCHAR dc[]

Referenced by IntGdiLineTo().

◆ PATH_PathToRegion()

BOOL FASTCALL PATH_PathToRegion ( PPATH  pPath,
INT  nPolyFillMode,
PREGION  Rgn 
)

Definition at line 1451 of file path.c.

1455 {
1456  int i, pos, polygons;
1457  PULONG counts;
1458  int Ret;
1459 
1460  if (!pPath->numEntriesUsed) return FALSE;
1461 
1462  counts = ExAllocatePoolWithTag(PagedPool, (pPath->numEntriesUsed / 2) * sizeof(counts), TAG_PATH);
1463  if (!counts)
1464  {
1465  ERR("Failed to allocate %lu strokes\n", (pPath->numEntriesUsed / 2) * sizeof(*counts));
1467  return FALSE;
1468  }
1469 
1470  pos = polygons = 0;
1471  ASSERT( pPath->pFlags[0] == PT_MOVETO );
1472  for (i = 1; i < pPath->numEntriesUsed; i++)
1473  {
1474  if (pPath->pFlags[i] != PT_MOVETO) continue;
1475  counts[polygons++] = i - pos;
1476  pos = i;
1477  }
1478  if (i > pos + 1) counts[polygons++] = i - pos;
1479 
1480  ASSERT( polygons <= pPath->numEntriesUsed / 2 );
1481 
1482  /* Fill the region with the strokes */
1483  Ret = REGION_SetPolyPolygonRgn(Rgn,
1484  pPath->pPoints,
1485  counts,
1486  polygons,
1487  Mode);
1488  if (!Ret)
1489  {
1490  ERR("REGION_SetPolyPolygonRgn failed\n");
1491  }
1492 
1493  ExFreePoolWithTag(counts, TAG_PATH);
1494 
1495  /* Success! */
1496  return Ret;
1497 }
BOOL FASTCALL REGION_SetPolyPolygonRgn(_Inout_ PREGION prgn, _In_ const POINT *ppt, _In_ const ULONG *pcPoints, _In_ ULONG cPolygons, _In_ INT iMode)
Definition: region.c:3275
_In_ ULONG Mode
Definition: hubbusif.h:303
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define FALSE
Definition: types.h:117
#define TAG_PATH
Definition: tags.h:25
POINT * pPoints
Definition: path.h:53
int numEntriesUsed
Definition: path.h:55
BYTE * pFlags
Definition: path.h:54
#define ASSERT(a)
Definition: mode.c:44
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define ERR(fmt,...)
Definition: debug.h:110
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
unsigned int * PULONG
Definition: retypes.h:1
#define PT_MOVETO
Definition: wingdi.h:883
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by NtGdiPathToRegion(), NtGdiSelectClipPath(), and PATH_FillPathEx().

◆ PATH_PolyBezier()

BOOL FASTCALL PATH_PolyBezier ( PDC  dc,
const POINT pts,
DWORD  cbPoints 
)

Definition at line 1154 of file path.c.

1158 {
1159  PPATH pPath;
1160  BYTE *type;
1161 
1162  ASSERT(dc);
1163  ASSERT(pts);
1164  ASSERT(cbPoints);
1165 
1166  pPath = PATH_LockPath(dc->dclevel.hPath);
1167  if (!pPath) return FALSE;
1168 
1169  type = add_log_points( dc, pPath, pts, cbPoints, PT_BEZIERTO );
1170  if (!type) return FALSE;
1171 
1172  type[0] = PT_MOVETO;
1173 
1174  PATH_UnlockPath(pPath);
1175  return TRUE;
1176 }
#define TRUE
Definition: types.h:120
Definition: path.h:34
#define PATH_LockPath(hPath)
Definition: path.h:70
#define FALSE
Definition: types.h:117
#define PATH_UnlockPath(pPath)
Definition: path.h:71
#define ASSERT(a)
Definition: mode.c:44
unsigned char BYTE
Definition: xxhash.c:193
#define PT_MOVETO
Definition: wingdi.h:883
static const WCHAR dc[]
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define PT_BEZIERTO
Definition: wingdi.h:885
static BYTE * add_log_points(DC *dc, PPATH path, const POINT *points, DWORD count, BYTE type)
Definition: path.c:463

Referenced by IntGdiPolyBezier().

◆ PATH_PolyBezierTo()

BOOL FASTCALL PATH_PolyBezierTo ( PDC  dc,
const POINT pts,
DWORD  cbPoints 
)

Definition at line 1131 of file path.c.

1135 {
1136  PPATH pPath;
1137  BOOL ret;
1138 
1139  ASSERT(dc);
1140  ASSERT(pts);
1141  ASSERT(cbPoints);
1142 
1143  pPath = PATH_LockPath(dc->dclevel.hPath);
1144  if (!pPath) return FALSE;
1145 
1146  ret = add_log_points_new_stroke( dc, pPath, pts, cbPoints, PT_BEZIERTO );
1147 
1148  PATH_UnlockPath(pPath);
1149  return ret;
1150 }
Definition: path.h:34
DWORD ret
Definition: path.c:47
#define PATH_LockPath(hPath)
Definition: path.h:70
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PATH_UnlockPath(pPath)
Definition: path.h:71
#define ASSERT(a)
Definition: mode.c:44
static BOOL add_log_points_new_stroke(DC *dc, PPATH path, const POINT *points, DWORD count, BYTE type)
Definition: path.c:533
static const WCHAR dc[]
#define PT_BEZIERTO
Definition: wingdi.h:885

Referenced by IntGdiPolyBezierTo().

◆ PATH_PolyDraw()

BOOL FASTCALL PATH_PolyDraw ( PDC  dc,
const POINT pts,
const BYTE types,
DWORD  cbPoints 
)

Definition at line 1180 of file path.c.

1185 {
1186  PPATH pPath;
1187  POINT orig_pos, cur_pos;
1188  ULONG i, lastmove = 0;
1189 
1190  pPath = PATH_LockPath(dc->dclevel.hPath);
1191  if (!pPath) return FALSE;
1192 
1193  if (pPath->state != PATH_Open)
1194  {
1195  PATH_UnlockPath(pPath);
1196  return FALSE;
1197  }
1198 
1199  for (i = 0; i < pPath->numEntriesUsed; i++) if (pPath->pFlags[i] == PT_MOVETO) lastmove = i;
1200  orig_pos = pPath->pos;
1201 
1202  IntGetCurrentPositionEx(dc, &cur_pos);
1203 
1204  TRACE("PPD : Current pos X %d Y %d\n",pPath->pos.x, pPath->pos.y);
1205  TRACE("PPD : last %d pos X %d Y %d\n",lastmove, pPath->pPoints[lastmove].x, pPath->pPoints[lastmove].y);
1206 
1207 
1208  for(i = 0; i < cbPoints; i++)
1209  {
1210  switch (types[i])
1211  {
1212  case PT_MOVETO:
1213  pPath->newStroke = TRUE;
1214  pPath->pos = pts[i];
1215  IntLPtoDP( dc, &pPath->pos, 1);
1216  lastmove = pPath->numEntriesUsed;
1217  break;
1218  case PT_LINETO:
1219  case PT_LINETO | PT_CLOSEFIGURE:
1220  if (!add_log_points_new_stroke( dc, pPath, &pts[i], 1, PT_LINETO ))
1221  {
1222  PATH_UnlockPath(pPath);
1223  return FALSE;
1224  }
1225  break;
1226  case PT_BEZIERTO:
1227  if ((i + 2 < cbPoints) && (types[i + 1] == PT_BEZIERTO) &&
1228  (types[i + 2] & ~PT_CLOSEFIGURE) == PT_BEZIERTO)
1229  {
1230  if (!add_log_points_new_stroke( dc, pPath, &pts[i], 3, PT_BEZIERTO ))
1231  {
1232  PATH_UnlockPath(pPath);
1233  return FALSE;
1234  }
1235  i += 2;
1236  break;
1237  }
1238  /* fall through */
1239  default:
1240  /* restore original position */
1241  pPath->pos = orig_pos;
1242 
1243  TRACE("PPD Bad : pos X %d Y %d\n",pPath->pos.x, pPath->pos.y);
1244 
1245  IntGdiMoveToEx(dc, cur_pos.x, cur_pos.y, NULL);
1246 
1247  PATH_UnlockPath(pPath);
1248  return FALSE;
1249  }
1250 
1251  if (types[i] & PT_CLOSEFIGURE)
1252  {
1253  close_figure( pPath );
1254  pPath->pos = pPath->pPoints[lastmove];
1255  TRACE("PPD close : pos X %d Y %d\n",pPath->pos.x, pPath->pos.y);
1256  }
1257  }
1258  PATH_UnlockPath(pPath);
1259  return TRUE;
1260 }
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define TRUE
Definition: types.h:120
Definition: path.h:34
#define PATH_LockPath(hPath)
Definition: path.h:70
static void close_figure(PPATH path)
Definition: path.c:526
#define FALSE
Definition: types.h:117
POINT * pPoints
Definition: path.h:53
#define PATH_UnlockPath(pPath)
Definition: path.h:71
int numEntriesUsed
Definition: path.h:55
BYTE * pFlags
Definition: path.h:54
VOID FASTCALL IntGetCurrentPositionEx(PDC dc, LPPOINT pt)
Definition: line.c:128
POINT pos
Definition: path.h:58
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cmds.c:130
static BOOL add_log_points_new_stroke(DC *dc, PPATH path, const POINT *points, DWORD count, BYTE type)
Definition: path.c:533
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
Definition: path.h:19
BOOL newStroke
Definition: path.h:57
#define NULL
Definition: types.h:112
#define PT_CLOSEFIGURE
Definition: wingdi.h:886
#define PT_LINETO
Definition: wingdi.h:884
#define PT_MOVETO
Definition: wingdi.h:883
unsigned int ULONG
Definition: retypes.h:1
BOOL FASTCALL IntGdiMoveToEx(DC *dc, int X, int Y, LPPOINT Point)
Definition: line.c:78
static const WCHAR dc[]
FLONG state
Definition: path.h:52
#define PT_BEZIERTO
Definition: wingdi.h:885
static BOOLEAN IntLPtoDP(DC *pdc, PPOINTL ppt, UINT count)
Definition: coord.h:182

Referenced by NtGdiPolyDraw().

◆ PATH_PolylineTo()

BOOL FASTCALL PATH_PolylineTo ( PDC  dc,
const POINT pts,
DWORD  cbPoints 
)

Definition at line 1264 of file path.c.

1268 {
1269  PPATH pPath;
1270  BOOL ret;
1271 
1272  ASSERT(dc);
1273  ASSERT(pts);
1274  ASSERT(cbPoints);
1275 
1276  if (cbPoints < 1) return FALSE;
1277 
1278  pPath = PATH_LockPath(dc->dclevel.hPath);
1279  if (!pPath) return FALSE;
1280 
1281  ret = add_log_points_new_stroke( dc, pPath, pts, cbPoints, PT_LINETO );
1282  PATH_UnlockPath(pPath);
1283  return ret;
1284 }
Definition: path.h:34
DWORD ret
Definition: path.c:47
#define PATH_LockPath(hPath)
Definition: path.h:70
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PATH_UnlockPath(pPath)
Definition: path.h:71
#define ASSERT(a)
Definition: mode.c:44
static BOOL add_log_points_new_stroke(DC *dc, PPATH path, const POINT *points, DWORD count, BYTE type)
Definition: path.c:533
#define PT_LINETO
Definition: wingdi.h:884
static const WCHAR dc[]

Referenced by IntGdiPolylineTo().

◆ PATH_PolyPolygon()

BOOL FASTCALL PATH_PolyPolygon ( PDC  dc,
const POINT pts,
const INT counts,
UINT  polygons 
)

Definition at line 1288 of file path.c.

1293 {
1294  UINT poly, count;
1295  BYTE *type;
1296  PPATH pPath;
1297 
1298  ASSERT(dc);
1299  ASSERT(pts);
1300  ASSERT(counts);
1301  ASSERT(polygons);
1302 
1303  if (!polygons) return FALSE;
1304 
1305  pPath = PATH_LockPath(dc->dclevel.hPath);
1306  if (!pPath) return FALSE;
1307 
1308 
1309  for (poly = count = 0; poly < polygons; poly++)
1310  {
1311  if (counts[poly] < 2)
1312  {
1313  PATH_UnlockPath(pPath);
1314  return FALSE;
1315  }
1316  count += counts[poly];
1317  }
1318 
1319  type = add_log_points( dc, pPath, pts, count, PT_LINETO );
1320  if (!type)
1321  {
1322  PATH_UnlockPath(pPath);
1323  return FALSE;
1324  }
1325 
1326  /* make the first point of each polyline a PT_MOVETO, and close the last one */
1327  for (poly = 0; poly < polygons; type += counts[poly++])
1328  {
1329  type[0] = PT_MOVETO;
1330  type[counts[poly] - 1] = PT_LINETO | PT_CLOSEFIGURE;
1331  }
1332  PATH_UnlockPath(pPath);
1333  return TRUE;
1334 }
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
Definition: path.h:34
#define PATH_LockPath(hPath)
Definition: path.h:70
#define FALSE
Definition: types.h:117
#define PATH_UnlockPath(pPath)
Definition: path.h:71
#define ASSERT(a)
Definition: mode.c:44
unsigned char BYTE
Definition: xxhash.c:193
unsigned int UINT
Definition: ndis.h:50
#define PT_CLOSEFIGURE
Definition: wingdi.h:886
#define PT_LINETO
Definition: wingdi.h:884
#define PT_MOVETO
Definition: wingdi.h:883
static const WCHAR dc[]
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static BYTE * add_log_points(DC *dc, PPATH path, const POINT *points, DWORD count, BYTE type)
Definition: path.c:463

Referenced by IntGdiPolyPolygon().

◆ PATH_PolyPolyline()

BOOL FASTCALL PATH_PolyPolyline ( PDC  dc,
const POINT pts,
const DWORD counts,
DWORD  polylines 
)

Definition at line 1338 of file path.c.

1343 {
1344  POINT pt;
1345  ULONG poly, point, i;
1346  PPATH pPath;
1347 
1348  ASSERT(dc);
1349  ASSERT(pts);
1350  ASSERT(counts);
1351  ASSERT(polylines);
1352 
1353  pPath = PATH_LockPath(dc->dclevel.hPath);
1354  if (!pPath)
1355  {
1356  return FALSE;
1357  }
1358 
1359  for (i = 0, poly = 0; poly < polylines; poly++)
1360  {
1361  for (point = 0; point < counts[poly]; point++, i++)
1362  {
1363  pt = pts[i];
1364  CoordLPtoDP(dc, &pt);
1365  PATH_AddEntry(pPath, &pt, (point == 0) ? PT_MOVETO : PT_LINETO);
1366  }
1367  }
1368  TRACE("PATH_PolyPolyline end count %d\n",pPath->numEntriesUsed);
1369  PATH_UnlockPath(pPath);
1370  return TRUE;
1371 }
BOOL FASTCALL PATH_AddEntry(PPATH pPath, const POINT *pPoint, BYTE flags)
Definition: path.c:262
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
Definition: path.h:34
POINTL point
Definition: edittest.c:50
#define PATH_LockPath(hPath)
Definition: path.h:70
#define FALSE
Definition: types.h:117
#define PATH_UnlockPath(pPath)
Definition: path.h:71
int numEntriesUsed
Definition: path.h:55
#define TRACE(s)
Definition: solgame.cpp:4
#define ASSERT(a)
Definition: mode.c:44
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
#define CoordLPtoDP(pdc, ppt)
Definition: coord.h:187
#define PT_LINETO
Definition: wingdi.h:884
#define PT_MOVETO
Definition: wingdi.h:883
unsigned int ULONG
Definition: retypes.h:1
static const WCHAR dc[]

Referenced by IntGdiPolyPolyline().

◆ PATH_Rectangle()

BOOL FASTCALL PATH_Rectangle ( PDC  dc,
INT  x1,
INT  y1,
INT  x2,
INT  y2 
)

Definition at line 627 of file path.c.

633 {
634  PPATH pPath;
635  RECTL rect;
636  POINTL points[4];
637  BYTE *type;
638 
639  pPath = PATH_LockPath(dc->dclevel.hPath);
640  if (!pPath) return FALSE;
641 
642  if (!PATH_CheckRect(dc, &rect, x1, y1, x2, y2))
643  {
644  PATH_UnlockPath(pPath);
645  return TRUE;
646  }
647 
648  points[0].x = rect.right; points[0].y = rect.top;
649  points[1].x = rect.left; points[1].y = rect.top;
650  points[2].x = rect.left; points[2].y = rect.bottom;
651  points[3].x = rect.right; points[3].y = rect.bottom;
652 
653  if (dc->dclevel.flPath & DCPATH_CLOCKWISE) reverse_points(points, 4 );
654 
655  if (!(type = add_points( pPath, points, 4, PT_LINETO )))
656  {
657  PATH_UnlockPath(pPath);
658  return FALSE;
659  }
660  type[0] = PT_MOVETO;
661 
662  /* Close the rectangle figure */
663  IntGdiCloseFigure(pPath) ;
664  PATH_UnlockPath(pPath);
665  return TRUE;
666 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
#define TRUE
Definition: types.h:120
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
Definition: path.h:34
static void reverse_points(POINT *points, UINT count)
Definition: path.c:494
& rect
Definition: startmenu.cpp:1413
#define PATH_LockPath(hPath)
Definition: path.h:70
#define FALSE
Definition: types.h:117
VOID FASTCALL IntGdiCloseFigure(PPATH pPath)
Definition: path.c:108
#define PATH_UnlockPath(pPath)
Definition: path.h:71
static BYTE * add_points(PPATH path, const POINT *points, DWORD count, BYTE type)
Definition: path.c:480
GLsizei const GLfloat * points
Definition: glext.h:8112
static BOOL PATH_CheckRect(DC *dc, RECTL *rect, INT x1, INT y1, INT x2, INT y2)
Definition: path.c:433
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
unsigned char BYTE
Definition: xxhash.c:193
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
#define PT_LINETO
Definition: wingdi.h:884
#define PT_MOVETO
Definition: wingdi.h:883
static const WCHAR dc[]
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by IntRectangle(), and PATH_RoundRect().

◆ PATH_ReserveEntries()

BOOL FASTCALL PATH_ReserveEntries ( PPATH  pPath,
INT  numEntries 
)

Definition at line 296 of file path.c.

299 {
300  INT numEntriesToAllocate;
301  POINT *pPointsNew;
302  BYTE *pFlagsNew;
303 
304  ASSERT(pPath != NULL);
305  ASSERT(numEntries >= 0);
306 
307  /* Do we have to allocate more memory? */
308  if (numEntries > pPath->numEntriesAllocated)
309  {
310  /* Find number of entries to allocate. We let the size of the array
311  * grow exponentially, since that will guarantee linear time
312  * complexity. */
313  if (pPath->numEntriesAllocated)
314  {
315  numEntriesToAllocate = pPath->numEntriesAllocated;
316  while (numEntriesToAllocate < numEntries)
317  numEntriesToAllocate = numEntriesToAllocate * GROW_FACTOR_NUMER / GROW_FACTOR_DENOM;
318  }
319  else
320  numEntriesToAllocate = numEntries;
321 
322  /* Allocate new arrays */
323  pPointsNew = (POINT *)ExAllocatePoolWithTag(PagedPool, numEntriesToAllocate * sizeof(POINT), TAG_PATH);
324  if (!pPointsNew)
325  return FALSE;
326 
327  pFlagsNew = (BYTE *)ExAllocatePoolWithTag(PagedPool, numEntriesToAllocate * sizeof(BYTE), TAG_PATH);
328  if (!pFlagsNew)
329  {
330  ExFreePoolWithTag(pPointsNew, TAG_PATH);
331  return FALSE;
332  }
333 
334  /* Copy old arrays to new arrays and discard old arrays */
335  if (pPath->pPoints)
336  {
337  ASSERT(pPath->pFlags);
338 
339  memcpy(pPointsNew, pPath->pPoints, sizeof(POINT)*pPath->numEntriesUsed);
340  memcpy(pFlagsNew, pPath->pFlags, sizeof(BYTE)*pPath->numEntriesUsed);
341 
344  }
345 
346  pPath->pPoints = pPointsNew;
347  pPath->pFlags = pFlagsNew;
348  pPath->numEntriesAllocated = numEntriesToAllocate;
349  }
350 
351  return TRUE;
352 }
int numEntriesAllocated
Definition: path.h:56
#define TRUE
Definition: types.h:120
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
#define TAG_PATH
Definition: tags.h:25
POINT * pPoints
Definition: path.h:53
int numEntriesUsed
Definition: path.h:55
BYTE * pFlags
Definition: path.h:54
#define ASSERT(a)
Definition: mode.c:44
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define GROW_FACTOR_DENOM
Definition: path.c:24
unsigned char BYTE
Definition: xxhash.c:193
#define NULL
Definition: types.h:112
#define GROW_FACTOR_NUMER
Definition: path.c:23
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

Referenced by add_log_points(), add_points(), PATH_AddEntry(), and PATH_AssignGdiPath().

◆ PATH_RestorePath()

BOOL PATH_RestorePath ( DC ,
DC  
)

Definition at line 209 of file path.c.

210 {
211  TRACE("PATH_RestorePath\n");
212 
213  if (dst->dclevel.hPath == NULL)
214  {
215  PPATH pdstPath, psrcPath = PATH_LockPath(src->dclevel.hPath);
216  TRACE("PATH_RestorePath 1\n");
217  pdstPath = PATH_CreatePath(psrcPath->numEntriesAllocated);
218  dst->dclevel.flPath = src->dclevel.flPath;
219  dst->dclevel.hPath = pdstPath->BaseObject.hHmgr;
220 
221  PATH_AssignGdiPath(pdstPath, psrcPath);
222 
223  PATH_UnlockPath(pdstPath);
224  PATH_UnlockPath(psrcPath);
225  }
226  else
227  {
228  PPATH pdstPath, psrcPath = PATH_LockPath(src->dclevel.hPath);
229  pdstPath = PATH_LockPath(dst->dclevel.hPath);
230  TRACE("PATH_RestorePath 2\n");
231  dst->dclevel.flPath = src->dclevel.flPath & (DCPATH_CLOCKWISE|DCPATH_ACTIVE);
232  PATH_AssignGdiPath(pdstPath, psrcPath);
233 
234  PATH_UnlockPath(pdstPath);
235  PATH_UnlockPath(psrcPath);
236  }
237  return TRUE;
238 }
int numEntriesAllocated
Definition: path.h:56
#define TRUE
Definition: types.h:120
PPATH FASTCALL PATH_CreatePath(int count)
Definition: path.c:35
Definition: path.h:34
#define PATH_LockPath(hPath)
Definition: path.h:70
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
#define PATH_UnlockPath(pPath)
Definition: path.h:71
#define TRACE(s)
Definition: solgame.cpp:4
GLenum src
Definition: glext.h:6340
BOOL FASTCALL PATH_AssignGdiPath(PPATH pPathDest, const PPATH pPathSrc)
Definition: path.c:166
GLenum GLenum dst
Definition: glext.h:6340
#define NULL
Definition: types.h:112
BASEOBJECT BaseObject
Definition: path.h:36

Referenced by DC_vRestoreDC().

◆ PATH_RoundRect()

BOOL PATH_RoundRect ( DC dc,
INT  x1,
INT  y1,
INT  x2,
INT  y2,
INT  ell_width,
INT  ell_height 
)

Definition at line 675 of file path.c.

683 {
684  PPATH pPath;
685  RECTL rect, ellipse;
686  POINT points[16];
687  BYTE *type;
689 
690  if (!ell_width || !ell_height) return PATH_Rectangle( dc, x1, y1, x2, y2 );
691 
692  pPath = PATH_LockPath(dc->dclevel.hPath);
693  if (!pPath) return FALSE;
694 
695  if (!PATH_CheckRect(dc, &rect, x1, y1, x2, y2))
696  {
697  PATH_UnlockPath(pPath);
698  return TRUE;
699  }
700 
701  RECTL_vSetRect(&ellipse, 0, 0, ell_width, ell_height);
702  IntLPtoDP( dc, (PPOINT)&ellipse, 2 );
703  RECTL_vMakeWellOrdered(&ellipse);
704  ell_width = min(RECTL_lGetWidth(&ellipse), RECTL_lGetWidth(&rect));
705  ell_height = min(RECTL_lGetHeight(&ellipse), RECTL_lGetHeight(&rect));
706 
707  /*
708  * See here to understand what's happening
709  * https://stackoverflow.com/questions/1734745/how-to-create-circle-with-b%C3%A9zier-curves
710  */
711  xOffset = EngMulDiv(ell_width, 44771525, 200000000); /* w * (1 - 0.5522847) / 2 */
712  yOffset = EngMulDiv(ell_height, 44771525, 200000000); /* h * (1 - 0.5522847) / 2 */
713  TRACE("xOffset %d, yOffset %d, Rect WxH: %dx%d.\n",
715 
716  /*
717  * Get half width & height.
718  * Do not use integer division, we need the rounding made by EngMulDiv.
719  */
720  ell_width = EngMulDiv(ell_width, 1, 2);
721  ell_height = EngMulDiv(ell_height, 1, 2);
722 
723  /* starting point */
724  points[0].x = rect.right;
725  points[0].y = rect.top + ell_height;
726  /* first curve */
727  points[1].x = rect.right;
728  points[1].y = rect.top + yOffset;
729  points[2].x = rect.right - xOffset;
730  points[2].y = rect.top;
731  points[3].x = rect.right - ell_width;
732  points[3].y = rect.top;
733  /* horizontal line */
734  points[4].x = rect.left + ell_width;
735  points[4].y = rect.top;
736  /* second curve */
737  points[5].x = rect.left + xOffset;
738  points[5].y = rect.top;
739  points[6].x = rect.left;
740  points[6].y = rect.top + yOffset;
741  points[7].x = rect.left;
742  points[7].y = rect.top + ell_height;
743  /* vertical line */
744  points[8].x = rect.left;
745  points[8].y = rect.bottom - ell_height;
746  /* third curve */
747  points[9].x = rect.left;
748  points[9].y = rect.bottom - yOffset;
749  points[10].x = rect.left + xOffset;
750  points[10].y = rect.bottom;
751  points[11].x = rect.left + ell_width;
752  points[11].y = rect.bottom;
753  /* horizontal line */
754  points[12].x = rect.right - ell_width;
755  points[12].y = rect.bottom;
756  /* fourth curve */
757  points[13].x = rect.right - xOffset;
758  points[13].y = rect.bottom;
759  points[14].x = rect.right;
760  points[14].y = rect.bottom - yOffset;
761  points[15].x = rect.right;
762  points[15].y = rect.bottom - ell_height;
763 
764  if (dc->dclevel.flPath & DCPATH_CLOCKWISE) reverse_points( points, 16 );
765  if (!(type = add_points( pPath, points, 16, PT_BEZIERTO )))
766  {
767  PATH_UnlockPath(pPath);
768  return FALSE;
769  }
770  type[0] = PT_MOVETO;
771  type[4] = type[8] = type[12] = PT_LINETO;
772 
773  IntGdiCloseFigure(pPath);
774  PATH_UnlockPath(pPath);
775  return TRUE;
776 }
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
BOOL FASTCALL PATH_Rectangle(PDC dc, INT x1, INT y1, INT x2, INT y2)
Definition: path.c:627
#define TRUE
Definition: types.h:120
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
Definition: path.h:34
static void reverse_points(POINT *points, UINT count)
Definition: path.c:494
int32_t INT
Definition: typedefs.h:58
& rect
Definition: startmenu.cpp:1413
#define PATH_LockPath(hPath)
Definition: path.h:70
#define FALSE
Definition: types.h:117
VOID FASTCALL IntGdiCloseFigure(PPATH pPath)
Definition: path.c:108
FORCEINLINE LONG RECTL_lGetWidth(_In_ const RECTL *prcl)
Definition: rect.h:93
#define PATH_UnlockPath(pPath)
Definition: path.h:71
static BYTE * add_points(PPATH path, const POINT *points, DWORD count, BYTE type)
Definition: path.c:480
#define TRACE(s)
Definition: solgame.cpp:4
GLsizei const GLfloat * points
Definition: glext.h:8112
static BOOL PATH_CheckRect(DC *dc, RECTL *rect, INT x1, INT y1, INT x2, INT y2)
Definition: path.c:433
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
unsigned char BYTE
Definition: xxhash.c:193
FORCEINLINE VOID RECTL_vSetRect(_Out_ RECTL *prcl, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
Definition: rect.h:5
int xOffset
Definition: appswitch.c:59
#define min(a, b)
Definition: monoChain.cc:55
ENGAPI INT APIENTRY EngMulDiv(_In_ INT a, _In_ INT b, _In_ INT c)
Definition: math.c:26
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
FORCEINLINE LONG RECTL_lGetHeight(_In_ const RECTL *prcl)
Definition: rect.h:86
#define PT_LINETO
Definition: wingdi.h:884
#define PT_MOVETO
Definition: wingdi.h:883
static const WCHAR dc[]
int yOffset
Definition: appswitch.c:59
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define PT_BEZIERTO
Definition: wingdi.h:885
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
Definition: rect.c:81
static BOOLEAN IntLPtoDP(DC *pdc, PPOINTL ppt, UINT count)
Definition: coord.h:182

Referenced by IntRoundRect().

◆ PATH_SavePath()

BOOL PATH_SavePath ( DC ,
DC  
)

Definition at line 187 of file path.c.

188 {
189  PPATH pdstPath, psrcPath = PATH_LockPath(src->dclevel.hPath);
190  TRACE("PATH_SavePath\n");
191  if (psrcPath)
192  {
193  TRACE("PATH_SavePath 1\n");
194 
195  pdstPath = PATH_CreatePath(psrcPath->numEntriesAllocated);
196 
197  dst->dclevel.flPath = src->dclevel.flPath;
198 
199  dst->dclevel.hPath = pdstPath->BaseObject.hHmgr;
200 
201  PATH_AssignGdiPath(pdstPath, psrcPath);
202 
203  PATH_UnlockPath(pdstPath);
204  PATH_UnlockPath(psrcPath);
205  }
206  return TRUE;
207 }
int numEntriesAllocated
Definition: path.h:56
#define TRUE
Definition: types.h:120
PPATH FASTCALL PATH_CreatePath(int count)
Definition: path.c:35
Definition: path.h:34
#define PATH_LockPath(hPath)
Definition: path.h:70
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
#define PATH_UnlockPath(pPath)
Definition: path.h:71
#define TRACE(s)
Definition: solgame.cpp:4
GLenum src
Definition: glext.h:6340
BOOL FASTCALL PATH_AssignGdiPath(PPATH pPathDest, const PPATH pPathSrc)
Definition: path.c:166
GLenum GLenum dst
Definition: glext.h:6340
BASEOBJECT BaseObject
Definition: path.h:36

Referenced by NtGdiSaveDC().

◆ PATH_StrokePath()

BOOL FASTCALL PATH_StrokePath ( DC dc,
PPATH  pPath 
)

Definition at line 1598 of file path.c.

1601 {
1602  BOOL ret = FALSE;
1603  INT i = 0;
1604  INT nLinePts, nAlloc;
1605  POINT *pLinePts = NULL;
1606  POINT ptViewportOrg, ptWindowOrg;
1607  SIZE szViewportExt, szWindowExt;
1608  DWORD mapMode, graphicsMode;
1609  XFORM xform;
1610  PDC_ATTR pdcattr = dc->pdcattr;
1611 
1612  TRACE("Enter %s\n", __FUNCTION__);
1613 
1614  /* Save the mapping mode info */
1615  mapMode = pdcattr->iMapMode;
1616 
1617  szViewportExt = *DC_pszlViewportExt(dc);
1618  ptViewportOrg = dc->pdcattr->ptlViewportOrg;
1619  szWindowExt = dc->pdcattr->szlWindowExt;
1620  ptWindowOrg = dc->pdcattr->ptlWindowOrg;
1621 
1622  MatrixS2XForm(&xform, &dc->pdcattr->mxWorldToPage);
1623 
1624  /* Set MM_TEXT */
1625  pdcattr->iMapMode = MM_TEXT;
1626  pdcattr->ptlViewportOrg.x = 0;
1627  pdcattr->ptlViewportOrg.y = 0;
1628  pdcattr->ptlWindowOrg.x = 0;
1629  pdcattr->ptlWindowOrg.y = 0;
1630  graphicsMode = pdcattr->iGraphicsMode;
1631  pdcattr->iGraphicsMode = GM_ADVANCED;
1633  pdcattr->iGraphicsMode = graphicsMode;
1634 
1635  /* Allocate enough memory for the worst case without beziers (one PT_MOVETO
1636  * and the rest PT_LINETO with PT_CLOSEFIGURE at the end) plus some buffer
1637  * space in case we get one to keep the number of reallocations small. */
1638  nAlloc = pPath->numEntriesUsed + 1 + 300;
1639  pLinePts = ExAllocatePoolWithTag(PagedPool, nAlloc * sizeof(POINT), TAG_PATH);
1640  if (!pLinePts)
1641  {
1642  ERR("Can't allocate pool!\n");
1644  goto end;
1645  }
1646  nLinePts = 0;
1647 
1648  for (i = 0; i < pPath->numEntriesUsed; i++)
1649  {
1650  if ((i == 0 || (pPath->pFlags[i - 1] & PT_CLOSEFIGURE))
1651  && (pPath->pFlags[i] != PT_MOVETO))
1652  {
1653  ERR("Expected PT_MOVETO %s, got path flag %d\n",
1654  i == 0 ? "as first point" : "after PT_CLOSEFIGURE",
1655  (INT)pPath->pFlags[i]);
1656  goto end;
1657  }
1658 
1659  switch(pPath->pFlags[i])
1660  {
1661  case PT_MOVETO:
1662  TRACE("Got PT_MOVETO (%ld, %ld)\n",
1663  pPath->pPoints[i].x, pPath->pPoints[i].y);
1664  if (nLinePts >= 2) IntGdiPolyline(dc, pLinePts, nLinePts);
1665  nLinePts = 0;
1666  pLinePts[nLinePts++] = pPath->pPoints[i];
1667  break;
1668  case PT_LINETO:
1669  case (PT_LINETO | PT_CLOSEFIGURE):
1670  TRACE("Got PT_LINETO (%ld, %ld)\n",
1671  pPath->pPoints[i].x, pPath->pPoints[i].y);
1672  pLinePts[nLinePts++] = pPath->pPoints[i];
1673  break;
1674  case PT_BEZIERTO:
1675  TRACE("Got PT_BEZIERTO\n");
1676  if (pPath->pFlags[i + 1] != PT_BEZIERTO ||
1677  (pPath->pFlags[i + 2] & ~PT_CLOSEFIGURE) != PT_BEZIERTO)
1678  {
1679  ERR("Path didn't contain 3 successive PT_BEZIERTOs\n");
1680  ret = FALSE;
1681  goto end;
1682  }
1683  else
1684  {
1685  INT nBzrPts, nMinAlloc;
1686  POINT *pBzrPts = GDI_Bezier(&pPath->pPoints[i - 1], 4, &nBzrPts);
1687  /* Make sure we have allocated enough memory for the lines of
1688  * this bezier and the rest of the path, assuming we won't get
1689  * another one (since we won't reallocate again then). */
1690  nMinAlloc = nLinePts + (pPath->numEntriesUsed - i) + nBzrPts;
1691  if (nAlloc < nMinAlloc)
1692  {
1693  // Reallocate memory
1694 
1695  POINT *Realloc = NULL;
1696  nAlloc = nMinAlloc * 2;
1697 
1699  nAlloc * sizeof(POINT),
1700  TAG_PATH);
1701 
1702  if (!Realloc)
1703  {
1704  ERR("Can't allocate pool!\n");
1705  ExFreePoolWithTag(pBzrPts, TAG_BEZIER);
1706  goto end;
1707  }
1708 
1709  memcpy(Realloc, pLinePts, nLinePts * sizeof(POINT));
1710  ExFreePoolWithTag(pLinePts, TAG_PATH);
1711  pLinePts = Realloc;
1712  }
1713  memcpy(&pLinePts[nLinePts], &pBzrPts[1], (nBzrPts - 1) * sizeof(POINT));
1714  nLinePts += nBzrPts - 1;
1715  ExFreePoolWithTag(pBzrPts, TAG_BEZIER);
1716  i += 2;
1717  }
1718  break;
1719  default:
1720  ERR("Got path flag %d (not supported)\n", (INT)pPath->pFlags[i]);
1721  goto end;
1722  }
1723 
1724  if (pPath->pFlags[i] & PT_CLOSEFIGURE)
1725  {
1726  pLinePts[nLinePts++] = pLinePts[0];
1727  }
1728  }
1729  if (nLinePts >= 2)
1730  IntGdiPolyline(dc, pLinePts, nLinePts);
1731 
1732  ret = TRUE;
1733 
1734 end:
1735  if (pLinePts) ExFreePoolWithTag(pLinePts, TAG_PATH);
1736 
1737  /* Restore the old mapping mode */
1738  pdcattr->iMapMode = mapMode;
1739  pdcattr->szlWindowExt.cx = szWindowExt.cx;
1740  pdcattr->szlWindowExt.cy = szWindowExt.cy;
1741  pdcattr->ptlWindowOrg.x = ptWindowOrg.x;
1742  pdcattr->ptlWindowOrg.y = ptWindowOrg.y;
1743 
1744  pdcattr->szlViewportExt.cx = szViewportExt.cx;
1745  pdcattr->szlViewportExt.cy = szViewportExt.cy;
1746  pdcattr->ptlViewportOrg.x = ptViewportOrg.x;
1747  pdcattr->ptlViewportOrg.y = ptViewportOrg.y;
1748 
1749  /* Restore the world transform */
1750  XForm2MatrixS(&dc->pdcattr->mxWorldToPage, &xform);
1751 
1752  /* If we've moved the current point then get its new position
1753  which will be in device (MM_TEXT) co-ords, convert it to
1754  logical co-ords and re-set it. This basically updates
1755  dc->CurPosX|Y so that their values are in the correct mapping
1756  mode.
1757  */
1758  if (i > 0)
1759  {
1760  POINT pt;
1762  IntDPtoLP(dc, &pt, 1);
1763  IntGdiMoveToEx(dc, pt.x, pt.y, NULL);
1764  }
1765  TRACE("Leave %s, ret=%d\n", __FUNCTION__, ret);
1766  return ret;
1767 }
#define XForm2MatrixS(m, x)
Definition: coord.h:199
BOOL NTAPI GreModifyWorldTransform(PDC pdc, const XFORML *pxform, DWORD dwMode)
Definition: coord.c:461
POINTL ptlViewportOrg
Definition: ntgdihdl.h:347
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
INT iMapMode
Definition: ntgdihdl.h:342
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
int32_t INT
Definition: typedefs.h:58
DWORD ret
Definition: path.c:47
LONG y
Definition: windef.h:330
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TAG_PATH
Definition: tags.h:25
#define TAG_BEZIER
Definition: tags.h:13
POINT * pPoints
Definition: path.h:53
LONG cx
Definition: windef.h:334
BOOL FASTCALL IntGdiPolyline(DC *dc, LPPOINT pt, int Count)
Definition: line.c:291
int numEntriesUsed
Definition: path.h:55
BYTE * pFlags
Definition: path.h:54
VOID FASTCALL IntGetCurrentPositionEx(PDC dc, LPPOINT pt)
Definition: line.c:128
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG x
Definition: windef.h:329
POINT * GDI_Bezier(const POINT *Points, INT count, INT *nPtsOut)
Definition: bezier.c:189
GLuint GLuint end
Definition: gl.h:1545
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define MatrixS2XForm(x, m)
Definition: coord.h:200
SIZEL szlWindowExt
Definition: ntgdihdl.h:346
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static BOOLEAN IntDPtoLP(DC *pdc, PPOINTL ppt, UINT count)
Definition: coord.h:192
#define ERR(fmt,...)
Definition: debug.h:110
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
FORCEINLINE PSIZEL DC_pszlViewportExt(PDC pdc)
Definition: coord.h:111
#define NULL
Definition: types.h:112
#define MWT_IDENTITY
Definition: wingdi.h:943
void * Realloc(void *, size_t)
#define MM_TEXT
Definition: wingdi.h:872
#define PT_CLOSEFIGURE
Definition: wingdi.h:886
#define PT_LINETO
Definition: wingdi.h:884
#define PT_MOVETO
Definition: wingdi.h:883
SIZEL szlViewportExt
Definition: ntgdihdl.h:348
BOOL FASTCALL IntGdiMoveToEx(DC *dc, int X, int Y, LPPOINT Point)
Definition: line.c:78
static const WCHAR dc[]
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define PT_BEZIERTO
Definition: wingdi.h:885
#define __FUNCTION__
Definition: types.h:112
LONG cy
Definition: windef.h:335
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
POINTL ptlWindowOrg
Definition: ntgdihdl.h:345
#define GM_ADVANCED
Definition: wingdi.h:864
INT iGraphicsMode
Definition: ntgdihdl.h:310

Referenced by NtGdiStrokeAndFillPath(), and NtGdiStrokePath().