FreeRDP
channels/rdpei.h
1 
22 #ifndef FREERDP_CHANNEL_RDPEI_H
23 #define FREERDP_CHANNEL_RDPEI_H
24 
25 #include <winpr/wtypes.h>
26 
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31 
32 #define RDPINPUT_HEADER_LENGTH 6
33 
38 #define RDPEI_CHANNEL_NAME "rdpei"
39 #define RDPEI_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Input"
40 
42 enum
43 {
44  RDPINPUT_PROTOCOL_V10 = 0x00010000,
45  RDPINPUT_PROTOCOL_V101 = 0x00010001,
46  RDPINPUT_PROTOCOL_V200 = 0x00020000,
47  RDPINPUT_PROTOCOL_V300 = 0x00030000
48 };
49 
50 /* Server feature flags */
51 #define SC_READY_MULTIPEN_INJECTION_SUPPORTED 0x0001
52 
53 /* Client Ready Flags */
54 #define CS_READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001
55 #define CS_READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002
56 #define CS_READY_FLAGS_ENABLE_MULTIPEN_INJECTION 0x00000004
57 
58 /* 2.2.3.3.1.1 RDPINPUT_TOUCH_CONTACT */
59 #define CONTACT_DATA_CONTACTRECT_PRESENT 0x0001
60 #define CONTACT_DATA_ORIENTATION_PRESENT 0x0002
61 #define CONTACT_DATA_PRESSURE_PRESENT 0x0004
62 
63 typedef enum
64 {
65  RDPINPUT_PEN_CONTACT_PENFLAGS_PRESENT = 0x0001,
66  RDPINPUT_PEN_CONTACT_PRESSURE_PRESENT = 0x0002,
67  RDPINPUT_PEN_CONTACT_ROTATION_PRESENT = 0x0004,
68  RDPINPUT_PEN_CONTACT_TILTX_PRESENT = 0x0008,
69  RDPINPUT_PEN_CONTACT_TILTY_PRESENT = 0x0010
70 } RDPINPUT_PEN_FIELDS_PRESENT;
71 
72 /*
73  * Valid combinations of RDPINPUT_CONTACT_FLAGS:
74  *
75  * See [MS-RDPEI] 2.2.3.3.1.1 RDPINPUT_TOUCH_CONTACT and 3.1.1.1 Touch Contact State Transitions
76  *
77  * UP
78  * UP | CANCELED
79  * UPDATE
80  * UPDATE | CANCELED
81  * DOWN | INRANGE | INCONTACT
82  * UPDATE | INRANGE | INCONTACT
83  * UP | INRANGE
84  * UPDATE | INRANGE
85  */
86 typedef enum
87 {
88  RDPINPUT_CONTACT_FLAG_DOWN = 0x0001,
89  RDPINPUT_CONTACT_FLAG_UPDATE = 0x0002,
90  RDPINPUT_CONTACT_FLAG_UP = 0x0004,
91  RDPINPUT_CONTACT_FLAG_INRANGE = 0x0008,
92  RDPINPUT_CONTACT_FLAG_INCONTACT = 0x0010,
93  RDPINPUT_CONTACT_FLAG_CANCELED = 0x0020
94 } RDPINPUT_CONTACT_FLAGS;
95 
96 typedef enum
97 {
98  RDPINPUT_PEN_FLAG_BARREL_PRESSED = 0x0001,
99  RDPINPUT_PEN_FLAG_ERASER_PRESSED = 0x0002,
100  RDPINPUT_PEN_FLAG_INVERTED = 0x0004
101 } RDPINPUT_PEN_FLAGS;
102 
104 typedef struct
105 {
106  UINT32 contactId;
107  UINT16 fieldsPresent; /* Mask of CONTACT_DATA_*_PRESENT values */
108  INT32 x;
109  INT32 y;
110  UINT32 contactFlags; /* See RDPINPUT_CONTACT_FLAG* */
111  INT16 contactRectLeft; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
112  INT16 contactRectTop; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
113  INT16 contactRectRight; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
114  INT16 contactRectBottom; /* Present if CONTACT_DATA_CONTACTRECT_PRESENT */
115  UINT32 orientation; /* Present if CONTACT_DATA_ORIENTATION_PRESENT, values in degree, [0-359] */
116  UINT32 pressure; /* Present if CONTACT_DATA_PRESSURE_PRESENT, normalized value [0-1024] */
118 
120 typedef struct
121 {
122  UINT16 contactCount;
123  UINT64 frameOffset;
124  RDPINPUT_CONTACT_DATA* contacts;
126 
128 typedef struct
129 {
130  UINT32 encodeTime;
131  UINT16 frameCount;
132  RDPINPUT_TOUCH_FRAME* frames;
134 
135 typedef struct
136 {
137  UINT8 deviceId;
138  UINT16 fieldsPresent; /* Mask of RDPINPUT_PEN_FIELDS_PRESENT values */
139  INT32 x;
140  INT32 y;
141  UINT32 contactFlags; /* See RDPINPUT_CONTACT_FLAG* */
142  UINT32 penFlags; /* Present if RDPINPUT_PEN_CONTACT_PENFLAGS_PRESENT, values see
143  RDPINPUT_PEN_FLAGS */
144  UINT16 rotation; /* Present if RDPINPUT_PEN_CONTACT_ROTATION_PRESENT, In degree, [0-359] */
145  UINT32
146  pressure; /* Present if RDPINPUT_PEN_CONTACT_PRESSURE_PRESENT, normalized value [0-1024] */
147  INT16 tiltX; /* Present if PEN_CONTACT_TILTX_PRESENT, range [-90, 90] */
148  INT16 tiltY; /* Present if PEN_CONTACT_TILTY_PRESENT, range [-90, 90] */
150 
151 typedef struct
152 {
153  UINT16 contactCount;
154  UINT64 frameOffset;
155  RDPINPUT_PEN_CONTACT* contacts;
157 
159 typedef struct
160 {
161  UINT32 encodeTime;
162  UINT16 frameCount;
163  RDPINPUT_PEN_FRAME* frames;
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* FREERDP_CHANNEL_RDPEI_H */
a touch event with some frames
a touch event with some frames
a frame containing contact points