Author: greatlrd
Date: Fri Nov 2 03:03:02 2007
New Revision: 30059
URL:
http://svn.reactos.org/svn/reactos?rev=30059&view=rev
Log:
rename framebuf_acc.* to framebufacc.* for rbuild can not handle _, forget about that
implement DrvSetPointerShape, left todo is the copy process for mono and color pointer
data before it is completed.
Added:
trunk/reactos/drivers/video/displays/framebufacc/framebufacc.def
- copied unchanged from r30049,
trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.def
trunk/reactos/drivers/video/displays/framebufacc/framebufacc.h
- copied, changed from r30049,
trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.h
trunk/reactos/drivers/video/displays/framebufacc/framebufacc.rbuild
- copied, changed from r30050,
trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rbuild
trunk/reactos/drivers/video/displays/framebufacc/framebufacc.rc
- copied unchanged from r30049,
trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rc
Removed:
trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.def
trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.h
trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rbuild
trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rc
Modified:
trunk/reactos/drivers/video/displays/framebufacc/enable.c
trunk/reactos/drivers/video/displays/framebufacc/palette.c
trunk/reactos/drivers/video/displays/framebufacc/pointer.c
trunk/reactos/drivers/video/displays/framebufacc/screen.c
trunk/reactos/drivers/video/displays/framebufacc/surface.c
Modified: trunk/reactos/drivers/video/displays/framebufacc/enable.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebufacc/enable.c (original)
+++ trunk/reactos/drivers/video/displays/framebufacc/enable.c Fri Nov 2 03:03:02 2007
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "framebuf_acc.h"
+#include "framebufacc.h"
static DRVFN DrvFunctionTable[] =
{
Removed: trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.def (original)
+++ trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.def (removed)
@@ -1,3 +1,0 @@
-LIBRARY framebuf.dll
-EXPORTS
-DrvEnableDriver@12
Removed: trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.h (original)
+++ trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.h (removed)
@@ -1,190 +1,0 @@
-/*
- * ReactOS Generic Framebuffer display driver
- *
- * Copyright (C) 2004 Filip Navara
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef FRAMEBUF_H
-#define FRAMEBUF_H
-
-#include <stdarg.h>
-#include <windef.h>
-#include <guiddef.h>
-#include <wingdi.h>
-#include <winddi.h>
-#include <winioctl.h>
-#include <ntddvdeo.h>
-
-
-//#define EXPERIMENTAL_ACC_SUPPORT
-
-typedef struct _PDEV
-{
- /* Driver stuff */
- HANDLE hDriver;
- HDEV hDevEng;
- HSURF hSurfEng;
- ULONG dwHooks;
-
- /* Screen Data */
- ULONG ModeIndex;
- ULONG ScreenWidth;
- ULONG ScreenHeight;
- ULONG ScreenDelta;
- BYTE BitsPerPixel;
- ULONG RedMask;
- ULONG GreenMask;
- ULONG BlueMask;
- BYTE PaletteShift;
- PVOID ScreenPtr;
-
- /* Vitual desktop stuff */
- POINTL ScreenOffsetXY;
-
- /* Palette data */
- HPALETTE DefaultPalette;
- PALETTEENTRY *PaletteEntries;
-
- /* hw mouse acclartions support */
- VIDEO_POINTER_CAPABILITIES PointerCapabilities;
- PVIDEO_POINTER_ATTRIBUTES pPointerAttributes;
- ULONG PointerAttributesSize;
- POINTL PointerHotSpot;
- BOOL HwMouseActive;
-
-#ifdef EXPERIMENTAL_MOUSE_CURSOR_SUPPORT
- XLATEOBJ *PointerXlateObject;
- HSURF PointerColorSurface;
- HSURF PointerMaskSurface;
- HSURF PointerSaveSurface;
-
-#endif
-
- /* DirectX Support */
- DWORD iDitherFormat;
- ULONG MemHeight;
- ULONG MemWidth;
- DWORD dwHeap;
- VIDEOMEMORY* pvmList;
- BOOL bDDInitialized;
- DDPIXELFORMAT ddpfDisplay;
-
- /* System Cached data */
- PVOID pVideoMemCache;
- PVOID pRealVideoMem;
-
- /* Avail Video memory from Current Screen and the end range */
- ULONG VideoMemSize;
-
-} PDEV, *PPDEV;
-
-#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
-
-#define DEVICE_NAME L"framebuf"
-#define ALLOC_TAG TAG('F','B','U','F')
-
-
-DHPDEV APIENTRY
-DrvEnablePDEV(
- IN DEVMODEW *pdm,
- IN LPWSTR pwszLogAddress,
- IN ULONG cPat,
- OUT HSURF *phsurfPatterns,
- IN ULONG cjCaps,
- OUT ULONG *pdevcaps,
- IN ULONG cjDevInfo,
- OUT DEVINFO *pdi,
- IN HDEV hdev,
- IN LPWSTR pwszDeviceName,
- IN HANDLE hDriver);
-
-VOID APIENTRY
-DrvCompletePDEV(
- IN DHPDEV dhpdev,
- IN HDEV hdev);
-
-VOID APIENTRY
-DrvDisablePDEV(
- IN DHPDEV dhpdev);
-
-HSURF APIENTRY
-DrvEnableSurface(
- IN DHPDEV dhpdev);
-
-VOID APIENTRY
-DrvDisableSurface(
- IN DHPDEV dhpdev);
-
-BOOL APIENTRY
-DrvAssertMode(
- IN DHPDEV dhpdev,
- IN BOOL bEnable);
-
-ULONG APIENTRY
-DrvGetModes(
- IN HANDLE hDriver,
- IN ULONG cjSize,
- OUT DEVMODEW *pdm);
-
-BOOL APIENTRY
-DrvSetPalette(
- IN DHPDEV dhpdev,
- IN PALOBJ *ppalo,
- IN FLONG fl,
- IN ULONG iStart,
- IN ULONG cColors);
-
-ULONG APIENTRY
-DrvSetPointerShape(
- IN SURFOBJ *pso,
- IN SURFOBJ *psoMask,
- IN SURFOBJ *psoColor,
- IN XLATEOBJ *pxlo,
- IN LONG xHot,
- IN LONG yHot,
- IN LONG x,
- IN LONG y,
- IN RECTL *prcl,
- IN FLONG fl);
-
-VOID APIENTRY
-DrvMovePointer(
- IN SURFOBJ *pso,
- IN LONG x,
- IN LONG y,
- IN RECTL *prcl);
-
-BOOL
-IntInitScreenInfo(
- PPDEV ppdev,
- LPDEVMODEW pDevMode,
- PGDIINFO pGdiInfo,
- PDEVINFO pDevInfo);
-
-BOOL
-IntInitDefaultPalette(
- PPDEV ppdev,
- PDEVINFO pDevInfo);
-
-BOOL APIENTRY
-IntSetPalette(
- IN DHPDEV dhpdev,
- IN PPALETTEENTRY ppalent,
- IN ULONG iStart,
- IN ULONG cColors);
-
-#endif /* FRAMEBUF_H */
Removed: trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rbuild (original)
+++ trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rbuild (removed)
@@ -1,14 +1,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
-<module name="framebufacc" type="kernelmodedll"
entrypoint="_DrvEnableDriver@12" installbase="system32"
installname="framebuf.dll">
- <importlibrary definition="framebuf_acc.def" />
- <include base="framebuf_acc">.</include>
- <library>win32k</library>
- <library>libcntpr</library>
- <file>enable.c</file>
- <file>palette.c</file>
- <file>pointer.c</file>
- <file>screen.c</file>
- <file>surface.c</file>
- <file>framebuf_acc.rc</file>
-</module>
Removed: trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rc (original)
+++ trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rc (removed)
@@ -1,5 +1,0 @@
-#define REACTOS_VERSION_DLL
-#define REACTOS_STR_FILE_DESCRIPTION "Framebuffer Display Driver\0"
-#define REACTOS_STR_INTERNAL_NAME "framebuf\0"
-#define REACTOS_STR_ORIGINAL_FILENAME "framebuf.dll\0"
-#include <reactos/version.rc>
Copied: trunk/reactos/drivers/video/displays/framebufacc/framebufacc.h (from r30049,
trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.h)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.h (original)
+++ trunk/reactos/drivers/video/displays/framebufacc/framebufacc.h Fri Nov 2 03:03:02
2007
@@ -91,6 +91,9 @@
ULONG VideoMemSize;
} PDEV, *PPDEV;
+
+
+
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
@@ -187,4 +190,14 @@
IN ULONG iStart,
IN ULONG cColors);
+BOOL
+CopyMonoPointer(PPDEV ppdev,
+ SURFOBJ *pso);
+
+BOOL
+CopyColorPointer(PPDEV ppdev,
+ SURFOBJ *psoMask,
+ SURFOBJ *psoColor,
+ XLATEOBJ *pxlo);
+
#endif /* FRAMEBUF_H */
Copied: trunk/reactos/drivers/video/displays/framebufacc/framebufacc.rbuild (from r30050,
trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rbuild)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebufacc/framebuf_acc.rbuild (original)
+++ trunk/reactos/drivers/video/displays/framebufacc/framebufacc.rbuild Fri Nov 2
03:03:02 2007
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
<module name="framebufacc" type="kernelmodedll"
entrypoint="_DrvEnableDriver@12" installbase="system32"
installname="framebuf.dll">
- <importlibrary definition="framebuf_acc.def" />
- <include base="framebuf_acc">.</include>
+ <importlibrary definition="framebufacc.def" />
+ <include base="framebufacc">.</include>
<library>win32k</library>
<library>libcntpr</library>
<file>enable.c</file>
@@ -10,5 +10,5 @@
<file>pointer.c</file>
<file>screen.c</file>
<file>surface.c</file>
- <file>framebuf_acc.rc</file>
+ <file>framebufacc.rc</file>
</module>
Modified: trunk/reactos/drivers/video/displays/framebufacc/palette.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebufacc/palette.c (original)
+++ trunk/reactos/drivers/video/displays/framebufacc/palette.c Fri Nov 2 03:03:02 2007
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "framebuf_acc.h"
+#include "framebufacc.h"
/*
* Standard color that must be in palette, because they're used for
Modified: trunk/reactos/drivers/video/displays/framebufacc/pointer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebufacc/pointer.c (original)
+++ trunk/reactos/drivers/video/displays/framebufacc/pointer.c Fri Nov 2 03:03:02 2007
@@ -18,7 +18,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "framebuf_acc.h"
+#include "framebufacc.h"
+
/*
@@ -75,7 +76,7 @@
* Sets the new pointer shape.
*
* Status
- * @unimplemented
+ * @implemented
*/
ULONG APIENTRY
@@ -91,10 +92,135 @@
IN RECTL *prcl,
IN FLONG fl)
{
-/* return SPS_DECLINE;*/
- return EngSetPointerShape(pso, psoMask, psoColor, pxlo, xHot, yHot, x, y, prcl, fl);
-}
-
-
-
-
+ PPDEV ppdev = (PPDEV) pso->dhpdev;
+ ULONG returnedDataLength = 0;
+
+ if (ppdev->pPointerAttributes == NULL)
+ {
+ /* hw did not support hw mouse pointer, we try then with software */
+ return EngSetPointerShape(pso, psoMask, psoColor, pxlo, xHot, yHot, x, y, prcl,
fl);
+ }
+
+ /* check see if the apps ask to hide the mouse or not */
+ if (psoMask == (SURFOBJ *) NULL)
+ {
+ if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER, NULL, 0,
NULL, 0, &returnedDataLength))
+ {
+ /* no hw support found for the mouse we try then the software version */
+ return EngSetPointerShape(pso, psoMask, psoColor, pxlo, xHot, yHot, x, y,
prcl, fl);
+ }
+
+ return TRUE;
+ }
+
+ /* set our hotspot */
+ ppdev->PointerHotSpot.x = xHot;
+ ppdev->PointerHotSpot.y = yHot;
+
+ /* Set the hw mouse shape */
+
+ if (psoColor != (SURFOBJ *) NULL)
+ {
+ /* We got a color mouse pointer */
+ if ((ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER)
&&
+ (CopyColorPointer(ppdev, psoMask, psoColor, pxlo)) )
+ {
+ ppdev->pPointerAttributes->Flags |= VIDEO_MODE_COLOR_POINTER;
+ }
+ else
+ {
+ /* No color mouse pointer being set, so we need try the software version then
*/
+ if (ppdev->HwMouseActive)
+ {
+ ppdev->HwMouseActive = FALSE;
+ if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER,
NULL, 0, NULL, 0, &returnedDataLength))
+ {
+ /* hw did not support hw mouse pointer, we try then with software */
+ return EngSetPointerShape(pso, psoMask, psoColor, pxlo, xHot, yHot,
x, y, prcl, fl);
+ }
+ }
+ return SPS_DECLINE ;
+ }
+ }
+ else
+ {
+ /* We got a mono mouse pointer */
+ if ( (ppdev->PointerCapabilities.Flags & VIDEO_MODE_MONO_POINTER)
&&
+ (CopyMonoPointer(ppdev, psoMask)))
+ {
+ ppdev->pPointerAttributes->Flags |= VIDEO_MODE_MONO_POINTER;
+ }
+ else
+ {
+ /* No mono mouse pointer being set, so we need try the software version then
*/
+ if (ppdev->HwMouseActive)
+ {
+ ppdev->HwMouseActive = FALSE;
+ if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER,
NULL, 0, NULL, 0, &returnedDataLength))
+ {
+ /* hw did not support hw mouse pointer, we try then with software */
+ return EngSetPointerShape(pso, psoMask, psoColor, pxlo, xHot, yHot,
x, y, prcl, fl);
+ }
+ }
+ return SPS_DECLINE ;
+ }
+ }
+
+ /* we goto hw mouse pointer then we contnue filling in more info */
+
+ /* calc the mouse point positions */
+ if ((x != -1) || (y != -1))
+ {
+ ppdev->pPointerAttributes->Column -= (SHORT)(ppdev->PointerHotSpot.x);
+ ppdev->pPointerAttributes->Row -= (SHORT)(ppdev->PointerHotSpot.y);
+ }
+
+ /* set correct flags if it animated or need be updated anime or no flags at all */
+ if (fl & SPS_ANIMATESTART)
+ {
+ ppdev->pPointerAttributes->Flags |= VIDEO_MODE_ANIMATE_START;
+ }
+ else if (fl & SPS_ANIMATEUPDATE)
+ {
+ ppdev->pPointerAttributes->Flags |= VIDEO_MODE_ANIMATE_UPDATE;
+ }
+
+ ppdev->pPointerAttributes->Enable = 1;
+ ppdev->pPointerAttributes->Column = (SHORT)(x);
+ ppdev->pPointerAttributes->Row = (SHORT)(y);
+
+ /* Set the new mouse pointer shape */
+ if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_SET_POINTER_ATTR,
ppdev->pPointerAttributes,
+ ppdev->PointerAttributesSize, NULL, 0,
&returnedDataLength))
+ {
+ /* no hw support found for the mouse we try then the software version */
+ return EngSetPointerShape(pso, psoMask, psoColor, pxlo, xHot, yHot, x, y,
prcl, fl);
+ }
+
+ /* we got real hw support */
+ ppdev->HwMouseActive = TRUE;
+ return SPS_ACCEPT_NOEXCLUDE;
+}
+
+
+/* Internal api that are only use in DrvSetPointerShape */
+
+BOOL
+CopyColorPointer(PPDEV ppdev,
+ SURFOBJ *psoMask,
+ SURFOBJ *psoColor,
+ XLATEOBJ *pxlo)
+{
+ /* FIXME unimplement */
+ return FALSE;
+}
+
+BOOL
+CopyMonoPointer(PPDEV ppdev,
+ SURFOBJ *pso)
+{
+ /* FIXME unimplement */
+ return FALSE;
+}
+
+
Modified: trunk/reactos/drivers/video/displays/framebufacc/screen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebufacc/screen.c (original)
+++ trunk/reactos/drivers/video/displays/framebufacc/screen.c Fri Nov 2 03:03:02 2007
@@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "framebuf_acc.h"
+#include "framebufacc.h"
/*
* GetAvailableModes
Modified: trunk/reactos/drivers/video/displays/framebufacc/surface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fra…
==============================================================================
--- trunk/reactos/drivers/video/displays/framebufacc/surface.c (original)
+++ trunk/reactos/drivers/video/displays/framebufacc/surface.c Fri Nov 2 03:03:02 2007
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "framebuf_acc.h"
+#include "framebufacc.h"
BOOL
InitSurface(PPDEV ppdev,
@@ -156,7 +156,8 @@
}
/* Rest the desktop vitual position */
- ppdev->ScreenOffsetXY = {0,0};
+ ppdev->ScreenOffsetXY.x = 0;
+ ppdev->ScreenOffsetXY.y = 0;
switch (ppdev->BitsPerPixel)