Author: jimtabor
Date: Mon Nov 19 05:48:25 2007
New Revision: 30572
URL:
http://svn.reactos.org/svn/reactos?rev=30572&view=rev
Log:
Move gdi functions to dcattr. Tested Qemu with AbiWord.
Modified:
trunk/reactos/dll/win32/gdi32/objects/coord.c
trunk/reactos/dll/win32/gdi32/objects/dc.c
trunk/reactos/dll/win32/gdi32/objects/painting.c
trunk/reactos/dll/win32/gdi32/objects/text.c
Modified: trunk/reactos/dll/win32/gdi32/objects/coord.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/co…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/coord.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/coord.c Mon Nov 19 05:48:25 2007
@@ -194,13 +194,14 @@
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);
}
Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/dc.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/dc.c Mon Nov 19 05:48:25 2007
@@ -327,7 +327,6 @@
case GDI_OBJECT_TYPE_EXTPEN:
case GDI_OBJECT_TYPE_PEN:
{
-#if 0
PBRUSH_ATTR Brh_Attr;
PTEB pTeb;
@@ -351,7 +350,6 @@
if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush();
return TRUE;
}
-#endif
break;
}
case GDI_OBJECT_TYPE_BITMAP:
@@ -750,13 +748,10 @@
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 @@
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 @@
COLORREF crColor
)
{
-//#if 0
PDC_ATTR Dc_Attr;
COLORREF OldColor = CLR_INVALID;
@@ -804,8 +795,6 @@
}
}
return OldColor;
-//#endif
- return NtUserSetDCBrushColor(hdc, crColor);
}
/*
@@ -818,7 +807,6 @@
COLORREF crColor
)
{
-//#if 0
PDC_ATTR Dc_Attr;
COLORREF OldColor = CLR_INVALID;
@@ -835,8 +823,7 @@
}
}
return OldColor;
-//#endif
- return NtUserSetDCPenColor(hdc, crColor);
+// return NtUserSetDCPenColor(hdc, crColor);
}
/*
@@ -849,7 +836,6 @@
COLORREF crColor
)
{
-#if 0
PDC_ATTR Dc_Attr;
COLORREF OldColor = CLR_INVALID;
@@ -883,8 +869,7 @@
Dc_Attr->crForegroundClr = crColor;
}
return OldColor;
-#endif
- return NtGdiSetTextColor(hdc, crColor);
+// return NtGdiSetTextColor(hdc, crColor);
}
/*
@@ -897,7 +882,6 @@
COLORREF crColor
)
{
-#if 0
PDC_ATTR Dc_Attr;
COLORREF OldColor = CLR_INVALID;
@@ -931,8 +915,7 @@
Dc_Attr->crBackgroundClr = crColor;
}
return OldColor;
-#endif
- return NtGdiSetBkColor(hdc, crColor);
+// return NtGdiSetBkColor(hdc, crColor);
}
/*
@@ -1087,22 +1070,18 @@
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 @@
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 @@
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 @@
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 */
Modified: trunk/reactos/dll/win32/gdi32/objects/painting.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/pa…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/painting.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/painting.c Mon Nov 19 05:48:25 2007
@@ -41,26 +41,26 @@
{
PDC_ATTR Dc_Attr;
+ if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
+ {
+ if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
+ return MFDRV_MetaParam2( hDC, META_MOVETO, x, y);
+ else
+ {
+ PLDC pLDC = Dc_Attr->pvLDC;
+ if ( !pLDC )
+ {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+ if (pLDC->iType == LDC_EMFLDC)
+ {
+ if (!EMFDRV_MoveTo( hDC, x, y)) return FALSE;
+ }
+ }
+ }
+
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)
- return MFDRV_MetaParam2( hDC, META_MOVETO, x, y);
- else
- {
- PLDC pLDC = Dc_Attr->pvLDC;
- if ( !pLDC )
- {
- SetLastError(ERROR_INVALID_HANDLE);
- return FALSE;
- }
- if (pLDC->iType == LDC_EMFLDC)
- {
- if (!EMFDRV_MoveTo( hDC, x, y)) return FALSE;
- }
- }
- }
if ( Point )
{
Modified: trunk/reactos/dll/win32/gdi32/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/te…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/text.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/text.c Mon Nov 19 05:48:25 2007
@@ -70,14 +70,11 @@
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 @@
)
{
INT cExtra = 0x80000000;
-// PDC_ATTR Dc_Attr;
+ PDC_ATTR Dc_Attr;
if (CharExtra == cExtra)
{
@@ -444,9 +441,10 @@
{
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 @@
}
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 );
+}
+
+