Moved most of the old Win struct to Dc_Attr structure. Tested it with qemu.

svn path=/trunk/; revision=28183
This commit is contained in:
James Tabor 2007-08-06 02:48:09 +00:00
parent 174418b0d1
commit 556e9b7da8
11 changed files with 148 additions and 161 deletions

View file

@ -26,9 +26,6 @@ typedef struct _WIN_DC_INFO
HRGN hClipRgn; /* Clip region (may be 0) */ HRGN hClipRgn; /* Clip region (may be 0) */
HRGN hVisRgn; /* Visible region (must never be 0) */ HRGN hVisRgn; /* Visible region (must never be 0) */
HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */ HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */
HPEN hPen;
HBRUSH hBrush;
HFONT hFont;
HBITMAP hBitmap; HBITMAP hBitmap;
HBITMAP hFirstBitmap; /* Bitmap selected at creation of the DC */ HBITMAP hFirstBitmap; /* Bitmap selected at creation of the DC */
@ -39,19 +36,9 @@ typedef struct _WIN_DC_INFO
GdiPath path; GdiPath path;
/* #endif */ /* #endif */
WORD ROPmode;
WORD polyFillMode;
WORD stretchBltMode;
WORD relAbsMode;
WORD backgroundMode;
COLORREF backgroundColor;
COLORREF textColor;
short brushOrgX; short brushOrgX;
short brushOrgY; short brushOrgY;
WORD textAlign; /* Text alignment from SetTextAlign() */
short charExtra; /* Spacing from SetTextCharacterExtra() */
short breakTotalExtra; /* Total extra space for justification */ short breakTotalExtra; /* Total extra space for justification */
short breakCount; /* Break char. count */ short breakCount; /* Break char. count */
short breakExtra; /* breakTotalExtra / breakCount */ short breakExtra; /* breakTotalExtra / breakCount */
@ -60,8 +47,6 @@ typedef struct _WIN_DC_INFO
RECT totalExtent; RECT totalExtent;
BYTE bitsPerPixel; BYTE bitsPerPixel;
INT MapMode;
INT GraphicsMode; /* Graphics mode */
INT DCOrgX; /* DC origin */ INT DCOrgX; /* DC origin */
INT DCOrgY; INT DCOrgY;
@ -92,6 +77,8 @@ typedef struct _DC
HDC hSelf; HDC hSelf;
HDC hNext; HDC hNext;
PDC_ATTR pDc_Attr; PDC_ATTR pDc_Attr;
INT DC_Type;
INT DC_Flags;
DHPDEV PDev; DHPDEV PDev;
HSURF FillPatternSurfaces[HS_DDI_MAX]; HSURF FillPatternSurfaces[HS_DDI_MAX];
PGDIINFO GDIInfo; PGDIINFO GDIInfo;

View file

@ -140,7 +140,7 @@ NtGdiBitBlt(
if (UsesPattern) if (UsesPattern)
{ {
BrushObj = BRUSHOBJ_LockBrush(DCDest->w.hBrush); BrushObj = BRUSHOBJ_LockBrush(DCDest->Dc_Attr.hbrush);
if (NULL == BrushObj) if (NULL == BrushObj)
{ {
if (UsesSource && hDCSrc != hDCDest) if (UsesSource && hDCSrc != hDCDest)
@ -185,11 +185,11 @@ NtGdiBitBlt(
{ {
if (DCDest->w.bitsPerPixel == 1) if (DCDest->w.bitsPerPixel == 1)
{ {
XlateObj = IntEngCreateMonoXlate(0, DestPalette, SourcePalette, DCSrc->w.backgroundColor); XlateObj = IntEngCreateMonoXlate(0, DestPalette, SourcePalette, DCSrc->Dc_Attr.crBackgroundClr);
} }
else if (DCSrc->w.bitsPerPixel == 1) else if (DCSrc->w.bitsPerPixel == 1)
{ {
XlateObj = IntEngCreateSrcMonoXlate(DestPalette, DCSrc->w.backgroundColor, DCSrc->w.textColor); XlateObj = IntEngCreateSrcMonoXlate(DestPalette, DCSrc->Dc_Attr.crBackgroundClr, DCSrc->Dc_Attr.crForegroundClr);
} }
else else
{ {
@ -1315,7 +1315,7 @@ NtGdiStretchBlt(
if (UsesPattern) if (UsesPattern)
{ {
BrushObj = BRUSHOBJ_LockBrush(DCDest->w.hBrush); BrushObj = BRUSHOBJ_LockBrush(DCDest->Dc_Attr.hbrush);
if (NULL == BrushObj) if (NULL == BrushObj)
{ {
if (UsesSource && hDCSrc != hDCDest) if (UsesSource && hDCSrc != hDCDest)
@ -1481,11 +1481,11 @@ NtGdiAlphaBlend(
{ {
if (DCDest->w.bitsPerPixel == 1) if (DCDest->w.bitsPerPixel == 1)
{ {
XlateObj = IntEngCreateMonoXlate(0, DestPalette, SourcePalette, DCSrc->w.backgroundColor); XlateObj = IntEngCreateMonoXlate(0, DestPalette, SourcePalette, DCSrc->Dc_Attr.crBackgroundClr);
} }
else if (DCSrc->w.bitsPerPixel == 1) else if (DCSrc->w.bitsPerPixel == 1)
{ {
XlateObj = IntEngCreateSrcMonoXlate(DestPalette, DCSrc->w.backgroundColor, DCSrc->w.textColor); XlateObj = IntEngCreateSrcMonoXlate(DestPalette, DCSrc->Dc_Attr.crBackgroundClr, DCSrc->Dc_Attr.crForegroundClr);
} }
else else
{ {

View file

@ -134,7 +134,7 @@ IntGdiCreateBrushXlate(PDC Dc, GDIBRUSHOBJ *BrushObj, BOOLEAN *Failed)
if (Pattern->SurfObj.iBitmapFormat == BMF_1BPP) if (Pattern->SurfObj.iBitmapFormat == BMF_1BPP)
{ {
if (Dc->w.bitsPerPixel != 1) if (Dc->w.bitsPerPixel != 1)
Result = IntEngCreateSrcMonoXlate(Dc->w.hPalette, Dc->w.textColor, Dc->w.backgroundColor); Result = IntEngCreateSrcMonoXlate(Dc->w.hPalette, Dc->Dc_Attr.crForegroundClr, Dc->Dc_Attr.crBackgroundClr);
} }
else if (BrushObj->flAttrs & GDIBRUSH_IS_DIB) else if (BrushObj->flAttrs & GDIBRUSH_IS_DIB)
{ {
@ -823,7 +823,7 @@ NtGdiPatBlt(
return TRUE; return TRUE;
} }
BrushObj = BRUSHOBJ_LockBrush(dc->w.hBrush); BrushObj = BRUSHOBJ_LockBrush(dc->Dc_Attr.hbrush);
if (BrushObj == NULL) if (BrushObj == NULL)
{ {
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);

View file

@ -255,7 +255,7 @@ FASTCALL
IntGetGraphicsMode ( PDC dc ) IntGetGraphicsMode ( PDC dc )
{ {
ASSERT ( dc ); ASSERT ( dc );
return dc->w.GraphicsMode; return dc->Dc_Attr.iGraphicsMode;
} }
BOOL BOOL
@ -309,7 +309,7 @@ NtGdiGetGraphicsMode ( HDC hDC )
return 0; return 0;
} }
GraphicsMode = dc->w.GraphicsMode; GraphicsMode = dc->Dc_Attr.iGraphicsMode;
DC_UnlockDc(dc); DC_UnlockDc(dc);
return GraphicsMode; return GraphicsMode;
@ -680,8 +680,8 @@ NtGdiSetGraphicsMode(HDC hDC,
return 0; return 0;
} }
ret = dc->w.GraphicsMode; ret = dc->Dc_Attr.iGraphicsMode;
dc->w.GraphicsMode = Mode; dc->Dc_Attr.iGraphicsMode = Mode;
DC_UnlockDc(dc); DC_UnlockDc(dc);
return ret; return ret;
} }
@ -701,11 +701,11 @@ NtGdiSetMapMode(HDC hDC,
return 0; return 0;
} }
PrevMapMode = dc->w.MapMode; PrevMapMode = dc->Dc_Attr.iMapMode;
if (MapMode != dc->w.MapMode || (MapMode != MM_ISOTROPIC && MapMode != MM_ANISOTROPIC)) if (MapMode != dc->Dc_Attr.iMapMode || (MapMode != MM_ISOTROPIC && MapMode != MM_ANISOTROPIC))
{ {
dc->w.MapMode = MapMode; dc->Dc_Attr.iMapMode = MapMode;
switch (MapMode) switch (MapMode)
{ {
@ -780,7 +780,7 @@ NtGdiSetViewportExtEx(HDC hDC,
return FALSE; return FALSE;
} }
switch (dc->w.MapMode) switch (dc->Dc_Attr.iMapMode)
{ {
case MM_HIENGLISH: case MM_HIENGLISH:
case MM_HIMETRIC: case MM_HIMETRIC:
@ -812,7 +812,7 @@ NtGdiSetViewportExtEx(HDC hDC,
dc->vportExtX = XExtent; dc->vportExtX = XExtent;
dc->vportExtY = YExtent; dc->vportExtY = YExtent;
if (dc->w.MapMode == MM_ISOTROPIC) if (dc->Dc_Attr.iMapMode == MM_ISOTROPIC)
IntFixIsotropicMapping(dc); IntFixIsotropicMapping(dc);
} }
_SEH_HANDLE _SEH_HANDLE
@ -903,7 +903,7 @@ NtGdiSetWindowExtEx(HDC hDC,
return FALSE; return FALSE;
} }
switch (dc->w.MapMode) switch (dc->Dc_Attr.iMapMode)
{ {
case MM_HIENGLISH: case MM_HIENGLISH:
case MM_HIMETRIC: case MM_HIMETRIC:
@ -1024,7 +1024,7 @@ NtGdiSetWorldTransform(HDC hDC,
} }
/* Check that graphics mode is GM_ADVANCED */ /* Check that graphics mode is GM_ADVANCED */
if ( dc->w.GraphicsMode != GM_ADVANCED ) if ( dc->Dc_Attr.iGraphicsMode != GM_ADVANCED )
{ {
DC_UnlockDc(dc); DC_UnlockDc(dc);
return FALSE; return FALSE;

View file

@ -244,11 +244,11 @@ NtGdiCreateCompatibleDC(HDC hDC)
NewDC->PalIndexed = OrigDC->PalIndexed; NewDC->PalIndexed = OrigDC->PalIndexed;
NewDC->w.hPalette = OrigDC->w.hPalette; NewDC->w.hPalette = OrigDC->w.hPalette;
NewDC->w.textColor = OrigDC->w.textColor; NewDC->Dc_Attr.crForegroundClr = OrigDC->Dc_Attr.crForegroundClr;
NewDC->w.textAlign = OrigDC->w.textAlign; NewDC->Dc_Attr.lTextAlign = OrigDC->Dc_Attr.lTextAlign;
NewDC->w.backgroundColor = OrigDC->w.backgroundColor; NewDC->Dc_Attr.crBackgroundClr = OrigDC->Dc_Attr.crBackgroundClr;
NewDC->w.backgroundMode = OrigDC->w.backgroundMode; NewDC->Dc_Attr.jBkMode = OrigDC->Dc_Attr.jBkMode;
NewDC->w.ROPmode = OrigDC->w.ROPmode; NewDC->Dc_Attr.jROP2 = OrigDC->Dc_Attr.jROP2;
DC_UnlockDc(NewDC); DC_UnlockDc(NewDC);
DC_UnlockDc(OrigDC); DC_UnlockDc(OrigDC);
if (NULL != DisplayDC) if (NULL != DisplayDC)
@ -908,7 +908,7 @@ IntGdiCreateDC(PUNICODE_STRING Driver,
{ {
NewDC->PalIndexed = NtGdiGetStockObject(DEFAULT_PALETTE); NewDC->PalIndexed = NtGdiGetStockObject(DEFAULT_PALETTE);
NewDC->w.hPalette = NewDC->DevInfo->hpalDefault; NewDC->w.hPalette = NewDC->DevInfo->hpalDefault;
NewDC->w.ROPmode = R2_COPYPEN; NewDC->Dc_Attr.jROP2 = R2_COPYPEN;
DC_UnlockDc( NewDC ); DC_UnlockDc( NewDC );
@ -1098,8 +1098,8 @@ NtGdiEnumObjects(
return 0; return 0;
} }
DC_GET_VAL( COLORREF, NtGdiGetBkColor, w.backgroundColor ) DC_GET_VAL( COLORREF, NtGdiGetBkColor, Dc_Attr.crBackgroundClr )
DC_GET_VAL( INT, NtGdiGetBkMode, w.backgroundMode ) DC_GET_VAL( INT, NtGdiGetBkMode, Dc_Attr.jBkMode )
DC_GET_VAL_EX( GetBrushOrgEx, w.brushOrgX, w.brushOrgY, POINT, x, y ) DC_GET_VAL_EX( GetBrushOrgEx, w.brushOrgX, w.brushOrgY, POINT, x, y )
DC_GET_VAL( HRGN, NtGdiGetClipRgn, w.hClipRgn ) DC_GET_VAL( HRGN, NtGdiGetClipRgn, w.hClipRgn )
@ -1122,16 +1122,16 @@ NtGdiGetCurrentObject(HDC hDC, UINT ObjectType)
{ {
case OBJ_PEN: case OBJ_PEN:
case OBJ_EXTPEN: case OBJ_EXTPEN:
SelObject = dc->w.hPen; SelObject = dc->Dc_Attr.hpen;
break; break;
case OBJ_BRUSH: case OBJ_BRUSH:
SelObject = dc->w.hBrush; SelObject = dc->Dc_Attr.hbrush;
break; break;
case OBJ_PAL: case OBJ_PAL:
SelObject = dc->w.hPalette; SelObject = dc->w.hPalette;
break; break;
case OBJ_FONT: case OBJ_FONT:
SelObject = dc->w.hFont; SelObject = dc->Dc_Attr.hlfntNew;
break; break;
case OBJ_BITMAP: case OBJ_BITMAP:
SelObject = dc->w.hBitmap; SelObject = dc->w.hBitmap;
@ -1221,9 +1221,9 @@ NtGdiSetBkColor(HDC hDC, COLORREF color)
return CLR_INVALID; return CLR_INVALID;
} }
oldColor = dc->w.backgroundColor; oldColor = dc->Dc_Attr.crBackgroundClr;
dc->w.backgroundColor = color; dc->Dc_Attr.crBackgroundClr = color;
hBrush = dc->w.hBrush; hBrush = dc->Dc_Attr.hbrush;
DC_UnlockDc(dc); DC_UnlockDc(dc);
NtGdiSelectObject(hDC, hBrush); NtGdiSelectObject(hDC, hBrush);
return oldColor; return oldColor;
@ -1253,9 +1253,9 @@ IntGdiGetDCState(HDC hDC)
ASSERT( newdc ); ASSERT( newdc );
newdc->w.flags = dc->w.flags | DC_SAVED; newdc->w.flags = dc->w.flags | DC_SAVED;
newdc->w.hPen = dc->w.hPen; newdc->Dc_Attr.hpen = dc->Dc_Attr.hpen;
newdc->w.hBrush = dc->w.hBrush; newdc->Dc_Attr.hbrush = dc->Dc_Attr.hbrush;
newdc->w.hFont = dc->w.hFont; newdc->Dc_Attr.hlfntNew = dc->Dc_Attr.hlfntNew;
newdc->w.hBitmap = dc->w.hBitmap; newdc->w.hBitmap = dc->w.hBitmap;
newdc->w.hFirstBitmap = dc->w.hFirstBitmap; newdc->w.hFirstBitmap = dc->w.hFirstBitmap;
#if 0 #if 0
@ -1265,23 +1265,23 @@ IntGdiGetDCState(HDC hDC)
newdc->w.hPalette = dc->w.hPalette; newdc->w.hPalette = dc->w.hPalette;
newdc->w.totalExtent = dc->w.totalExtent; newdc->w.totalExtent = dc->w.totalExtent;
newdc->w.bitsPerPixel = dc->w.bitsPerPixel; newdc->w.bitsPerPixel = dc->w.bitsPerPixel;
newdc->w.ROPmode = dc->w.ROPmode; newdc->Dc_Attr.jROP2 = dc->Dc_Attr.jROP2;
newdc->w.polyFillMode = dc->w.polyFillMode; newdc->Dc_Attr.jFillMode = dc->Dc_Attr.jFillMode;
newdc->w.stretchBltMode = dc->w.stretchBltMode; newdc->Dc_Attr.jStretchBltMode = dc->Dc_Attr.jStretchBltMode;
newdc->w.relAbsMode = dc->w.relAbsMode; newdc->Dc_Attr.lRelAbs = dc->Dc_Attr.lRelAbs;
newdc->w.backgroundMode = dc->w.backgroundMode; newdc->Dc_Attr.jBkMode = dc->Dc_Attr.jBkMode;
newdc->w.backgroundColor = dc->w.backgroundColor; newdc->Dc_Attr.crBackgroundClr = dc->Dc_Attr.crBackgroundClr;
newdc->w.textColor = dc->w.textColor; newdc->Dc_Attr.crForegroundClr = dc->Dc_Attr.crForegroundClr;
newdc->w.brushOrgX = dc->w.brushOrgX; newdc->w.brushOrgX = dc->w.brushOrgX;
newdc->w.brushOrgY = dc->w.brushOrgY; newdc->w.brushOrgY = dc->w.brushOrgY;
newdc->w.textAlign = dc->w.textAlign; newdc->Dc_Attr.lTextAlign = dc->Dc_Attr.lTextAlign;
newdc->w.charExtra = dc->w.charExtra; newdc->Dc_Attr.lTextExtra = dc->Dc_Attr.lTextExtra;
newdc->w.breakTotalExtra = dc->w.breakTotalExtra; newdc->w.breakTotalExtra = dc->w.breakTotalExtra;
newdc->w.breakCount = dc->w.breakCount; newdc->w.breakCount = dc->w.breakCount;
newdc->w.breakExtra = dc->w.breakExtra; newdc->w.breakExtra = dc->w.breakExtra;
newdc->w.breakRem = dc->w.breakRem; newdc->w.breakRem = dc->w.breakRem;
newdc->w.MapMode = dc->w.MapMode; newdc->Dc_Attr.iMapMode = dc->Dc_Attr.iMapMode;
newdc->w.GraphicsMode = dc->w.GraphicsMode; newdc->Dc_Attr.iGraphicsMode = dc->Dc_Attr.iGraphicsMode;
#if 0 #if 0
/* Apparently, the DC origin is not changed by [GS]etDCState */ /* Apparently, the DC origin is not changed by [GS]etDCState */
newdc->w.DCOrgX = dc->w.DCOrgX; newdc->w.DCOrgX = dc->w.DCOrgX;
@ -1348,23 +1348,23 @@ IntGdiSetDCState ( HDC hDC, HDC hDCSave )
#endif #endif
dc->w.totalExtent = dcs->w.totalExtent; dc->w.totalExtent = dcs->w.totalExtent;
dc->w.ROPmode = dcs->w.ROPmode; dc->Dc_Attr.jROP2 = dcs->Dc_Attr.jROP2;
dc->w.polyFillMode = dcs->w.polyFillMode; dc->Dc_Attr.jFillMode = dcs->Dc_Attr.jFillMode;
dc->w.stretchBltMode = dcs->w.stretchBltMode; dc->Dc_Attr.jStretchBltMode = dcs->Dc_Attr.jStretchBltMode;
dc->w.relAbsMode = dcs->w.relAbsMode; dc->Dc_Attr.lRelAbs = dcs->Dc_Attr.lRelAbs;
dc->w.backgroundMode = dcs->w.backgroundMode; dc->Dc_Attr.jBkMode = dcs->Dc_Attr.jBkMode;
dc->w.backgroundColor = dcs->w.backgroundColor; dc->Dc_Attr.crBackgroundClr = dcs->Dc_Attr.crBackgroundClr;
dc->w.textColor = dcs->w.textColor; dc->Dc_Attr.crForegroundClr = dcs->Dc_Attr.crForegroundClr;
dc->w.brushOrgX = dcs->w.brushOrgX; dc->w.brushOrgX = dcs->w.brushOrgX;
dc->w.brushOrgY = dcs->w.brushOrgY; dc->w.brushOrgY = dcs->w.brushOrgY;
dc->w.textAlign = dcs->w.textAlign; dc->Dc_Attr.lTextAlign = dcs->Dc_Attr.lTextAlign;
dc->w.charExtra = dcs->w.charExtra; dc->Dc_Attr.lTextExtra = dcs->Dc_Attr.lTextExtra;
dc->w.breakTotalExtra = dcs->w.breakTotalExtra; dc->w.breakTotalExtra = dcs->w.breakTotalExtra;
dc->w.breakCount = dcs->w.breakCount; dc->w.breakCount = dcs->w.breakCount;
dc->w.breakExtra = dcs->w.breakExtra; dc->w.breakExtra = dcs->w.breakExtra;
dc->w.breakRem = dcs->w.breakRem; dc->w.breakRem = dcs->w.breakRem;
dc->w.MapMode = dcs->w.MapMode; dc->Dc_Attr.iMapMode = dcs->Dc_Attr.iMapMode;
dc->w.GraphicsMode = dcs->w.GraphicsMode; dc->Dc_Attr.iGraphicsMode = dcs->Dc_Attr.iGraphicsMode;
#if 0 #if 0
/* Apparently, the DC origin is not changed by [GS]etDCState */ /* Apparently, the DC origin is not changed by [GS]etDCState */
dc->w.DCOrgX = dcs->w.DCOrgX; dc->w.DCOrgX = dcs->w.DCOrgX;
@ -1424,11 +1424,11 @@ IntGdiSetDCState ( HDC hDC, HDC hDCSave )
#endif #endif
NtGdiSelectObject( hDC, dcs->w.hBitmap ); NtGdiSelectObject( hDC, dcs->w.hBitmap );
NtGdiSelectObject( hDC, dcs->w.hBrush ); NtGdiSelectObject( hDC, dcs->Dc_Attr.hbrush );
NtGdiSelectObject( hDC, dcs->w.hFont ); NtGdiSelectObject( hDC, dcs->Dc_Attr.hlfntNew );
NtGdiSelectObject( hDC, dcs->w.hPen ); NtGdiSelectObject( hDC, dcs->Dc_Attr.hpen );
NtGdiSetBkColor( hDC, dcs->w.backgroundColor); NtGdiSetBkColor( hDC, dcs->Dc_Attr.crBackgroundClr);
NtGdiSetTextColor( hDC, dcs->w.textColor); NtGdiSetTextColor( hDC, dcs->Dc_Attr.crForegroundClr);
NtGdiSelectPalette( hDC, dcs->w.hPalette, FALSE ); NtGdiSelectPalette( hDC, dcs->w.hPalette, FALSE );
@ -1665,8 +1665,8 @@ NtGdiGetDeviceCaps(HDC hDC,
return ret; return ret;
} }
DC_GET_VAL( INT, NtGdiGetMapMode, w.MapMode ) DC_GET_VAL( INT, NtGdiGetMapMode, Dc_Attr.iMapMode )
DC_GET_VAL( INT, NtGdiGetPolyFillMode, w.polyFillMode ) DC_GET_VAL( INT, NtGdiGetPolyFillMode, Dc_Attr.jFillMode )
INT INT
FASTCALL FASTCALL
@ -1773,11 +1773,11 @@ NtGdiExtGetObjectW(IN HANDLE hGdiObj,
return iRetCount; return iRetCount;
} }
DC_GET_VAL( INT, NtGdiGetRelAbs, w.relAbsMode ) DC_GET_VAL( INT, NtGdiGetRelAbs, Dc_Attr.lRelAbs )
DC_GET_VAL( INT, NtGdiGetROP2, w.ROPmode ) DC_GET_VAL( INT, NtGdiGetROP2, Dc_Attr.jROP2 )
DC_GET_VAL( INT, NtGdiGetStretchBltMode, w.stretchBltMode ) DC_GET_VAL( INT, NtGdiGetStretchBltMode, Dc_Attr.jStretchBltMode )
DC_GET_VAL( UINT, NtGdiGetTextAlign, w.textAlign ) DC_GET_VAL( UINT, NtGdiGetTextAlign, Dc_Attr.lTextAlign )
DC_GET_VAL( COLORREF, NtGdiGetTextColor, w.textColor ) DC_GET_VAL( COLORREF, NtGdiGetTextColor, Dc_Attr.crForegroundClr )
DC_GET_VAL_EX( GetViewportExtEx, vportExtX, vportExtY, SIZE, cx, cy ) DC_GET_VAL_EX( GetViewportExtEx, vportExtX, vportExtY, SIZE, cx, cy )
DC_GET_VAL_EX( GetViewportOrgEx, vportOrgX, vportOrgY, POINT, x, y ) DC_GET_VAL_EX( GetViewportOrgEx, vportOrgX, vportOrgY, POINT, x, y )
DC_GET_VAL_EX( GetWindowExtEx, wndExtX, wndExtY, SIZE, cx, cy ) DC_GET_VAL_EX( GetWindowExtEx, wndExtX, wndExtY, SIZE, cx, cy )
@ -1968,8 +1968,8 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
break; break;
} }
objOrg = (HGDIOBJ)dc->w.hPen; objOrg = (HGDIOBJ)dc->Dc_Attr.hpen;
dc->w.hPen = hGDIObj; dc->Dc_Attr.hpen = hGDIObj;
if (dc->XlatePen != NULL) if (dc->XlatePen != NULL)
EngDeleteXlate(dc->XlatePen); EngDeleteXlate(dc->XlatePen);
dc->XlatePen = XlateObj; dc->XlatePen = XlateObj;
@ -1991,8 +1991,8 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
break; break;
} }
objOrg = (HGDIOBJ)dc->w.hBrush; objOrg = (HGDIOBJ)dc->Dc_Attr.hbrush;
dc->w.hBrush = hGDIObj; dc->Dc_Attr.hbrush = hGDIObj;
if (dc->XlateBrush != NULL) if (dc->XlateBrush != NULL)
EngDeleteXlate(dc->XlateBrush); EngDeleteXlate(dc->XlateBrush);
dc->XlateBrush = XlateObj; dc->XlateBrush = XlateObj;
@ -2001,8 +2001,8 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
case GDI_OBJECT_TYPE_FONT: case GDI_OBJECT_TYPE_FONT:
if(NT_SUCCESS(TextIntRealizeFont((HFONT)hGDIObj))) if(NT_SUCCESS(TextIntRealizeFont((HFONT)hGDIObj)))
{ {
objOrg = (HGDIOBJ)dc->w.hFont; objOrg = (HGDIOBJ)dc->Dc_Attr.hlfntNew;
dc->w.hFont = (HFONT) hGDIObj; dc->Dc_Attr.hlfntNew = (HFONT) hGDIObj;
} }
break; break;
@ -2038,8 +2038,8 @@ NtGdiSelectObject(HDC hDC, HGDIOBJ hGDIObj)
} }
/* Reselect brush and pen to regenerate the XLATEOBJs. */ /* Reselect brush and pen to regenerate the XLATEOBJs. */
NtGdiSelectObject ( hDC, dc->w.hBrush ); NtGdiSelectObject ( hDC, dc->Dc_Attr.hbrush );
NtGdiSelectObject ( hDC, dc->w.hPen ); NtGdiSelectObject ( hDC, dc->Dc_Attr.hpen );
DC_UnlockDc ( dc ); DC_UnlockDc ( dc );
hVisRgn = NtGdiCreateRectRgn ( 0, 0, pb->SurfObj.sizlBitmap.cx, pb->SurfObj.sizlBitmap.cy ); hVisRgn = NtGdiCreateRectRgn ( 0, 0, pb->SurfObj.sizlBitmap.cx, pb->SurfObj.sizlBitmap.cy );
@ -2099,11 +2099,11 @@ IntGdiSetHookFlags(HDC hDC, WORD Flags)
return wRet; return wRet;
} }
DC_SET_MODE( NtGdiSetBkMode, w.backgroundMode, TRANSPARENT, OPAQUE ) DC_SET_MODE( NtGdiSetBkMode, Dc_Attr.jBkMode, TRANSPARENT, OPAQUE )
DC_SET_MODE( NtGdiSetPolyFillMode, w.polyFillMode, ALTERNATE, WINDING ) DC_SET_MODE( NtGdiSetPolyFillMode, Dc_Attr.jFillMode, ALTERNATE, WINDING )
// DC_SET_MODE( NtGdiSetRelAbs, w.relAbsMode, ABSOLUTE, RELATIVE ) // DC_SET_MODE( NtGdiSetRelAbs, Dc_Attr.lRelAbs, ABSOLUTE, RELATIVE )
DC_SET_MODE( NtGdiSetROP2, w.ROPmode, R2_BLACK, R2_WHITE ) DC_SET_MODE( NtGdiSetROP2, Dc_Attr.jROP2, R2_BLACK, R2_WHITE )
DC_SET_MODE( NtGdiSetStretchBltMode, w.stretchBltMode, BLACKONWHITE, HALFTONE ) DC_SET_MODE( NtGdiSetStretchBltMode, Dc_Attr.jStretchBltMode, BLACKONWHITE, HALFTONE )
// ---------------------------------------------------- Private Interface // ---------------------------------------------------- Private Interface
@ -2202,7 +2202,7 @@ DC_AllocDC(PUNICODE_STRING Driver)
NewDC->w.vport2WorldValid = TRUE; NewDC->w.vport2WorldValid = TRUE;
// DC_Attr->flXform = DEVICE_TO_PAGE_INVALID; // More research. // DC_Attr->flXform = DEVICE_TO_PAGE_INVALID; // More research.
NewDC->w.MapMode = MM_TEXT; NewDC->Dc_Attr.iMapMode = MM_TEXT;
// DC_Attr->iMapMode = MM_TEXT; // DC_Attr->iMapMode = MM_TEXT;
NewDC->wndExtX = 1.0f; NewDC->wndExtX = 1.0f;
@ -2210,16 +2210,16 @@ DC_AllocDC(PUNICODE_STRING Driver)
NewDC->vportExtX = 1.0f; NewDC->vportExtX = 1.0f;
NewDC->vportExtY = 1.0f; NewDC->vportExtY = 1.0f;
NewDC->w.textColor = 0; NewDC->Dc_Attr.crForegroundClr = 0;
// NewDC->pDc_Attr->ulForegroundClr = 0; // Already Zero // NewDC->pDc_Attr->ulForegroundClr = 0; // Already Zero
// NewDC->pDc_Attr->crForegroundClr = 0; // NewDC->pDc_Attr->crForegroundClr = 0;
NewDC->w.backgroundColor = 0xffffff; NewDC->Dc_Attr.crBackgroundClr = 0xffffff;
// DC_Attr->ulBackgroundClr = 0xffffff; // DC_Attr->ulBackgroundClr = 0xffffff;
// DC_Attr->crBackgroundClr = 0xffffff; // DC_Attr->crBackgroundClr = 0xffffff;
NewDC->w.hFont = NtGdiGetStockObject(SYSTEM_FONT); NewDC->Dc_Attr.hlfntNew = NtGdiGetStockObject(SYSTEM_FONT);
TextIntRealizeFont(NewDC->w.hFont); TextIntRealizeFont(NewDC->Dc_Attr.hlfntNew);
// DC_Attr->hlfntNew = NtGdiGetStockObject(SYSTEM_FONT); // DC_Attr->hlfntNew = NtGdiGetStockObject(SYSTEM_FONT);
NewDC->w.hPalette = NtGdiGetStockObject(DEFAULT_PALETTE); NewDC->w.hPalette = NtGdiGetStockObject(DEFAULT_PALETTE);

View file

@ -31,7 +31,7 @@
&BrushInst.BrushObject, \ &BrushInst.BrushObject, \
x, y, (x)+1, y, \ x, y, (x)+1, y, \
&RectBounds, \ &RectBounds, \
ROP2_TO_MIX(dc->w.ROPmode)); ROP2_TO_MIX(dc->Dc_Attr.jROP2));
#define PUTLINE(x1,y1,x2,y2,BrushInst) \ #define PUTLINE(x1,y1,x2,y2,BrushInst) \
ret = ret && IntEngLineTo(&BitmapObj->SurfObj, \ ret = ret && IntEngLineTo(&BitmapObj->SurfObj, \
@ -39,7 +39,7 @@
&BrushInst.BrushObject, \ &BrushInst.BrushObject, \
x1, y1, x2, y2, \ x1, y1, x2, y2, \
&RectBounds, \ &RectBounds, \
ROP2_TO_MIX(dc->w.ROPmode)); ROP2_TO_MIX(dc->Dc_Attr.jROP2));
BOOL FASTCALL BOOL FASTCALL
IntGdiPolygon(PDC dc, IntGdiPolygon(PDC dc,
@ -91,16 +91,16 @@ IntGdiPolygon(PDC dc,
} }
/* Now fill the polygon with the current brush. */ /* Now fill the polygon with the current brush. */
FillBrushObj = BRUSHOBJ_LockBrush(dc->w.hBrush); FillBrushObj = BRUSHOBJ_LockBrush(dc->Dc_Attr.hbrush);
if (FillBrushObj && !(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL)) if (FillBrushObj && !(FillBrushObj->flAttrs & GDIBRUSH_IS_NULL))
{ {
IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush); IntGdiInitBrushInstance(&FillBrushInst, FillBrushObj, dc->XlateBrush);
ret = FillPolygon ( dc, BitmapObj, &FillBrushInst.BrushObject, ROP2_TO_MIX(dc->w.ROPmode), UnsafePoints, Count, DestRect ); ret = FillPolygon ( dc, BitmapObj, &FillBrushInst.BrushObject, ROP2_TO_MIX(dc->Dc_Attr.jROP2), UnsafePoints, Count, DestRect );
} }
BRUSHOBJ_UnlockBrush(FillBrushObj); BRUSHOBJ_UnlockBrush(FillBrushObj);
/* get BRUSHOBJ from current pen. */ /* get BRUSHOBJ from current pen. */
PenBrushObj = PENOBJ_LockPen(dc->w.hPen); PenBrushObj = PENOBJ_LockPen(dc->Dc_Attr.hpen);
// Draw the Polygon Edges with the current pen ( if not a NULL pen ) // Draw the Polygon Edges with the current pen ( if not a NULL pen )
if (PenBrushObj && !(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)) if (PenBrushObj && !(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
{ {
@ -121,7 +121,7 @@ IntGdiPolygon(PDC dc,
UnsafePoints[1].x, /* To */ UnsafePoints[1].x, /* To */
UnsafePoints[1].y, UnsafePoints[1].y,
&DestRect, &DestRect,
ROP2_TO_MIX(dc->w.ROPmode)); /* MIX */ ROP2_TO_MIX(dc->Dc_Attr.jROP2)); /* MIX */
if(!ret) break; if(!ret) break;
UnsafePoints++; UnsafePoints++;
} }
@ -213,7 +213,7 @@ NtGdiEllipse(
return TRUE; return TRUE;
} }
FillBrush = BRUSHOBJ_LockBrush(dc->w.hBrush); FillBrush = BRUSHOBJ_LockBrush(dc->Dc_Attr.hbrush);
if (NULL == FillBrush) if (NULL == FillBrush)
{ {
DC_UnlockDc(dc); DC_UnlockDc(dc);
@ -221,7 +221,7 @@ NtGdiEllipse(
return FALSE; return FALSE;
} }
PenBrush = PENOBJ_LockPen(dc->w.hPen); PenBrush = PENOBJ_LockPen(dc->Dc_Attr.hpen);
if (NULL == PenBrush) if (NULL == PenBrush)
{ {
BRUSHOBJ_UnlockBrush(FillBrush); BRUSHOBJ_UnlockBrush(FillBrush);
@ -648,7 +648,7 @@ NtGdiPie(HDC hDC,
return TRUE; return TRUE;
} }
FillBrushObj = BRUSHOBJ_LockBrush(dc->w.hBrush); FillBrushObj = BRUSHOBJ_LockBrush(dc->Dc_Attr.hbrush);
if (NULL == FillBrushObj) if (NULL == FillBrushObj)
{ {
DC_UnlockDc(dc); DC_UnlockDc(dc);
@ -671,7 +671,7 @@ NtGdiPie(HDC hDC,
RectBounds.bottom = Bottom; RectBounds.bottom = Bottom;
SurfObj = (SURFOBJ*) AccessUserObject((ULONG)dc->Surface); SurfObj = (SURFOBJ*) AccessUserObject((ULONG)dc->Surface);
HPenToBrushObj(&PenBrushObj, dc->w.hPen); HPenToBrushObj(&PenBrushObj, dc->Dc_Attr.hpen);
/* Number of points for the circle is 4 * sqrt(2) * Radius, start /* Number of points for the circle is 4 * sqrt(2) * Radius, start
and end line have at most Radius points, so allocate at least and end line have at most Radius points, so allocate at least
@ -1030,7 +1030,7 @@ IntRectangle(PDC dc,
DestRect.top = TopRect; DestRect.top = TopRect;
DestRect.bottom = BottomRect; DestRect.bottom = BottomRect;
FillBrushObj = BRUSHOBJ_LockBrush(dc->w.hBrush); FillBrushObj = BRUSHOBJ_LockBrush(dc->Dc_Attr.hbrush);
if ( FillBrushObj ) if ( FillBrushObj )
{ {
@ -1054,7 +1054,7 @@ IntRectangle(PDC dc,
BRUSHOBJ_UnlockBrush(FillBrushObj); BRUSHOBJ_UnlockBrush(FillBrushObj);
/* get BRUSHOBJ from current pen. */ /* get BRUSHOBJ from current pen. */
PenBrushObj = PENOBJ_LockPen(dc->w.hPen); PenBrushObj = PENOBJ_LockPen(dc->Dc_Attr.hpen);
if (PenBrushObj == NULL) if (PenBrushObj == NULL)
{ {
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
@ -1070,7 +1070,7 @@ IntRectangle(PDC dc,
if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)) if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
{ {
Mix = ROP2_TO_MIX(dc->w.ROPmode); Mix = ROP2_TO_MIX(dc->Dc_Attr.jROP2);
ret = ret && IntEngLineTo(&BitmapObj->SurfObj, ret = ret && IntEngLineTo(&BitmapObj->SurfObj,
dc->CombinedClip, dc->CombinedClip,
&PenBrushInst.BrushObject, &PenBrushInst.BrushObject,
@ -1195,7 +1195,7 @@ IntRoundRect(
return FALSE; return FALSE;
} }
FillBrushObj = BRUSHOBJ_LockBrush(dc->w.hBrush); FillBrushObj = BRUSHOBJ_LockBrush(dc->Dc_Attr.hbrush);
if (FillBrushObj) if (FillBrushObj)
{ {
if (FillBrushObj->flAttrs & GDIBRUSH_IS_NULL) if (FillBrushObj->flAttrs & GDIBRUSH_IS_NULL)
@ -1210,7 +1210,7 @@ IntRoundRect(
} }
} }
PenBrushObj = PENOBJ_LockPen(dc->w.hPen); PenBrushObj = PENOBJ_LockPen(dc->Dc_Attr.hpen);
if (PenBrushObj) if (PenBrushObj)
{ {
if (PenBrushObj->flAttrs & GDIBRUSH_IS_NULL) if (PenBrushObj->flAttrs & GDIBRUSH_IS_NULL)

View file

@ -100,7 +100,7 @@ IntGdiLineTo(DC *dc,
Bounds.bottom = max(Points[0].y, Points[1].y); Bounds.bottom = max(Points[0].y, Points[1].y);
/* get BRUSHOBJ from current pen. */ /* get BRUSHOBJ from current pen. */
PenBrushObj = PENOBJ_LockPen( dc->w.hPen ); PenBrushObj = PENOBJ_LockPen( dc->Dc_Attr.hpen );
/* FIXME - PenBrushObj can be NULL!!!! Don't assert here! */ /* FIXME - PenBrushObj can be NULL!!!! Don't assert here! */
ASSERT(PenBrushObj); ASSERT(PenBrushObj);
@ -113,7 +113,7 @@ IntGdiLineTo(DC *dc,
Points[0].x, Points[0].y, Points[0].x, Points[0].y,
Points[1].x, Points[1].y, Points[1].x, Points[1].y,
&Bounds, &Bounds,
ROP2_TO_MIX(dc->w.ROPmode)); ROP2_TO_MIX(dc->Dc_Attr.jROP2));
} }
BITMAPOBJ_UnlockBitmap ( BitmapObj ); BITMAPOBJ_UnlockBitmap ( BitmapObj );
@ -204,7 +204,7 @@ IntGdiPolyline(DC *dc,
return PATH_Polyline(dc, pt, Count); return PATH_Polyline(dc, pt, Count);
/* Get BRUSHOBJ from current pen. */ /* Get BRUSHOBJ from current pen. */
PenBrushObj = PENOBJ_LockPen(dc->w.hPen); PenBrushObj = PENOBJ_LockPen(dc->Dc_Attr.hpen);
/* FIXME - PenBrushObj can be NULL! Don't assert here! */ /* FIXME - PenBrushObj can be NULL! Don't assert here! */
ASSERT(PenBrushObj); ASSERT(PenBrushObj);
@ -230,7 +230,7 @@ IntGdiPolyline(DC *dc,
IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen); IntGdiInitBrushInstance(&PenBrushInst, PenBrushObj, dc->XlatePen);
Ret = IntEngPolyline(&BitmapObj->SurfObj, dc->CombinedClip, Ret = IntEngPolyline(&BitmapObj->SurfObj, dc->CombinedClip,
&PenBrushInst.BrushObject, Points, Count, &PenBrushInst.BrushObject, Points, Count,
ROP2_TO_MIX(dc->w.ROPmode)); ROP2_TO_MIX(dc->Dc_Attr.jROP2));
BITMAPOBJ_UnlockBitmap(BitmapObj); BITMAPOBJ_UnlockBitmap(BitmapObj);
EngFreeMem(Points); EngFreeMem(Points);

View file

@ -284,7 +284,7 @@ NtGdiPathToRegion(HDC hDC)
else else
{ {
/* FIXME: Should we empty the path even if conversion failed? */ /* FIXME: Should we empty the path even if conversion failed? */
if(PATH_PathToRegion(pPath, pDc->w.polyFillMode, &hrgnRval)) if(PATH_PathToRegion(pPath, pDc->Dc_Attr.jFillMode, &hrgnRval))
PATH_EmptyPath(pPath); PATH_EmptyPath(pPath);
} }
@ -364,7 +364,7 @@ BOOL STDCALL NtGdiSelectClipPath(HDC hDC,
return FALSE; return FALSE;
} }
/* Construct a region from the path */ /* Construct a region from the path */
else if( PATH_PathToRegion( &dc->w.path, dc->w.polyFillMode, &hrgnPath ) ) else if( PATH_PathToRegion( &dc->w.path, dc->Dc_Attr.jFillMode, &hrgnPath ) )
{ {
success = IntGdiExtSelectClipRgn( dc, hrgnPath, Mode ) != ERROR; success = IntGdiExtSelectClipRgn( dc, hrgnPath, Mode ) != ERROR;
NtGdiDeleteObject( hrgnPath ); NtGdiDeleteObject( hrgnPath );
@ -404,7 +404,7 @@ PATH_FillPath( PDC dc, GdiPath *pPath )
return FALSE; return FALSE;
} }
if( PATH_PathToRegion( pPath, dc->w.polyFillMode, &hrgn )) if( PATH_PathToRegion( pPath, dc->Dc_Attr.jFillMode, &hrgn ))
{ {
/* Since PaintRgn interprets the region as being in logical coordinates /* Since PaintRgn interprets the region as being in logical coordinates
* but the points we store for the path are already in device * but the points we store for the path are already in device
@ -1115,7 +1115,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 */ /* In GM_COMPATIBLE, don't include bottom and right edges */
if(dc->w.GraphicsMode==GM_COMPATIBLE) if(dc->Dc_Attr.iGraphicsMode==GM_COMPATIBLE)
{ {
corners[1].x--; corners[1].x--;
corners[1].y--; corners[1].y--;
@ -1478,7 +1478,7 @@ BOOL FASTCALL PATH_StrokePath(DC *dc, GdiPath *pPath)
return FALSE; return FALSE;
/* Save the mapping mode info */ /* Save the mapping mode info */
mapMode=dc->w.MapMode; mapMode=dc->Dc_Attr.iMapMode;
IntGetViewportExtEx(dc, &szViewportExt); IntGetViewportExtEx(dc, &szViewportExt);
IntGetViewportOrgEx(dc, &ptViewportOrg); IntGetViewportOrgEx(dc, &ptViewportOrg);
IntGetWindowExtEx(dc, &szWindowExt); IntGetWindowExtEx(dc, &szWindowExt);
@ -1486,15 +1486,15 @@ BOOL FASTCALL PATH_StrokePath(DC *dc, GdiPath *pPath)
xform = dc->w.xformWorld2Wnd; xform = dc->w.xformWorld2Wnd;
/* Set MM_TEXT */ /* Set MM_TEXT */
dc->w.MapMode = MM_TEXT; dc->Dc_Attr.iMapMode = MM_TEXT;
dc->vportOrgX = 0; dc->vportOrgX = 0;
dc->vportOrgY = 0; dc->vportOrgY = 0;
dc->wndOrgX = 0; dc->wndOrgX = 0;
dc->wndOrgY = 0; dc->wndOrgY = 0;
graphicsMode = dc->w.GraphicsMode; graphicsMode = dc->Dc_Attr.iGraphicsMode;
dc->w.GraphicsMode = GM_ADVANCED; dc->Dc_Attr.iGraphicsMode = GM_ADVANCED;
IntGdiModifyWorldTransform(dc, &xform, MWT_IDENTITY); IntGdiModifyWorldTransform(dc, &xform, MWT_IDENTITY);
dc->w.GraphicsMode = graphicsMode; dc->Dc_Attr.iGraphicsMode = graphicsMode;
/* Allocate enough memory for the worst case without beziers (one PT_MOVETO /* 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 * and the rest PT_LINETO with PT_CLOSEFIGURE at the end) plus some buffer
@ -1599,7 +1599,7 @@ end:
if(pLinePts)ExFreePool(pLinePts); if(pLinePts)ExFreePool(pLinePts);
/* Restore the old mapping mode */ /* Restore the old mapping mode */
dc->w.MapMode = mapMode; dc->Dc_Attr.iMapMode = mapMode;
dc->wndExtX = szWindowExt.cx; dc->wndExtX = szWindowExt.cx;
dc->wndExtY = szWindowExt.cy; dc->wndExtY = szWindowExt.cy;
dc->wndOrgX = ptWindowOrg.x; dc->wndOrgX = ptWindowOrg.x;

View file

@ -578,7 +578,7 @@ FillPolygon(
if (NULL == list) if (NULL == list)
return FALSE; return FALSE;
if ( WINDING == dc->w.polyFillMode ) if ( WINDING == dc->Dc_Attr.jFillMode )
FillScanLine = POLYGONFILL_FillScanLineWinding; FillScanLine = POLYGONFILL_FillScanLineWinding;
else /* default */ else /* default */
FillScanLine = POLYGONFILL_FillScanLineAlternate; FillScanLine = POLYGONFILL_FillScanLineAlternate;

View file

@ -1855,7 +1855,7 @@ BOOL FASTCALL REGION_LPTODP(HDC hdc, HRGN hDest, HRGN hSrc)
if(!dc) if(!dc)
return ret; return ret;
if(dc->w.MapMode == MM_TEXT) // Requires only a translation if(dc->Dc_Attr.iMapMode == MM_TEXT) // Requires only a translation
{ {
if(NtGdiCombineRgn(hDest, hSrc, 0, RGN_COPY) == ERROR) if(NtGdiCombineRgn(hDest, hSrc, 0, RGN_COPY) == ERROR)
goto done; goto done;
@ -2570,7 +2570,7 @@ NtGdiPaintRgn(HDC hDC,
(PRECTL)visrgn->Buffer, (PRECTL)visrgn->Buffer,
(PRECTL)&visrgn->rdh.rcBound ); (PRECTL)&visrgn->rdh.rcBound );
ASSERT( ClipRegion ); ASSERT( ClipRegion );
pBrush = BRUSHOBJ_LockBrush(dc->w.hBrush); pBrush = BRUSHOBJ_LockBrush(dc->Dc_Attr.hbrush);
ASSERT(pBrush); ASSERT(pBrush);
IntGdiInitBrushInstance(&BrushInst, pBrush, dc->XlateBrush); IntGdiInitBrushInstance(&BrushInst, pBrush, dc->XlateBrush);

View file

@ -1697,7 +1697,7 @@ NtGdiExtTextOut(
{ {
goto fail; goto fail;
} }
hBrushFg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.textColor), 0); hBrushFg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->Dc_Attr.crForegroundClr), 0);
if ( !hBrushFg ) if ( !hBrushFg )
{ {
goto fail; goto fail;
@ -1708,9 +1708,9 @@ NtGdiExtTextOut(
goto fail; goto fail;
} }
IntGdiInitBrushInstance(&BrushFgInst, BrushFg, NULL); IntGdiInitBrushInstance(&BrushFgInst, BrushFg, NULL);
if ((fuOptions & ETO_OPAQUE) || dc->w.backgroundMode == OPAQUE) if ((fuOptions & ETO_OPAQUE) || dc->Dc_Attr.jBkMode == OPAQUE)
{ {
hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->w.backgroundColor), 0); hBrushBg = NtGdiCreateSolidBrush(XLATEOBJ_iXlate(XlateObj, dc->Dc_Attr.crBackgroundClr), 0);
if ( !hBrushBg ) if ( !hBrushBg )
{ {
goto fail; goto fail;
@ -1758,13 +1758,13 @@ NtGdiExtTextOut(
} }
else else
{ {
if (dc->w.backgroundMode == OPAQUE) if (dc->Dc_Attr.jBkMode == OPAQUE)
{ {
fuOptions |= ETO_OPAQUE; fuOptions |= ETO_OPAQUE;
} }
} }
TextObj = TEXTOBJ_LockText(dc->w.hFont); TextObj = TEXTOBJ_LockText(dc->Dc_Attr.hlfntNew);
if(TextObj == NULL) if(TextObj == NULL)
{ {
goto fail; goto fail;
@ -1827,9 +1827,9 @@ NtGdiExtTextOut(
* Process the vertical alignment and determine the yoff. * Process the vertical alignment and determine the yoff.
*/ */
if (dc->w.textAlign & TA_BASELINE) if (dc->Dc_Attr.lTextAlign & TA_BASELINE)
yoff = 0; yoff = 0;
else if (dc->w.textAlign & TA_BOTTOM) else if (dc->Dc_Attr.lTextAlign & TA_BOTTOM)
yoff = -face->size->metrics.descender >> 6; yoff = -face->size->metrics.descender >> 6;
else /* TA_TOP */ else /* TA_TOP */
yoff = face->size->metrics.ascender >> 6; yoff = face->size->metrics.ascender >> 6;
@ -1841,7 +1841,7 @@ NtGdiExtTextOut(
* Process the horizontal alignment and modify XStart accordingly. * Process the horizontal alignment and modify XStart accordingly.
*/ */
if (dc->w.textAlign & (TA_RIGHT | TA_CENTER)) if (dc->Dc_Attr.lTextAlign & (TA_RIGHT | TA_CENTER))
{ {
ULONGLONG TextWidth = 0; ULONGLONG TextWidth = 0;
LPCWSTR TempText = String; LPCWSTR TempText = String;
@ -1905,7 +1905,7 @@ NtGdiExtTextOut(
previous = 0; previous = 0;
if (dc->w.textAlign & TA_RIGHT) if (dc->Dc_Attr.lTextAlign & TA_RIGHT)
{ {
RealXStart -= TextWidth; RealXStart -= TextWidth;
} }
@ -2205,7 +2205,7 @@ NtGdiGetCharABCWidths(HDC hDC,
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE; return FALSE;
} }
hFont = dc->w.hFont; hFont = dc->Dc_Attr.hlfntNew;
TextObj = TEXTOBJ_LockText(hFont); TextObj = TEXTOBJ_LockText(hFont);
DC_UnlockDc(dc); DC_UnlockDc(dc);
@ -2349,7 +2349,7 @@ NtGdiGetCharWidth32(HDC hDC,
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE; return FALSE;
} }
hFont = dc->w.hFont; hFont = dc->Dc_Attr.hlfntNew;
TextObj = TEXTOBJ_LockText(hFont); TextObj = TEXTOBJ_LockText(hFont);
DC_UnlockDc(dc); DC_UnlockDc(dc);
@ -2515,7 +2515,7 @@ NtGdiGetGlyphOutline(
return GDI_ERROR; return GDI_ERROR;
} }
eM11 = dc->w.xformWorld2Vport.eM11; eM11 = dc->w.xformWorld2Vport.eM11;
hFont = dc->w.hFont; hFont = dc->Dc_Attr.hlfntNew;
TextObj = TEXTOBJ_LockText(hFont); TextObj = TEXTOBJ_LockText(hFont);
DC_UnlockDc(dc); DC_UnlockDc(dc);
if (!TextObj) if (!TextObj)
@ -3138,7 +3138,7 @@ NtGdiGetOutlineTextMetricsInternalW (HDC hDC,
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
return 0; return 0;
} }
hFont = dc->w.hFont; hFont = dc->Dc_Attr.hlfntNew;
TextObj = TEXTOBJ_LockText(hFont); TextObj = TEXTOBJ_LockText(hFont);
DC_UnlockDc(dc); DC_UnlockDc(dc);
if (TextObj == NULL) if (TextObj == NULL)
@ -3217,7 +3217,7 @@ NtGdiGetTextCharsetInfo(
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
return Ret; return Ret;
} }
hFont = Dc->w.hFont; hFont = Dc->Dc_Attr.hlfntNew;
TextObj = TEXTOBJ_LockText(hFont); TextObj = TEXTOBJ_LockText(hFont);
DC_UnlockDc( Dc ); DC_UnlockDc( Dc );
if ( TextObj == NULL) if ( TextObj == NULL)
@ -3493,7 +3493,7 @@ NtGdiGetTextExtentExW(
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE; return FALSE;
} }
TextObj = TEXTOBJ_LockText(dc->w.hFont); TextObj = TEXTOBJ_LockText(dc->Dc_Attr.hlfntNew);
if ( TextObj ) if ( TextObj )
{ {
Result = TextIntGetTextExtentPoint(dc, TextObj, String, Count, MaxExtent, Result = TextIntGetTextExtentPoint(dc, TextObj, String, Count, MaxExtent,
@ -3621,7 +3621,7 @@ NtGdiGetTextExtentPoint32(HDC hDC,
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE; return FALSE;
} }
TextObj = TEXTOBJ_LockText(dc->w.hFont); TextObj = TEXTOBJ_LockText(dc->Dc_Attr.hlfntNew);
if ( TextObj != NULL ) if ( TextObj != NULL )
{ {
Result = TextIntGetTextExtentPoint ( Result = TextIntGetTextExtentPoint (
@ -3671,7 +3671,7 @@ NtGdiGetTextFaceW(
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE; return FALSE;
} }
hFont = Dc->w.hFont; hFont = Dc->Dc_Attr.hlfntNew;
DC_UnlockDc(Dc); DC_UnlockDc(Dc);
TextObj = TEXTOBJ_LockText(hFont); TextObj = TEXTOBJ_LockText(hFont);
@ -3721,7 +3721,7 @@ NtGdiGetTextMetricsW(
return FALSE; return FALSE;
} }
TextObj = TEXTOBJ_LockText(dc->w.hFont); TextObj = TEXTOBJ_LockText(dc->Dc_Attr.hlfntNew);
if (NULL != TextObj) if (NULL != TextObj)
{ {
FontGDI = ObjToGDI(TextObj->Font, FONT); FontGDI = ObjToGDI(TextObj->Font, FONT);
@ -3842,8 +3842,8 @@ NtGdiSetTextAlign(HDC hDC,
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
return GDI_ERROR; return GDI_ERROR;
} }
prevAlign = dc->w.textAlign; prevAlign = dc->Dc_Attr.lTextAlign;
dc->w.textAlign = Mode; dc->Dc_Attr.lTextAlign = Mode;
DC_UnlockDc( dc ); DC_UnlockDc( dc );
return prevAlign; return prevAlign;
} }
@ -3863,9 +3863,9 @@ NtGdiSetTextColor(HDC hDC,
return CLR_INVALID; return CLR_INVALID;
} }
oldColor = dc->w.textColor; oldColor = dc->Dc_Attr.crForegroundClr;
dc->w.textColor = color; dc->Dc_Attr.crForegroundClr = color;
hBrush = dc->w.hBrush; hBrush = dc->Dc_Attr.hbrush;
DC_UnlockDc( dc ); DC_UnlockDc( dc );
NtGdiSelectObject(hDC, hBrush); NtGdiSelectObject(hDC, hBrush);
return oldColor; return oldColor;
@ -3901,7 +3901,7 @@ NtGdiGetFontData(
SetLastWin32Error(ERROR_INVALID_HANDLE); SetLastWin32Error(ERROR_INVALID_HANDLE);
return GDI_ERROR; return GDI_ERROR;
} }
hFont = Dc->w.hFont; hFont = Dc->Dc_Attr.hlfntNew;
TextObj = TEXTOBJ_LockText(hFont); TextObj = TEXTOBJ_LockText(hFont);
DC_UnlockDc(Dc); DC_UnlockDc(Dc);
@ -4196,8 +4196,8 @@ NtGdiGetSetTextCharExtra( HDC hDC, INT CharExtra, BOOL Set)
return Ret; return Ret;
} }
DPRINT("TextCharacterExtra %d", CharExtra); DPRINT("TextCharacterExtra %d", CharExtra);
Ret = dc->w.charExtra; Ret = dc->Dc_Attr.lTextExtra;
if( Set ) dc->w.charExtra = CharExtra; if( Set ) dc->Dc_Attr.lTextExtra = CharExtra;
DC_UnlockDc(dc); DC_UnlockDc(dc);
return (Ret); return (Ret);
} }