Author: jimtabor
Date: Sat Aug 4 11:37:27 2007
New Revision: 28150
URL:
http://svn.reactos.org/svn/reactos?rev=28150&view=rev
Log:
Dc.c :
- Update Get/SetDCBrush/PenColor code.
* Added dcattr sync flags to Set functions.
* if'ed out, does compile.
Painting.c :
- Update LP to DP to LP code.
* Added update flags for Xforms, the best way I understand them.
* if'ed out.
- Moved Fixme line down and above GetDCObject.
Modified:
trunk/reactos/dll/win32/gdi32/objects/dc.c
trunk/reactos/dll/win32/gdi32/objects/painting.c
trunk/reactos/include/psdk/wingdi.h
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 Sat Aug 4 11:37:27 2007
@@ -544,6 +544,12 @@
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);
}
@@ -556,6 +562,12 @@
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);
}
@@ -569,6 +581,24 @@
COLORREF crColor
)
{
+#if 0
+ PDC_ATTR Dc_Attr;
+ COLORREF OldColor = CLR_INVALID;
+
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor;
+ else
+ {
+ OldColor = (COLORREF) Dc_Attr->ulBrushClr;
+ Dc_Attr->ulBrushClr = (ULONG) crColor;
+
+ if ( Dc_Attr->crBrushClr != crColor ) // if same, don't force a copy.
+ {
+ Dc_Attr->ulDirty_ |= DIRTY_FILL;
+ Dc_Attr->crBrushClr = crColor;
+ }
+ }
+ return OldColor;
+#endif
return NtUserSetDCBrushColor(hdc, crColor);
}
@@ -582,6 +612,24 @@
COLORREF crColor
)
{
+#if 0
+ PDC_ATTR Dc_Attr;
+ COLORREF OldColor = CLR_INVALID;
+
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return OldColor;
+ else
+ {
+ OldColor = (COLORREF) Dc_Attr->ulPenClr;
+ Dc_Attr->ulPenClr = (ULONG) crColor;
+
+ if ( Dc_Attr->crPenClr != crColor )
+ {
+ Dc_Attr->ulDirty_ |= DIRTY_LINE;
+ Dc_Attr->crPenClr = crColor;
+ }
+ }
+ return OldColor;
+#endif
return NtUserSetDCPenColor(hdc, crColor);
}
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 Sat Aug 4 11:37:27 2007
@@ -18,7 +18,6 @@
__asm fistp out
#endif
-#if 0 /* FIXME: enable this as soon as we have working usermode gdi */
LONG
FASTCALL
EFtoF( EFLOAT_S * efp)
@@ -93,14 +92,26 @@
STDCALL
DPtoLP ( HDC hDC, LPPOINT Points, INT Count )
{
+#if 0
INT i;
PDC_ATTR Dc_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE;
- for ( i = 0; i < Count; i++ )
- CoordCnvP ( &Dc_Attr->mxDevicetoWorld, &Points[i] );
+ if (Dc_Attr->flXform & ( DEVICE_TO_WORLD_INVALID | // Force a full
recalibration!
+ PAGE_XLATE_CHANGED | // Changes or Updates have been
made,
+ PAGE_EXTENTS_CHANGED | // do processing in kernel space.
+ WORLD_XFORM_CHANGED )
+#endif
+ return NtGdiTransformPoints( hDC, Points, Points, Count, 0); // Last is 0 or 2
+#if 0
+ else
+ {
+ for ( i = 0; i < Count; i++ )
+ CoordCnvP ( &Dc_Attr->mxDevicetoWorld, &Points[i] );
+ }
return TRUE;
+#endif
}
@@ -108,16 +119,28 @@
STDCALL
LPtoDP ( HDC hDC, LPPOINT Points, INT Count )
{
+#if 0
INT i;
PDC_ATTR Dc_Attr;
if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE;
- for ( i = 0; i < Count; i++ )
- CoordCnvP ( &Dc_Attr->mxWorldToDevice, &Points[i] );
+ if (Dc_Attr->flXform & ( PAGE_XLATE_CHANGED | // Check for Changes and
Updates
+ PAGE_EXTENTS_CHANGED |
+ WORLD_XFORM_CHANGED )
+#endif
+ return NtGdiTransformPoints( hDC, Points, Points, Count, 0);
+#if 0
+ else
+ {
+ for ( i = 0; i < Count; i++ )
+ CoordCnvP ( &Dc_Attr->mxWorldToDevice, &Points[i] );
+ }
return TRUE;
-}
-
+#endif
+}
+
+#if 0 /* FIXME: enable this as soon as we have working usermode gdi */
// Will move to dc.c
HGDIOBJ
Modified: trunk/reactos/include/psdk/wingdi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wingdi.h?rev=…
==============================================================================
--- trunk/reactos/include/psdk/wingdi.h (original)
+++ trunk/reactos/include/psdk/wingdi.h Sat Aug 4 11:37:27 2007
@@ -2753,6 +2753,10 @@
BOOL WINAPI GetCurrentPositionEx(HDC,LPPOINT);
HCURSOR WINAPI GetCursor(void);
BOOL WINAPI GetDCOrgEx(HDC,LPPOINT);
+#if (_WIN32_WINNT >= 0x0500)
+COLORREF WINAPI GetDCBrushColor(HDC);
+COLORREF WINAPI GetDCPenColor(HDC);
+#endif
int WINAPI GetDeviceCaps(HDC,int);
BOOL WINAPI GetDeviceGammaRamp(HDC,PVOID);
UINT WINAPI GetDIBColorTable(HDC,UINT,UINT,RGBQUAD*);