rename framebuf_acc to framebufacc to make rbuild happy
authorMagnus Olsen <magnus@greatlord.com>
Thu, 1 Nov 2007 20:32:39 +0000 (20:32 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Thu, 1 Nov 2007 20:32:39 +0000 (20:32 +0000)
implement hw support for DrvMovePointer, it mean if a driver have this function implement our framebufacc will use it

svn path=/trunk/; revision=30049

12 files changed:
reactos/drivers/video/displays/directory.rbuild
reactos/drivers/video/displays/framebufacc/dd.c [moved from reactos/drivers/video/displays/framebuf_acc/dd.c with 100% similarity]
reactos/drivers/video/displays/framebufacc/ddenable.c [moved from reactos/drivers/video/displays/framebuf_acc/ddenable.c with 100% similarity]
reactos/drivers/video/displays/framebufacc/enable.c [moved from reactos/drivers/video/displays/framebuf_acc/enable.c with 100% similarity]
reactos/drivers/video/displays/framebufacc/framebuf_acc.def [moved from reactos/drivers/video/displays/framebuf_acc/framebuf_acc.def with 100% similarity]
reactos/drivers/video/displays/framebufacc/framebuf_acc.h [moved from reactos/drivers/video/displays/framebuf_acc/framebuf_acc.h with 98% similarity]
reactos/drivers/video/displays/framebufacc/framebuf_acc.rbuild [moved from reactos/drivers/video/displays/framebuf_acc/framebuf_acc.rbuild with 100% similarity]
reactos/drivers/video/displays/framebufacc/framebuf_acc.rc [moved from reactos/drivers/video/displays/framebuf_acc/framebuf_acc.rc with 100% similarity]
reactos/drivers/video/displays/framebufacc/palette.c [moved from reactos/drivers/video/displays/framebuf_acc/palette.c with 100% similarity]
reactos/drivers/video/displays/framebufacc/pointer.c [moved from reactos/drivers/video/displays/framebuf_acc/pointer.c with 52% similarity]
reactos/drivers/video/displays/framebufacc/screen.c [moved from reactos/drivers/video/displays/framebuf_acc/screen.c with 100% similarity]
reactos/drivers/video/displays/framebufacc/surface.c [moved from reactos/drivers/video/displays/framebuf_acc/surface.c with 99% similarity]

index eb65085..a377938 100644 (file)
@@ -4,6 +4,9 @@
        <directory name="framebuf">
                <xi:include href="framebuf/framebuf.rbuild" />
        </directory>
+       <directory name="framebufacc">
+               <xi:include href="framebufacc/framebuf_acc.rbuild" />
+       </directory>
        <directory name="vga">
                <xi:include href="vga/vgaddi.rbuild" />
        </directory>
@@ -52,6 +52,9 @@ typedef struct _PDEV
    BYTE PaletteShift;
    PVOID ScreenPtr;
 
+   /* Vitual desktop stuff */
+   POINTL ScreenOffsetXY;
+
    /* Palette data */
    HPALETTE DefaultPalette;
    PALETTEENTRY *PaletteEntries;
@@ -1,7 +1,7 @@
 /*
  * ReactOS Generic Framebuffer display driver
  *
- * Copyright (C) 2004 Filip Navara
+ * Copyright (C) 2007 Magnus Olsen
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
 #include "framebuf_acc.h"
 
 
+/*
+ * DrvMovePointer
+ *
+ * Moves the pointer to a new position and ensures that GDI does not interfere
+ * with the display of the pointer.
+ *
+ * Status
+ *    @implemented
+ */
+
+VOID APIENTRY
+DrvMovePointer(IN SURFOBJ *pso,
+               IN LONG x,
+               IN LONG y,
+               IN RECTL *prcl)
+{
+    PPDEV ppdev = (PPDEV) pso->dhpdev;
+    DWORD returnedDataLength;
+    VIDEO_POINTER_POSITION NewPointerPosition;
+
+    x -= ppdev->ScreenOffsetXY.x;
+    y -= ppdev->ScreenOffsetXY.y;
+
+    /* position of (-1,-1) hide the pointer */
+    if ((x == -1) || (y == -1))
+    {
+        if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER, NULL, 0, NULL, 0, &returnedDataLength))
+        {
+            /* hw did not disable the mouse, we try then with software */
+            EngMovePointer(pso, x, y, prcl);
+        }
+    }
+    else
+    {
+        /* Calc the mouse positions and set it to the new positions */
+        NewPointerPosition.Column = (SHORT) x - (SHORT) (ppdev->PointerHotSpot.x);
+        NewPointerPosition.Row    = (SHORT) y - (SHORT) (ppdev->PointerHotSpot.y);
+
+        if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_SET_POINTER_POSITION, &NewPointerPosition,
+                               sizeof(VIDEO_POINTER_POSITION), NULL, 0, &returnedDataLength))
+        {
+            /* hw did not disable the mouse, we try then with software */
+            EngMovePointer(pso, x, y, prcl);
+        }
+    }
+}
+
 
 /*
  * DrvSetPointerShape
@@ -48,24 +95,6 @@ DrvSetPointerShape(
    return EngSetPointerShape(pso, psoMask, psoColor, pxlo, xHot, yHot, x, y, prcl, fl);
 }
 
-/*
- * DrvMovePointer
- *
- * Moves the pointer to a new position and ensures that GDI does not interfere
- * with the display of the pointer.
- *
- * Status
- *    @unimplemented
- */
 
-VOID APIENTRY
-DrvMovePointer(
-   IN SURFOBJ *pso,
-   IN LONG x,
-   IN LONG y,
-   IN RECTL *prcl)
-{
-   return EngMovePointer(pso, x, y, prcl);
-}
 
 
@@ -155,6 +155,9 @@ DrvEnableSurface(
        return FALSE;
    }
 
+   /* Rest the desktop vitual position */
+   ppdev->ScreenOffsetXY = {0,0};
+
 
    switch (ppdev->BitsPerPixel)
    {