ReactOS  0.4.14-dev-293-g2b39b42
pointer.c File Reference
#include "framebufacc.h"
Include dependency graph for pointer.c:

Go to the source code of this file.

Functions

VOID APIENTRY DrvMovePointer (IN SURFOBJ *pso, IN LONG x, IN LONG y, IN RECTL *prcl)
 
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)
 
BOOL CopyColorPointer (PPDEV ppdev, SURFOBJ *psoMask, SURFOBJ *psoColor, XLATEOBJ *pxlo)
 
BOOL CopyMonoPointer (PPDEV ppdev, SURFOBJ *pso)
 

Function Documentation

◆ CopyColorPointer()

BOOL CopyColorPointer ( PPDEV  ppdev,
SURFOBJ psoMask,
SURFOBJ psoColor,
XLATEOBJ pxlo 
)

Definition at line 209 of file pointer.c.

213 {
214  /* FIXME unimplement */
215  return FALSE;
216 }

Referenced by DrvSetPointerShape().

◆ CopyMonoPointer()

BOOL CopyMonoPointer ( PPDEV  ppdev,
SURFOBJ pso 
)

Definition at line 219 of file pointer.c.

221 {
222  /* FIXME unimplement */
223  return FALSE;
224 }

Referenced by DrvSetPointerShape().

◆ DrvMovePointer()

VOID APIENTRY DrvMovePointer ( IN SURFOBJ pso,
IN LONG  x,
IN LONG  y,
IN RECTL prcl 
)

Definition at line 36 of file pointer.c.

40 {
41  PPDEV ppdev = (PPDEV) pso->dhpdev;
42  DWORD returnedDataLength;
43  VIDEO_POINTER_POSITION NewPointerPosition;
44 
45  x -= ppdev->ScreenOffsetXY.x;
46  y -= ppdev->ScreenOffsetXY.y;
47 
48  /* position of (-1,-1) hide the pointer */
49  if ((x == -1) || (y == -1))
50  {
51  if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER, NULL, 0, NULL, 0, &returnedDataLength))
52  {
53  /* hw did not disable the mouse, we try then with software */
55  }
56  }
57  else
58  {
59  /* Calc the mouse positions and set it to the new positions */
60  NewPointerPosition.Column = (SHORT) x - (SHORT) (ppdev->PointerHotSpot.x);
61  NewPointerPosition.Row = (SHORT) y - (SHORT) (ppdev->PointerHotSpot.y);
62 
63  if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_SET_POINTER_POSITION, &NewPointerPosition,
64  sizeof(VIDEO_POINTER_POSITION), NULL, 0, &returnedDataLength))
65  {
66  /* hw did not disable the mouse, we try then with software */
68  }
69  }
70 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
POINTL ScreenOffsetXY
Definition: framebufacc.h:55
#define IOCTL_VIDEO_DISABLE_POINTER
Definition: ntddvdeo.h:80
LONG y
Definition: windef.h:315
short SHORT
Definition: pedump.c:59
HANDLE hDriver
Definition: framebuf.h:35
smooth NULL
Definition: ftsmooth.c:416
_In_ HANDLE _In_ SURFOBJ * pso
Definition: winddi.h:3664
POINTL PointerHotSpot
Definition: framebufacc.h:65
if(!(yy_init))
Definition: macro.lex.yy.c:714
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG x
Definition: windef.h:314
struct _PDEV * PPDEV
Definition: framebuf.h:33
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_In_ ULONG _In_ CLIPOBJ _In_ RECTL * prcl
Definition: winddi.h:3529
ENGAPI VOID APIENTRY EngMovePointer(_In_ SURFOBJ *pso, _In_ LONG x, _In_ LONG y, _In_ RECTL *prcl)
Definition: mouse.c:566
#define IOCTL_VIDEO_SET_POINTER_POSITION
Definition: ntddvdeo.h:167

◆ DrvSetPointerShape()

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 
)

Definition at line 83 of file pointer.c.

94 {
95  PPDEV ppdev = (PPDEV) pso->dhpdev;
96  ULONG returnedDataLength = 0;
97 
98  if (ppdev->pPointerAttributes == NULL)
99  {
100  /* hw did not support hw mouse pointer, we try then with software */
102  }
103 
104  /* check see if the apps ask to hide the mouse or not */
105  if (psoMask == (SURFOBJ *) NULL)
106  {
107  if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER, NULL, 0, NULL, 0, &returnedDataLength))
108  {
109  /* no hw support found for the mouse we try then the software version */
111  }
112 
113  return TRUE;
114  }
115 
116  /* set our hotspot */
117  ppdev->PointerHotSpot.x = xHot;
118  ppdev->PointerHotSpot.y = yHot;
119 
120  /* Set the hw mouse shape */
121 
122  if (psoColor != (SURFOBJ *) NULL)
123  {
124  /* We got a color mouse pointer */
126  (CopyColorPointer(ppdev, psoMask, psoColor, pxlo)) )
127  {
129  }
130  else
131  {
132  /* No color mouse pointer being set, so we need try the software version then */
133  if (ppdev->HwMouseActive)
134  {
135  ppdev->HwMouseActive = FALSE;
136  if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER, NULL, 0, NULL, 0, &returnedDataLength))
137  {
138  /* hw did not support hw mouse pointer, we try then with software */
140  }
141  }
142  return SPS_DECLINE ;
143  }
144  }
145  else
146  {
147  /* We got a mono mouse pointer */
149  (CopyMonoPointer(ppdev, psoMask)))
150  {
152  }
153  else
154  {
155  /* No mono mouse pointer being set, so we need try the software version then */
156  if (ppdev->HwMouseActive)
157  {
158  ppdev->HwMouseActive = FALSE;
159  if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER, NULL, 0, NULL, 0, &returnedDataLength))
160  {
161  /* hw did not support hw mouse pointer, we try then with software */
163  }
164  }
165  return SPS_DECLINE ;
166  }
167  }
168 
169  /* we goto hw mouse pointer then we contnue filling in more info */
170 
171  /* calc the mouse point positions */
172  if ((x != -1) || (y != -1))
173  {
174  ppdev->pPointerAttributes->Column -= (SHORT)(ppdev->PointerHotSpot.x);
175  ppdev->pPointerAttributes->Row -= (SHORT)(ppdev->PointerHotSpot.y);
176  }
177 
178  /* set correct flags if it animated or need be updated anime or no flags at all */
179  if (fl & SPS_ANIMATESTART)
180  {
182  }
183  else if (fl & SPS_ANIMATEUPDATE)
184  {
186  }
187 
188  ppdev->pPointerAttributes->Enable = 1;
189  ppdev->pPointerAttributes->Column = (SHORT)(x);
190  ppdev->pPointerAttributes->Row = (SHORT)(y);
191 
192  /* Set the new mouse pointer shape */
193  if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_SET_POINTER_ATTR, ppdev->pPointerAttributes,
194  ppdev->PointerAttributesSize, NULL, 0, &returnedDataLength))
195  {
196  /* no hw support found for the mouse we try then the software version */
198  }
199 
200  /* we got real hw support */
201  ppdev->HwMouseActive = TRUE;
202  return SPS_ACCEPT_NOEXCLUDE;
203 }
#define SPS_ANIMATESTART
Definition: winddi.h:4037
VIDEO_POINTER_CAPABILITIES PointerCapabilities
Definition: driver.h:44
BOOL HwMouseActive
Definition: framebufacc.h:66
#define TRUE
Definition: types.h:120
#define IOCTL_VIDEO_SET_POINTER_ATTR
Definition: ntddvdeo.h:164
#define VIDEO_MODE_COLOR_POINTER
Definition: ntddvdeo.h:455
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
BOOL CopyMonoPointer(PPDEV ppdev, SURFOBJ *pso)
Definition: pointer.c:219
#define IOCTL_VIDEO_DISABLE_POINTER
Definition: ntddvdeo.h:80
#define SPS_ACCEPT_NOEXCLUDE
Definition: winddi.h:4030
#define VIDEO_MODE_MONO_POINTER
Definition: ntddvdeo.h:454
LONG y
Definition: windef.h:315
_In_ FLONG fl
Definition: winddi.h:1279
short SHORT
Definition: pedump.c:59
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ XLATEOBJ _In_ LONG _In_ LONG yHot
Definition: winddi.h:4049
HANDLE hDriver
Definition: framebuf.h:35
smooth NULL
Definition: ftsmooth.c:416
#define SPS_ANIMATEUPDATE
Definition: winddi.h:4038
_In_ HANDLE _In_ SURFOBJ * pso
Definition: winddi.h:3664
POINTL PointerHotSpot
Definition: framebufacc.h:65
ULONG PointerAttributesSize
Definition: framebufacc.h:64
if(!(yy_init))
Definition: macro.lex.yy.c:714
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ XLATEOBJ _In_ LONG xHot
Definition: winddi.h:4049
LONG x
Definition: windef.h:314
struct _PDEV * PPDEV
Definition: framebuf.h:33
#define SPS_DECLINE
Definition: winddi.h:4029
_In_opt_ SURFOBJ _In_opt_ SURFOBJ * psoColor
Definition: winddi.h:4049
PVIDEO_POINTER_ATTRIBUTES pPointerAttributes
Definition: driver.h:45
_In_opt_ SURFOBJ _In_opt_ SURFOBJ * psoMask
Definition: winddi.h:3433
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
_In_ ULONG _In_ CLIPOBJ _In_ RECTL * prcl
Definition: winddi.h:3529
unsigned int ULONG
Definition: retypes.h:1
#define VIDEO_MODE_ANIMATE_UPDATE
Definition: ntddvdeo.h:457
#define VIDEO_MODE_ANIMATE_START
Definition: ntddvdeo.h:456
ENGAPI ULONG APIENTRY EngSetPointerShape(_In_ SURFOBJ *pso, _In_opt_ SURFOBJ *psoMask, _In_opt_ SURFOBJ *psoColor, _In_opt_ XLATEOBJ *pxlo, _In_ LONG xHot, _In_ LONG yHot, _In_ LONG x, _In_ LONG y, _In_ RECTL *prcl, _In_ FLONG fl)
Definition: mouse.c:321
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ * pxlo
Definition: winddi.h:3414
BOOL CopyColorPointer(PPDEV ppdev, SURFOBJ *psoMask, SURFOBJ *psoColor, XLATEOBJ *pxlo)
Definition: pointer.c:209