mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
rename DCs pDc_Attr to pdcattr, like in gdikdx.
Make pdcattr alsways point to a DC_ATTR, either the user mode struct or the local part. Get rid of all the If (!pdcattr) pdcattr = &dc->Dc_Attr; That are not required anymore. svn path=/trunk/; revision=40115
This commit is contained in:
@@ -450,7 +450,7 @@ IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, SURFACE* psurfDest, SURFACE* psurf
|
||||
{
|
||||
XLATEOBJ *XlateObj;
|
||||
HPALETTE DestPalette, SourcePalette;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
DPRINT("Enter IntCreateXlateFromDCs\n");
|
||||
|
||||
@@ -476,9 +476,8 @@ IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, SURFACE* psurfDest, SURFACE* psurf
|
||||
}
|
||||
else
|
||||
{
|
||||
pDc_Attr = pDCSrc->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &pDCSrc->Dc_Attr;
|
||||
XlateObj = IntEngCreateMonoXlate(0, DestPalette, SourcePalette, pDc_Attr->crBackgroundClr);
|
||||
pdcattr = pDCSrc->pdcattr;
|
||||
XlateObj = IntEngCreateMonoXlate(0, DestPalette, SourcePalette, pdcattr->crBackgroundClr);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -499,9 +498,8 @@ IntCreateXlateForBlt(PDC pDCDest, PDC pDCSrc, SURFACE* psurfDest, SURFACE* psurf
|
||||
}
|
||||
else
|
||||
{
|
||||
pDc_Attr = pDCDest->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &pDCDest->Dc_Attr;
|
||||
XlateObj = IntEngCreateSrcMonoXlate(DestPalette, pDc_Attr->crForegroundClr, pDc_Attr->crBackgroundClr);
|
||||
pdcattr = pDCDest->pdcattr;
|
||||
XlateObj = IntEngCreateSrcMonoXlate(DestPalette, pdcattr->crForegroundClr, pdcattr->crBackgroundClr);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -113,7 +113,7 @@ typedef struct _DC
|
||||
PVOID hsem; /* PERESOURCE aka HSEMAPHORE */
|
||||
FLONG flGraphicsCaps;
|
||||
FLONG flGraphicsCaps2;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
DCLEVEL DcLevel;
|
||||
DC_ATTR Dc_Attr;
|
||||
HDC hdcNext;
|
||||
|
||||
@@ -44,6 +44,7 @@ DceCreateDisplayDC(VOID)
|
||||
PDC dc = DC_LockDc ( hDC );
|
||||
defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC);
|
||||
RtlZeroMemory(defaultDCstate, sizeof(DC));
|
||||
defaultDCstate->pdcattr = &defaultDCstate->Dc_Attr;
|
||||
IntGdiCopyToSaveState(dc, defaultDCstate);
|
||||
DC_UnlockDc( dc );
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
&BrushInst.BrushObject, \
|
||||
x, y, (x)+1, y, \
|
||||
&RectBounds, \
|
||||
ROP2_TO_MIX(Dc_Attr->jROP2));
|
||||
ROP2_TO_MIX(pdcattr->jROP2));
|
||||
|
||||
#define PUTLINE(x1,y1,x2,y2,BrushInst) \
|
||||
ret = ret && IntEngLineTo(&psurf->SurfObj, \
|
||||
@@ -20,7 +20,7 @@
|
||||
&BrushInst.BrushObject, \
|
||||
x1, y1, x2, y2, \
|
||||
&RectBounds, \
|
||||
ROP2_TO_MIX(Dc_Attr->jROP2));
|
||||
ROP2_TO_MIX(pdcattr->jROP2));
|
||||
|
||||
#define Rsin(d) ((d) == 0.0 ? 0.0 : ((d) == 90.0 ? 1.0 : sin(d*M_PI/180.0)))
|
||||
#define Rcos(d) ((d) == 0.0 ? 1.0 : ((d) == 90.0 ? 0.0 : cos(d*M_PI/180.0)))
|
||||
@@ -42,7 +42,7 @@ IntArc( DC *dc,
|
||||
int YRadialEnd,
|
||||
ARCTYPE arctype)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
RECTL RectBounds, RectSEpts;
|
||||
PGDIBRUSHOBJ PenBrushObj;
|
||||
GDIBRUSHINST PenBrushInst;
|
||||
@@ -68,10 +68,9 @@ IntArc( DC *dc,
|
||||
(Bottom - Top == 1))))
|
||||
return TRUE;
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen);
|
||||
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
|
||||
if (NULL == PenBrushObj)
|
||||
{
|
||||
DPRINT1("Arc Fail 1\n");
|
||||
@@ -199,7 +198,7 @@ IntGdiArcInternal(
|
||||
int YEndArc)
|
||||
{
|
||||
BOOL Ret;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
DPRINT("StartX: %d, StartY: %d, EndX: %d, EndY: %d\n",
|
||||
XStartArc,YStartArc,XEndArc,YEndArc);
|
||||
@@ -222,14 +221,13 @@ IntGdiArcInternal(
|
||||
arctype);
|
||||
}
|
||||
|
||||
pDc_Attr = dc->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (pDc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pDc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
if (pDc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,pDc_Attr->hpen);
|
||||
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,pdcattr->hpen);
|
||||
|
||||
if (arctype == GdiTypeArcTo)
|
||||
{
|
||||
|
||||
@@ -186,7 +186,7 @@ NtGdiBitBlt(
|
||||
{
|
||||
PDC DCDest;
|
||||
PDC DCSrc = NULL;
|
||||
PDC_ATTR Dc_Attr = NULL;
|
||||
PDC_ATTR pdcattr = NULL;
|
||||
SURFACE *BitmapDest, *BitmapSrc = NULL;
|
||||
RECTL DestRect;
|
||||
POINTL SourcePoint, BrushOrigin;
|
||||
@@ -235,11 +235,10 @@ NtGdiBitBlt(
|
||||
}
|
||||
}
|
||||
|
||||
Dc_Attr = DCDest->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &DCDest->Dc_Attr;
|
||||
pdcattr = DCDest->pdcattr;
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(DCDest,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(DCDest,pdcattr->hbrush);
|
||||
|
||||
/* Offset the destination and source by the origin of their DCs. */
|
||||
XDest += DCDest->ptlDCOrig.x;
|
||||
@@ -286,7 +285,7 @@ NtGdiBitBlt(
|
||||
|
||||
if (UsesPattern)
|
||||
{
|
||||
BrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
|
||||
BrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
|
||||
if (NULL == BrushObj)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
@@ -750,7 +749,7 @@ NtGdiStretchBlt(
|
||||
{
|
||||
PDC DCDest;
|
||||
PDC DCSrc = NULL;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
SURFACE *BitmapDest, *BitmapSrc = NULL;
|
||||
RECTL DestRect;
|
||||
RECTL SourceRect;
|
||||
@@ -807,11 +806,10 @@ NtGdiStretchBlt(
|
||||
}
|
||||
}
|
||||
|
||||
Dc_Attr = DCDest->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &DCDest->Dc_Attr;
|
||||
pdcattr = DCDest->pdcattr;
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(DCDest,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(DCDest,pdcattr->hbrush);
|
||||
|
||||
/* Offset the destination and source by the origin of their DCs. */
|
||||
XOriginDest += DCDest->ptlDCOrig.x;
|
||||
@@ -869,7 +867,7 @@ NtGdiStretchBlt(
|
||||
|
||||
if (UsesPattern)
|
||||
{
|
||||
BrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
|
||||
BrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
|
||||
if (NULL == BrushObj)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
@@ -1002,7 +1000,7 @@ IntGdiPolyPatBlt(
|
||||
int i;
|
||||
PPATRECT r;
|
||||
PGDIBRUSHOBJ BrushObj;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
DC *dc;
|
||||
|
||||
dc = DC_LockDc(hDC);
|
||||
@@ -1018,11 +1016,10 @@ IntGdiPolyPatBlt(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
for (r = pRects, i = 0; i < cRects; i++)
|
||||
{
|
||||
@@ -1059,7 +1056,7 @@ NtGdiPatBlt(
|
||||
{
|
||||
PGDIBRUSHOBJ BrushObj;
|
||||
DC *dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
BOOL ret;
|
||||
|
||||
BOOL UsesSource = ROP3_USES_SOURCE(ROP);
|
||||
@@ -1082,13 +1079,12 @@ NtGdiPatBlt(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
BrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
|
||||
BrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
|
||||
if (BrushObj == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
|
||||
@@ -904,7 +904,7 @@ NtGdiSelectBitmap(
|
||||
IN HBITMAP hBmp)
|
||||
{
|
||||
PDC pDC;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
HBITMAP hOrgBmp;
|
||||
PSURFACE psurfBmp;
|
||||
HRGN hVisRgn;
|
||||
@@ -919,8 +919,7 @@ NtGdiSelectBitmap(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
pdcattr = pDC->pdcattr;
|
||||
|
||||
/* must be memory dc to select bitmap */
|
||||
if (pDC->dctype != DC_TYPE_MEMORY)
|
||||
@@ -963,7 +962,7 @@ NtGdiSelectBitmap(
|
||||
SURFACE_UnlockSurface(psurfBmp);
|
||||
|
||||
/* Regenerate the XLATEOBJs. */
|
||||
pBrush = BRUSHOBJ_LockBrush(pDc_Attr->hbrush);
|
||||
pBrush = BRUSHOBJ_LockBrush(pdcattr->hbrush);
|
||||
if (pBrush)
|
||||
{
|
||||
if (pDC->rosdc.XlateBrush)
|
||||
@@ -974,7 +973,7 @@ NtGdiSelectBitmap(
|
||||
BRUSHOBJ_UnlockBrush(pBrush);
|
||||
}
|
||||
|
||||
pBrush = PENOBJ_LockPen(pDc_Attr->hpen);
|
||||
pBrush = PENOBJ_LockPen(pdcattr->hpen);
|
||||
if (pBrush)
|
||||
{
|
||||
if (pDC->rosdc.XlatePen)
|
||||
|
||||
@@ -149,11 +149,10 @@ IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed)
|
||||
/* Special case: 1bpp pattern */
|
||||
if (Pattern->SurfObj.iBitmapFormat == BMF_1BPP)
|
||||
{
|
||||
PDC_ATTR Dc_Attr = Dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &Dc->Dc_Attr;
|
||||
PDC_ATTR pdcattr = Dc->pdcattr;
|
||||
|
||||
if (Dc->rosdc.bitsPerPixel != 1)
|
||||
Result = IntEngCreateSrcMonoXlate(hPalette, Dc_Attr->crBackgroundClr, BrushObj->BrushAttr.lbColor);
|
||||
Result = IntEngCreateSrcMonoXlate(hPalette, pdcattr->crBackgroundClr, BrushObj->BrushAttr.lbColor);
|
||||
}
|
||||
else if (BrushObj->flAttrs & GDIBRUSH_IS_DIB)
|
||||
{
|
||||
@@ -515,7 +514,7 @@ IntGdiSelectBrush(
|
||||
PDC pDC,
|
||||
HBRUSH hBrush)
|
||||
{
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
HBRUSH hOrgBrush;
|
||||
PGDIBRUSHOBJ pBrush;
|
||||
XLATEOBJ *XlateObj;
|
||||
@@ -523,8 +522,7 @@ IntGdiSelectBrush(
|
||||
|
||||
if (pDC == NULL || hBrush == NULL) return NULL;
|
||||
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
pdcattr = pDC->pdcattr;
|
||||
|
||||
pBrush = BRUSHOBJ_LockBrush(hBrush);
|
||||
if (pBrush == NULL)
|
||||
@@ -540,8 +538,8 @@ IntGdiSelectBrush(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hOrgBrush = pDc_Attr->hbrush;
|
||||
pDc_Attr->hbrush = hBrush;
|
||||
hOrgBrush = pdcattr->hbrush;
|
||||
pdcattr->hbrush = hBrush;
|
||||
|
||||
if (pDC->rosdc.XlateBrush != NULL)
|
||||
{
|
||||
@@ -549,7 +547,7 @@ IntGdiSelectBrush(
|
||||
}
|
||||
pDC->rosdc.XlateBrush = XlateObj;
|
||||
|
||||
pDc_Attr->ulDirty_ &= ~DC_BRUSH_DIRTY;
|
||||
pdcattr->ulDirty_ &= ~DC_BRUSH_DIRTY;
|
||||
|
||||
return hOrgBrush;
|
||||
}
|
||||
@@ -646,7 +644,7 @@ BOOL APIENTRY
|
||||
NtGdiSetBrushOrg(HDC hDC, INT XOrg, INT YOrg, LPPOINT Point)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
dc = DC_LockDc(hDC);
|
||||
if (dc == NULL)
|
||||
@@ -654,15 +652,14 @@ NtGdiSetBrushOrg(HDC hDC, INT XOrg, INT YOrg, LPPOINT Point)
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (Point != NULL)
|
||||
{
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
POINT SafePoint;
|
||||
SafePoint.x = Dc_Attr->ptlBrushOrigin.x;
|
||||
SafePoint.y = Dc_Attr->ptlBrushOrigin.y;
|
||||
SafePoint.x = pdcattr->ptlBrushOrigin.x;
|
||||
SafePoint.y = pdcattr->ptlBrushOrigin.y;
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite(Point,
|
||||
@@ -683,8 +680,8 @@ NtGdiSetBrushOrg(HDC hDC, INT XOrg, INT YOrg, LPPOINT Point)
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
Dc_Attr->ptlBrushOrigin.x = XOrg;
|
||||
Dc_Attr->ptlBrushOrigin.y = YOrg;
|
||||
pdcattr->ptlBrushOrigin.x = XOrg;
|
||||
pdcattr->ptlBrushOrigin.y = YOrg;
|
||||
DC_UnlockDc(dc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -37,33 +37,32 @@
|
||||
void FASTCALL
|
||||
IntFixIsotropicMapping(PDC dc)
|
||||
{
|
||||
PDC_ATTR pDcAttr;
|
||||
PDC_ATTR pdcattr;
|
||||
LONG fx, fy, s;
|
||||
|
||||
/* Get a pointer to the DC_ATTR */
|
||||
pDcAttr = dc->pDc_Attr;
|
||||
if (!pDcAttr) pDcAttr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
/* Check if all values are valid */
|
||||
if (pDcAttr->szlWindowExt.cx == 0 || pDcAttr->szlWindowExt.cy == 0 ||
|
||||
pDcAttr->szlViewportExt.cx == 0 || pDcAttr->szlViewportExt.cy == 0)
|
||||
if (pdcattr->szlWindowExt.cx == 0 || pdcattr->szlWindowExt.cy == 0 ||
|
||||
pdcattr->szlViewportExt.cx == 0 || pdcattr->szlViewportExt.cy == 0)
|
||||
{
|
||||
/* Don't recalculate */
|
||||
return;
|
||||
}
|
||||
|
||||
fx = abs(pDcAttr->szlWindowExt.cx * pDcAttr->szlViewportExt.cy);
|
||||
fy = abs(pDcAttr->szlWindowExt.cy * pDcAttr->szlViewportExt.cx);
|
||||
fx = abs(pdcattr->szlWindowExt.cx * pdcattr->szlViewportExt.cy);
|
||||
fy = abs(pdcattr->szlWindowExt.cy * pdcattr->szlViewportExt.cx);
|
||||
|
||||
if (fy > fx)
|
||||
{
|
||||
s = pDcAttr->szlWindowExt.cy * pDcAttr->szlViewportExt.cx > 0 ? 1 : -1;
|
||||
pDcAttr->szlViewportExt.cx = s * fx / pDcAttr->szlWindowExt.cy;
|
||||
s = pdcattr->szlWindowExt.cy * pdcattr->szlViewportExt.cx > 0 ? 1 : -1;
|
||||
pdcattr->szlViewportExt.cx = s * fx / pdcattr->szlWindowExt.cy;
|
||||
}
|
||||
else if (fx > fy)
|
||||
{
|
||||
s = pDcAttr->szlWindowExt.cx * pDcAttr->szlViewportExt.cy > 0 ? 1 : -1;
|
||||
pDcAttr->szlViewportExt.cy = s * fy / pDcAttr->szlWindowExt.cx;
|
||||
s = pdcattr->szlWindowExt.cx * pdcattr->szlViewportExt.cy > 0 ? 1 : -1;
|
||||
pdcattr->szlViewportExt.cy = s * fy / pdcattr->szlWindowExt.cx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,11 +120,10 @@ int
|
||||
FASTCALL
|
||||
IntGetGraphicsMode(PDC dc)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
ASSERT(dc);
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
return Dc_Attr->iGraphicsMode;
|
||||
pdcattr = dc->pdcattr;
|
||||
return pdcattr->iGraphicsMode;
|
||||
}
|
||||
|
||||
BOOL
|
||||
@@ -373,7 +371,7 @@ NtGdiOffsetViewportOrgEx(HDC hDC,
|
||||
LPPOINT UnsafePoint)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
dc = DC_LockDc(hDC);
|
||||
@@ -382,17 +380,16 @@ NtGdiOffsetViewportOrgEx(HDC hDC,
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (UnsafePoint)
|
||||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite(UnsafePoint, sizeof(POINT), 1);
|
||||
UnsafePoint->x = Dc_Attr->ptlViewportOrg.x;
|
||||
UnsafePoint->y = Dc_Attr->ptlViewportOrg.y;
|
||||
if (Dc_Attr->dwLayout & LAYOUT_RTL)
|
||||
UnsafePoint->x = pdcattr->ptlViewportOrg.x;
|
||||
UnsafePoint->y = pdcattr->ptlViewportOrg.y;
|
||||
if (pdcattr->dwLayout & LAYOUT_RTL)
|
||||
{
|
||||
UnsafePoint->x = -UnsafePoint->x;
|
||||
}
|
||||
@@ -411,12 +408,12 @@ NtGdiOffsetViewportOrgEx(HDC hDC,
|
||||
}
|
||||
}
|
||||
|
||||
if (Dc_Attr->dwLayout & LAYOUT_RTL)
|
||||
if (pdcattr->dwLayout & LAYOUT_RTL)
|
||||
{
|
||||
XOffset = -XOffset;
|
||||
}
|
||||
Dc_Attr->ptlViewportOrg.x += XOffset;
|
||||
Dc_Attr->ptlViewportOrg.y += YOffset;
|
||||
pdcattr->ptlViewportOrg.x += XOffset;
|
||||
pdcattr->ptlViewportOrg.y += YOffset;
|
||||
DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
@@ -431,7 +428,7 @@ NtGdiOffsetWindowOrgEx(HDC hDC,
|
||||
LPPOINT Point)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
dc = DC_LockDc(hDC);
|
||||
if (!dc)
|
||||
@@ -439,8 +436,7 @@ NtGdiOffsetWindowOrgEx(HDC hDC,
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (Point)
|
||||
{
|
||||
@@ -449,8 +445,8 @@ NtGdiOffsetWindowOrgEx(HDC hDC,
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite(Point, sizeof(POINT), 1);
|
||||
Point->x = Dc_Attr->ptlWindowOrg.x;
|
||||
Point->y = Dc_Attr->ptlWindowOrg.y;
|
||||
Point->x = pdcattr->ptlWindowOrg.x;
|
||||
Point->y = pdcattr->ptlWindowOrg.y;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
@@ -466,8 +462,8 @@ NtGdiOffsetWindowOrgEx(HDC hDC,
|
||||
}
|
||||
}
|
||||
|
||||
Dc_Attr->ptlWindowOrg.x += XOffset;
|
||||
Dc_Attr->ptlWindowOrg.y += YOffset;
|
||||
pdcattr->ptlWindowOrg.x += XOffset;
|
||||
pdcattr->ptlWindowOrg.y += YOffset;
|
||||
|
||||
DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(dc);
|
||||
@@ -485,7 +481,7 @@ NtGdiScaleViewportExtEx(HDC hDC,
|
||||
LPSIZE pSize)
|
||||
{
|
||||
PDC pDC;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
BOOL Ret = FALSE;
|
||||
LONG X, Y;
|
||||
|
||||
@@ -495,8 +491,7 @@ NtGdiScaleViewportExtEx(HDC hDC,
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
pdcattr = pDC->pdcattr;
|
||||
|
||||
if (pSize)
|
||||
{
|
||||
@@ -506,8 +501,8 @@ NtGdiScaleViewportExtEx(HDC hDC,
|
||||
{
|
||||
ProbeForWrite(pSize, sizeof(LPSIZE), 1);
|
||||
|
||||
pSize->cx = pDc_Attr->szlViewportExt.cx;
|
||||
pSize->cy = pDc_Attr->szlViewportExt.cy;
|
||||
pSize->cx = pdcattr->szlViewportExt.cx;
|
||||
pSize->cy = pdcattr->szlViewportExt.cy;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
@@ -523,26 +518,26 @@ NtGdiScaleViewportExtEx(HDC hDC,
|
||||
}
|
||||
}
|
||||
|
||||
if (pDc_Attr->iMapMode > MM_TWIPS)
|
||||
if (pdcattr->iMapMode > MM_TWIPS)
|
||||
{
|
||||
if (Xdenom && Ydenom)
|
||||
{
|
||||
X = Xnum * pDc_Attr->szlViewportExt.cx / Xdenom;
|
||||
X = Xnum * pdcattr->szlViewportExt.cx / Xdenom;
|
||||
if (X)
|
||||
{
|
||||
Y = Ynum * pDc_Attr->szlViewportExt.cy / Ydenom;
|
||||
Y = Ynum * pdcattr->szlViewportExt.cy / Ydenom;
|
||||
if (Y)
|
||||
{
|
||||
pDc_Attr->szlViewportExt.cx = X;
|
||||
pDc_Attr->szlViewportExt.cy = Y;
|
||||
pdcattr->szlViewportExt.cx = X;
|
||||
pdcattr->szlViewportExt.cy = Y;
|
||||
|
||||
IntMirrorWindowOrg(pDC);
|
||||
|
||||
pDc_Attr->flXform |= (PAGE_EXTENTS_CHANGED |
|
||||
pdcattr->flXform |= (PAGE_EXTENTS_CHANGED |
|
||||
INVALIDATE_ATTRIBUTES |
|
||||
DEVICE_TO_WORLD_INVALID);
|
||||
|
||||
if (pDc_Attr->iMapMode == MM_ISOTROPIC)
|
||||
if (pdcattr->iMapMode == MM_ISOTROPIC)
|
||||
{
|
||||
IntFixIsotropicMapping(pDC);
|
||||
}
|
||||
@@ -570,7 +565,7 @@ NtGdiScaleWindowExtEx(HDC hDC,
|
||||
LPSIZE pSize)
|
||||
{
|
||||
PDC pDC;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
BOOL Ret = FALSE;
|
||||
LONG X, Y;
|
||||
|
||||
@@ -580,8 +575,7 @@ NtGdiScaleWindowExtEx(HDC hDC,
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
pdcattr = pDC->pdcattr;
|
||||
|
||||
if (pSize)
|
||||
{
|
||||
@@ -591,10 +585,10 @@ NtGdiScaleWindowExtEx(HDC hDC,
|
||||
{
|
||||
ProbeForWrite(pSize, sizeof(LPSIZE), 1);
|
||||
|
||||
X = pDc_Attr->szlWindowExt.cx;
|
||||
if (pDc_Attr->dwLayout & LAYOUT_RTL) X = -X;
|
||||
X = pdcattr->szlWindowExt.cx;
|
||||
if (pdcattr->dwLayout & LAYOUT_RTL) X = -X;
|
||||
pSize->cx = X;
|
||||
pSize->cy = pDc_Attr->szlWindowExt.cy;
|
||||
pSize->cy = pdcattr->szlWindowExt.cy;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
@@ -610,24 +604,24 @@ NtGdiScaleWindowExtEx(HDC hDC,
|
||||
}
|
||||
}
|
||||
|
||||
if (pDc_Attr->iMapMode > MM_TWIPS)
|
||||
if (pdcattr->iMapMode > MM_TWIPS)
|
||||
{
|
||||
if (Xdenom && Ydenom)
|
||||
{
|
||||
X = Xnum * pDc_Attr->szlWindowExt.cx / Xdenom;
|
||||
X = Xnum * pdcattr->szlWindowExt.cx / Xdenom;
|
||||
if (X)
|
||||
{
|
||||
Y = Ynum * pDc_Attr->szlWindowExt.cy / Ydenom;
|
||||
Y = Ynum * pdcattr->szlWindowExt.cy / Ydenom;
|
||||
if (Y)
|
||||
{
|
||||
pDc_Attr->szlWindowExt.cx = X;
|
||||
pDc_Attr->szlWindowExt.cy = Y;
|
||||
pdcattr->szlWindowExt.cx = X;
|
||||
pdcattr->szlWindowExt.cy = Y;
|
||||
|
||||
IntMirrorWindowOrg(pDC);
|
||||
|
||||
pDc_Attr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID);
|
||||
pdcattr->flXform |= (PAGE_EXTENTS_CHANGED|INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID);
|
||||
|
||||
if (pDc_Attr->iMapMode == MM_ISOTROPIC) IntFixIsotropicMapping(pDC);
|
||||
if (pdcattr->iMapMode == MM_ISOTROPIC) IntFixIsotropicMapping(pDC);
|
||||
DC_UpdateXforms(pDC);
|
||||
|
||||
Ret = TRUE;
|
||||
@@ -648,71 +642,70 @@ IntGdiSetMapMode(PDC dc,
|
||||
int MapMode)
|
||||
{
|
||||
int PrevMapMode;
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
PrevMapMode = Dc_Attr->iMapMode;
|
||||
PrevMapMode = pdcattr->iMapMode;
|
||||
|
||||
Dc_Attr->iMapMode = MapMode;
|
||||
pdcattr->iMapMode = MapMode;
|
||||
|
||||
switch (MapMode)
|
||||
{
|
||||
case MM_TEXT:
|
||||
Dc_Attr->szlWindowExt.cx = 1;
|
||||
Dc_Attr->szlWindowExt.cy = 1;
|
||||
Dc_Attr->szlViewportExt.cx = 1;
|
||||
Dc_Attr->szlViewportExt.cy = 1;
|
||||
Dc_Attr->flXform &= ~(ISO_OR_ANISO_MAP_MODE|PTOD_EFM22_NEGATIVE|
|
||||
pdcattr->szlWindowExt.cx = 1;
|
||||
pdcattr->szlWindowExt.cy = 1;
|
||||
pdcattr->szlViewportExt.cx = 1;
|
||||
pdcattr->szlViewportExt.cy = 1;
|
||||
pdcattr->flXform &= ~(ISO_OR_ANISO_MAP_MODE|PTOD_EFM22_NEGATIVE|
|
||||
PTOD_EFM11_NEGATIVE|POSITIVE_Y_IS_UP);
|
||||
Dc_Attr->flXform |= (PAGE_XLATE_CHANGED|PAGE_TO_DEVICE_SCALE_IDENTITY|
|
||||
pdcattr->flXform |= (PAGE_XLATE_CHANGED|PAGE_TO_DEVICE_SCALE_IDENTITY|
|
||||
INVALIDATE_ATTRIBUTES|DEVICE_TO_WORLD_INVALID);
|
||||
break;
|
||||
|
||||
case MM_ISOTROPIC:
|
||||
Dc_Attr->flXform |= ISO_OR_ANISO_MAP_MODE;
|
||||
pdcattr->flXform |= ISO_OR_ANISO_MAP_MODE;
|
||||
/* Fall through */
|
||||
|
||||
case MM_LOMETRIC:
|
||||
Dc_Attr->szlWindowExt.cx = 3600;
|
||||
Dc_Attr->szlWindowExt.cy = 2700;
|
||||
Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
|
||||
Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
|
||||
pdcattr->szlWindowExt.cx = 3600;
|
||||
pdcattr->szlWindowExt.cy = 2700;
|
||||
pdcattr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
|
||||
pdcattr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
|
||||
break;
|
||||
|
||||
case MM_HIMETRIC:
|
||||
Dc_Attr->szlWindowExt.cx = 36000;
|
||||
Dc_Attr->szlWindowExt.cy = 27000;
|
||||
Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
|
||||
Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
|
||||
pdcattr->szlWindowExt.cx = 36000;
|
||||
pdcattr->szlWindowExt.cy = 27000;
|
||||
pdcattr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
|
||||
pdcattr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
|
||||
break;
|
||||
|
||||
case MM_LOENGLISH:
|
||||
Dc_Attr->szlWindowExt.cx = 1417;
|
||||
Dc_Attr->szlWindowExt.cy = 1063;
|
||||
Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
|
||||
Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
|
||||
pdcattr->szlWindowExt.cx = 1417;
|
||||
pdcattr->szlWindowExt.cy = 1063;
|
||||
pdcattr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
|
||||
pdcattr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
|
||||
break;
|
||||
|
||||
case MM_HIENGLISH:
|
||||
Dc_Attr->szlWindowExt.cx = 14173;
|
||||
Dc_Attr->szlWindowExt.cy = 10630;
|
||||
Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
|
||||
Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
|
||||
pdcattr->szlWindowExt.cx = 14173;
|
||||
pdcattr->szlWindowExt.cy = 10630;
|
||||
pdcattr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
|
||||
pdcattr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
|
||||
break;
|
||||
|
||||
case MM_TWIPS:
|
||||
Dc_Attr->szlWindowExt.cx = 20409;
|
||||
Dc_Attr->szlWindowExt.cy = 15307;
|
||||
Dc_Attr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
|
||||
Dc_Attr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
|
||||
pdcattr->szlWindowExt.cx = 20409;
|
||||
pdcattr->szlWindowExt.cy = 15307;
|
||||
pdcattr->szlViewportExt.cx = ((PGDIDEVICE)dc->ppdev)->GDIInfo.ulHorzRes;
|
||||
pdcattr->szlViewportExt.cy = -((PGDIDEVICE)dc->ppdev)->GDIInfo.ulVertRes;
|
||||
break;
|
||||
|
||||
case MM_ANISOTROPIC:
|
||||
Dc_Attr->flXform &= ~(PAGE_TO_DEVICE_IDENTITY|POSITIVE_Y_IS_UP);
|
||||
Dc_Attr->flXform |= ISO_OR_ANISO_MAP_MODE;
|
||||
pdcattr->flXform &= ~(PAGE_TO_DEVICE_IDENTITY|POSITIVE_Y_IS_UP);
|
||||
pdcattr->flXform |= ISO_OR_ANISO_MAP_MODE;
|
||||
break;
|
||||
default:
|
||||
Dc_Attr->iMapMode = PrevMapMode;
|
||||
pdcattr->iMapMode = PrevMapMode;
|
||||
PrevMapMode = 0;
|
||||
}
|
||||
DC_UpdateXforms(dc);
|
||||
@@ -729,7 +722,7 @@ NtGdiSetViewportOrgEx(HDC hDC,
|
||||
LPPOINT Point)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
dc = DC_LockDc(hDC);
|
||||
if (!dc)
|
||||
@@ -737,8 +730,7 @@ NtGdiSetViewportOrgEx(HDC hDC,
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (Point)
|
||||
{
|
||||
@@ -747,8 +739,8 @@ NtGdiSetViewportOrgEx(HDC hDC,
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite(Point, sizeof(POINT), 1);
|
||||
Point->x = Dc_Attr->ptlViewportOrg.x;
|
||||
Point->y = Dc_Attr->ptlViewportOrg.y;
|
||||
Point->x = pdcattr->ptlViewportOrg.x;
|
||||
Point->y = pdcattr->ptlViewportOrg.y;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
@@ -764,8 +756,8 @@ NtGdiSetViewportOrgEx(HDC hDC,
|
||||
}
|
||||
}
|
||||
|
||||
Dc_Attr->ptlViewportOrg.x = X;
|
||||
Dc_Attr->ptlViewportOrg.y = Y;
|
||||
pdcattr->ptlViewportOrg.x = X;
|
||||
pdcattr->ptlViewportOrg.y = Y;
|
||||
|
||||
DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(dc);
|
||||
@@ -781,7 +773,7 @@ NtGdiSetWindowOrgEx(HDC hDC,
|
||||
LPPOINT Point)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
dc = DC_LockDc(hDC);
|
||||
if (!dc)
|
||||
@@ -789,8 +781,7 @@ NtGdiSetWindowOrgEx(HDC hDC,
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (Point)
|
||||
{
|
||||
@@ -799,8 +790,8 @@ NtGdiSetWindowOrgEx(HDC hDC,
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite(Point, sizeof(POINT), 1);
|
||||
Point->x = Dc_Attr->ptlWindowOrg.x;
|
||||
Point->y = Dc_Attr->ptlWindowOrg.y;
|
||||
Point->x = pdcattr->ptlWindowOrg.x;
|
||||
Point->y = pdcattr->ptlWindowOrg.y;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
@@ -816,8 +807,8 @@ NtGdiSetWindowOrgEx(HDC hDC,
|
||||
}
|
||||
}
|
||||
|
||||
Dc_Attr->ptlWindowOrg.x = X;
|
||||
Dc_Attr->ptlWindowOrg.y = Y;
|
||||
pdcattr->ptlWindowOrg.x = X;
|
||||
pdcattr->ptlWindowOrg.y = Y;
|
||||
|
||||
DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(dc);
|
||||
@@ -832,26 +823,25 @@ VOID
|
||||
FASTCALL
|
||||
IntMirrorWindowOrg(PDC dc)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
LONG X;
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (!(Dc_Attr->dwLayout & LAYOUT_RTL))
|
||||
if (!(pdcattr->dwLayout & LAYOUT_RTL))
|
||||
{
|
||||
Dc_Attr->ptlWindowOrg.x = Dc_Attr->lWindowOrgx; // Flip it back.
|
||||
pdcattr->ptlWindowOrg.x = pdcattr->lWindowOrgx; // Flip it back.
|
||||
return;
|
||||
}
|
||||
if (!Dc_Attr->szlViewportExt.cx) return;
|
||||
if (!pdcattr->szlViewportExt.cx) return;
|
||||
//
|
||||
// WOrgx = wox - (Width - 1) * WExtx / VExtx
|
||||
//
|
||||
X = (dc->erclWindow.right - dc->erclWindow.left) - 1; // Get device width - 1
|
||||
|
||||
X = (X * Dc_Attr->szlWindowExt.cx) / Dc_Attr->szlViewportExt.cx;
|
||||
X = (X * pdcattr->szlWindowExt.cx) / pdcattr->szlViewportExt.cx;
|
||||
|
||||
Dc_Attr->ptlWindowOrg.x = Dc_Attr->lWindowOrgx - X; // Now set the inverted win origion.
|
||||
pdcattr->ptlWindowOrg.x = pdcattr->lWindowOrgx - X; // Now set the inverted win origion.
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -872,7 +862,7 @@ NtGdiSetLayout(
|
||||
IN DWORD dwLayout)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
DWORD oLayout;
|
||||
|
||||
dc = DC_LockDc(hdc);
|
||||
@@ -881,11 +871,10 @@ NtGdiSetLayout(
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return GDI_ERROR;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
Dc_Attr->dwLayout = dwLayout;
|
||||
oLayout = Dc_Attr->dwLayout;
|
||||
pdcattr->dwLayout = dwLayout;
|
||||
oLayout = pdcattr->dwLayout;
|
||||
|
||||
if (!(dwLayout & LAYOUT_ORIENTATIONMASK))
|
||||
{
|
||||
@@ -895,25 +884,25 @@ NtGdiSetLayout(
|
||||
|
||||
if (dwLayout & LAYOUT_RTL)
|
||||
{
|
||||
Dc_Attr->iMapMode = MM_ANISOTROPIC;
|
||||
pdcattr->iMapMode = MM_ANISOTROPIC;
|
||||
}
|
||||
|
||||
Dc_Attr->szlWindowExt.cy = -Dc_Attr->szlWindowExt.cy;
|
||||
Dc_Attr->ptlWindowOrg.x = -Dc_Attr->ptlWindowOrg.x;
|
||||
pdcattr->szlWindowExt.cy = -pdcattr->szlWindowExt.cy;
|
||||
pdcattr->ptlWindowOrg.x = -pdcattr->ptlWindowOrg.x;
|
||||
|
||||
if (wox == -1)
|
||||
IntMirrorWindowOrg(dc);
|
||||
else
|
||||
Dc_Attr->ptlWindowOrg.x = wox - Dc_Attr->ptlWindowOrg.x;
|
||||
pdcattr->ptlWindowOrg.x = wox - pdcattr->ptlWindowOrg.x;
|
||||
|
||||
if (!(Dc_Attr->flTextAlign & TA_CENTER)) Dc_Attr->flTextAlign |= TA_RIGHT;
|
||||
if (!(pdcattr->flTextAlign & TA_CENTER)) pdcattr->flTextAlign |= TA_RIGHT;
|
||||
|
||||
if (dc->DcLevel.flPath & DCPATH_CLOCKWISE)
|
||||
dc->DcLevel.flPath &= ~DCPATH_CLOCKWISE;
|
||||
else
|
||||
dc->DcLevel.flPath |= DCPATH_CLOCKWISE;
|
||||
|
||||
Dc_Attr->flXform |= (PAGE_EXTENTS_CHANGED |
|
||||
pdcattr->flXform |= (PAGE_EXTENTS_CHANGED |
|
||||
INVALIDATE_ATTRIBUTES |
|
||||
DEVICE_TO_WORLD_INVALID);
|
||||
|
||||
@@ -974,7 +963,7 @@ NtGdiSetSizeDevice(
|
||||
IN INT cyVirtualDevice)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
if (!cxVirtualDevice || !cyVirtualDevice)
|
||||
{
|
||||
@@ -984,11 +973,10 @@ NtGdiSetSizeDevice(
|
||||
dc = DC_LockDc(hdc);
|
||||
if (!dc) return FALSE;
|
||||
|
||||
pDc_Attr = dc->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
pDc_Attr->szlVirtualDeviceSize.cx = cxVirtualDevice;
|
||||
pDc_Attr->szlVirtualDeviceSize.cy = cyVirtualDevice;
|
||||
pdcattr->szlVirtualDeviceSize.cx = cxVirtualDevice;
|
||||
pdcattr->szlVirtualDeviceSize.cy = cyVirtualDevice;
|
||||
|
||||
// DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(dc);
|
||||
@@ -1009,20 +997,19 @@ NtGdiSetVirtualResolution(
|
||||
IN INT cyVirtualDeviceMm)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
// Need test types for zeros and non zeros
|
||||
|
||||
dc = DC_LockDc(hdc);
|
||||
if (!dc) return FALSE;
|
||||
|
||||
pDc_Attr = dc->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
pDc_Attr->szlVirtualDevicePixel.cx = cxVirtualDevicePixel;
|
||||
pDc_Attr->szlVirtualDevicePixel.cy = cyVirtualDevicePixel;
|
||||
pDc_Attr->szlVirtualDeviceMm.cx = cxVirtualDeviceMm;
|
||||
pDc_Attr->szlVirtualDeviceMm.cy = cyVirtualDeviceMm;
|
||||
pdcattr->szlVirtualDevicePixel.cx = cxVirtualDevicePixel;
|
||||
pdcattr->szlVirtualDevicePixel.cy = cyVirtualDevicePixel;
|
||||
pdcattr->szlVirtualDeviceMm.cx = cxVirtualDeviceMm;
|
||||
pdcattr->szlVirtualDeviceMm.cy = cyVirtualDeviceMm;
|
||||
|
||||
// DC_UpdateXforms(dc);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
@@ -108,10 +108,8 @@ NtGdiCreateCompatibleDC(HDC hDC)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
oDc_Attr = OrigDC->pDc_Attr;
|
||||
if(!oDc_Attr) oDc_Attr = &OrigDC->Dc_Attr;
|
||||
nDc_Attr = NewDC->pDc_Attr;
|
||||
if(!nDc_Attr) nDc_Attr = &NewDC->Dc_Attr;
|
||||
oDc_Attr = OrigDC->pdcattr;
|
||||
nDc_Attr = NewDC->pdcattr;
|
||||
|
||||
/* Copy information from original DC to new DC */
|
||||
NewDC->DcLevel.hdcSave = hNewDC;
|
||||
@@ -816,8 +814,7 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
nDc_Attr = NewDC->pDc_Attr;
|
||||
if(!nDc_Attr) nDc_Attr = &NewDC->Dc_Attr;
|
||||
nDc_Attr = NewDC->pdcattr;
|
||||
|
||||
NewDC->dctype = DC_TYPE_DIRECT;
|
||||
|
||||
@@ -984,6 +981,7 @@ IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC)
|
||||
return NULL;
|
||||
}
|
||||
RtlZeroMemory(defaultDCstate, sizeof(DC));
|
||||
defaultDCstate->pdcattr = &defaultDCstate->Dc_Attr;
|
||||
IntGdiCopyToSaveState(dc, defaultDCstate);
|
||||
DC_UnlockDc( dc );
|
||||
}
|
||||
@@ -1134,7 +1132,7 @@ NtGdiGetDCObject(HDC hDC, INT ObjectType)
|
||||
{
|
||||
HGDIOBJ SelObject;
|
||||
DC *dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
/* From Wine: GetCurrentObject does not SetLastError() on a null object */
|
||||
if(!hDC) return NULL;
|
||||
@@ -1144,29 +1142,28 @@ NtGdiGetDCObject(HDC hDC, INT ObjectType)
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,Dc_Attr->hpen);
|
||||
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,pdcattr->hpen);
|
||||
|
||||
switch(ObjectType)
|
||||
{
|
||||
case GDI_OBJECT_TYPE_EXTPEN:
|
||||
case GDI_OBJECT_TYPE_PEN:
|
||||
SelObject = Dc_Attr->hpen;
|
||||
SelObject = pdcattr->hpen;
|
||||
break;
|
||||
case GDI_OBJECT_TYPE_BRUSH:
|
||||
SelObject = Dc_Attr->hbrush;
|
||||
SelObject = pdcattr->hbrush;
|
||||
break;
|
||||
case GDI_OBJECT_TYPE_PALETTE:
|
||||
SelObject = dc->DcLevel.hpal;
|
||||
break;
|
||||
case GDI_OBJECT_TYPE_FONT:
|
||||
SelObject = Dc_Attr->hlfntNew;
|
||||
SelObject = pdcattr->hlfntNew;
|
||||
break;
|
||||
case GDI_OBJECT_TYPE_BITMAP:
|
||||
SelObject = dc->rosdc.hBitmap;
|
||||
@@ -1241,12 +1238,11 @@ BOOL FASTCALL
|
||||
IntGetAspectRatioFilter(PDC pDC,
|
||||
LPSIZE AspectRatio)
|
||||
{
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if ( !pDc_Attr ) pDc_Attr = &pDC->Dc_Attr;
|
||||
pdcattr = pDC->pdcattr;
|
||||
|
||||
if ( pDc_Attr->flFontMapper & 1 ) // TRUE assume 1.
|
||||
if ( pdcattr->flFontMapper & 1 ) // TRUE assume 1.
|
||||
{
|
||||
// "This specifies that Windows should only match fonts that have the
|
||||
// same aspect ratio as the display.", Programming Windows, Fifth Ed.
|
||||
@@ -1265,17 +1261,16 @@ VOID
|
||||
FASTCALL
|
||||
IntGetViewportExtEx(PDC pdc, LPSIZE pSize)
|
||||
{
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
/* Get a pointer to the dc attribute */
|
||||
pDc_Attr = pdc->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &pdc->Dc_Attr;
|
||||
pdcattr = pdc->pdcattr;
|
||||
|
||||
/* Check if we need to recalculate */
|
||||
if (pDc_Attr->flXform & PAGE_EXTENTS_CHANGED)
|
||||
if (pdcattr->flXform & PAGE_EXTENTS_CHANGED)
|
||||
{
|
||||
/* Check if we need to do isotropic fixup */
|
||||
if (pDc_Attr->iMapMode == MM_ISOTROPIC)
|
||||
if (pdcattr->iMapMode == MM_ISOTROPIC)
|
||||
{
|
||||
IntFixIsotropicMapping(pdc);
|
||||
}
|
||||
@@ -1285,7 +1280,7 @@ IntGetViewportExtEx(PDC pdc, LPSIZE pSize)
|
||||
}
|
||||
|
||||
/* Copy the viewport extension */
|
||||
*pSize = pDc_Attr->szlViewportExt;
|
||||
*pSize = pdcattr->szlViewportExt;
|
||||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
@@ -1375,54 +1370,52 @@ VOID
|
||||
FASTCALL
|
||||
IntGdiCopyToSaveState(PDC dc, PDC newdc)
|
||||
{
|
||||
PDC_ATTR Dc_Attr, nDc_Attr;
|
||||
PDC_ATTR pdcattr, nDc_Attr;
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
nDc_Attr = newdc->pDc_Attr;
|
||||
if(!nDc_Attr) nDc_Attr = &newdc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
nDc_Attr = newdc->pdcattr;
|
||||
|
||||
newdc->DcLevel.flPath = dc->DcLevel.flPath | DCPATH_SAVESTATE;
|
||||
|
||||
nDc_Attr->dwLayout = Dc_Attr->dwLayout;
|
||||
nDc_Attr->hpen = Dc_Attr->hpen;
|
||||
nDc_Attr->hbrush = Dc_Attr->hbrush;
|
||||
nDc_Attr->hlfntNew = Dc_Attr->hlfntNew;
|
||||
nDc_Attr->dwLayout = pdcattr->dwLayout;
|
||||
nDc_Attr->hpen = pdcattr->hpen;
|
||||
nDc_Attr->hbrush = pdcattr->hbrush;
|
||||
nDc_Attr->hlfntNew = pdcattr->hlfntNew;
|
||||
newdc->rosdc.hBitmap = dc->rosdc.hBitmap;
|
||||
newdc->DcLevel.hpal = dc->DcLevel.hpal;
|
||||
newdc->rosdc.bitsPerPixel = dc->rosdc.bitsPerPixel;
|
||||
nDc_Attr->jROP2 = Dc_Attr->jROP2;
|
||||
nDc_Attr->jFillMode = Dc_Attr->jFillMode;
|
||||
nDc_Attr->jStretchBltMode = Dc_Attr->jStretchBltMode;
|
||||
nDc_Attr->lRelAbs = Dc_Attr->lRelAbs;
|
||||
nDc_Attr->jBkMode = Dc_Attr->jBkMode;
|
||||
nDc_Attr->lBkMode = Dc_Attr->lBkMode;
|
||||
nDc_Attr->crBackgroundClr = Dc_Attr->crBackgroundClr;
|
||||
nDc_Attr->crForegroundClr = Dc_Attr->crForegroundClr;
|
||||
nDc_Attr->ulBackgroundClr = Dc_Attr->ulBackgroundClr;
|
||||
nDc_Attr->ulForegroundClr = Dc_Attr->ulForegroundClr;
|
||||
nDc_Attr->ptlBrushOrigin = Dc_Attr->ptlBrushOrigin;
|
||||
nDc_Attr->lTextAlign = Dc_Attr->lTextAlign;
|
||||
nDc_Attr->lTextExtra = Dc_Attr->lTextExtra;
|
||||
nDc_Attr->cBreak = Dc_Attr->cBreak;
|
||||
nDc_Attr->lBreakExtra = Dc_Attr->lBreakExtra;
|
||||
nDc_Attr->iMapMode = Dc_Attr->iMapMode;
|
||||
nDc_Attr->iGraphicsMode = Dc_Attr->iGraphicsMode;
|
||||
nDc_Attr->jROP2 = pdcattr->jROP2;
|
||||
nDc_Attr->jFillMode = pdcattr->jFillMode;
|
||||
nDc_Attr->jStretchBltMode = pdcattr->jStretchBltMode;
|
||||
nDc_Attr->lRelAbs = pdcattr->lRelAbs;
|
||||
nDc_Attr->jBkMode = pdcattr->jBkMode;
|
||||
nDc_Attr->lBkMode = pdcattr->lBkMode;
|
||||
nDc_Attr->crBackgroundClr = pdcattr->crBackgroundClr;
|
||||
nDc_Attr->crForegroundClr = pdcattr->crForegroundClr;
|
||||
nDc_Attr->ulBackgroundClr = pdcattr->ulBackgroundClr;
|
||||
nDc_Attr->ulForegroundClr = pdcattr->ulForegroundClr;
|
||||
nDc_Attr->ptlBrushOrigin = pdcattr->ptlBrushOrigin;
|
||||
nDc_Attr->lTextAlign = pdcattr->lTextAlign;
|
||||
nDc_Attr->lTextExtra = pdcattr->lTextExtra;
|
||||
nDc_Attr->cBreak = pdcattr->cBreak;
|
||||
nDc_Attr->lBreakExtra = pdcattr->lBreakExtra;
|
||||
nDc_Attr->iMapMode = pdcattr->iMapMode;
|
||||
nDc_Attr->iGraphicsMode = pdcattr->iGraphicsMode;
|
||||
#if 0
|
||||
/* Apparently, the DC origin is not changed by [GS]etDCState */
|
||||
newdc->ptlDCOrig.x = dc->ptlDCOrig.x;
|
||||
newdc->ptlDCOrig.y = dc->ptlDCOrig.y;
|
||||
#endif
|
||||
nDc_Attr->ptlCurrent = Dc_Attr->ptlCurrent;
|
||||
nDc_Attr->ptfxCurrent = Dc_Attr->ptfxCurrent;
|
||||
nDc_Attr->ptlCurrent = pdcattr->ptlCurrent;
|
||||
nDc_Attr->ptfxCurrent = pdcattr->ptfxCurrent;
|
||||
newdc->DcLevel.mxWorldToDevice = dc->DcLevel.mxWorldToDevice;
|
||||
newdc->DcLevel.mxDeviceToWorld = dc->DcLevel.mxDeviceToWorld;
|
||||
newdc->DcLevel.mxWorldToPage = dc->DcLevel.mxWorldToPage;
|
||||
nDc_Attr->flXform = Dc_Attr->flXform;
|
||||
nDc_Attr->ptlWindowOrg = Dc_Attr->ptlWindowOrg;
|
||||
nDc_Attr->szlWindowExt = Dc_Attr->szlWindowExt;
|
||||
nDc_Attr->ptlViewportOrg = Dc_Attr->ptlViewportOrg;
|
||||
nDc_Attr->szlViewportExt = Dc_Attr->szlViewportExt;
|
||||
nDc_Attr->flXform = pdcattr->flXform;
|
||||
nDc_Attr->ptlWindowOrg = pdcattr->ptlWindowOrg;
|
||||
nDc_Attr->szlWindowExt = pdcattr->szlWindowExt;
|
||||
nDc_Attr->ptlViewportOrg = pdcattr->ptlViewportOrg;
|
||||
nDc_Attr->szlViewportExt = pdcattr->szlViewportExt;
|
||||
|
||||
newdc->DcLevel.lSaveDepth = 0;
|
||||
newdc->dctype = dc->dctype;
|
||||
@@ -1446,49 +1439,47 @@ VOID
|
||||
FASTCALL
|
||||
IntGdiCopyFromSaveState(PDC dc, PDC dcs, HDC hDC)
|
||||
{
|
||||
PDC_ATTR Dc_Attr, sDc_Attr;
|
||||
PDC_ATTR pdcattr, sDc_Attr;
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
sDc_Attr = dcs->pDc_Attr;
|
||||
if(!sDc_Attr) sDc_Attr = &dcs->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
sDc_Attr = dcs->pdcattr;
|
||||
|
||||
dc->DcLevel.flPath = dcs->DcLevel.flPath & ~DCPATH_SAVESTATE;
|
||||
|
||||
Dc_Attr->dwLayout = sDc_Attr->dwLayout;
|
||||
Dc_Attr->jROP2 = sDc_Attr->jROP2;
|
||||
Dc_Attr->jFillMode = sDc_Attr->jFillMode;
|
||||
Dc_Attr->jStretchBltMode = sDc_Attr->jStretchBltMode;
|
||||
Dc_Attr->lRelAbs = sDc_Attr->lRelAbs;
|
||||
Dc_Attr->jBkMode = sDc_Attr->jBkMode;
|
||||
Dc_Attr->crBackgroundClr = sDc_Attr->crBackgroundClr;
|
||||
Dc_Attr->crForegroundClr = sDc_Attr->crForegroundClr;
|
||||
Dc_Attr->lBkMode = sDc_Attr->lBkMode;
|
||||
Dc_Attr->ulBackgroundClr = sDc_Attr->ulBackgroundClr;
|
||||
Dc_Attr->ulForegroundClr = sDc_Attr->ulForegroundClr;
|
||||
Dc_Attr->ptlBrushOrigin = sDc_Attr->ptlBrushOrigin;
|
||||
pdcattr->dwLayout = sDc_Attr->dwLayout;
|
||||
pdcattr->jROP2 = sDc_Attr->jROP2;
|
||||
pdcattr->jFillMode = sDc_Attr->jFillMode;
|
||||
pdcattr->jStretchBltMode = sDc_Attr->jStretchBltMode;
|
||||
pdcattr->lRelAbs = sDc_Attr->lRelAbs;
|
||||
pdcattr->jBkMode = sDc_Attr->jBkMode;
|
||||
pdcattr->crBackgroundClr = sDc_Attr->crBackgroundClr;
|
||||
pdcattr->crForegroundClr = sDc_Attr->crForegroundClr;
|
||||
pdcattr->lBkMode = sDc_Attr->lBkMode;
|
||||
pdcattr->ulBackgroundClr = sDc_Attr->ulBackgroundClr;
|
||||
pdcattr->ulForegroundClr = sDc_Attr->ulForegroundClr;
|
||||
pdcattr->ptlBrushOrigin = sDc_Attr->ptlBrushOrigin;
|
||||
|
||||
Dc_Attr->lTextAlign = sDc_Attr->lTextAlign;
|
||||
Dc_Attr->lTextExtra = sDc_Attr->lTextExtra;
|
||||
Dc_Attr->cBreak = sDc_Attr->cBreak;
|
||||
Dc_Attr->lBreakExtra = sDc_Attr->lBreakExtra;
|
||||
Dc_Attr->iMapMode = sDc_Attr->iMapMode;
|
||||
Dc_Attr->iGraphicsMode = sDc_Attr->iGraphicsMode;
|
||||
pdcattr->lTextAlign = sDc_Attr->lTextAlign;
|
||||
pdcattr->lTextExtra = sDc_Attr->lTextExtra;
|
||||
pdcattr->cBreak = sDc_Attr->cBreak;
|
||||
pdcattr->lBreakExtra = sDc_Attr->lBreakExtra;
|
||||
pdcattr->iMapMode = sDc_Attr->iMapMode;
|
||||
pdcattr->iGraphicsMode = sDc_Attr->iGraphicsMode;
|
||||
#if 0
|
||||
/* Apparently, the DC origin is not changed by [GS]etDCState */
|
||||
dc->ptlDCOrig.x = dcs->ptlDCOrig.x;
|
||||
dc->ptlDCOrig.y = dcs->ptlDCOrig.y;
|
||||
#endif
|
||||
Dc_Attr->ptlCurrent = sDc_Attr->ptlCurrent;
|
||||
Dc_Attr->ptfxCurrent = sDc_Attr->ptfxCurrent;
|
||||
pdcattr->ptlCurrent = sDc_Attr->ptlCurrent;
|
||||
pdcattr->ptfxCurrent = sDc_Attr->ptfxCurrent;
|
||||
dc->DcLevel.mxWorldToDevice = dcs->DcLevel.mxWorldToDevice;
|
||||
dc->DcLevel.mxDeviceToWorld = dcs->DcLevel.mxDeviceToWorld;
|
||||
dc->DcLevel.mxWorldToPage = dcs->DcLevel.mxWorldToPage;
|
||||
Dc_Attr->flXform = sDc_Attr->flXform;
|
||||
Dc_Attr->ptlWindowOrg = sDc_Attr->ptlWindowOrg;
|
||||
Dc_Attr->szlWindowExt = sDc_Attr->szlWindowExt;
|
||||
Dc_Attr->ptlViewportOrg = sDc_Attr->ptlViewportOrg;
|
||||
Dc_Attr->szlViewportExt = sDc_Attr->szlViewportExt;
|
||||
pdcattr->flXform = sDc_Attr->flXform;
|
||||
pdcattr->ptlWindowOrg = sDc_Attr->ptlWindowOrg;
|
||||
pdcattr->szlWindowExt = sDc_Attr->szlWindowExt;
|
||||
pdcattr->ptlViewportOrg = sDc_Attr->ptlViewportOrg;
|
||||
pdcattr->szlViewportExt = sDc_Attr->szlViewportExt;
|
||||
|
||||
if (dc->dctype != DC_TYPE_MEMORY)
|
||||
{
|
||||
@@ -2177,7 +2168,7 @@ NtGdiGetDCDword(
|
||||
{
|
||||
BOOL Ret = TRUE;
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
DWORD SafeResult = 0;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
@@ -2194,24 +2185,23 @@ NtGdiGetDCDword(
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
switch (u)
|
||||
{
|
||||
case GdiGetJournal:
|
||||
break;
|
||||
case GdiGetRelAbs:
|
||||
SafeResult = Dc_Attr->lRelAbs;
|
||||
SafeResult = pdcattr->lRelAbs;
|
||||
break;
|
||||
case GdiGetBreakExtra:
|
||||
SafeResult = Dc_Attr->lBreakExtra;
|
||||
SafeResult = pdcattr->lBreakExtra;
|
||||
break;
|
||||
case GdiGerCharBreak:
|
||||
SafeResult = Dc_Attr->cBreak;
|
||||
SafeResult = pdcattr->cBreak;
|
||||
break;
|
||||
case GdiGetArcDirection:
|
||||
if (Dc_Attr->dwLayout & LAYOUT_RTL)
|
||||
if (pdcattr->dwLayout & LAYOUT_RTL)
|
||||
SafeResult = AD_CLOCKWISE - ((dc->DcLevel.flPath & DCPATH_CLOCKWISE) != 0);
|
||||
else
|
||||
SafeResult = ((dc->DcLevel.flPath & DCPATH_CLOCKWISE) != 0) + AD_COUNTERCLOCKWISE;
|
||||
@@ -2225,10 +2215,10 @@ NtGdiGetDCDword(
|
||||
SafeResult = dc->dctype;
|
||||
break;
|
||||
case GdiGetMapMode:
|
||||
SafeResult = Dc_Attr->iMapMode;
|
||||
SafeResult = pdcattr->iMapMode;
|
||||
break;
|
||||
case GdiGetTextCharExtra:
|
||||
SafeResult = Dc_Attr->lTextExtra;
|
||||
SafeResult = pdcattr->lTextExtra;
|
||||
break;
|
||||
default:
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
@@ -2274,7 +2264,7 @@ NtGdiGetAndSetDCDword(
|
||||
{
|
||||
BOOL Ret = TRUE;
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
DWORD SafeResult = 0;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
@@ -2291,8 +2281,7 @@ NtGdiGetAndSetDCDword(
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
switch (u)
|
||||
{
|
||||
@@ -2301,17 +2290,17 @@ NtGdiGetAndSetDCDword(
|
||||
dc->ulCopyCount = dwIn;
|
||||
break;
|
||||
case GdiGetSetTextAlign:
|
||||
SafeResult = Dc_Attr->lTextAlign;
|
||||
Dc_Attr->lTextAlign = dwIn;
|
||||
// Dc_Attr->flTextAlign = dwIn; // Flags!
|
||||
SafeResult = pdcattr->lTextAlign;
|
||||
pdcattr->lTextAlign = dwIn;
|
||||
// pdcattr->flTextAlign = dwIn; // Flags!
|
||||
break;
|
||||
case GdiGetSetRelAbs:
|
||||
SafeResult = Dc_Attr->lRelAbs;
|
||||
Dc_Attr->lRelAbs = dwIn;
|
||||
SafeResult = pdcattr->lRelAbs;
|
||||
pdcattr->lRelAbs = dwIn;
|
||||
break;
|
||||
case GdiGetSetTextCharExtra:
|
||||
SafeResult = Dc_Attr->lTextExtra;
|
||||
Dc_Attr->lTextExtra = dwIn;
|
||||
SafeResult = pdcattr->lTextExtra;
|
||||
pdcattr->lTextExtra = dwIn;
|
||||
break;
|
||||
case GdiGetSetSelectFont:
|
||||
break;
|
||||
@@ -2322,8 +2311,8 @@ NtGdiGetAndSetDCDword(
|
||||
Ret = FALSE;
|
||||
break;
|
||||
}
|
||||
SafeResult = Dc_Attr->flFontMapper;
|
||||
Dc_Attr->flFontMapper = dwIn;
|
||||
SafeResult = pdcattr->flFontMapper;
|
||||
pdcattr->flFontMapper = dwIn;
|
||||
break;
|
||||
case GdiGetSetMapMode:
|
||||
SafeResult = IntGdiSetMapMode( dc, dwIn);
|
||||
@@ -2335,7 +2324,7 @@ NtGdiGetAndSetDCDword(
|
||||
Ret = FALSE;
|
||||
break;
|
||||
}
|
||||
if ( Dc_Attr->dwLayout & LAYOUT_RTL ) // Right to Left
|
||||
if ( pdcattr->dwLayout & LAYOUT_RTL ) // Right to Left
|
||||
{
|
||||
SafeResult = AD_CLOCKWISE - ((dc->DcLevel.flPath & DCPATH_CLOCKWISE) != 0);
|
||||
if ( dwIn == AD_CLOCKWISE )
|
||||
@@ -2395,7 +2384,7 @@ HDC FASTCALL
|
||||
DC_AllocDC(PUNICODE_STRING Driver)
|
||||
{
|
||||
PDC NewDC;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
HDC hDC;
|
||||
PWSTR Buf = NULL;
|
||||
XFORM xformTemplate;
|
||||
@@ -2424,6 +2413,7 @@ DC_AllocDC(PUNICODE_STRING Driver)
|
||||
|
||||
hDC = NewDC->BaseObject.hHmgr;
|
||||
|
||||
NewDC->pdcattr = &NewDC->Dc_Attr;
|
||||
DC_AllocateDcAttr(hDC);
|
||||
|
||||
if (Driver != NULL)
|
||||
@@ -2431,8 +2421,7 @@ DC_AllocDC(PUNICODE_STRING Driver)
|
||||
RtlCopyMemory(&NewDC->rosdc.DriverName, Driver, sizeof(UNICODE_STRING));
|
||||
NewDC->rosdc.DriverName.Buffer = Buf;
|
||||
}
|
||||
Dc_Attr = NewDC->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &NewDC->Dc_Attr;
|
||||
pdcattr = NewDC->pdcattr;
|
||||
|
||||
NewDC->BaseObject.hHmgr = (HGDIOBJ) hDC; // Save the handle for this DC object.
|
||||
|
||||
@@ -2447,37 +2436,37 @@ DC_AllocDC(PUNICODE_STRING Driver)
|
||||
XForm2MatrixS(&NewDC->DcLevel.mxWorldToPage, &xformTemplate);
|
||||
|
||||
// Setup syncing bits for the dcattr data packets.
|
||||
Dc_Attr->flXform = DEVICE_TO_PAGE_INVALID;
|
||||
pdcattr->flXform = DEVICE_TO_PAGE_INVALID;
|
||||
|
||||
Dc_Attr->ulDirty_ = 0; // Server side
|
||||
pdcattr->ulDirty_ = 0; // Server side
|
||||
|
||||
Dc_Attr->iMapMode = MM_TEXT;
|
||||
Dc_Attr->iGraphicsMode = GM_COMPATIBLE;
|
||||
Dc_Attr->jFillMode = ALTERNATE;
|
||||
pdcattr->iMapMode = MM_TEXT;
|
||||
pdcattr->iGraphicsMode = GM_COMPATIBLE;
|
||||
pdcattr->jFillMode = ALTERNATE;
|
||||
|
||||
Dc_Attr->szlWindowExt.cx = 1; // Float to Int,,, WRONG!
|
||||
Dc_Attr->szlWindowExt.cy = 1;
|
||||
Dc_Attr->szlViewportExt.cx = 1;
|
||||
Dc_Attr->szlViewportExt.cy = 1;
|
||||
pdcattr->szlWindowExt.cx = 1; // Float to Int,,, WRONG!
|
||||
pdcattr->szlWindowExt.cy = 1;
|
||||
pdcattr->szlViewportExt.cx = 1;
|
||||
pdcattr->szlViewportExt.cy = 1;
|
||||
|
||||
Dc_Attr->crForegroundClr = 0;
|
||||
Dc_Attr->ulForegroundClr = 0;
|
||||
pdcattr->crForegroundClr = 0;
|
||||
pdcattr->ulForegroundClr = 0;
|
||||
|
||||
Dc_Attr->ulBackgroundClr = 0xffffff;
|
||||
Dc_Attr->crBackgroundClr = 0xffffff;
|
||||
pdcattr->ulBackgroundClr = 0xffffff;
|
||||
pdcattr->crBackgroundClr = 0xffffff;
|
||||
|
||||
Dc_Attr->ulPenClr = RGB( 0, 0, 0 );
|
||||
Dc_Attr->crPenClr = RGB( 0, 0, 0 );
|
||||
pdcattr->ulPenClr = RGB( 0, 0, 0 );
|
||||
pdcattr->crPenClr = RGB( 0, 0, 0 );
|
||||
|
||||
Dc_Attr->ulBrushClr = RGB( 255, 255, 255 ); // Do this way too.
|
||||
Dc_Attr->crBrushClr = RGB( 255, 255, 255 );
|
||||
pdcattr->ulBrushClr = RGB( 255, 255, 255 ); // Do this way too.
|
||||
pdcattr->crBrushClr = RGB( 255, 255, 255 );
|
||||
|
||||
//// This fixes the default brush and pen settings. See DC_InitDC.
|
||||
Dc_Attr->hbrush = NtGdiGetStockObject( WHITE_BRUSH );
|
||||
Dc_Attr->hpen = NtGdiGetStockObject( BLACK_PEN );
|
||||
pdcattr->hbrush = NtGdiGetStockObject( WHITE_BRUSH );
|
||||
pdcattr->hpen = NtGdiGetStockObject( BLACK_PEN );
|
||||
////
|
||||
Dc_Attr->hlfntNew = NtGdiGetStockObject(SYSTEM_FONT);
|
||||
TextIntRealizeFont(Dc_Attr->hlfntNew,NULL);
|
||||
pdcattr->hlfntNew = NtGdiGetStockObject(SYSTEM_FONT);
|
||||
TextIntRealizeFont(pdcattr->hlfntNew,NULL);
|
||||
|
||||
NewDC->DcLevel.hpal = NtGdiGetStockObject(DEFAULT_PALETTE);
|
||||
NewDC->DcLevel.laPath.eMiterLimit = 10.0;
|
||||
@@ -2549,9 +2538,10 @@ DC_AllocateDcAttr(HDC hDC)
|
||||
}
|
||||
KeLeaveCriticalRegion();
|
||||
pDC = DC_LockDc(hDC);
|
||||
ASSERT(pDC->pdcattr == &pDC->Dc_Attr);
|
||||
if(NewMem)
|
||||
{
|
||||
pDC->pDc_Attr = NewMem; // Store pointer
|
||||
pDC->pdcattr = NewMem; // Store pointer
|
||||
}
|
||||
DC_UnlockDc(pDC);
|
||||
}
|
||||
@@ -2562,8 +2552,8 @@ DC_FreeDcAttr(HDC DCToFree )
|
||||
{
|
||||
HANDLE Pid = NtCurrentProcess();
|
||||
PDC pDC = DC_LockDc(DCToFree);
|
||||
if (pDC->pDc_Attr == &pDC->Dc_Attr) return; // Internal DC object!
|
||||
pDC->pDc_Attr = NULL;
|
||||
if (pDC->pdcattr == &pDC->Dc_Attr) return; // Internal DC object!
|
||||
pDC->pdcattr = &pDC->Dc_Attr;
|
||||
DC_UnlockDc(pDC);
|
||||
|
||||
KeEnterCriticalRegion();
|
||||
@@ -2630,19 +2620,18 @@ DC_UpdateXforms(PDC dc)
|
||||
{
|
||||
XFORM xformWnd2Vport;
|
||||
FLOAT scaleX, scaleY;
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
XFORM xformWorld2Vport, xformWorld2Wnd, xformVport2World;
|
||||
|
||||
/* Construct a transformation to do the window-to-viewport conversion */
|
||||
scaleX = (Dc_Attr->szlWindowExt.cx ? (FLOAT)Dc_Attr->szlViewportExt.cx / (FLOAT)Dc_Attr->szlWindowExt.cx : 0.0f);
|
||||
scaleY = (Dc_Attr->szlWindowExt.cy ? (FLOAT)Dc_Attr->szlViewportExt.cy / (FLOAT)Dc_Attr->szlWindowExt.cy : 0.0f);
|
||||
scaleX = (pdcattr->szlWindowExt.cx ? (FLOAT)pdcattr->szlViewportExt.cx / (FLOAT)pdcattr->szlWindowExt.cx : 0.0f);
|
||||
scaleY = (pdcattr->szlWindowExt.cy ? (FLOAT)pdcattr->szlViewportExt.cy / (FLOAT)pdcattr->szlWindowExt.cy : 0.0f);
|
||||
xformWnd2Vport.eM11 = scaleX;
|
||||
xformWnd2Vport.eM12 = 0.0;
|
||||
xformWnd2Vport.eM21 = 0.0;
|
||||
xformWnd2Vport.eM22 = scaleY;
|
||||
xformWnd2Vport.eDx = (FLOAT)Dc_Attr->ptlViewportOrg.x - scaleX * (FLOAT)Dc_Attr->ptlWindowOrg.x;
|
||||
xformWnd2Vport.eDy = (FLOAT)Dc_Attr->ptlViewportOrg.y - scaleY * (FLOAT)Dc_Attr->ptlWindowOrg.y;
|
||||
xformWnd2Vport.eDx = (FLOAT)pdcattr->ptlViewportOrg.x - scaleX * (FLOAT)pdcattr->ptlWindowOrg.x;
|
||||
xformWnd2Vport.eDy = (FLOAT)pdcattr->ptlViewportOrg.y - scaleY * (FLOAT)pdcattr->ptlWindowOrg.y;
|
||||
|
||||
/* Combine with the world transformation */
|
||||
MatrixS2XForm(&xformWorld2Vport, &dc->DcLevel.mxWorldToDevice);
|
||||
@@ -2653,11 +2642,11 @@ DC_UpdateXforms(PDC dc)
|
||||
MatrixS2XForm(&xformVport2World, &dc->DcLevel.mxDeviceToWorld);
|
||||
if (DC_InvertXform(&xformWorld2Vport, &xformVport2World))
|
||||
{
|
||||
Dc_Attr->flXform &= ~DEVICE_TO_WORLD_INVALID;
|
||||
pdcattr->flXform &= ~DEVICE_TO_WORLD_INVALID;
|
||||
}
|
||||
else
|
||||
{
|
||||
Dc_Attr->flXform |= DEVICE_TO_WORLD_INVALID;
|
||||
pdcattr->flXform |= DEVICE_TO_WORLD_INVALID;
|
||||
}
|
||||
|
||||
XForm2MatrixS(&dc->DcLevel.mxWorldToDevice, &xformWorld2Vport);
|
||||
|
||||
@@ -14,15 +14,14 @@ func_type APIENTRY func_name( HDC hdc ) \
|
||||
{ \
|
||||
func_type ft; \
|
||||
PDC dc = DC_LockDc( hdc ); \
|
||||
PDC_ATTR Dc_Attr; \
|
||||
PDC_ATTR pdcattr; \
|
||||
if (!dc) \
|
||||
{ \
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE); \
|
||||
return 0; \
|
||||
} \
|
||||
Dc_Attr = dc->pDc_Attr; \
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; \
|
||||
ft = Dc_Attr->dc_field; \
|
||||
pdcattr = dc->pdcattr; \
|
||||
ft = pdcattr->dc_field; \
|
||||
DC_UnlockDc(dc); \
|
||||
return ft; \
|
||||
}
|
||||
@@ -34,13 +33,12 @@ func_type APIENTRY func_name( HDC hdc ) \
|
||||
#define DC_GET_VAL_EX( FuncName, ret_x, ret_y, type, ax, ay ) \
|
||||
VOID FASTCALL Int##FuncName ( PDC dc, LP##type pt) \
|
||||
{ \
|
||||
PDC_ATTR Dc_Attr; \
|
||||
PDC_ATTR pdcattr; \
|
||||
ASSERT(dc); \
|
||||
ASSERT(pt); \
|
||||
Dc_Attr = dc->pDc_Attr; \
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; \
|
||||
pt->ax = Dc_Attr->ret_x; \
|
||||
pt->ay = Dc_Attr->ret_y; \
|
||||
pdcattr = dc->pdcattr; \
|
||||
pt->ax = pdcattr->ret_x; \
|
||||
pt->ay = pdcattr->ret_y; \
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -87,7 +85,7 @@ INT APIENTRY func_name( HDC hdc, INT mode ) \
|
||||
{ \
|
||||
INT prevMode; \
|
||||
PDC dc; \
|
||||
PDC_ATTR Dc_Attr; \
|
||||
PDC_ATTR pdcattr; \
|
||||
if ((mode < min_val) || (mode > max_val)) \
|
||||
{ \
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER); \
|
||||
@@ -99,10 +97,9 @@ INT APIENTRY func_name( HDC hdc, INT mode ) \
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE); \
|
||||
return 0; \
|
||||
} \
|
||||
Dc_Attr = dc->pDc_Attr; \
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr; \
|
||||
prevMode = Dc_Attr->dc_field; \
|
||||
Dc_Attr->dc_field = mode; \
|
||||
pdcattr = dc->pdcattr; \
|
||||
prevMode = pdcattr->dc_field; \
|
||||
pdcattr->dc_field = mode; \
|
||||
DC_UnlockDc ( dc ); \
|
||||
return prevMode; \
|
||||
}
|
||||
@@ -110,7 +107,7 @@ INT APIENTRY func_name( HDC hdc, INT mode ) \
|
||||
|
||||
static
|
||||
VOID
|
||||
CopytoUserDcAttr(PDC dc, PDC_ATTR Dc_Attr)
|
||||
CopytoUserDcAttr(PDC dc, PDC_ATTR pdcattr)
|
||||
{
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
dc->Dc_Attr.mxWorldToDevice = dc->DcLevel.mxWorldToDevice;
|
||||
@@ -119,16 +116,17 @@ CopytoUserDcAttr(PDC dc, PDC_ATTR Dc_Attr)
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite( Dc_Attr,
|
||||
ProbeForWrite( pdcattr,
|
||||
sizeof(DC_ATTR),
|
||||
1);
|
||||
RtlCopyMemory( Dc_Attr,
|
||||
RtlCopyMemory( pdcattr,
|
||||
&dc->Dc_Attr,
|
||||
sizeof(DC_ATTR));
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
Status = _SEH2_GetExceptionCode();
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
_SEH2_END;
|
||||
}
|
||||
@@ -138,13 +136,11 @@ BOOL
|
||||
FASTCALL
|
||||
DCU_SyncDcAttrtoUser(PDC dc)
|
||||
{
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
if (Dc_Attr == ((PDC_ATTR)&dc->Dc_Attr)) return TRUE; // No need to copy self.
|
||||
|
||||
if (!Dc_Attr) return FALSE;
|
||||
else
|
||||
CopytoUserDcAttr( dc, Dc_Attr);
|
||||
if (pdcattr == &dc->Dc_Attr) return TRUE; // No need to copy self.
|
||||
ASSERT(pdcattr);
|
||||
CopytoUserDcAttr( dc, pdcattr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -185,7 +181,7 @@ IntGdiSetBkColor(HDC hDC, COLORREF color)
|
||||
{
|
||||
COLORREF oldColor;
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
HBRUSH hBrush;
|
||||
|
||||
if (!(dc = DC_LockDc(hDC)))
|
||||
@@ -193,13 +189,12 @@ IntGdiSetBkColor(HDC hDC, COLORREF color)
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return CLR_INVALID;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
oldColor = Dc_Attr->crBackgroundClr;
|
||||
Dc_Attr->crBackgroundClr = color;
|
||||
Dc_Attr->ulBackgroundClr = (ULONG)color;
|
||||
Dc_Attr->ulDirty_ &= ~(DIRTY_BACKGROUND|DIRTY_LINE|DIRTY_FILL); // Clear Flag if set.
|
||||
hBrush = Dc_Attr->hbrush;
|
||||
pdcattr = dc->pdcattr;
|
||||
oldColor = pdcattr->crBackgroundClr;
|
||||
pdcattr->crBackgroundClr = color;
|
||||
pdcattr->ulBackgroundClr = (ULONG)color;
|
||||
pdcattr->ulDirty_ &= ~(DIRTY_BACKGROUND|DIRTY_LINE|DIRTY_FILL); // Clear Flag if set.
|
||||
hBrush = pdcattr->hbrush;
|
||||
DC_UnlockDc(dc);
|
||||
NtGdiSelectBrush(hDC, hBrush);
|
||||
return oldColor;
|
||||
@@ -210,18 +205,17 @@ IntGdiSetBkMode(HDC hDC, INT Mode)
|
||||
{
|
||||
COLORREF oldMode;
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
if (!(dc = DC_LockDc(hDC)))
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return CLR_INVALID;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
oldMode = Dc_Attr->lBkMode;
|
||||
Dc_Attr->jBkMode = Mode;
|
||||
Dc_Attr->lBkMode = Mode;
|
||||
pdcattr = dc->pdcattr;
|
||||
oldMode = pdcattr->lBkMode;
|
||||
pdcattr->jBkMode = Mode;
|
||||
pdcattr->lBkMode = Mode;
|
||||
DC_UnlockDc(dc);
|
||||
return oldMode;
|
||||
}
|
||||
@@ -233,7 +227,7 @@ IntGdiSetTextAlign(HDC hDC,
|
||||
{
|
||||
UINT prevAlign;
|
||||
DC *dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
dc = DC_LockDc(hDC);
|
||||
if (!dc)
|
||||
@@ -241,10 +235,9 @@ IntGdiSetTextAlign(HDC hDC,
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return GDI_ERROR;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
prevAlign = Dc_Attr->lTextAlign;
|
||||
Dc_Attr->lTextAlign = Mode;
|
||||
pdcattr = dc->pdcattr;
|
||||
prevAlign = pdcattr->lTextAlign;
|
||||
pdcattr->lTextAlign = Mode;
|
||||
DC_UnlockDc( dc );
|
||||
return prevAlign;
|
||||
}
|
||||
@@ -256,7 +249,7 @@ IntGdiSetTextColor(HDC hDC,
|
||||
{
|
||||
COLORREF oldColor;
|
||||
PDC dc = DC_LockDc(hDC);
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
HBRUSH hBrush;
|
||||
|
||||
if (!dc)
|
||||
@@ -264,13 +257,12 @@ IntGdiSetTextColor(HDC hDC,
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return CLR_INVALID;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
oldColor = Dc_Attr->crForegroundClr;
|
||||
Dc_Attr->crForegroundClr = color;
|
||||
hBrush = Dc_Attr->hbrush;
|
||||
Dc_Attr->ulDirty_ &= ~(DIRTY_TEXT|DIRTY_LINE|DIRTY_FILL);
|
||||
oldColor = pdcattr->crForegroundClr;
|
||||
pdcattr->crForegroundClr = color;
|
||||
hBrush = pdcattr->hbrush;
|
||||
pdcattr->ulDirty_ &= ~(DIRTY_TEXT|DIRTY_LINE|DIRTY_FILL);
|
||||
DC_UnlockDc( dc );
|
||||
NtGdiSelectBrush(hDC, hBrush);
|
||||
return oldColor;
|
||||
|
||||
@@ -1320,7 +1320,7 @@ DIB_CreateDIBSection(
|
||||
HBITMAP res = 0;
|
||||
SURFACE *bmp = NULL;
|
||||
void *mapBits = NULL;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
// Fill BITMAP32 structure with DIB data
|
||||
BITMAPINFOHEADER *bi = &bmi->bmiHeader;
|
||||
@@ -1342,8 +1342,7 @@ DIB_CreateDIBSection(
|
||||
return (HBITMAP)NULL;
|
||||
}
|
||||
|
||||
pDc_Attr = dc->pDc_Attr;
|
||||
if ( !pDc_Attr ) pDc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
effHeight = bi->biHeight >= 0 ? bi->biHeight : -bi->biHeight;
|
||||
bm.bmType = 0;
|
||||
@@ -1543,7 +1542,7 @@ DIB_CreateDIBSection(
|
||||
*bits = bm.bmBits;
|
||||
}
|
||||
|
||||
// if (res) pDc_Attr->ulDirty_ |= DC_DIBSECTION;
|
||||
// if (res) pdcattr->ulDirty_ |= DC_DIBSECTION;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1195,7 +1195,7 @@ IntFillRect( DC *dc,
|
||||
GDIBRUSHINST BrushInst;
|
||||
POINTL BrushOrigin;
|
||||
BOOL Ret = TRUE;
|
||||
PDC_ATTR Dc_Attr = NULL;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
ASSERT(BrushObj);
|
||||
|
||||
@@ -1208,8 +1208,7 @@ IntFillRect( DC *dc,
|
||||
|
||||
if (!(BrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
||||
{
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
/* fix negative spaces */
|
||||
if (Width < 0)
|
||||
@@ -1232,7 +1231,7 @@ IntFillRect( DC *dc,
|
||||
BrushOrigin.x = BrushObj->ptOrigin.x;
|
||||
BrushOrigin.y = BrushObj->ptOrigin.y;
|
||||
|
||||
if (Dc_Attr->jROP2 == R2_XORPEN)
|
||||
if (pdcattr->jROP2 == R2_XORPEN)
|
||||
ROP = PATINVERT;
|
||||
else
|
||||
ROP = PATCOPY;
|
||||
@@ -1271,16 +1270,15 @@ IntFillArc( PDC dc,
|
||||
double EndArc,
|
||||
ARCTYPE arctype)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PGDIBRUSHOBJ FillBrushObj;
|
||||
int Start = ceill(StartArc);
|
||||
int End = ceill(EndArc);
|
||||
BOOL Chord = (arctype == GdiTypeChord), ret;
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
FillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
|
||||
FillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
|
||||
if (NULL == FillBrushObj)
|
||||
{
|
||||
DPRINT1("FillArc Fail\n");
|
||||
|
||||
@@ -60,7 +60,7 @@ IntGdiPolygon(PDC dc,
|
||||
BOOL ret = FALSE; // default to failure
|
||||
RECTL DestRect;
|
||||
int CurrentPoint;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
POINTL BrushOrigin;
|
||||
// int Left;
|
||||
// int Top;
|
||||
@@ -83,8 +83,7 @@ IntGdiPolygon(PDC dc,
|
||||
}
|
||||
*/
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
/* Convert to screen coordinates */
|
||||
IntLPtoDP(dc, Points, Count);
|
||||
@@ -108,15 +107,15 @@ IntGdiPolygon(PDC dc,
|
||||
DestRect.bottom = max(DestRect.bottom, Points[CurrentPoint].y);
|
||||
}
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,Dc_Attr->hpen);
|
||||
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,pdcattr->hpen);
|
||||
|
||||
/* Special locking order to avoid lock-ups */
|
||||
FillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
|
||||
PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen);
|
||||
FillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
|
||||
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
|
||||
psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
|
||||
/* FIXME - psurf can be NULL!!!! don't assert but handle this case gracefully! */
|
||||
ASSERT(psurf);
|
||||
@@ -156,7 +155,7 @@ IntGdiPolygon(PDC dc,
|
||||
Points[i+1].x, /* To */
|
||||
Points[i+1].y,
|
||||
&DestRect,
|
||||
ROP2_TO_MIX(Dc_Attr->jROP2)); /* MIX */
|
||||
ROP2_TO_MIX(pdcattr->jROP2)); /* MIX */
|
||||
if (!ret) break;
|
||||
}
|
||||
/* Close the polygon */
|
||||
@@ -170,7 +169,7 @@ IntGdiPolygon(PDC dc,
|
||||
Points[0].x, /* To */
|
||||
Points[0].y,
|
||||
&DestRect,
|
||||
ROP2_TO_MIX(Dc_Attr->jROP2)); /* MIX */
|
||||
ROP2_TO_MIX(pdcattr->jROP2)); /* MIX */
|
||||
}
|
||||
}
|
||||
if (PenBrushObj)
|
||||
@@ -224,7 +223,7 @@ NtGdiEllipse(
|
||||
int Bottom)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
RECTL RectBounds;
|
||||
PGDIBRUSHOBJ PenBrushObj;
|
||||
BOOL ret = TRUE;
|
||||
@@ -264,16 +263,15 @@ NtGdiEllipse(
|
||||
INT tmp = Bottom; Bottom = Top; Top = tmp;
|
||||
}
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,Dc_Attr->hpen);
|
||||
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,pdcattr->hpen);
|
||||
|
||||
PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen);
|
||||
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
|
||||
if (NULL == PenBrushObj)
|
||||
{
|
||||
DPRINT1("Ellipse Fail 1\n");
|
||||
@@ -322,7 +320,7 @@ NtGdiEllipse(
|
||||
DPRINT("Ellipse 2: XLeft: %d, YLeft: %d, Width: %d, Height: %d\n",
|
||||
CenterX - RadiusX, CenterY + RadiusY, RadiusX*2, RadiusY*2);
|
||||
|
||||
pFillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
|
||||
pFillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
|
||||
if (NULL == pFillBrushObj)
|
||||
{
|
||||
DPRINT1("FillEllipse Fail\n");
|
||||
@@ -548,13 +546,12 @@ IntRectangle(PDC dc,
|
||||
BOOL ret = FALSE; // default to failure
|
||||
RECTL DestRect;
|
||||
MIX Mix;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
POINTL BrushOrigin;
|
||||
|
||||
ASSERT ( dc ); // caller's responsibility to set this up
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
/* Do we rotate or shear? */
|
||||
if (!(dc->DcLevel.mxWorldToDevice.flAccel & MX_SCALE))
|
||||
@@ -594,15 +591,15 @@ IntRectangle(PDC dc,
|
||||
DestRect.bottom--;
|
||||
}
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,Dc_Attr->hpen);
|
||||
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,pdcattr->hpen);
|
||||
|
||||
/* Special locking order to avoid lock-ups! */
|
||||
FillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
|
||||
PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen);
|
||||
FillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
|
||||
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
|
||||
if (!PenBrushObj)
|
||||
{
|
||||
ret = FALSE;
|
||||
@@ -645,7 +642,7 @@ IntRectangle(PDC dc,
|
||||
|
||||
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
|
||||
{
|
||||
Mix = ROP2_TO_MIX(Dc_Attr->jROP2);
|
||||
Mix = ROP2_TO_MIX(pdcattr->jROP2);
|
||||
ret = ret && IntEngLineTo(&psurf->SurfObj,
|
||||
dc->rosdc.CombinedClip,
|
||||
&PenBrushInst.BrushObject,
|
||||
@@ -733,7 +730,7 @@ IntRoundRect(
|
||||
int xCurveDiameter,
|
||||
int yCurveDiameter)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PGDIBRUSHOBJ PenBrushObj;
|
||||
RECTL RectBounds;
|
||||
LONG PenWidth, PenOrigWidth;
|
||||
@@ -761,16 +758,15 @@ IntRoundRect(
|
||||
INT tmp = Bottom; Bottom = Top; Top = tmp;
|
||||
}
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,Dc_Attr->hpen);
|
||||
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,pdcattr->hpen);
|
||||
|
||||
PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen);
|
||||
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
|
||||
if (!PenBrushObj)
|
||||
{
|
||||
/* Nothing to do, as we don't have a bitmap */
|
||||
@@ -806,7 +802,7 @@ IntRoundRect(
|
||||
RectBounds.right += dc->ptlDCOrig.x;
|
||||
RectBounds.bottom += dc->ptlDCOrig.y;
|
||||
|
||||
pFillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
|
||||
pFillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
|
||||
if (NULL == pFillBrushObj)
|
||||
{
|
||||
DPRINT1("FillRound Fail\n");
|
||||
@@ -1108,7 +1104,7 @@ NtGdiExtFloodFill(
|
||||
UINT FillType)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
SURFACE *psurf = NULL;
|
||||
PGDIBRUSHOBJ FillBrushObj = NULL;
|
||||
GDIBRUSHINST FillBrushInst;
|
||||
@@ -1132,14 +1128,13 @@ NtGdiExtFloodFill(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,Dc_Attr->hpen);
|
||||
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,pdcattr->hpen);
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
Pt.x = XStart;
|
||||
Pt.y = YStart;
|
||||
@@ -1151,7 +1146,7 @@ NtGdiExtFloodFill(
|
||||
else
|
||||
goto cleanup;
|
||||
|
||||
FillBrushObj = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
|
||||
FillBrushObj = BRUSHOBJ_LockBrush(pdcattr->hbrush);
|
||||
if (!FillBrushObj)
|
||||
{
|
||||
Ret = FALSE;
|
||||
|
||||
@@ -59,7 +59,7 @@ FASTCALL
|
||||
IntGetCharDimensions(HDC hdc, PTEXTMETRICW ptm, PDWORD height)
|
||||
{
|
||||
PDC pdc;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PTEXTOBJ TextObj;
|
||||
SIZE sz;
|
||||
TMW_INTERNAL tmwi;
|
||||
@@ -76,10 +76,9 @@ IntGetCharDimensions(HDC hdc, PTEXTMETRICW ptm, PDWORD height)
|
||||
|
||||
if (!pdc) return 0;
|
||||
|
||||
pDc_Attr = pdc->pDc_Attr;
|
||||
if(!pDc_Attr) pDc_Attr = &pdc->Dc_Attr;
|
||||
pdcattr = pdc->pdcattr;
|
||||
|
||||
TextObj = RealizeFontInit(pDc_Attr->hlfntNew);
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
if ( !TextObj )
|
||||
{
|
||||
DC_UnlockDc(pdc);
|
||||
@@ -101,7 +100,7 @@ DWORD
|
||||
FASTCALL
|
||||
IntGetFontLanguageInfo(PDC Dc)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
FONTSIGNATURE fontsig;
|
||||
static const DWORD GCP_DBCS_MASK=0x003F0000,
|
||||
GCP_DIACRITIC_MASK=0x00000000,
|
||||
@@ -138,11 +137,10 @@ IntGetFontLanguageInfo(PDC Dc)
|
||||
if( (fontsig.fsCsb[0]&GCP_USEKERNING_MASK)!=0 )
|
||||
result|=GCP_USEKERNING;
|
||||
|
||||
Dc_Attr = Dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &Dc->Dc_Attr;
|
||||
pdcattr = Dc->pdcattr;
|
||||
|
||||
/* this might need a test for a HEBREW- or ARABIC_CHARSET as well */
|
||||
if ( Dc_Attr->lTextAlign & TA_RTLREADING )
|
||||
if ( pdcattr->lTextAlign & TA_RTLREADING )
|
||||
if( (fontsig.fsCsb[0]&GCP_REORDER_MASK)!=0 )
|
||||
result|=GCP_REORDER;
|
||||
|
||||
@@ -229,7 +227,7 @@ NtGdiGetFontData(
|
||||
DWORD Size)
|
||||
{
|
||||
PDC Dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
HFONT hFont;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGdi;
|
||||
@@ -257,10 +255,9 @@ NtGdiGetFontData(
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return GDI_ERROR;
|
||||
}
|
||||
Dc_Attr = Dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &Dc->Dc_Attr;
|
||||
pdcattr = Dc->pdcattr;
|
||||
|
||||
hFont = Dc_Attr->hlfntNew;
|
||||
hFont = pdcattr->hlfntNew;
|
||||
TextObj = RealizeFontInit(hFont);
|
||||
DC_UnlockDc(Dc);
|
||||
|
||||
@@ -289,7 +286,7 @@ NtGdiGetFontUnicodeRanges(
|
||||
OUT OPTIONAL LPGLYPHSET pgs)
|
||||
{
|
||||
PDC pDc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
HFONT hFont;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGdi;
|
||||
@@ -304,10 +301,9 @@ NtGdiGetFontUnicodeRanges(
|
||||
return 0;
|
||||
}
|
||||
|
||||
Dc_Attr = pDc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &pDc->Dc_Attr;
|
||||
pdcattr = pDc->pdcattr;
|
||||
|
||||
hFont = Dc_Attr->hlfntNew;
|
||||
hFont = pdcattr->hlfntNew;
|
||||
TextObj = RealizeFontInit(hFont);
|
||||
|
||||
if ( TextObj == NULL)
|
||||
@@ -446,7 +442,7 @@ NtGdiGetKerningPairs(HDC hDC,
|
||||
LPKERNINGPAIR krnpair)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGDI;
|
||||
DWORD Count;
|
||||
@@ -460,9 +456,8 @@ NtGdiGetKerningPairs(HDC hDC,
|
||||
return 0;
|
||||
}
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
TextObj = RealizeFontInit(Dc_Attr->hlfntNew);
|
||||
pdcattr = dc->pdcattr;
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
if (!TextObj)
|
||||
@@ -522,7 +517,7 @@ NtGdiGetOutlineTextMetricsInternalW (HDC hDC,
|
||||
TMDIFF *Tmd)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGDI;
|
||||
HFONT hFont = 0;
|
||||
@@ -536,9 +531,8 @@ NtGdiGetOutlineTextMetricsInternalW (HDC hDC,
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
hFont = Dc_Attr->hlfntNew;
|
||||
pdcattr = dc->pdcattr;
|
||||
hFont = pdcattr->hlfntNew;
|
||||
TextObj = RealizeFontInit(hFont);
|
||||
DC_UnlockDc(dc);
|
||||
if (!TextObj)
|
||||
@@ -699,7 +693,7 @@ NtGdiGetRealizationInfo(
|
||||
PDC pDc;
|
||||
PTEXTOBJ pTextObj;
|
||||
PFONTGDI pFontGdi;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
BOOL Ret = FALSE;
|
||||
INT i = 0;
|
||||
REALIZATION_INFO ri;
|
||||
@@ -710,9 +704,8 @@ NtGdiGetRealizationInfo(
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
Dc_Attr = pDc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &pDc->Dc_Attr;
|
||||
pTextObj = RealizeFontInit(Dc_Attr->hlfntNew);
|
||||
pdcattr = pDc->pdcattr;
|
||||
pTextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
pFontGdi = ObjToGDI(pTextObj->Font, FONT);
|
||||
TEXTOBJ_UnlockText(pTextObj);
|
||||
DC_UnlockDc(pDc);
|
||||
@@ -841,7 +834,7 @@ NtGdiSelectFont(
|
||||
IN HFONT hFont)
|
||||
{
|
||||
PDC pDC;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
HFONT hOrgFont = NULL;
|
||||
|
||||
if (hDC == NULL || hFont == NULL) return NULL;
|
||||
@@ -852,14 +845,13 @@ NtGdiSelectFont(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
pdcattr = pDC->pdcattr;
|
||||
|
||||
/* FIXME: what if not successful? */
|
||||
if(NT_SUCCESS(TextIntRealizeFont((HFONT)hFont,NULL)))
|
||||
{
|
||||
hOrgFont = pDc_Attr->hlfntNew;
|
||||
pDc_Attr->hlfntNew = hFont;
|
||||
hOrgFont = pdcattr->hlfntNew;
|
||||
pdcattr->hlfntNew = hFont;
|
||||
}
|
||||
|
||||
DC_UnlockDc(pDC);
|
||||
|
||||
@@ -1470,7 +1470,7 @@ ftGdiGetGlyphOutline(
|
||||
BOOL bIgnoreRotation)
|
||||
{
|
||||
static const FT_Matrix identityMat = {(1 << 16), 0, 0, (1 << 16)};
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGDI;
|
||||
HFONT hFont = 0;
|
||||
@@ -1498,13 +1498,12 @@ ftGdiGetGlyphOutline(
|
||||
DPRINT("%d, %08x, %p, %08lx, %p, %p\n", wch, iFormat, pgm,
|
||||
cjBuf, pvBuf, pmat2);
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
MatrixS2XForm(&xForm, &dc->DcLevel.mxWorldToDevice);
|
||||
eM11 = xForm.eM11;
|
||||
|
||||
hFont = Dc_Attr->hlfntNew;
|
||||
hFont = pdcattr->hlfntNew;
|
||||
TextObj = RealizeFontInit(hFont);
|
||||
|
||||
if (!TextObj)
|
||||
@@ -2228,7 +2227,7 @@ ftGdiGetTextCharsetInfo(
|
||||
LPFONTSIGNATURE lpSig,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
UINT Ret = DEFAULT_CHARSET, i;
|
||||
HFONT hFont;
|
||||
PTEXTOBJ TextObj;
|
||||
@@ -2240,9 +2239,8 @@ ftGdiGetTextCharsetInfo(
|
||||
DWORD cp, fs0;
|
||||
USHORT usACP, usOEM;
|
||||
|
||||
Dc_Attr = Dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &Dc->Dc_Attr;
|
||||
hFont = Dc_Attr->hlfntNew;
|
||||
pdcattr = Dc->pdcattr;
|
||||
hFont = pdcattr->hlfntNew;
|
||||
TextObj = RealizeFontInit(hFont);
|
||||
|
||||
if (!TextObj)
|
||||
@@ -2407,7 +2405,7 @@ ftGdiGetTextMetricsW(
|
||||
PTMW_INTERNAL ptmwi)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGDI;
|
||||
FT_Face Face;
|
||||
@@ -2428,9 +2426,8 @@ ftGdiGetTextMetricsW(
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
TextObj = RealizeFontInit(Dc_Attr->hlfntNew);
|
||||
pdcattr = dc->pdcattr;
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
if (NULL != TextObj)
|
||||
{
|
||||
FontGDI = ObjToGDI(TextObj->Font, FONT);
|
||||
@@ -3118,7 +3115,7 @@ GreExtTextOutW(
|
||||
*/
|
||||
|
||||
DC *dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
SURFOBJ *SurfObj;
|
||||
SURFACE *psurf = NULL;
|
||||
int error, glyph_index, n, i;
|
||||
@@ -3170,8 +3167,7 @@ GreExtTextOutW(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
/* Check if String is valid */
|
||||
if ((Count > 0xFFFF) || (Count > 0 && String == NULL))
|
||||
@@ -3231,7 +3227,7 @@ GreExtTextOutW(
|
||||
{
|
||||
goto fail;
|
||||
}
|
||||
hBrushFg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, Dc_Attr->crForegroundClr), 0);
|
||||
hBrushFg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, pdcattr->crForegroundClr), 0);
|
||||
if ( !hBrushFg )
|
||||
{
|
||||
goto fail;
|
||||
@@ -3242,9 +3238,9 @@ GreExtTextOutW(
|
||||
goto fail;
|
||||
}
|
||||
IntGdiInitBrushInstance(&BrushFgInst, BrushFg, NULL);
|
||||
if ((fuOptions & ETO_OPAQUE) || Dc_Attr->jBkMode == OPAQUE)
|
||||
if ((fuOptions & ETO_OPAQUE) || pdcattr->jBkMode == OPAQUE)
|
||||
{
|
||||
hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, Dc_Attr->crBackgroundClr), 0);
|
||||
hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, pdcattr->crBackgroundClr), 0);
|
||||
if ( !hBrushBg )
|
||||
{
|
||||
goto fail;
|
||||
@@ -3292,13 +3288,13 @@ GreExtTextOutW(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Dc_Attr->jBkMode == OPAQUE)
|
||||
if (pdcattr->jBkMode == OPAQUE)
|
||||
{
|
||||
fuOptions |= ETO_OPAQUE;
|
||||
}
|
||||
}
|
||||
|
||||
TextObj = RealizeFontInit(Dc_Attr->hlfntNew);
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
if (TextObj == NULL)
|
||||
{
|
||||
goto fail;
|
||||
@@ -3361,9 +3357,9 @@ GreExtTextOutW(
|
||||
* Process the vertical alignment and determine the yoff.
|
||||
*/
|
||||
|
||||
if (Dc_Attr->lTextAlign & TA_BASELINE)
|
||||
if (pdcattr->lTextAlign & TA_BASELINE)
|
||||
yoff = 0;
|
||||
else if (Dc_Attr->lTextAlign & TA_BOTTOM)
|
||||
else if (pdcattr->lTextAlign & TA_BOTTOM)
|
||||
yoff = -face->size->metrics.descender >> 6;
|
||||
else /* TA_TOP */
|
||||
yoff = face->size->metrics.ascender >> 6;
|
||||
@@ -3375,7 +3371,7 @@ GreExtTextOutW(
|
||||
* Process the horizontal alignment and modify XStart accordingly.
|
||||
*/
|
||||
|
||||
if (Dc_Attr->lTextAlign & (TA_RIGHT | TA_CENTER))
|
||||
if (pdcattr->lTextAlign & (TA_RIGHT | TA_CENTER))
|
||||
{
|
||||
ULONGLONG TextWidth = 0;
|
||||
LPCWSTR TempText = String;
|
||||
@@ -3439,7 +3435,7 @@ GreExtTextOutW(
|
||||
|
||||
previous = 0;
|
||||
|
||||
if (Dc_Attr->lTextAlign & TA_RIGHT)
|
||||
if (pdcattr->lTextAlign & TA_RIGHT)
|
||||
{
|
||||
RealXStart -= TextWidth;
|
||||
}
|
||||
@@ -3817,7 +3813,7 @@ NtGdiGetCharABCWidthsW(
|
||||
LPABC SafeBuff;
|
||||
LPABCFLOAT SafeBuffF = NULL;
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGDI;
|
||||
FT_Face face;
|
||||
@@ -3862,9 +3858,8 @@ NtGdiGetCharABCWidthsW(
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
hFont = Dc_Attr->hlfntNew;
|
||||
pdcattr = dc->pdcattr;
|
||||
hFont = pdcattr->hlfntNew;
|
||||
TextObj = RealizeFontInit(hFont);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
@@ -3986,7 +3981,7 @@ NtGdiGetCharWidthW(
|
||||
LPINT SafeBuff;
|
||||
PFLOAT SafeBuffF = NULL;
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGDI;
|
||||
FT_Face face;
|
||||
@@ -4030,9 +4025,8 @@ NtGdiGetCharWidthW(
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
hFont = Dc_Attr->hlfntNew;
|
||||
pdcattr = dc->pdcattr;
|
||||
hFont = pdcattr->hlfntNew;
|
||||
TextObj = RealizeFontInit(hFont);
|
||||
DC_UnlockDc(dc);
|
||||
|
||||
@@ -4122,7 +4116,7 @@ NtGdiGetGlyphIndicesW(
|
||||
IN DWORD iMode)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PTEXTOBJ TextObj;
|
||||
PFONTGDI FontGDI;
|
||||
HFONT hFont = 0;
|
||||
@@ -4142,9 +4136,8 @@ NtGdiGetGlyphIndicesW(
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return GDI_ERROR;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
hFont = Dc_Attr->hlfntNew;
|
||||
pdcattr = dc->pdcattr;
|
||||
hFont = pdcattr->hlfntNew;
|
||||
TextObj = RealizeFontInit(hFont);
|
||||
DC_UnlockDc(dc);
|
||||
if (!TextObj)
|
||||
|
||||
@@ -63,12 +63,11 @@ ULONG
|
||||
FASTCALL
|
||||
GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
|
||||
{
|
||||
PDC_ATTR Dc_Attr = NULL;
|
||||
PDC_ATTR pdcattr = NULL;
|
||||
|
||||
if (dc)
|
||||
{
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
}
|
||||
// The thread is approaching the end of sunset.
|
||||
switch(pHdr->Cmd)
|
||||
@@ -86,7 +85,7 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
|
||||
PGDIBSSETBRHORG pgSBO;
|
||||
if(!dc) break;
|
||||
pgSBO = (PGDIBSSETBRHORG) pHdr;
|
||||
Dc_Attr->ptlBrushOrigin = pgSBO->ptlBrushOrigin;
|
||||
pdcattr->ptlBrushOrigin = pgSBO->ptlBrushOrigin;
|
||||
break;
|
||||
}
|
||||
case GdiBCExtSelClipRgn:
|
||||
@@ -97,7 +96,7 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
|
||||
if(!dc) break;
|
||||
pgO = (PGDIBSOBJECT) pHdr;
|
||||
TextIntRealizeFont((HFONT) pgO->hgdiobj, NULL);
|
||||
Dc_Attr->ulDirty_ &= ~(DIRTY_CHARSET);
|
||||
pdcattr->ulDirty_ &= ~(DIRTY_CHARSET);
|
||||
}
|
||||
case GdiBCDelObj:
|
||||
case GdiBCDelRgn:
|
||||
|
||||
@@ -1562,7 +1562,7 @@ IntGdiSetDCOwnerEx( HDC hDC, DWORD OwnerMask, BOOL NoSetBrush)
|
||||
if ((OwnerMask == GDI_OBJ_HMGR_PUBLIC) || OwnerMask == GDI_OBJ_HMGR_NONE)
|
||||
{
|
||||
pDC = DC_LockDc ( hDC );
|
||||
MmCopyFromCaller(&pDC->Dc_Attr, pDC->pDc_Attr, sizeof(DC_ATTR));
|
||||
MmCopyFromCaller(&pDC->Dc_Attr, pDC->pdcattr, sizeof(DC_ATTR));
|
||||
DC_UnlockDc( pDC );
|
||||
|
||||
DC_FreeDcAttr( hDC ); // Free the dcattr!
|
||||
@@ -1574,9 +1574,8 @@ IntGdiSetDCOwnerEx( HDC hDC, DWORD OwnerMask, BOOL NoSetBrush)
|
||||
if (OwnerMask == GDI_OBJ_HMGR_POWNED)
|
||||
{
|
||||
pDC = DC_LockDc ( hDC );
|
||||
if ( !pDC->pDc_Attr ) Ret = TRUE; // Must be zero.
|
||||
ASSERT(pDC->pdcattr == &pDC->Dc_Attr);
|
||||
DC_UnlockDc( pDC );
|
||||
if (!Ret) return Ret;
|
||||
|
||||
if (!DC_SetOwnership( hDC, PsGetCurrentProcess() )) return Ret;
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ NtGdiSetColorSpace(IN HDC hdc,
|
||||
IN HCOLORSPACE hColorSpace)
|
||||
{
|
||||
PDC pDC;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PCOLORSPACE pCS;
|
||||
|
||||
pDC = DC_LockDc(hdc);
|
||||
@@ -199,10 +199,9 @@ NtGdiSetColorSpace(IN HDC hdc,
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
pdcattr = pDC->pdcattr;
|
||||
|
||||
if (pDc_Attr->hColorSpace == hColorSpace)
|
||||
if (pdcattr->hColorSpace == hColorSpace)
|
||||
{
|
||||
DC_UnlockDc(pDC);
|
||||
return TRUE;
|
||||
@@ -221,7 +220,7 @@ NtGdiSetColorSpace(IN HDC hdc,
|
||||
}
|
||||
|
||||
pDC->DcLevel.pColorSpace = pCS;
|
||||
pDc_Attr->hColorSpace = hColorSpace;
|
||||
pdcattr->hColorSpace = hColorSpace;
|
||||
|
||||
COLORSPACEOBJ_UnlockCS(pCS);
|
||||
DC_UnlockDc(pDC);
|
||||
|
||||
@@ -33,27 +33,26 @@ IntGdiMoveToEx(DC *dc,
|
||||
LPPOINT Point)
|
||||
{
|
||||
BOOL PathIsOpen;
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
if ( Point )
|
||||
{
|
||||
if ( Dc_Attr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit!
|
||||
if ( pdcattr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit!
|
||||
{
|
||||
Point->x = Dc_Attr->ptfxCurrent.x; // ret prev before change.
|
||||
Point->y = Dc_Attr->ptfxCurrent.y;
|
||||
Point->x = pdcattr->ptfxCurrent.x; // ret prev before change.
|
||||
Point->y = pdcattr->ptfxCurrent.y;
|
||||
IntDPtoLP ( dc, Point, 1); // reconvert back.
|
||||
}
|
||||
else
|
||||
{
|
||||
Point->x = Dc_Attr->ptlCurrent.x;
|
||||
Point->y = Dc_Attr->ptlCurrent.y;
|
||||
Point->x = pdcattr->ptlCurrent.x;
|
||||
Point->y = pdcattr->ptlCurrent.y;
|
||||
}
|
||||
}
|
||||
Dc_Attr->ptlCurrent.x = X;
|
||||
Dc_Attr->ptlCurrent.y = Y;
|
||||
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
|
||||
Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
pdcattr->ptlCurrent.x = X;
|
||||
pdcattr->ptlCurrent.y = Y;
|
||||
pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
|
||||
pdcattr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
|
||||
PathIsOpen = PATH_IsPathOpen(dc->DcLevel);
|
||||
|
||||
@@ -68,19 +67,18 @@ IntGdiMoveToEx(DC *dc,
|
||||
VOID FASTCALL
|
||||
IntGetCurrentPositionEx(PDC dc, LPPOINT pt)
|
||||
{
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
if ( pt )
|
||||
{
|
||||
if (Dc_Attr->ulDirty_ & DIRTY_PTFXCURRENT)
|
||||
if (pdcattr->ulDirty_ & DIRTY_PTFXCURRENT)
|
||||
{
|
||||
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
|
||||
Dc_Attr->ulDirty_ &= ~(DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
|
||||
pdcattr->ulDirty_ &= ~(DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
}
|
||||
pt->x = Dc_Attr->ptlCurrent.x;
|
||||
pt->y = Dc_Attr->ptlCurrent.y;
|
||||
pt->x = pdcattr->ptlCurrent.x;
|
||||
pt->y = pdcattr->ptlCurrent.y;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,9 +93,8 @@ IntGdiLineTo(DC *dc,
|
||||
GDIBRUSHINST PenBrushInst;
|
||||
RECTL Bounds;
|
||||
POINT Points[2];
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
|
||||
if (PATH_IsPathOpen(dc->DcLevel))
|
||||
{
|
||||
@@ -105,21 +102,21 @@ IntGdiLineTo(DC *dc,
|
||||
if (Ret)
|
||||
{
|
||||
// FIXME - PATH_LineTo should maybe do this? No
|
||||
Dc_Attr->ptlCurrent.x = XEnd;
|
||||
Dc_Attr->ptlCurrent.y = YEnd;
|
||||
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
|
||||
Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
pdcattr->ptlCurrent.x = XEnd;
|
||||
pdcattr->ptlCurrent.y = YEnd;
|
||||
pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
|
||||
pdcattr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
}
|
||||
return Ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,Dc_Attr->hpen);
|
||||
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,pdcattr->hpen);
|
||||
|
||||
psurf = SURFACE_LockSurface( dc->rosdc.hBitmap );
|
||||
if (NULL == psurf)
|
||||
@@ -128,8 +125,8 @@ IntGdiLineTo(DC *dc,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Points[0].x = Dc_Attr->ptlCurrent.x;
|
||||
Points[0].y = Dc_Attr->ptlCurrent.y;
|
||||
Points[0].x = pdcattr->ptlCurrent.x;
|
||||
Points[0].y = pdcattr->ptlCurrent.y;
|
||||
Points[1].x = XEnd;
|
||||
Points[1].y = YEnd;
|
||||
|
||||
@@ -147,7 +144,7 @@ IntGdiLineTo(DC *dc,
|
||||
Bounds.bottom = max(Points[0].y, Points[1].y);
|
||||
|
||||
/* get BRUSHOBJ from current pen. */
|
||||
PenBrushObj = PENOBJ_LockPen( Dc_Attr->hpen );
|
||||
PenBrushObj = PENOBJ_LockPen( pdcattr->hpen );
|
||||
if (!PenBrushObj)
|
||||
{
|
||||
/* default to BLACK_PEN */
|
||||
@@ -164,7 +161,7 @@ IntGdiLineTo(DC *dc,
|
||||
Points[0].x, Points[0].y,
|
||||
Points[1].x, Points[1].y,
|
||||
&Bounds,
|
||||
ROP2_TO_MIX(Dc_Attr->jROP2));
|
||||
ROP2_TO_MIX(pdcattr->jROP2));
|
||||
}
|
||||
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
@@ -173,11 +170,11 @@ IntGdiLineTo(DC *dc,
|
||||
|
||||
if (Ret)
|
||||
{
|
||||
Dc_Attr->ptlCurrent.x = XEnd;
|
||||
Dc_Attr->ptlCurrent.y = YEnd;
|
||||
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
|
||||
Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
pdcattr->ptlCurrent.x = XEnd;
|
||||
pdcattr->ptlCurrent.y = YEnd;
|
||||
pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
|
||||
pdcattr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
}
|
||||
|
||||
return Ret;
|
||||
@@ -217,9 +214,8 @@ IntGdiPolyBezierTo(DC *dc,
|
||||
DWORD Count)
|
||||
{
|
||||
BOOL ret = FALSE; // default to failure
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
if ( PATH_IsPathOpen(dc->DcLevel) )
|
||||
ret = PATH_PolyBezierTo ( dc, pt, Count );
|
||||
else /* We'll do it using PolyBezier */
|
||||
@@ -230,8 +226,8 @@ IntGdiPolyBezierTo(DC *dc,
|
||||
TAG_BEZIER);
|
||||
if ( npt )
|
||||
{
|
||||
npt[0].x = Dc_Attr->ptlCurrent.x;
|
||||
npt[0].y = Dc_Attr->ptlCurrent.y;
|
||||
npt[0].x = pdcattr->ptlCurrent.x;
|
||||
npt[0].y = pdcattr->ptlCurrent.y;
|
||||
memcpy(npt + 1, pt, sizeof(POINT) * Count);
|
||||
ret = IntGdiPolyBezier(dc, npt, Count+1);
|
||||
ExFreePoolWithTag(npt, TAG_BEZIER);
|
||||
@@ -239,11 +235,11 @@ IntGdiPolyBezierTo(DC *dc,
|
||||
}
|
||||
if ( ret )
|
||||
{
|
||||
Dc_Attr->ptlCurrent.x = pt[Count-1].x;
|
||||
Dc_Attr->ptlCurrent.y = pt[Count-1].y;
|
||||
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
|
||||
Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
pdcattr->ptlCurrent.x = pt[Count-1].x;
|
||||
pdcattr->ptlCurrent.y = pt[Count-1].y;
|
||||
pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
|
||||
pdcattr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -260,21 +256,19 @@ IntGdiPolyline(DC *dc,
|
||||
LPPOINT Points;
|
||||
BOOL Ret = TRUE;
|
||||
LONG i;
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
if (PATH_IsPathOpen(dc->DcLevel))
|
||||
return PATH_Polyline(dc, pt, Count);
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,Dc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
if (Dc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,Dc_Attr->hpen);
|
||||
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(dc,pdcattr->hpen);
|
||||
|
||||
/* Get BRUSHOBJ from current pen. */
|
||||
PenBrushObj = PENOBJ_LockPen(Dc_Attr->hpen);
|
||||
PenBrushObj = PENOBJ_LockPen(pdcattr->hpen);
|
||||
/* FIXME - PenBrushObj can be NULL! Don't assert here! */
|
||||
ASSERT(PenBrushObj);
|
||||
|
||||
@@ -304,7 +298,7 @@ IntGdiPolyline(DC *dc,
|
||||
&PenBrushInst.BrushObject,
|
||||
Points,
|
||||
Count,
|
||||
ROP2_TO_MIX(Dc_Attr->jROP2));
|
||||
ROP2_TO_MIX(pdcattr->jROP2));
|
||||
|
||||
SURFACE_UnlockSurface(psurf);
|
||||
EngFreeMem(Points);
|
||||
@@ -326,9 +320,8 @@ IntGdiPolylineTo(DC *dc,
|
||||
DWORD Count)
|
||||
{
|
||||
BOOL ret = FALSE; // default to failure
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
if (PATH_IsPathOpen(dc->DcLevel))
|
||||
{
|
||||
ret = PATH_PolylineTo(dc, pt, Count);
|
||||
@@ -340,8 +333,8 @@ IntGdiPolylineTo(DC *dc,
|
||||
TAG_SHAPE);
|
||||
if ( pts )
|
||||
{
|
||||
pts[0].x = Dc_Attr->ptlCurrent.x;
|
||||
pts[0].y = Dc_Attr->ptlCurrent.y;
|
||||
pts[0].x = pdcattr->ptlCurrent.x;
|
||||
pts[0].y = pdcattr->ptlCurrent.y;
|
||||
memcpy( pts + 1, pt, sizeof(POINT) * Count);
|
||||
ret = IntGdiPolyline(dc, pts, Count + 1);
|
||||
ExFreePoolWithTag(pts, TAG_SHAPE);
|
||||
@@ -349,11 +342,11 @@ IntGdiPolylineTo(DC *dc,
|
||||
}
|
||||
if ( ret )
|
||||
{
|
||||
Dc_Attr->ptlCurrent.x = pt[Count-1].x;
|
||||
Dc_Attr->ptlCurrent.y = pt[Count-1].y;
|
||||
Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &Dc_Attr->ptfxCurrent); // Update fx
|
||||
Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
pdcattr->ptlCurrent.x = pt[Count-1].x;
|
||||
pdcattr->ptlCurrent.y = pt[Count-1].y;
|
||||
pdcattr->ptfxCurrent = pdcattr->ptlCurrent;
|
||||
CoordLPtoDP(dc, &pdcattr->ptfxCurrent); // Update fx
|
||||
pdcattr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -432,12 +425,11 @@ NtGdiPolyDraw(
|
||||
BOOL result = FALSE;
|
||||
POINT lastmove;
|
||||
unsigned int i;
|
||||
PDC_ATTR Dc_Attr = NULL;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
dc = DC_LockDc(hdc);
|
||||
if (!dc) return FALSE;
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
@@ -456,8 +448,8 @@ NtGdiPolyDraw(
|
||||
}
|
||||
|
||||
/* if no moveto occurs, we will close the figure here */
|
||||
lastmove.x = Dc_Attr->ptlCurrent.x;
|
||||
lastmove.y = Dc_Attr->ptlCurrent.y;
|
||||
lastmove.x = pdcattr->ptlCurrent.x;
|
||||
lastmove.y = pdcattr->ptlCurrent.y;
|
||||
|
||||
/* now let's draw */
|
||||
for ( i = 0; i < cCount; i++ )
|
||||
@@ -465,16 +457,16 @@ NtGdiPolyDraw(
|
||||
if ( lpbTypes[i] == PT_MOVETO )
|
||||
{
|
||||
IntGdiMoveToEx( dc, lppt[i].x, lppt[i].y, NULL );
|
||||
lastmove.x = Dc_Attr->ptlCurrent.x;
|
||||
lastmove.y = Dc_Attr->ptlCurrent.y;
|
||||
lastmove.x = pdcattr->ptlCurrent.x;
|
||||
lastmove.y = pdcattr->ptlCurrent.y;
|
||||
}
|
||||
else if ( lpbTypes[i] & PT_LINETO )
|
||||
IntGdiLineTo( dc, lppt[i].x, lppt[i].y );
|
||||
else if ( lpbTypes[i] & PT_BEZIERTO )
|
||||
{
|
||||
POINT pts[4];
|
||||
pts[0].x = Dc_Attr->ptlCurrent.x;
|
||||
pts[0].y = Dc_Attr->ptlCurrent.y;
|
||||
pts[0].x = pdcattr->ptlCurrent.x;
|
||||
pts[0].y = pdcattr->ptlCurrent.y;
|
||||
RtlCopyMemory(pts + 1, &lppt[i], sizeof(POINT) * 3);
|
||||
IntGdiPolyBezier(dc, pts, 4);
|
||||
i += 2;
|
||||
|
||||
@@ -102,9 +102,7 @@ PATH_FillPath( PDC dc, PPATH pPath )
|
||||
POINTL ptViewportOrg, ptWindowOrg;
|
||||
XFORM xform;
|
||||
HRGN hrgn;
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
if( pPath->state != PATH_Closed )
|
||||
{
|
||||
@@ -112,7 +110,7 @@ PATH_FillPath( PDC dc, PPATH pPath )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( PATH_PathToRegion( pPath, Dc_Attr->jFillMode, &hrgn ))
|
||||
if( PATH_PathToRegion( pPath, pdcattr->jFillMode, &hrgn ))
|
||||
{
|
||||
/* Since PaintRgn interprets the region as being in logical coordinates
|
||||
* but the points we store for the path are already in device
|
||||
@@ -123,11 +121,11 @@ PATH_FillPath( PDC dc, PPATH pPath )
|
||||
*/
|
||||
|
||||
/* Save the information about the old mapping mode */
|
||||
mapMode = Dc_Attr->iMapMode;
|
||||
ptViewportExt = Dc_Attr->szlViewportExt;
|
||||
ptViewportOrg = Dc_Attr->ptlViewportOrg;
|
||||
ptWindowExt = Dc_Attr->szlWindowExt;
|
||||
ptWindowOrg = Dc_Attr->ptlWindowOrg;
|
||||
mapMode = pdcattr->iMapMode;
|
||||
ptViewportExt = pdcattr->szlViewportExt;
|
||||
ptViewportOrg = pdcattr->ptlViewportOrg;
|
||||
ptWindowExt = pdcattr->szlWindowExt;
|
||||
ptWindowOrg = pdcattr->ptlWindowOrg;
|
||||
|
||||
/* Save world transform
|
||||
* NB: The Windows documentation on world transforms would lead one to
|
||||
@@ -139,31 +137,31 @@ PATH_FillPath( PDC dc, PPATH pPath )
|
||||
|
||||
/* Set MM_TEXT */
|
||||
// IntGdiSetMapMode( dc, MM_TEXT );
|
||||
// Dc_Attr->ptlViewportOrg.x = 0;
|
||||
// Dc_Attr->ptlViewportOrg.y = 0;
|
||||
// Dc_Attr->ptlWindowOrg.x = 0;
|
||||
// Dc_Attr->ptlWindowOrg.y = 0;
|
||||
// pdcattr->ptlViewportOrg.x = 0;
|
||||
// pdcattr->ptlViewportOrg.y = 0;
|
||||
// pdcattr->ptlWindowOrg.x = 0;
|
||||
// pdcattr->ptlWindowOrg.y = 0;
|
||||
|
||||
graphicsMode = Dc_Attr->iGraphicsMode;
|
||||
// Dc_Attr->iGraphicsMode = GM_ADVANCED;
|
||||
graphicsMode = pdcattr->iGraphicsMode;
|
||||
// pdcattr->iGraphicsMode = GM_ADVANCED;
|
||||
// IntGdiModifyWorldTransform( dc, &xform, MWT_IDENTITY );
|
||||
// Dc_Attr->iGraphicsMode = graphicsMode;
|
||||
// pdcattr->iGraphicsMode = graphicsMode;
|
||||
|
||||
/* Paint the region */
|
||||
IntGdiPaintRgn( dc, hrgn );
|
||||
NtGdiDeleteObject( hrgn );
|
||||
/* Restore the old mapping mode */
|
||||
// IntGdiSetMapMode( dc, mapMode );
|
||||
// Dc_Attr->szlViewportExt = ptViewportExt;
|
||||
// Dc_Attr->ptlViewportOrg = ptViewportOrg;
|
||||
// Dc_Attr->szlWindowExt = ptWindowExt;
|
||||
// Dc_Attr->ptlWindowOrg = ptWindowOrg;
|
||||
// pdcattr->szlViewportExt = ptViewportExt;
|
||||
// pdcattr->ptlViewportOrg = ptViewportOrg;
|
||||
// pdcattr->szlWindowExt = ptWindowExt;
|
||||
// pdcattr->ptlWindowOrg = ptWindowOrg;
|
||||
|
||||
/* Go to GM_ADVANCED temporarily to restore the world transform */
|
||||
graphicsMode = Dc_Attr->iGraphicsMode;
|
||||
// Dc_Attr->iGraphicsMode = GM_ADVANCED;
|
||||
graphicsMode = pdcattr->iGraphicsMode;
|
||||
// pdcattr->iGraphicsMode = GM_ADVANCED;
|
||||
// IntGdiModifyWorldTransform( dc, &xform, MWT_MAX+1 );
|
||||
// Dc_Attr->iGraphicsMode = graphicsMode;
|
||||
// pdcattr->iGraphicsMode = graphicsMode;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
@@ -954,8 +952,7 @@ PATH_PolyPolyline ( PDC dc, const POINT* pts, const DWORD* counts, DWORD polylin
|
||||
BOOL PATH_CheckCorners(DC *dc, POINT corners[], INT x1, INT y1, INT x2, INT y2)
|
||||
{
|
||||
INT temp;
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
/* Convert points to device coordinates */
|
||||
corners[0].x=x1;
|
||||
@@ -980,7 +977,7 @@ BOOL PATH_CheckCorners(DC *dc, POINT corners[], INT x1, INT y1, INT x2, INT y2)
|
||||
}
|
||||
|
||||
/* In GM_COMPATIBLE, don't include bottom and right edges */
|
||||
if(Dc_Attr->iGraphicsMode==GM_COMPATIBLE)
|
||||
if(pdcattr->iGraphicsMode==GM_COMPATIBLE)
|
||||
{
|
||||
corners[1].x--;
|
||||
corners[1].y--;
|
||||
@@ -1337,18 +1334,15 @@ BOOL FASTCALL PATH_StrokePath(DC *dc, PPATH pPath)
|
||||
SIZE szViewportExt, szWindowExt;
|
||||
DWORD mapMode, graphicsMode;
|
||||
XFORM xform;
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
DPRINT("Enter %s\n", __FUNCTION__);
|
||||
|
||||
if (pPath->state != PATH_Closed)
|
||||
return FALSE;
|
||||
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
|
||||
|
||||
/* Save the mapping mode info */
|
||||
mapMode = Dc_Attr->iMapMode;
|
||||
mapMode = pdcattr->iMapMode;
|
||||
IntGetViewportExtEx(dc, &szViewportExt);
|
||||
IntGetViewportOrgEx(dc, &ptViewportOrg);
|
||||
IntGetWindowExtEx(dc, &szWindowExt);
|
||||
@@ -1357,15 +1351,15 @@ BOOL FASTCALL PATH_StrokePath(DC *dc, PPATH pPath)
|
||||
MatrixS2XForm(&xform, &dc->DcLevel.mxWorldToPage);
|
||||
|
||||
/* Set MM_TEXT */
|
||||
Dc_Attr->iMapMode = MM_TEXT;
|
||||
Dc_Attr->ptlViewportOrg.x = 0;
|
||||
Dc_Attr->ptlViewportOrg.y = 0;
|
||||
Dc_Attr->ptlWindowOrg.x = 0;
|
||||
Dc_Attr->ptlWindowOrg.y = 0;
|
||||
graphicsMode = Dc_Attr->iGraphicsMode;
|
||||
Dc_Attr->iGraphicsMode = GM_ADVANCED;
|
||||
pdcattr->iMapMode = MM_TEXT;
|
||||
pdcattr->ptlViewportOrg.x = 0;
|
||||
pdcattr->ptlViewportOrg.y = 0;
|
||||
pdcattr->ptlWindowOrg.x = 0;
|
||||
pdcattr->ptlWindowOrg.y = 0;
|
||||
graphicsMode = pdcattr->iGraphicsMode;
|
||||
pdcattr->iGraphicsMode = GM_ADVANCED;
|
||||
IntGdiModifyWorldTransform(dc, &xform, MWT_IDENTITY);
|
||||
Dc_Attr->iGraphicsMode = graphicsMode;
|
||||
pdcattr->iGraphicsMode = graphicsMode;
|
||||
|
||||
/* Allocate enough memory for the worst case without beziers (one PT_MOVETO
|
||||
* and the rest PT_LINETO with PT_CLOSEFIGURE at the end) plus some buffer
|
||||
@@ -1469,16 +1463,16 @@ end:
|
||||
if(pLinePts) ExFreePoolWithTag(pLinePts, TAG_PATH);
|
||||
|
||||
/* Restore the old mapping mode */
|
||||
Dc_Attr->iMapMode = mapMode;
|
||||
Dc_Attr->szlWindowExt.cx = szWindowExt.cx;
|
||||
Dc_Attr->szlWindowExt.cy = szWindowExt.cy;
|
||||
Dc_Attr->ptlWindowOrg.x = ptWindowOrg.x;
|
||||
Dc_Attr->ptlWindowOrg.y = ptWindowOrg.y;
|
||||
pdcattr->iMapMode = mapMode;
|
||||
pdcattr->szlWindowExt.cx = szWindowExt.cx;
|
||||
pdcattr->szlWindowExt.cy = szWindowExt.cy;
|
||||
pdcattr->ptlWindowOrg.x = ptWindowOrg.x;
|
||||
pdcattr->ptlWindowOrg.y = ptWindowOrg.y;
|
||||
|
||||
Dc_Attr->szlViewportExt.cx = szViewportExt.cx;
|
||||
Dc_Attr->szlViewportExt.cy = szViewportExt.cy;
|
||||
Dc_Attr->ptlViewportOrg.x = ptViewportOrg.x;
|
||||
Dc_Attr->ptlViewportOrg.y = ptViewportOrg.y;
|
||||
pdcattr->szlViewportExt.cx = szViewportExt.cx;
|
||||
pdcattr->szlViewportExt.cy = szViewportExt.cy;
|
||||
pdcattr->ptlViewportOrg.x = ptViewportOrg.x;
|
||||
pdcattr->ptlViewportOrg.y = ptViewportOrg.y;
|
||||
|
||||
/* Restore the world transform */
|
||||
XForm2MatrixS(&dc->DcLevel.mxWorldToPage, &xform);
|
||||
@@ -1512,7 +1506,7 @@ PATH_WidenPath(DC *dc)
|
||||
PPATH pPath, pNewPath, *pStrokes, *pOldStrokes, pUpPath, pDownPath;
|
||||
EXTLOGPEN *elp;
|
||||
DWORD obj_type, joint, endcap, penType;
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
|
||||
pPath = PATH_LockPath( dc->DcLevel.hPath );
|
||||
if (!pPath) return FALSE;
|
||||
@@ -1524,11 +1518,9 @@ PATH_WidenPath(DC *dc)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
|
||||
PATH_FlattenPath(pPath);
|
||||
|
||||
size = IntGdiGetObject( Dc_Attr->hpen, 0, NULL);
|
||||
size = IntGdiGetObject( pdcattr->hpen, 0, NULL);
|
||||
if (!size)
|
||||
{
|
||||
PATH_UnlockPath( pPath );
|
||||
@@ -1537,9 +1529,9 @@ PATH_WidenPath(DC *dc)
|
||||
}
|
||||
|
||||
elp = ExAllocatePoolWithTag(PagedPool, size, TAG_PATH);
|
||||
(VOID) IntGdiGetObject( Dc_Attr->hpen, size, elp);
|
||||
(VOID) IntGdiGetObject( pdcattr->hpen, size, elp);
|
||||
|
||||
obj_type = GDIOBJ_GetObjectType(Dc_Attr->hpen);
|
||||
obj_type = GDIOBJ_GetObjectType(pdcattr->hpen);
|
||||
if(obj_type == GDI_OBJECT_TYPE_PEN)
|
||||
{
|
||||
penStyle = ((LOGPEN*)elp)->lopnStyle;
|
||||
@@ -2030,7 +2022,7 @@ PATH_ExtTextOut(PDC dc, INT x, INT y, UINT flags, const RECTL *lprc,
|
||||
{
|
||||
unsigned int idx;
|
||||
double cosEsc, sinEsc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PTEXTOBJ TextObj;
|
||||
LOGFONTW lf;
|
||||
POINTL org;
|
||||
@@ -2038,10 +2030,9 @@ PATH_ExtTextOut(PDC dc, INT x, INT y, UINT flags, const RECTL *lprc,
|
||||
|
||||
if (!count) return TRUE;
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
TextObj = RealizeFontInit( Dc_Attr->hlfntNew);
|
||||
TextObj = RealizeFontInit( pdcattr->hlfntNew);
|
||||
if ( !TextObj ) return FALSE;
|
||||
|
||||
FontGetObject( TextObj, sizeof(lf), &lf);
|
||||
@@ -2284,7 +2275,7 @@ NtGdiFillPath(HDC hDC)
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
PPATH pPath;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PDC dc = DC_LockDc ( hDC );
|
||||
|
||||
if ( !dc )
|
||||
@@ -2299,11 +2290,10 @@ NtGdiFillPath(HDC hDC)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pDc_Attr = dc->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (pDc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pDc_Attr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(dc,pdcattr->hbrush);
|
||||
|
||||
ret = PATH_FillPath( dc, pPath );
|
||||
if ( ret )
|
||||
@@ -2468,7 +2458,7 @@ NtGdiPathToRegion(HDC hDC)
|
||||
PPATH pPath;
|
||||
HRGN hrgnRval = 0;
|
||||
DC *pDc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
DPRINT("Enter %s\n", __FUNCTION__);
|
||||
|
||||
@@ -2479,8 +2469,7 @@ NtGdiPathToRegion(HDC hDC)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Dc_Attr = pDc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &pDc->Dc_Attr;
|
||||
pdcattr = pDc->pdcattr;
|
||||
|
||||
pPath = PATH_LockPath( pDc->DcLevel.hPath );
|
||||
if (!pPath)
|
||||
@@ -2497,7 +2486,7 @@ NtGdiPathToRegion(HDC hDC)
|
||||
else
|
||||
{
|
||||
/* FIXME: Should we empty the path even if conversion failed? */
|
||||
if(PATH_PathToRegion(pPath, Dc_Attr->jFillMode, &hrgnRval))
|
||||
if(PATH_PathToRegion(pPath, pdcattr->jFillMode, &hrgnRval))
|
||||
PATH_EmptyPath(pPath);
|
||||
}
|
||||
|
||||
@@ -2558,7 +2547,7 @@ APIENTRY
|
||||
NtGdiStrokeAndFillPath(HDC hDC)
|
||||
{
|
||||
DC *pDc;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PPATH pPath;
|
||||
BOOL bRet = FALSE;
|
||||
|
||||
@@ -2576,13 +2565,12 @@ NtGdiStrokeAndFillPath(HDC hDC)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pDc_Attr = pDc->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &pDc->Dc_Attr;
|
||||
pdcattr = pDc->pdcattr;
|
||||
|
||||
if (pDc_Attr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(pDc,pDc_Attr->hbrush);
|
||||
if (pDc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(pDc,pDc_Attr->hpen);
|
||||
if (pdcattr->ulDirty_ & DC_BRUSH_DIRTY)
|
||||
IntGdiSelectBrush(pDc,pdcattr->hbrush);
|
||||
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(pDc,pdcattr->hpen);
|
||||
|
||||
bRet = PATH_FillPath(pDc, pPath);
|
||||
if (bRet) bRet = PATH_StrokePath(pDc, pPath);
|
||||
@@ -2598,7 +2586,7 @@ APIENTRY
|
||||
NtGdiStrokePath(HDC hDC)
|
||||
{
|
||||
DC *pDc;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PPATH pPath;
|
||||
BOOL bRet = FALSE;
|
||||
|
||||
@@ -2616,11 +2604,10 @@ NtGdiStrokePath(HDC hDC)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pDc_Attr = pDc->pDc_Attr;
|
||||
if (!pDc_Attr) pDc_Attr = &pDc->Dc_Attr;
|
||||
pdcattr = pDc->pdcattr;
|
||||
|
||||
if (pDc_Attr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(pDc,pDc_Attr->hpen);
|
||||
if (pdcattr->ulDirty_ & DC_PEN_DIRTY)
|
||||
IntGdiSelectPen(pDc,pdcattr->hpen);
|
||||
|
||||
bRet = PATH_StrokePath(pDc, pPath);
|
||||
PATH_EmptyPath(pPath);
|
||||
@@ -2654,7 +2641,7 @@ NtGdiSelectClipPath(HDC hDC,
|
||||
HRGN hrgnPath;
|
||||
PPATH pPath;
|
||||
BOOL success = FALSE;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
PDC dc = DC_LockDc ( hDC );
|
||||
|
||||
if ( !dc )
|
||||
@@ -2663,8 +2650,7 @@ NtGdiSelectClipPath(HDC hDC,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
pPath = PATH_LockPath( dc->DcLevel.hPath );
|
||||
if (!pPath)
|
||||
@@ -2679,7 +2665,7 @@ NtGdiSelectClipPath(HDC hDC,
|
||||
return FALSE;
|
||||
}
|
||||
/* Construct a region from the path */
|
||||
else if( PATH_PathToRegion( pPath, Dc_Attr->jFillMode, &hrgnPath ) )
|
||||
else if( PATH_PathToRegion( pPath, pdcattr->jFillMode, &hrgnPath ) )
|
||||
{
|
||||
success = GdiExtSelectClipRgn( dc, hrgnPath, Mode ) != ERROR;
|
||||
NtGdiDeleteObject( hrgnPath );
|
||||
|
||||
@@ -272,7 +272,7 @@ IntGdiSelectPen(
|
||||
PDC pDC,
|
||||
HPEN hPen)
|
||||
{
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
HPEN hOrgPen = NULL;
|
||||
PGDIBRUSHOBJ pPen;
|
||||
XLATEOBJ *XlateObj;
|
||||
@@ -280,8 +280,7 @@ IntGdiSelectPen(
|
||||
|
||||
if (pDC == NULL || hPen == NULL) return NULL;
|
||||
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr;
|
||||
pdcattr = pDC->pdcattr;
|
||||
|
||||
pPen = PENOBJ_LockPen(hPen);
|
||||
if (pPen == NULL)
|
||||
@@ -297,14 +296,14 @@ IntGdiSelectPen(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hOrgPen = pDc_Attr->hpen;
|
||||
pDc_Attr->hpen = hPen;
|
||||
hOrgPen = pdcattr->hpen;
|
||||
pdcattr->hpen = hPen;
|
||||
|
||||
if (pDC->rosdc.XlatePen != NULL)
|
||||
{
|
||||
EngDeleteXlate(pDC->rosdc.XlatePen);
|
||||
}
|
||||
pDc_Attr->ulDirty_ &= ~DC_PEN_DIRTY;
|
||||
pdcattr->ulDirty_ &= ~DC_PEN_DIRTY;
|
||||
|
||||
pDC->rosdc.XlatePen = XlateObj;
|
||||
|
||||
|
||||
@@ -560,7 +560,7 @@ FillPolygon(
|
||||
FILL_EDGE_LIST *list = 0;
|
||||
FILL_EDGE *ActiveHead = 0;
|
||||
int ScanLine;
|
||||
PDC_ATTR Dc_Attr = dc->pDc_Attr;
|
||||
PDC_ATTR pdcattr = dc->pdcattr;
|
||||
void
|
||||
(APIENTRY *FillScanLine)(
|
||||
PDC dc,
|
||||
@@ -570,8 +570,6 @@ FillPolygon(
|
||||
BRUSHOBJ *BrushObj,
|
||||
MIX RopMode );
|
||||
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
|
||||
//DPRINT("FillPolygon\n");
|
||||
|
||||
/* Create Edge List. */
|
||||
@@ -580,7 +578,7 @@ FillPolygon(
|
||||
if (NULL == list)
|
||||
return FALSE;
|
||||
|
||||
if ( WINDING == Dc_Attr->jFillMode )
|
||||
if ( WINDING == pdcattr->jFillMode )
|
||||
FillScanLine = POLYGONFILL_FillScanLineWinding;
|
||||
else /* default */
|
||||
FillScanLine = POLYGONFILL_FillScanLineAlternate;
|
||||
|
||||
@@ -1969,20 +1969,19 @@ REGION_LPTODP(
|
||||
|
||||
RECTL tmpRect;
|
||||
BOOL ret = FALSE;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
if (!dc)
|
||||
return ret;
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (Dc_Attr->iMapMode == MM_TEXT) // Requires only a translation
|
||||
if (pdcattr->iMapMode == MM_TEXT) // Requires only a translation
|
||||
{
|
||||
if (NtGdiCombineRgn(hDest, hSrc, 0, RGN_COPY) == ERROR)
|
||||
goto done;
|
||||
|
||||
NtGdiOffsetRgn(hDest, Dc_Attr->ptlViewportOrg.x - Dc_Attr->ptlWindowOrg.x,
|
||||
Dc_Attr->ptlViewportOrg.y - Dc_Attr->ptlWindowOrg.y);
|
||||
NtGdiOffsetRgn(hDest, pdcattr->ptlViewportOrg.x - pdcattr->ptlWindowOrg.x,
|
||||
pdcattr->ptlViewportOrg.y - pdcattr->ptlWindowOrg.y);
|
||||
ret = TRUE;
|
||||
goto done;
|
||||
}
|
||||
@@ -2000,10 +1999,10 @@ REGION_LPTODP(
|
||||
for (pCurRect = srcObj->Buffer; pCurRect < pEndRect; pCurRect++)
|
||||
{
|
||||
tmpRect = *pCurRect;
|
||||
tmpRect.left = XLPTODP(Dc_Attr, tmpRect.left);
|
||||
tmpRect.top = YLPTODP(Dc_Attr, tmpRect.top);
|
||||
tmpRect.right = XLPTODP(Dc_Attr, tmpRect.right);
|
||||
tmpRect.bottom = YLPTODP(Dc_Attr, tmpRect.bottom);
|
||||
tmpRect.left = XLPTODP(pdcattr, tmpRect.left);
|
||||
tmpRect.top = YLPTODP(pdcattr, tmpRect.top);
|
||||
tmpRect.right = XLPTODP(pdcattr, tmpRect.right);
|
||||
tmpRect.bottom = YLPTODP(pdcattr, tmpRect.bottom);
|
||||
|
||||
if (tmpRect.left > tmpRect.right)
|
||||
{
|
||||
@@ -2114,17 +2113,16 @@ IntUpdateVisRectRgn(PDC pDC, PROSRGNDATA pRgn)
|
||||
{
|
||||
INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr);
|
||||
PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index];
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
RECTL rcl;
|
||||
|
||||
if (Entry->Flags & GDI_ENTRY_VALIDATE_VIS)
|
||||
{
|
||||
pDc_Attr = pDC->pDc_Attr;
|
||||
if ( !pDc_Attr ) pDc_Attr = &pDC->Dc_Attr;
|
||||
pdcattr = pDC->pdcattr;
|
||||
|
||||
pDc_Attr->VisRectRegion.Flags = REGION_Complexity(pRgn);
|
||||
pdcattr->VisRectRegion.Flags = REGION_Complexity(pRgn);
|
||||
|
||||
if (pRgn && pDc_Attr->VisRectRegion.Flags != NULLREGION)
|
||||
if (pRgn && pdcattr->VisRectRegion.Flags != NULLREGION)
|
||||
{
|
||||
rcl.left = pRgn->rdh.rcBound.left;
|
||||
rcl.top = pRgn->rdh.rcBound.top;
|
||||
@@ -2139,7 +2137,7 @@ IntUpdateVisRectRgn(PDC pDC, PROSRGNDATA pRgn)
|
||||
else
|
||||
RECTL_vSetEmptyRect(&rcl);
|
||||
|
||||
pDc_Attr->VisRectRegion.Rect = rcl;
|
||||
pdcattr->VisRectRegion.Rect = rcl;
|
||||
|
||||
Entry->Flags &= ~GDI_ENTRY_VALIDATE_VIS;
|
||||
}
|
||||
@@ -2909,11 +2907,10 @@ IntGdiPaintRgn(
|
||||
GDIBRUSHINST BrushInst;
|
||||
POINTL BrushOrigin;
|
||||
SURFACE *psurf;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
if (!dc) return FALSE;
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
pdcattr = dc->pdcattr;
|
||||
|
||||
if (!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0))) return FALSE;
|
||||
|
||||
@@ -2938,12 +2935,12 @@ IntGdiPaintRgn(
|
||||
visrgn->Buffer,
|
||||
&visrgn->rdh.rcBound );
|
||||
ASSERT(ClipRegion);
|
||||
pBrush = BRUSHOBJ_LockBrush(Dc_Attr->hbrush);
|
||||
pBrush = BRUSHOBJ_LockBrush(pdcattr->hbrush);
|
||||
ASSERT(pBrush);
|
||||
IntGdiInitBrushInstance(&BrushInst, pBrush, dc->rosdc.XlateBrush);
|
||||
|
||||
BrushOrigin.x = Dc_Attr->ptlBrushOrigin.x;
|
||||
BrushOrigin.y = Dc_Attr->ptlBrushOrigin.y;
|
||||
BrushOrigin.x = pdcattr->ptlBrushOrigin.x;
|
||||
BrushOrigin.y = pdcattr->ptlBrushOrigin.y;
|
||||
psurf = SURFACE_LockSurface(dc->rosdc.hBitmap);
|
||||
/* FIXME - Handle psurf == NULL !!!! */
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ APIENTRY
|
||||
NtGdiGetCharSet(HDC hDC)
|
||||
{
|
||||
PDC Dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
DWORD cscp;
|
||||
// If here, update everything!
|
||||
Dc = DC_LockDc(hDC);
|
||||
@@ -30,10 +30,9 @@ NtGdiGetCharSet(HDC hDC)
|
||||
return 0;
|
||||
}
|
||||
cscp = ftGdiGetTextCharsetInfo(Dc,NULL,0);
|
||||
Dc_Attr = Dc->pDc_Attr;
|
||||
if (!Dc_Attr) Dc_Attr = &Dc->Dc_Attr;
|
||||
Dc_Attr->iCS_CP = cscp;
|
||||
Dc_Attr->ulDirty_ &= ~DIRTY_CHARSET;
|
||||
pdcattr = Dc->pdcattr;
|
||||
pdcattr->iCS_CP = cscp;
|
||||
pdcattr->ulDirty_ &= ~DIRTY_CHARSET;
|
||||
DC_UnlockDc( Dc );
|
||||
return cscp;
|
||||
}
|
||||
@@ -142,7 +141,7 @@ NtGdiGetTextExtentExW(
|
||||
)
|
||||
{
|
||||
PDC dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
LPWSTR String;
|
||||
SIZE Size;
|
||||
NTSTATUS Status;
|
||||
@@ -211,9 +210,8 @@ NtGdiGetTextExtentExW(
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
|
||||
TextObj = RealizeFontInit(Dc_Attr->hlfntNew);
|
||||
pdcattr = dc->pdcattr;
|
||||
TextObj = RealizeFontInit(pdcattr->hlfntNew);
|
||||
if ( TextObj )
|
||||
{
|
||||
Result = TextIntGetTextExtentPoint(dc, TextObj, String, Count, MaxExtent,
|
||||
@@ -294,7 +292,7 @@ NtGdiSetTextJustification(HDC hDC,
|
||||
int BreakCount)
|
||||
{
|
||||
PDC pDc;
|
||||
PDC_ATTR pDc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
|
||||
pDc = DC_LockDc(hDC);
|
||||
if (!pDc)
|
||||
@@ -303,11 +301,10 @@ NtGdiSetTextJustification(HDC hDC,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pDc_Attr = pDc->pDc_Attr;
|
||||
if(!pDc_Attr) pDc_Attr = &pDc->Dc_Attr;
|
||||
pdcattr = pDc->pdcattr;
|
||||
|
||||
pDc_Attr->lBreakExtra = BreakExtra;
|
||||
pDc_Attr->cBreak = BreakCount;
|
||||
pdcattr->lBreakExtra = BreakExtra;
|
||||
pdcattr->cBreak = BreakCount;
|
||||
|
||||
DC_UnlockDc(pDc);
|
||||
return TRUE;
|
||||
@@ -325,7 +322,7 @@ NtGdiGetTextFaceW(
|
||||
)
|
||||
{
|
||||
PDC Dc;
|
||||
PDC_ATTR Dc_Attr;
|
||||
PDC_ATTR pdcattr;
|
||||
HFONT hFont;
|
||||
PTEXTOBJ TextObj;
|
||||
NTSTATUS Status;
|
||||
@@ -338,9 +335,8 @@ NtGdiGetTextFaceW(
|
||||
SetLastWin32Error(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
Dc_Attr = Dc->pDc_Attr;
|
||||
if(!Dc_Attr) Dc_Attr = &Dc->Dc_Attr;
|
||||
hFont = Dc_Attr->hlfntNew;
|
||||
pdcattr = Dc->pdcattr;
|
||||
hFont = pdcattr->hlfntNew;
|
||||
DC_UnlockDc(Dc);
|
||||
|
||||
TextObj = RealizeFontInit(hFont);
|
||||
|
||||
Reference in New Issue
Block a user