Author: greatlrd Date: Thu Nov 1 17:40:22 2007 New Revision: 30040
URL: http://svn.reactos.org/svn/reactos?rev=30040&view=rev Log: Rename framebuf.def to framebuf_acc.def, framebuf.h to framebuf_acc.h, framebuf.rbuild to framebuf_acc.h Start add hw mouse cures support Deleted all old mouse pointer code that was disable.
Disable the new cached code for now
Added: trunk/reactos/drivers/video/displays/framebuf_acc/framebuf_acc.def - copied unchanged from r30014, trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.def trunk/reactos/drivers/video/displays/framebuf_acc/framebuf_acc.h - copied, changed from r30024, trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.h trunk/reactos/drivers/video/displays/framebuf_acc/framebuf_acc.rbuild - copied, changed from r30014, trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.rbuild trunk/reactos/drivers/video/displays/framebuf_acc/framebuf_acc.rc - copied unchanged from r30014, trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.rc Removed: trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.def trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.h trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.rbuild trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.rc Modified: trunk/reactos/drivers/video/displays/framebuf_acc/enable.c trunk/reactos/drivers/video/displays/framebuf_acc/palette.c trunk/reactos/drivers/video/displays/framebuf_acc/pointer.c trunk/reactos/drivers/video/displays/framebuf_acc/screen.c trunk/reactos/drivers/video/displays/framebuf_acc/surface.c
Modified: trunk/reactos/drivers/video/displays/framebuf_acc/enable.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fram... ============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_acc/enable.c (original) +++ trunk/reactos/drivers/video/displays/framebuf_acc/enable.c Thu Nov 1 17:40:22 2007 @@ -18,20 +18,20 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "framebuf.h" +#include "framebuf_acc.h"
static DRVFN DrvFunctionTable[] = { - {INDEX_DrvEnablePDEV, (PFN)DrvEnablePDEV}, - {INDEX_DrvCompletePDEV, (PFN)DrvCompletePDEV}, - {INDEX_DrvDisablePDEV, (PFN)DrvDisablePDEV}, - {INDEX_DrvEnableSurface, (PFN)DrvEnableSurface}, - {INDEX_DrvDisableSurface, (PFN)DrvDisableSurface}, - {INDEX_DrvAssertMode, (PFN)DrvAssertMode}, - {INDEX_DrvGetModes, (PFN)DrvGetModes}, - {INDEX_DrvSetPalette, (PFN)DrvSetPalette}, - {INDEX_DrvSetPointerShape, (PFN)DrvSetPointerShape}, - {INDEX_DrvMovePointer, (PFN)DrvMovePointer} + {INDEX_DrvEnablePDEV, (PFN)DrvEnablePDEV}, + {INDEX_DrvCompletePDEV, (PFN)DrvCompletePDEV}, + {INDEX_DrvDisablePDEV, (PFN)DrvDisablePDEV}, + {INDEX_DrvEnableSurface, (PFN)DrvEnableSurface}, + {INDEX_DrvDisableSurface, (PFN)DrvDisableSurface}, + {INDEX_DrvAssertMode, (PFN)DrvAssertMode}, + {INDEX_DrvGetModes, (PFN)DrvGetModes}, + {INDEX_DrvSetPalette, (PFN)DrvSetPalette}, + {INDEX_DrvSetPointerShape, (PFN)DrvSetPointerShape}, + {INDEX_DrvMovePointer, (PFN)DrvMovePointer}
};
@@ -91,6 +91,7 @@ PPDEV ppdev; GDIINFO GdiInfo; DEVINFO DevInfo; + ULONG returnedDataLength = 0;
ppdev = EngAllocMem(FL_ZERO_MEMORY, sizeof(PDEV), ALLOC_TAG); if (ppdev == NULL) @@ -106,6 +107,35 @@ return NULL; }
+ /* hw mouse pointer */ + + ppdev->pPointerAttributes = NULL; + ppdev->PointerAttributesSize = 0; + + /* Test see if the driver support hw mouse or not */ + if (!EngDeviceIoControl(ppdev->hDriver,IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES, + &ppdev->ModeIndex, sizeof(PVIDEO_MODE), + &ppdev->PointerCapabilities, + sizeof(VIDEO_POINTER_CAPABILITIES), + &returnedDataLength)) + { + /* Test see if we got a hw mouse or not */ + if ( (ppdev->PointerCapabilities.Flags & VIDEO_MODE_MONO_POINTER) || + (ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER) ) + { + /* determent the hw mouse mode */ + if (!(ppdev->PointerCapabilities.Flags & VIDEO_MODE_ASYNC_POINTER)) + { + DevInfo.flGraphicsCaps &= ~GCAPS_ASYNCMOVE; + } + else + { + DevInfo.flGraphicsCaps |= GCAPS_ASYNCMOVE; + } + } + } + + /* setup paletted */ if (!IntInitDefaultPalette(ppdev, &DevInfo)) { EngFreeMem(ppdev);
Removed: trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.def URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fram... ============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.def (original) +++ trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.def (removed) @@ -1,3 +1,0 @@ -LIBRARY framebuf.dll -EXPORTS -DrvEnableDriver@12
Removed: trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fram... ============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.h (original) +++ trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.h (removed) @@ -1,174 +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_MOUSE_CURSOR_SUPPORT - -typedef struct _PDEV -{ - HANDLE hDriver; - HDEV hDevEng; - HSURF hSurfEng; - ULONG ModeIndex; - ULONG ScreenWidth; - ULONG ScreenHeight; - ULONG ScreenDelta; - BYTE BitsPerPixel; - ULONG RedMask; - ULONG GreenMask; - ULONG BlueMask; - BYTE PaletteShift; - PVOID ScreenPtr; - HPALETTE DefaultPalette; - PALETTEENTRY *PaletteEntries; - -#ifdef EXPERIMENTAL_MOUSE_CURSOR_SUPPORT - VIDEO_POINTER_ATTRIBUTES PointerAttributes; - XLATEOBJ *PointerXlateObject; - HSURF PointerColorSurface; - HSURF PointerMaskSurface; - HSURF PointerSaveSurface; - POINTL PointerHotSpot; -#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/framebuf_acc/framebuf.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fram... ============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.rbuild (original) +++ trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.rbuild (removed) @@ -1,14 +1,0 @@ -<?xml version="1.0"?> -<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd"> -<module name="framebuf" type="kernelmodedll" entrypoint="_DrvEnableDriver@12" installbase="system32" installname="framebuf.dll"> - <importlibrary definition="framebuf.def" /> - <include base="framebuf">.</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.rc</file> -</module>
Removed: trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.rc URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fram... ============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.rc (original) +++ trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.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/framebuf_acc/framebuf_acc.h (from r30024, trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.h) URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fram... ============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.h (original) +++ trunk/reactos/drivers/video/displays/framebuf_acc/framebuf_acc.h Thu Nov 1 17:40:22 2007 @@ -29,13 +29,18 @@ #include <winioctl.h> #include <ntddvdeo.h>
-//#define EXPERIMENTAL_MOUSE_CURSOR_SUPPORT + +//#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; @@ -46,16 +51,24 @@ ULONG BlueMask; BYTE PaletteShift; PVOID ScreenPtr; + + /* 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 - VIDEO_POINTER_ATTRIBUTES PointerAttributes; XLATEOBJ *PointerXlateObject; HSURF PointerColorSurface; HSURF PointerMaskSurface; HSURF PointerSaveSurface; - POINTL PointerHotSpot; + #endif
/* DirectX Support */
Copied: trunk/reactos/drivers/video/displays/framebuf_acc/framebuf_acc.rbuild (from r30014, trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.rbuild) URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fram... ============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_acc/framebuf.rbuild (original) +++ trunk/reactos/drivers/video/displays/framebuf_acc/framebuf_acc.rbuild Thu Nov 1 17:40:22 2007 @@ -1,8 +1,8 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd"> -<module name="framebuf" type="kernelmodedll" entrypoint="_DrvEnableDriver@12" installbase="system32" installname="framebuf.dll"> - <importlibrary definition="framebuf.def" /> - <include base="framebuf">.</include> +<module name="framebuf_acc" 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> @@ -10,5 +10,5 @@ <file>pointer.c</file> <file>screen.c</file> <file>surface.c</file> - <file>framebuf.rc</file> + <file>framebuf_acc.rc</file> </module>
Modified: trunk/reactos/drivers/video/displays/framebuf_acc/palette.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fram... ============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_acc/palette.c (original) +++ trunk/reactos/drivers/video/displays/framebuf_acc/palette.c Thu Nov 1 17:40:22 2007 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "framebuf.h" +#include "framebuf_acc.h"
/* * Standard color that must be in palette, because they're used for
Modified: trunk/reactos/drivers/video/displays/framebuf_acc/pointer.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fram... ============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_acc/pointer.c (original) +++ trunk/reactos/drivers/video/displays/framebuf_acc/pointer.c Thu Nov 1 17:40:22 2007 @@ -18,9 +18,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "framebuf.h" +#include "framebuf_acc.h"
-#ifndef EXPERIMENTAL_MOUSE_CURSOR_SUPPORT +
/* * DrvSetPointerShape @@ -68,303 +68,4 @@ return EngMovePointer(pso, x, y, prcl); }
-#else
-VOID FASTCALL -IntHideMousePointer(PPDEV ppdev, SURFOBJ *DestSurface) -{ - if (ppdev->PointerAttributes.Enable == FALSE) - { - return; - } - - ppdev->PointerAttributes.Enable = FALSE; - if (ppdev->PointerSaveSurface != NULL) - { - RECTL DestRect; - POINTL SrcPoint; - SURFOBJ *SaveSurface; - SURFOBJ *MaskSurface; - - DestRect.left = max(ppdev->PointerAttributes.Column, 0); - DestRect.top = max(ppdev->PointerAttributes.Row, 0); - DestRect.right = min( - ppdev->PointerAttributes.Column + ppdev->PointerAttributes.Width, - ppdev->ScreenWidth - 1); - DestRect.bottom = min( - ppdev->PointerAttributes.Row + ppdev->PointerAttributes.Height, - ppdev->ScreenHeight - 1); - - SrcPoint.x = max(-ppdev->PointerAttributes.Column, 0); - SrcPoint.y = max(-ppdev->PointerAttributes.Row, 0); - - SaveSurface = EngLockSurface(ppdev->PointerSaveSurface); - MaskSurface = EngLockSurface(ppdev->PointerMaskSurface); - EngBitBlt(DestSurface, SaveSurface, MaskSurface, NULL, NULL, - &DestRect, &SrcPoint, &SrcPoint, NULL, NULL, SRCCOPY); - EngUnlockSurface(MaskSurface); - EngUnlockSurface(SaveSurface); - } -} - -VOID FASTCALL -IntShowMousePointer(PPDEV ppdev, SURFOBJ *DestSurface) -{ - if (ppdev->PointerAttributes.Enable == TRUE) - { - return; - } - - ppdev->PointerAttributes.Enable = TRUE; - - /* - * Copy the pixels under the cursor to temporary surface. - */ - - if (ppdev->PointerSaveSurface != NULL) - { - RECTL DestRect; - POINTL SrcPoint; - SURFOBJ *SaveSurface; - - SrcPoint.x = max(ppdev->PointerAttributes.Column, 0); - SrcPoint.y = max(ppdev->PointerAttributes.Row, 0); - - DestRect.left = SrcPoint.x - ppdev->PointerAttributes.Column; - DestRect.top = SrcPoint.y - ppdev->PointerAttributes.Row; - DestRect.right = min( - ppdev->PointerAttributes.Width, - ppdev->ScreenWidth - ppdev->PointerAttributes.Column - 1); - DestRect.bottom = min( - ppdev->PointerAttributes.Height, - ppdev->ScreenHeight - ppdev->PointerAttributes.Row - 1); - - SaveSurface = EngLockSurface(ppdev->PointerSaveSurface); - EngBitBlt(SaveSurface, DestSurface, NULL, NULL, NULL, - &DestRect, &SrcPoint, NULL, NULL, NULL, SRCCOPY); - EngUnlockSurface(SaveSurface); - } - - /* - * Blit the cursor on the screen. - */ - - { - RECTL DestRect; - POINTL SrcPoint; - SURFOBJ *ColorSurf; - SURFOBJ *MaskSurf; - - DestRect.left = max(ppdev->PointerAttributes.Column, 0); - DestRect.top = max(ppdev->PointerAttributes.Row, 0); - DestRect.right = min( - ppdev->PointerAttributes.Column + ppdev->PointerAttributes.Width, - ppdev->ScreenWidth - 1); - DestRect.bottom = min( - ppdev->PointerAttributes.Row + ppdev->PointerAttributes.Height, - ppdev->ScreenHeight - 1); - - SrcPoint.x = max(-ppdev->PointerAttributes.Column, 0); - SrcPoint.y = max(-ppdev->PointerAttributes.Row, 0); - - MaskSurf = EngLockSurface(ppdev->PointerMaskSurface); - if (ppdev->PointerColorSurface != NULL) - { - ColorSurf = EngLockSurface(ppdev->PointerColorSurface); - EngBitBlt(DestSurface, ColorSurf, MaskSurf, NULL, ppdev->PointerXlateObject, - &DestRect, &SrcPoint, &SrcPoint, NULL, NULL, 0xAACC); - EngUnlockSurface(ColorSurf); - } - else - { - /* FIXME */ - EngBitBlt(DestSurface, MaskSurf, NULL, NULL, ppdev->PointerXlateObject, - &DestRect, &SrcPoint, NULL, NULL, NULL, SRCAND); - SrcPoint.y += ppdev->PointerAttributes.Height; - EngBitBlt(DestSurface, MaskSurf, NULL, NULL, ppdev->PointerXlateObject, - &DestRect, &SrcPoint, NULL, NULL, NULL, SRCINVERT); - } - EngUnlockSurface(MaskSurf); - } -} - -/* - * DrvSetPointerShape - * - * Sets the new pointer shape. - * - * Status - * @implemented - */ - -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) -{ - PPDEV ppdev = (PPDEV)pso->dhpdev; - SURFOBJ *TempSurfObj; - - IntHideMousePointer(ppdev, pso); - - if (ppdev->PointerColorSurface != NULL) - { - /* FIXME: Is this really needed? */ - TempSurfObj = EngLockSurface(ppdev->PointerColorSurface); - EngFreeMem(TempSurfObj->pvBits); - TempSurfObj->pvBits = 0; - EngUnlockSurface(TempSurfObj); - - EngDeleteSurface(ppdev->PointerColorSurface); - ppdev->PointerMaskSurface = NULL; - } - - if (ppdev->PointerMaskSurface != NULL) - { - /* FIXME: Is this really needed? */ - TempSurfObj = EngLockSurface(ppdev->PointerMaskSurface); - EngFreeMem(TempSurfObj->pvBits); - TempSurfObj->pvBits = 0; - EngUnlockSurface(TempSurfObj); - - EngDeleteSurface(ppdev->PointerMaskSurface); - ppdev->PointerMaskSurface = NULL; - } - - if (ppdev->PointerSaveSurface != NULL) - { - EngDeleteSurface(ppdev->PointerSaveSurface); - ppdev->PointerSaveSurface = NULL; - } - - /* - * See if we are being asked to hide the pointer. - */ - - if (psoMask == NULL) - { - return SPS_ACCEPT_EXCLUDE; - } - - ppdev->PointerHotSpot.x = xHot; - ppdev->PointerHotSpot.y = yHot; - - ppdev->PointerXlateObject = pxlo; - ppdev->PointerAttributes.Column = x - xHot; - ppdev->PointerAttributes.Row = y - yHot; - ppdev->PointerAttributes.Width = psoMask->lDelta << 3; - ppdev->PointerAttributes.Height = (psoMask->cjBits / psoMask->lDelta) >> 1; - - if (psoColor != NULL) - { - SIZEL Size; - PBYTE Bits; - - Size.cx = ppdev->PointerAttributes.Width; - Size.cy = ppdev->PointerAttributes.Height; - Bits = EngAllocMem(0, psoColor->cjBits, ALLOC_TAG); - memcpy(Bits, psoColor->pvBits, psoColor->cjBits); - - ppdev->PointerColorSurface = (HSURF)EngCreateBitmap(Size, - psoColor->lDelta, psoColor->iBitmapFormat, 0, Bits); - } - else - { - ppdev->PointerColorSurface = NULL; - } - - if (psoMask != NULL) - { - SIZEL Size; - PBYTE Bits; - - Size.cx = ppdev->PointerAttributes.Width; - Size.cy = ppdev->PointerAttributes.Height << 1; - Bits = EngAllocMem(0, psoMask->cjBits, ALLOC_TAG); - memcpy(Bits, psoMask->pvBits, psoMask->cjBits); - - ppdev->PointerMaskSurface = (HSURF)EngCreateBitmap(Size, - psoMask->lDelta, psoMask->iBitmapFormat, 0, Bits); - } - else - { - ppdev->PointerMaskSurface = NULL; - } - - /* - * Create surface for saving the pixels under the cursor. - */ - - { - SIZEL Size; - LONG lDelta; - - Size.cx = ppdev->PointerAttributes.Width; - Size.cy = ppdev->PointerAttributes.Height; - - switch (pso->iBitmapFormat) - { - case BMF_8BPP: lDelta = Size.cx; break; - case BMF_16BPP: lDelta = Size.cx << 1; break; - case BMF_24BPP: lDelta = Size.cx * 3; break; - case BMF_32BPP: lDelta = Size.cx << 2; break; - } - - ppdev->PointerSaveSurface = (HSURF)EngCreateBitmap( - Size, lDelta, pso->iBitmapFormat, BMF_NOZEROINIT, NULL); - } - - IntShowMousePointer(ppdev, pso); - - return SPS_ACCEPT_EXCLUDE; -} - -/* - * 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; - BOOL WasVisible; - - WasVisible = ppdev->PointerAttributes.Enable; - if (WasVisible) - { - IntHideMousePointer(ppdev, pso); - } - - if (x == -1) - { - return; - } - - ppdev->PointerAttributes.Column = x - ppdev->PointerHotSpot.x; - ppdev->PointerAttributes.Row = y - ppdev->PointerHotSpot.y; - - if (WasVisible) - { - IntShowMousePointer(ppdev, pso); - } -} - -#endif
Modified: trunk/reactos/drivers/video/displays/framebuf_acc/screen.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fram... ============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_acc/screen.c (original) +++ trunk/reactos/drivers/video/displays/framebuf_acc/screen.c Thu Nov 1 17:40:22 2007 @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "framebuf.h" +#include "framebuf_acc.h"
/* * GetAvailableModes
Modified: trunk/reactos/drivers/video/displays/framebuf_acc/surface.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/displays/fram... ============================================================================== --- trunk/reactos/drivers/video/displays/framebuf_acc/surface.c (original) +++ trunk/reactos/drivers/video/displays/framebuf_acc/surface.c Thu Nov 1 17:40:22 2007 @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include "framebuf.h" +#include "framebuf_acc.h"
BOOL InitSurface(PPDEV ppdev, @@ -29,6 +29,8 @@ VIDEO_MEMORY_INFORMATION VideoMemoryInfo; ULONG returnedDataLength; ULONG RemappingNeeded = 0; + ULONG PointerMaxWidth = 0; + ULONG PointerMaxHeight = 0;
/* * Set video mode of our adapter. @@ -72,11 +74,16 @@ ppdev->pRealVideoMem = VideoMemoryInfo.FrameBufferBase; ppdev->VideoMemSize = VideoMemoryInfo.VideoRamLength;
+ /* * Video memory cached * * We maby should only ask max 8MB as cached ?, think of the video ram length is 256MB */ + + ppdev->pVideoMemCache = NULL; +#ifdef EXPERIMENTAL_ACC_SUPPORT + ppdev->pVideoMemCache = EngAllocMem(0, (ULONG)VideoMemoryInfo.VideoRamLength, ALLOC_TAG); if (ppdev->pVideoMemCache == NULL) { @@ -84,12 +91,40 @@ ppdev->ScreenPtr = VideoMemoryInfo.FrameBufferBase; } else + +#endif { /* cached on, system memory is avail */ ppdev->ScreenPtr = ppdev->pRealVideoMem; }
- /* FIXME hw mouse pointer */ + /* hw mouse pointer support */ + PointerMaxHeight = ppdev->PointerCapabilities.MaxHeight; + PointerMaxWidth = ppdev->PointerCapabilities.MaxWidth * sizeof(ULONG); + if (ppdev->PointerCapabilities.Flags & VIDEO_MODE_COLOR_POINTER) + { + PointerMaxWidth = (ppdev->PointerCapabilities.MaxWidth + 7) / 8; + } + + ppdev->PointerAttributesSize = sizeof(VIDEO_POINTER_ATTRIBUTES) + ((sizeof(UCHAR) * PointerMaxWidth * PointerMaxHeight) << 1); + + ppdev->pPointerAttributes = EngAllocMem(0, ppdev->PointerAttributesSize, ALLOC_TAG); + + if (ppdev->pPointerAttributes != NULL) + { + ppdev->pPointerAttributes->Flags = ppdev->PointerCapabilities.Flags; + ppdev->pPointerAttributes->WidthInBytes = PointerMaxWidth; + ppdev->pPointerAttributes->Width = ppdev->PointerCapabilities.MaxWidth; + ppdev->pPointerAttributes->Height = PointerMaxHeight; + ppdev->pPointerAttributes->Column = 0; + ppdev->pPointerAttributes->Row = 0; + ppdev->pPointerAttributes->Enable = 0; + } + else + { + /* no hw mouse was avail */ + ppdev->PointerAttributesSize = 0; + }
return TRUE; } @@ -157,13 +192,15 @@ return FALSE; }
+ /* Which api we hooking to */ + ppdev->dwHooks = HOOK_BITBLT | HOOK_COPYBITS | HOOK_FILLPATH | HOOK_TEXTOUT | HOOK_STROKEPATH | HOOK_LINETO ; + /* * Associate the surface with our device. */
- if (!EngAssociateSurface(hSurface, ppdev->hDevEng, HOOK_BITBLT | HOOK_COPYBITS | - HOOK_FILLPATH | HOOK_TEXTOUT | - HOOK_STROKEPATH | HOOK_LINETO)) + + if (!EngAssociateSurface(hSurface, ppdev->hDevEng, ppdev->dwHooks)) { EngDeleteSurface(hSurface); return FALSE; @@ -232,52 +269,43 @@ { PPDEV ppdev = (PPDEV)dhpdev; ULONG ulTemp; + BOOLEAN Result = TRUE;
if (bEnable) { - BOOLEAN Result; - PBYTE pRealVideoMem = ppdev->pRealVideoMem; + PVOID pRealVideoMem = ppdev->pRealVideoMem;
/* Setup surface and remapping if it need it */ if (!InitSurface(ppdev, FALSE)) { - return FALSE; + Result = FALSE; } - - /* Check if we got same surface or not */ - if (pRealVideoMem != ppdev->pRealVideoMem) + else { - if (ppdev->pVideoMemCache == NULL) - { - if ( !EngModifySurface(ppdev->hsurfEng, - ppdev->hdevEng, - ppdev->flHooks | HOOK_SYNCHRONIZE, - MS_NOTSYSTEMMEMORY, - (DHSURF)ppdev, - ppdev->pRealVideoMem, - ppdev->lDeltaScreen, - NULL)) + /* Check if we got same surface or not */ + if (pRealVideoMem != ppdev->pRealVideoMem) + { + PVOID pVideoMem= NULL; + + if (ppdev->pVideoMemCache == NULL) { - return FALSE; + pVideoMem = ppdev->pRealVideoMem; } - } - else - { - if ( !EngModifySurface(ppdev->hsurfEng, - ppdev->hdevEng, - ppdev->flHooks | HOOK_SYNCHRONIZE, - 0, - (DHSURF)ppdev, - ppdev->pVideoMemCache, - ppdev->lDeltaScreen, - NULL)) + else { - return FALSE; + pVideoMem = ppdev->pVideoMemCache; } - } + + Result = !EngModifySurface(ppdev->hSurfEng, ppdev->hDevEng, + ppdev->dwHooks | HOOK_SYNCHRONIZE, + 0, (DHSURF)ppdev, pVideoMem, + ppdev->ScreenDelta, NULL); + } + + /* if the pRealVideoMem == ppdev->pRealVideoMem are + * the Result is then TRUE + */ } - - return TRUE;
} else @@ -286,7 +314,9 @@ * Call the miniport driver to reset the device to a known state. */
- return !EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_RESET_DEVICE, + Result = !EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_RESET_DEVICE, NULL, 0, NULL, 0, &ulTemp); } + + return Result; }