Increase size of current date selection
[reactos.git] / reactos / drivers / video / displays / framebufacc / pointer.c
1 /*
2 * ReactOS Generic Framebuffer display driver
3 *
4 * Copyright (C) 2007 Magnus Olsen
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21 #include "framebuf_acc.h"
22
23
24 /*
25 * DrvMovePointer
26 *
27 * Moves the pointer to a new position and ensures that GDI does not interfere
28 * with the display of the pointer.
29 *
30 * Status
31 * @implemented
32 */
33
34 VOID APIENTRY
35 DrvMovePointer(IN SURFOBJ *pso,
36 IN LONG x,
37 IN LONG y,
38 IN RECTL *prcl)
39 {
40 PPDEV ppdev = (PPDEV) pso->dhpdev;
41 DWORD returnedDataLength;
42 VIDEO_POINTER_POSITION NewPointerPosition;
43
44 x -= ppdev->ScreenOffsetXY.x;
45 y -= ppdev->ScreenOffsetXY.y;
46
47 /* position of (-1,-1) hide the pointer */
48 if ((x == -1) || (y == -1))
49 {
50 if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_DISABLE_POINTER, NULL, 0, NULL, 0, &returnedDataLength))
51 {
52 /* hw did not disable the mouse, we try then with software */
53 EngMovePointer(pso, x, y, prcl);
54 }
55 }
56 else
57 {
58 /* Calc the mouse positions and set it to the new positions */
59 NewPointerPosition.Column = (SHORT) x - (SHORT) (ppdev->PointerHotSpot.x);
60 NewPointerPosition.Row = (SHORT) y - (SHORT) (ppdev->PointerHotSpot.y);
61
62 if (EngDeviceIoControl(ppdev->hDriver, IOCTL_VIDEO_SET_POINTER_POSITION, &NewPointerPosition,
63 sizeof(VIDEO_POINTER_POSITION), NULL, 0, &returnedDataLength))
64 {
65 /* hw did not disable the mouse, we try then with software */
66 EngMovePointer(pso, x, y, prcl);
67 }
68 }
69 }
70
71
72 /*
73 * DrvSetPointerShape
74 *
75 * Sets the new pointer shape.
76 *
77 * Status
78 * @unimplemented
79 */
80
81 ULONG APIENTRY
82 DrvSetPointerShape(
83 IN SURFOBJ *pso,
84 IN SURFOBJ *psoMask,
85 IN SURFOBJ *psoColor,
86 IN XLATEOBJ *pxlo,
87 IN LONG xHot,
88 IN LONG yHot,
89 IN LONG x,
90 IN LONG y,
91 IN RECTL *prcl,
92 IN FLONG fl)
93 {
94 /* return SPS_DECLINE;*/
95 return EngSetPointerShape(pso, psoMask, psoColor, pxlo, xHot, yHot, x, y, prcl, fl);
96 }
97
98
99
100