Move gdi functions to dcattr. Tested Qemu with AbiWord.

svn path=/trunk/; revision=30572
This commit is contained in:
James Tabor
2007-11-19 02:48:25 +00:00
parent 502b2e6106
commit effad19afc
4 changed files with 17 additions and 50 deletions
+2 -1
View File
@@ -194,13 +194,14 @@ ModifyWorldTransform(
return FALSE;
}
}
#endif
PDC_ATTR Dc_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE;
/* Check that graphics mode is GM_ADVANCED */
if ( Dc_Attr->iGraphicsMode != GM_ADVANCED ) return FALSE;
#endif
return NtGdiModifyWorldTransform(hDC, (CONST LPXFORM) Xform, iMode);
}
+7 -37
View File
@@ -327,7 +327,6 @@ DeleteObject(HGDIOBJ hObject)
case GDI_OBJECT_TYPE_EXTPEN:
case GDI_OBJECT_TYPE_PEN:
{
#if 0
PBRUSH_ATTR Brh_Attr;
PTEB pTeb;
@@ -351,7 +350,6 @@ DeleteObject(HGDIOBJ hObject)
if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush();
return TRUE;
}
#endif
break;
}
case GDI_OBJECT_TYPE_BITMAP:
@@ -750,13 +748,10 @@ GetDCBrushColor(
HDC hdc
)
{
//#if 0
PDC_ATTR Dc_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return CLR_INVALID;
return (COLORREF) Dc_Attr->ulPenClr;
//#endif
return NtUserGetDCBrushColor(hdc);
}
/*
@@ -768,13 +763,10 @@ GetDCPenColor(
HDC hdc
)
{
//#if 0
PDC_ATTR Dc_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return CLR_INVALID;
return (COLORREF) Dc_Attr->ulPenClr;
//#endif
return NtUserGetDCPenColor(hdc);
}
/*
@@ -787,7 +779,6 @@ SetDCBrushColor(
COLORREF crColor
)
{
//#if 0
PDC_ATTR Dc_Attr;
COLORREF OldColor = CLR_INVALID;
@@ -804,8 +795,6 @@ SetDCBrushColor(
}
}
return OldColor;
//#endif
return NtUserSetDCBrushColor(hdc, crColor);
}
/*
@@ -818,7 +807,6 @@ SetDCPenColor(
COLORREF crColor
)
{
//#if 0
PDC_ATTR Dc_Attr;
COLORREF OldColor = CLR_INVALID;
@@ -835,8 +823,7 @@ SetDCPenColor(
}
}
return OldColor;
//#endif
return NtUserSetDCPenColor(hdc, crColor);
// return NtUserSetDCPenColor(hdc, crColor);
}
/*
@@ -849,7 +836,6 @@ SetTextColor(
COLORREF crColor
)
{
#if 0
PDC_ATTR Dc_Attr;
COLORREF OldColor = CLR_INVALID;
@@ -883,8 +869,7 @@ SetTextColor(
Dc_Attr->crForegroundClr = crColor;
}
return OldColor;
#endif
return NtGdiSetTextColor(hdc, crColor);
// return NtGdiSetTextColor(hdc, crColor);
}
/*
@@ -897,7 +882,6 @@ SetBkColor(
COLORREF crColor
)
{
#if 0
PDC_ATTR Dc_Attr;
COLORREF OldColor = CLR_INVALID;
@@ -931,8 +915,7 @@ SetBkColor(
Dc_Attr->crBackgroundClr = crColor;
}
return OldColor;
#endif
return NtGdiSetBkColor(hdc, crColor);
// return NtGdiSetBkColor(hdc, crColor);
}
/*
@@ -1087,22 +1070,18 @@ GetViewportExtEx(
LPSIZE lpSize
)
{
#if 0
PDC_ATTR Dc_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE;
if ( Dc_Attr->flXform & PAGE_EXTENTS_CHANGED ) // Something was updated, go to kernel.
#endif
return NtGdiGetDCPoint( hdc, GdiGetViewPortExt, (LPPOINT) lpSize );
#if 0
return NtGdiGetDCPoint( hdc, GdiGetViewPortExt, (LPPOINT) lpSize );
else
{
lpSize->cx = Dc_Attr->szlViewportExt.cx;
lpSize->cy = Dc_Attr->szlViewportExt.cy;
}
return TRUE;
#endif
}
@@ -1113,16 +1092,13 @@ GetViewportOrgEx(
LPPOINT lpPoint
)
{
#if 0
PDC_ATTR Dc_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE;
lpPoint->x = Dc_Attr->ptlViewportOrg.x;
lpPoint->x = Dc_Attr->ptlViewportOrg.x;
return TRUE;
#endif
// Do it this way for now.
return NtGdiGetDCPoint( hdc, GdiGetViewPortOrg, lpPoint );
// return NtGdiGetDCPoint( hdc, GdiGetViewPortOrg, lpPoint );
}
@@ -1133,16 +1109,13 @@ GetWindowExtEx(
LPSIZE lpSize
)
{
#if 0
PDC_ATTR Dc_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE;
lpSize->cx = Dc_Attr->szlWindowExt.cx;
lpSize->cy = Dc_Attr->szlWindowExt.cy;
return TRUE;
#endif
// Do it this way for now.
return NtGdiGetDCPoint( hdc, GdiGetWindowExt, (LPPOINT) lpSize );
// return NtGdiGetDCPoint( hdc, GdiGetWindowExt, (LPPOINT) lpSize );
}
@@ -1153,16 +1126,13 @@ GetWindowOrgEx(
LPPOINT lpPoint
)
{
#if 0
PDC_ATTR Dc_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE;
lpPoint->x = Dc_Attr->ptlWindowOrg.x;
lpPoint->x = Dc_Attr->ptlWindowOrg.x;
return TRUE;
#endif
// Do it this way for now.
return NtGdiGetDCPoint( hdc, GdiGetWindowOrg, lpPoint );
//return NtGdiGetDCPoint( hdc, GdiGetWindowOrg, lpPoint );
}
/* FIXME: include correct header */
+2 -2
View File
@@ -41,8 +41,6 @@ MoveToEx( HDC hDC, INT x, INT y, LPPOINT Point )
{
PDC_ATTR Dc_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE;
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
@@ -62,6 +60,8 @@ MoveToEx( HDC hDC, INT x, INT y, LPPOINT Point )
}
}
if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE;
if ( Point )
{
if ( Dc_Attr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit!
+6 -10
View File
@@ -70,14 +70,11 @@ GetTextCharacterExtra(
HDC hDc
)
{
#if 0
PDC_ATTR Dc_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hDc, (PVOID) &Dc_Attr)) return 0;
return Dc_Attr->lTextExtra;
#endif
// Do it this way for now.
return GetDCDWord( hDc, GdiGetTextCharExtra, 0);
// return GetDCDWord( hDc, GdiGetTextCharExtra, 0);
}
@@ -432,7 +429,7 @@ SetTextCharacterExtra(
)
{
INT cExtra = 0x80000000;
// PDC_ATTR Dc_Attr;
PDC_ATTR Dc_Attr;
if (CharExtra == cExtra)
{
@@ -444,9 +441,10 @@ SetTextCharacterExtra(
{
return MFDRV_SetTextCharacterExtra( hDC, CharExtra ); // Wine port.
}
#endif
if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return cExtra;
if (NtCurrentTeb()->GdiTebBatch.HDC == hDC)
if (NtCurrentTeb()->GdiTebBatch.HDC == (ULONG)hDC)
{
if (Dc_Attr->ulDirty_ & DC_FONTTEXT_DIRTY)
{
@@ -456,10 +454,8 @@ SetTextCharacterExtra(
}
cExtra = Dc_Attr->lTextExtra;
Dc_Attr->lTextExtra = CharExtra;
return cExrta;
#endif
// Do this for now.
return GetAndSetDCDWord( hDC, GdiGetSetTextCharExtra, CharExtra, 0, 0, 0 );
return cExtra;
// return GetAndSetDCDWord( hDC, GdiGetSetTextCharExtra, CharExtra, 0, 0, 0 );
}