Initial commit - from Precise source
[freerdp-ubuntu-pcb-backport.git] / include / freerdp / pointer.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * Pointer Updates Interface API
4  *
5  * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __UPDATE_POINTER_H
21 #define __UPDATE_POINTER_H
22
23 #include <freerdp/types.h>
24
25 #define PTR_MSG_TYPE_SYSTEM             0x0001
26 #define PTR_MSG_TYPE_POSITION           0x0003
27 #define PTR_MSG_TYPE_COLOR              0x0006
28 #define PTR_MSG_TYPE_CACHED             0x0007
29 #define PTR_MSG_TYPE_POINTER            0x0008
30
31 #define SYSPTR_NULL                     0x00000000
32 #define SYSPTR_DEFAULT                  0x00007F00
33
34 struct _POINTER_POSITION_UPDATE
35 {
36         uint32 xPos;
37         uint32 yPos;
38 };
39 typedef struct _POINTER_POSITION_UPDATE POINTER_POSITION_UPDATE;
40
41 struct _POINTER_SYSTEM_UPDATE
42 {
43         uint32 type;
44 };
45 typedef struct _POINTER_SYSTEM_UPDATE POINTER_SYSTEM_UPDATE;
46
47 struct _POINTER_COLOR_UPDATE
48 {
49         uint32 cacheIndex;
50         uint32 xPos;
51         uint32 yPos;
52         uint32 width;
53         uint32 height;
54         uint32 lengthAndMask;
55         uint32 lengthXorMask;
56         uint8* xorMaskData;
57         uint8* andMaskData;
58 };
59 typedef struct _POINTER_COLOR_UPDATE POINTER_COLOR_UPDATE;
60
61 struct _POINTER_NEW_UPDATE
62 {
63         uint32 xorBpp;
64         POINTER_COLOR_UPDATE colorPtrAttr;
65 };
66 typedef struct _POINTER_NEW_UPDATE POINTER_NEW_UPDATE;
67
68 struct _POINTER_CACHED_UPDATE
69 {
70         uint32 cacheIndex;
71 };
72 typedef struct _POINTER_CACHED_UPDATE POINTER_CACHED_UPDATE;
73
74 typedef void (*pPointerPosition)(rdpContext* context, POINTER_POSITION_UPDATE* pointer_position);
75 typedef void (*pPointerSystem)(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_system);
76 typedef void (*pPointerColor)(rdpContext* context, POINTER_COLOR_UPDATE* pointer_color);
77 typedef void (*pPointerNew)(rdpContext* context, POINTER_NEW_UPDATE* pointer_new);
78 typedef void (*pPointerCached)(rdpContext* context, POINTER_CACHED_UPDATE* pointer_cached);
79
80 struct rdp_pointer_update
81 {
82         rdpContext* context; /* 0 */
83         uint32 paddingA[16 - 1]; /* 1 */
84
85         pPointerPosition PointerPosition; /* 16 */
86         pPointerSystem PointerSystem; /* 17 */
87         pPointerColor PointerColor; /* 18 */
88         pPointerNew PointerNew; /* 19 */
89         pPointerCached PointerCached; /* 20 */
90         uint32 paddingB[32 - 21]; /* 21 */
91
92         /* internal */
93
94         POINTER_POSITION_UPDATE pointer_position;
95         POINTER_SYSTEM_UPDATE pointer_system;
96         POINTER_COLOR_UPDATE pointer_color;
97         POINTER_NEW_UPDATE pointer_new;
98         POINTER_CACHED_UPDATE pointer_cached;
99 };
100 typedef struct rdp_pointer_update rdpPointerUpdate;
101
102 #endif /* __UPDATE_POINTER_H */