Author: fireball
Date: Sun Aug 2 19:06:38 2009
New Revision: 42340
URL:
http://svn.reactos.org/svn/reactos?rev=42340&view=rev
Log:
- Move GDIPOINTER inside DEVOBJ, where it belongs.
- Bring in and use mouse safety functions from trunk.
Modified:
branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c
branches/arwinss/reactos/subsystems/win32/win32k/include/devobj.h
branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h
branches/arwinss/reactos/subsystems/win32/win32k/include/surfobj.h
branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h
Modified: branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/eng/engpoint.c [iso-8859-1] Sun Aug
2 19:06:38 2009
@@ -17,7 +17,6 @@
/* PUBLIC FUNCTIONS **********************************************************/
-GDIPOINTER Pointer;
POINTL ptlPointer;
VOID
@@ -33,7 +32,7 @@
ASSERT(ppdev);
ASSERT(psoDest);
- pgp = &Pointer;
+ pgp = &ppdev->Pointer;
if (!pgp->Enabled)
{
@@ -83,8 +82,7 @@
ASSERT(ppdev);
ASSERT(psoDest);
-
- pgp = &Pointer;
+ pgp = &ppdev->Pointer;
if (pgp->Enabled)
{
@@ -169,6 +167,91 @@
ROP3_TO_ROP4(SRCINVERT),
FALSE);
}
+}
+
+/*
+ * FUNCTION: Notify the mouse driver that drawing is about to begin in
+ * a rectangle on a particular surface.
+ */
+INT FASTCALL
+MouseSafetyOnDrawStart(SURFOBJ *pso,
+ LONG HazardX1,
+ LONG HazardY1,
+ LONG HazardX2,
+ LONG HazardY2)
+{
+ LONG tmp;
+ PDEVOBJ *ppdev;
+ GDIPOINTER *pgp;
+
+ ASSERT(pso != NULL);
+
+ ppdev = GDIDEV(pso);
+ if (!ppdev) return FALSE;
+
+ pgp = &ppdev->Pointer;
+
+ if (pgp->Exclude.right == -1)
+ return FALSE;
+
+ ppdev->SafetyRemoveCount++;
+
+ if (ppdev->SafetyRemoveLevel != 0)
+ return FALSE;
+
+ if (HazardX1 > HazardX2)
+ {
+ tmp = HazardX2;
+ HazardX2 = HazardX1;
+ HazardX1 = tmp;
+ }
+ if (HazardY1 > HazardY2)
+ {
+ tmp = HazardY2;
+ HazardY2 = HazardY1;
+ HazardY1 = tmp;
+ }
+
+ if (pgp->Exclude.right >= HazardX1
+ && pgp->Exclude.left <= HazardX2
+ && pgp->Exclude.bottom >= HazardY1
+ && pgp->Exclude.top <= HazardY2)
+ {
+ ppdev->SafetyRemoveLevel = ppdev->SafetyRemoveCount;
+ ppdev->pfnMovePointer(pso, -1, -1, NULL);
+ }
+
+ return TRUE;
+}
+
+/*
+ * FUNCTION: Notify the mouse driver that drawing has finished on a surface.
+ */
+INT FASTCALL
+MouseSafetyOnDrawEnd(SURFOBJ *pso)
+{
+ PDEVOBJ *ppdev;
+ GDIPOINTER *pgp;
+
+ ASSERT(pso != NULL);
+
+ ppdev = (PDEVOBJ*)pso->hdev;
+
+ if (!ppdev) return FALSE;
+
+ pgp = &ppdev->Pointer;
+
+ if (pgp->Exclude.right == -1)
+ return FALSE;
+
+ if (--ppdev->SafetyRemoveCount >= ppdev->SafetyRemoveLevel)
+ return FALSE;
+
+ ppdev->pfnMovePointer(pso, ptlPointer.x, ptlPointer.y, &pgp->Exclude);
+
+ ppdev->SafetyRemoveLevel = 0;
+
+ return TRUE;
}
/*
@@ -197,7 +280,7 @@
ASSERT(pso);
ppdev = GDIDEV(pso);
- pgp = &Pointer;
+ pgp = &ppdev->Pointer;
IntHideMousePointer(ppdev, pso);
@@ -386,7 +469,7 @@
ppdev = GDIDEV(pso);
ASSERT(ppdev);
- pgp = &Pointer;
+ pgp = &ppdev->Pointer;
IntHideMousePointer(ppdev, pso);
Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/devobj.h
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/include/devobj.h [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/include/devobj.h [iso-8859-1] Sun Aug
2 19:06:38 2009
@@ -17,8 +17,13 @@
};
ULONG DisplayNumber;
DEVMODEW DMW;
- PFILE_OBJECT VideoFileObject;
+ PFILE_OBJECT VideoFileObject;
BOOLEAN PreparedDriver;
+ GDIPOINTER Pointer;
+ /* Stuff to keep track of software cursors; win32k gdi part */
+ UINT SafetyRemoveLevel; /* at what level was the cursor removed?
+ 0 for not removed */
+ UINT SafetyRemoveCount;
} PDEVOBJ, *PPDEVOBJ;
extern PPDEVOBJ pPrimarySurface;
Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/include/gre.h [iso-8859-1] Sun Aug 2
19:06:38 2009
@@ -212,6 +212,8 @@
BRUSHOBJ* pbo, LONG x, LONG y, LONG deltax, LONG deltay,
POINTL* Translate);
+/* Mouse pointer */
+
BOOL NTAPI
GreSetCursor(ICONINFO* NewCursor, PSYSTEM_CURSORINFO CursorInfo);
@@ -222,5 +224,14 @@
LONG y,
RECTL *prcl);
+INT FASTCALL
+MouseSafetyOnDrawStart(SURFOBJ *pso,
+ LONG HazardX1,
+ LONG HazardY1,
+ LONG HazardX2,
+ LONG HazardY2);
+
+INT FASTCALL
+MouseSafetyOnDrawEnd(SURFOBJ *pso);
#endif
Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/surfobj.h
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/include/surfobj.h [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/include/surfobj.h [iso-8859-1] Sun
Aug 2 19:06:38 2009
@@ -45,7 +45,4 @@
#define SURFACE_LockBitmapBits(x)
#define SURFACE_UnlockBitmapBits(x)
-#define MouseSafetyOnDrawStart(srf, a, b, c, d)
-#define MouseSafetyOnDrawEnd(srf)
-
#endif
Modified: branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/include/win32kp.h [iso-8859-1] Sun
Aug 2 19:06:38 2009
@@ -36,6 +36,7 @@
/* Eng and GRE stuff */
#include <driver.h>
#include <engevent.h>
+#include <cursor.h>
#include <devobj.h>
#include <gdiobj.h>
#include <surfobj.h>
@@ -46,7 +47,6 @@
#include <floatobj.h>
#include <xformobj.h>
#include <xlateobj.h>
-#include <cursor.h>
#include <gre.h>
#include <monitor.h>