Author: jimtabor
Date: Mon Nov 26 21:47:21 2007
New Revision: 30783
URL:
http://svn.reactos.org/svn/reactos?rev=30783&view=rev
Log:
Removed NtGdi/GetCurrentPositionEx/MoveToEx, update all related files.
Modified:
trunk/reactos/dll/win32/gdi32/misc/hacks.c
trunk/reactos/dll/win32/gdi32/misc/stubs.c
trunk/reactos/dll/win32/gdi32/objects/coord.c
trunk/reactos/dll/win32/gdi32/objects/painting.c
trunk/reactos/include/reactos/win32k/ntgdibad.h
trunk/reactos/subsystems/win32/win32k/objects/dc.c
trunk/reactos/subsystems/win32/win32k/objects/dcutil.c
trunk/reactos/subsystems/win32/win32k/objects/line.c
trunk/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: trunk/reactos/dll/win32/gdi32/misc/hacks.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/hacks…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/hacks.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/hacks.c Mon Nov 26 21:47:21 2007
@@ -118,20 +118,6 @@
*/
BOOL
STDCALL
-MoveToEx(HDC hdc,
- int X,
- int Y,
- LPPOINT lpPoint)
-{
- return NtGdiMoveToEx(hdc, X, Y, lpPoint);
-}
-
-/*
- * @implemented
- *
- */
-BOOL
-STDCALL
OffsetViewportOrgEx(HDC hdc,
int nXOffset,
int nYOffset,
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Mon Nov 26 21:47:21 2007
@@ -2339,20 +2339,6 @@
return NtGdiGetDeviceCaps(hdc,i);
}
-
-/*
- * @implemented
- *
- */
-BOOL
-STDCALL
-GetCurrentPositionEx(HDC hdc,
- LPPOINT lpPoint)
-{
- /* FIXME some part need be done in user mode */
- return NtGdiGetCurrentPositionEx(hdc, lpPoint);
-}
-
/*
* @implemented
*
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 26 21:47:21 2007
@@ -142,6 +142,43 @@
#endif
}
+/*
+ * @implemented
+ *
+ */
+BOOL
+STDCALL
+GetCurrentPositionEx(HDC hdc,
+ LPPOINT lpPoint)
+{
+ PDC_ATTR Dc_Attr;
+
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, (PVOID) &Dc_Attr)) return FALSE;
+
+ if ( lpPoint )
+ {
+ if ( Dc_Attr->ulDirty_ & DIRTY_PTLCURRENT ) // have a hit!
+ {
+ lpPoint->x = Dc_Attr->ptfxCurrent.x;
+ lpPoint->y = Dc_Attr->ptfxCurrent.y;
+ DPtoLP ( hdc, lpPoint, 1); // reconvert back.
+ Dc_Attr->ptlCurrent.x = lpPoint->x; // save it
+ Dc_Attr->ptlCurrent.y = lpPoint->y;
+ Dc_Attr->ulDirty_ &= ~DIRTY_PTLCURRENT; // clear bit
+ }
+ else
+ {
+ lpPoint->x = Dc_Attr->ptlCurrent.x;
+ lpPoint->y = Dc_Attr->ptlCurrent.y;
+ }
+ }
+ else
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
+ }
+ return TRUE;
+}
/*
* @implemented
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 26 21:47:21 2007
@@ -33,14 +33,13 @@
return NtGdiLineTo( hDC, x, y);
}
-#if 0 /* FIXME: enable this as soon as we have working usermode gdi */
BOOL
STDCALL
MoveToEx( HDC hDC, INT x, INT y, LPPOINT Point )
{
PDC_ATTR Dc_Attr;
-
+#if 0
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
if (GDI_HANDLE_GET_TYPE(hDC) == GDI_OBJECT_TYPE_METADC)
@@ -59,7 +58,7 @@
}
}
}
-
+#endif
if (!GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr)) return FALSE;
if ( Point )
@@ -80,10 +79,11 @@
Dc_Attr->ptlCurrent.x = x;
Dc_Attr->ptlCurrent.y = y;
- Dc_Attr->ulDirty_ |= ( DIRTY_PTLCURRENT|DIRTY_STYLESTATE); // Set dirty
+ Dc_Attr->ulDirty_ &= ~DIRTY_PTLCURRENT;
+ Dc_Attr->ulDirty_ |= ( DIRTY_PTFXCURRENT|DIRTY_STYLESTATE); // Set dirty
return TRUE;
}
-#endif
+
/*
* @implemented
Modified: trunk/reactos/include/reactos/win32k/ntgdibad.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdibad.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdibad.h Mon Nov 26 21:47:21 2007
@@ -201,12 +201,6 @@
STDCALL
NtGdiGetColorSpace(HDC hDC);
-/* Should be done in user mode. */
-BOOL STDCALL NtGdiGetCurrentPositionEx(HDC hDC, LPPOINT currentPosition);
-
-/* Use NtGdiGetDCPoint with GdiGetDCOrg. */
-BOOL STDCALL NtGdiGetDCOrgEx(HDC hDC, LPPOINT Point);
-
/* Meta are user-mode. */
HENHMETAFILE
STDCALL
@@ -311,14 +305,6 @@
/* Needs to be done in user-mode. */
BOOL STDCALL NtGdiGetWindowOrgEx(HDC hDC, LPPOINT windowOrg);
-
-/* Needs to be done in user-mode. */
-BOOL
-STDCALL
-NtGdiMoveToEx(HDC hDC,
- int X,
- int Y,
- LPPOINT Point);
/* Needs to be done in user-mode. */
BOOL
Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Mon Nov 26 21:47:21 2007
@@ -1224,6 +1224,7 @@
newdc->w.DCOrgY = dc->w.DCOrgY;
#endif
nDc_Attr->ptlCurrent = Dc_Attr->ptlCurrent;
+ nDc_Attr->ptfxCurrent = Dc_Attr->ptfxCurrent;
newdc->w.ArcDirection = dc->w.ArcDirection;
newdc->w.xformWorld2Wnd = dc->w.xformWorld2Wnd;
newdc->w.xformWorld2Vport = dc->w.xformWorld2Vport;
@@ -1296,6 +1297,7 @@
dc->w.DCOrgY = dcs->w.DCOrgY;
#endif
Dc_Attr->ptlCurrent = sDc_Attr->ptlCurrent;
+ Dc_Attr->ptfxCurrent = sDc_Attr->ptfxCurrent;
dc->w.ArcDirection = dcs->w.ArcDirection;
dc->w.xformWorld2Wnd = dcs->w.xformWorld2Wnd;
dc->w.xformWorld2Vport = dcs->w.xformWorld2Vport;
Modified: trunk/reactos/subsystems/win32/win32k/objects/dcutil.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dcutil.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dcutil.c Mon Nov 26 21:47:21 2007
@@ -156,7 +156,6 @@
DC_GET_VAL_EX( GetViewportOrgEx, ptlViewportOrg.x, ptlViewportOrg.y, POINT, x, y )
DC_GET_VAL_EX( GetWindowExtEx, szlWindowExt.cx, szlWindowExt.cy, SIZE, cx, cy )
DC_GET_VAL_EX( GetWindowOrgEx, ptlWindowOrg.x, ptlWindowOrg.y, POINT, x, y )
-DC_GET_VAL_EX ( GetCurrentPositionEx, ptlCurrent.x, ptlCurrent.y, POINT, x, y )
DC_SET_MODE( NtGdiSetPolyFillMode, jFillMode, ALTERNATE, WINDING )
DC_SET_MODE( NtGdiSetROP2, jROP2, R2_BLACK, R2_WHITE )
Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/line.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/line.c Mon Nov 26 21:47:21 2007
@@ -24,7 +24,8 @@
// Some code from the WINE project source (
www.winehq.com)
-
+// Should use Fx in Point
+//
BOOL FASTCALL
IntGdiMoveToEx(DC *dc,
int X,
@@ -36,11 +37,23 @@
if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
if ( Point )
{
- Point->x = Dc_Attr->ptlCurrent.x;
- Point->y = Dc_Attr->ptlCurrent.y;
+ if ( Dc_Attr->ulDirty_ & DIRTY_PTLCURRENT ) // Double hit!
+ {
+ Point->x = Dc_Attr->ptfxCurrent.x; // ret prev before change.
+ Point->y = Dc_Attr->ptfxCurrent.y;
+ IntDPtoLP ( dc, Point, 1); // reconvert back.
+ }
+ else
+ {
+ Point->x = Dc_Attr->ptlCurrent.x;
+ Point->y = Dc_Attr->ptlCurrent.y;
+ }
}
Dc_Attr->ptlCurrent.x = X;
Dc_Attr->ptlCurrent.y = Y;
+ Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
+ IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
PathIsOpen = PATH_IsPathOpen(dc->w.path);
@@ -48,6 +61,27 @@
return PATH_MoveTo ( dc );
return TRUE;
+}
+
+// Should use Fx in pt
+//
+VOID FASTCALL
+IntGetCurrentPositionEx(PDC dc, LPPOINT pt)
+{
+ PDC_ATTR Dc_Attr = dc->pDc_Attr;
+ if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
+
+ if ( pt )
+ {
+ if (Dc_Attr->ulDirty_ & DIRTY_PTFXCURRENT)
+ {
+ Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
+ IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ Dc_Attr->ulDirty_ &= ~(DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
+ }
+ pt->x = Dc_Attr->ptlCurrent.x;
+ pt->y = Dc_Attr->ptlCurrent.y;
+ }
}
BOOL FASTCALL
@@ -73,6 +107,9 @@
// FIXME - PATH_LineTo should maybe do this...
Dc_Attr->ptlCurrent.x = XEnd;
Dc_Attr->ptlCurrent.y = YEnd;
+ Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
+ IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ Dc_Attr->ulDirty_ &=
~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
}
return Ret;
}
@@ -128,6 +165,9 @@
{
Dc_Attr->ptlCurrent.x = XEnd;
Dc_Attr->ptlCurrent.y = YEnd;
+ Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
+ IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ Dc_Attr->ulDirty_ &=
~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
}
return Ret;
@@ -189,6 +229,9 @@
{
Dc_Attr->ptlCurrent.x = pt[Count-1].x;
Dc_Attr->ptlCurrent.y = pt[Count-1].y;
+ Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
+ IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
}
return ret;
@@ -283,6 +326,9 @@
{
Dc_Attr->ptlCurrent.x = pt[Count-1].x;
Dc_Attr->ptlCurrent.y = pt[Count-1].y;
+ Dc_Attr->ptfxCurrent = Dc_Attr->ptlCurrent;
+ IntLPtoDP(dc, &Dc_Attr->ptfxCurrent, 1); // Update fx
+ Dc_Attr->ulDirty_ &= ~(DIRTY_PTLCURRENT|DIRTY_PTFXCURRENT|DIRTY_STYLESTATE);
}
return ret;
@@ -359,61 +405,6 @@
DC_UnlockDc(dc);
return Ret;
}
-
-BOOL
-STDCALL
-NtGdiMoveToEx(HDC hDC,
- int X,
- int Y,
- LPPOINT Point)
-{
- DC *dc;
- POINT SafePoint;
- NTSTATUS Status = STATUS_SUCCESS;
- BOOL Ret;
-
- dc = DC_LockDc(hDC);
- if(!dc)
- {
- SetLastWin32Error(ERROR_INVALID_HANDLE);
- return FALSE;
- }
- if (dc->IsIC)
- {
- DC_UnlockDc(dc);
- /* Yes, Windows really returns TRUE in this case */
- return TRUE;
- }
-
- Ret = IntGdiMoveToEx(dc, X, Y, (Point ? &SafePoint : NULL));
-
- if(Point)
- {
- _SEH_TRY
- {
- ProbeForWrite(Point,
- sizeof(POINT),
- 1);
- *Point = SafePoint;
- }
- _SEH_HANDLE
- {
- Status = _SEH_GetExceptionCode();
- }
- _SEH_END;
-
- if(!NT_SUCCESS(Status))
- {
- DC_UnlockDc(dc);
- SetLastNtError(Status);
- return FALSE;
- }
- }
-
- DC_UnlockDc(dc);
- return Ret;
-}
-
BOOL
APIENTRY
Modified: trunk/reactos/subsystems/win32/win32k/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/w3…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/w32ksvc.db (original)
+++ trunk/reactos/subsystems/win32/win32k/w32ksvc.db Mon Nov 26 21:47:21 2007
@@ -740,7 +740,6 @@
NtGdiGdiComment 3
NtGdiGetAspectRatioFilterEx 2
NtGdiGetColorSpace 1
-NtGdiGetCurrentPositionEx 2
NtGdiGetEnhMetaFile 1
NtGdiGetEnhMetaFileBits 3
NtGdiGetEnhMetaFileDescription 3
@@ -757,7 +756,6 @@
NtGdiGetPolyFillMode 1
NtGdiGetStretchBltMode 1
NtGdiGetTextExtentPoint32 4
-NtGdiMoveToEx 4
NtGdiOffsetViewportOrgEx 4
NtGdiOffsetWindowOrgEx 4
NtGdiPlayEnhMetaFile 3