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. 



svn path=/trunk/; revision=30059
This commit is contained in:
Magnus Olsen 2007-11-02 00:03:02 +00:00
parent 28eb54745a
commit 7c4c90e02b
9 changed files with 152 additions and 12 deletions

View file

@ -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[] =
{

View file

@ -92,6 +92,9 @@ typedef struct _PDEV
} PDEV, *PPDEV;
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
#define DEVICE_NAME L"framebuf"
@ -187,4 +190,14 @@ IntSetPalette(
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 */

View file

@ -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>

View file

@ -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

View file

@ -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 @@ DrvMovePointer(IN SURFOBJ *pso,
* Sets the new pointer shape.
*
* Status
* @unimplemented
* @implemented
*/
ULONG APIENTRY
@ -91,10 +92,135 @@ DrvSetPointerShape(
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;
}

View file

@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "framebuf_acc.h"
#include "framebufacc.h"
/*
* GetAvailableModes

View file

@ -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 @@ DrvEnableSurface(
}
/* Rest the desktop vitual position */
ppdev->ScreenOffsetXY = {0,0};
ppdev->ScreenOffsetXY.x = 0;
ppdev->ScreenOffsetXY.y = 0;
switch (ppdev->BitsPerPixel)