1 | /** @file
|
---|
2 | * VBox Remote Desktop Extension (VRDE) - Input interface.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2013 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef ___VBox_RemoteDesktop_VRDEInput_h
|
---|
27 | #define ___VBox_RemoteDesktop_VRDEInput_h
|
---|
28 |
|
---|
29 |
|
---|
30 | /*
|
---|
31 | * Interface for receiving input events from the client.
|
---|
32 | */
|
---|
33 |
|
---|
34 | /* All structures in this file are packed.
|
---|
35 | * Everything is little-endian.
|
---|
36 | */
|
---|
37 | #pragma pack(1)
|
---|
38 |
|
---|
39 | /*
|
---|
40 | * The application interface between VirtualBox and the VRDE server.
|
---|
41 | */
|
---|
42 |
|
---|
43 | #define VRDE_INPUT_INTERFACE_NAME "VRDE::INPUT"
|
---|
44 |
|
---|
45 | /*
|
---|
46 | * Supported input methods.
|
---|
47 | */
|
---|
48 | #define VRDE_INPUT_METHOD_TOUCH 1
|
---|
49 |
|
---|
50 | /*
|
---|
51 | * fu32Flags for VRDEInputSetup
|
---|
52 | */
|
---|
53 | #define VRDE_INPUT_F_ENABLE 1
|
---|
54 |
|
---|
55 | /* The interface entry points. Interface version 1. */
|
---|
56 | typedef struct VRDEINPUTINTERFACE
|
---|
57 | {
|
---|
58 | /* The header. */
|
---|
59 | VRDEINTERFACEHDR header;
|
---|
60 |
|
---|
61 | /* Tell the server that an input method will be used or disabled, etc.
|
---|
62 | * VRDECallbackInputSetup will be called with a result.
|
---|
63 | *
|
---|
64 | * @param hServer The VRDE server instance.
|
---|
65 | * @param u32Method The method VRDE_INPUT_METHOD_*.
|
---|
66 | * @param fu32Flags What to do with the method VRDE_INPUT_F_*.
|
---|
67 | * @param pvSetup Method specific parameters (optional).
|
---|
68 | * @param cbSetup Size of method specific parameters (optional).
|
---|
69 | */
|
---|
70 | DECLR3CALLBACKMEMBER(void, VRDEInputSetup, (HVRDESERVER hServer,
|
---|
71 | uint32_t u32Method,
|
---|
72 | uint32_t fu32Flags,
|
---|
73 | const void *pvSetup,
|
---|
74 | uint32_t cbSetup));
|
---|
75 | } VRDEINPUTINTERFACE;
|
---|
76 |
|
---|
77 |
|
---|
78 | /* Interface callbacks. */
|
---|
79 | typedef struct VRDEINPUTCALLBACKS
|
---|
80 | {
|
---|
81 | /* The header. */
|
---|
82 | VRDEINTERFACEHDR header;
|
---|
83 |
|
---|
84 | /* VRDPInputSetup async result.
|
---|
85 | *
|
---|
86 | * @param pvCallback The callbacks context specified in VRDEGetInterface.
|
---|
87 | * @param rcSetup The result code of the request.
|
---|
88 | * @param u32Method The method VRDE_INPUT_METHOD_*.
|
---|
89 | * @param pvResult The result information.
|
---|
90 | * @param cbResult The size of buffer pointed by pvResult.
|
---|
91 | */
|
---|
92 | DECLR3CALLBACKMEMBER(void, VRDECallbackInputSetup,(void *pvCallback,
|
---|
93 | int rcRequest,
|
---|
94 | uint32_t u32Method,
|
---|
95 | const void *pvResult,
|
---|
96 | uint32_t cbResult));
|
---|
97 |
|
---|
98 | /* Input event.
|
---|
99 | *
|
---|
100 | * @param pvCallback The callbacks context specified in VRDEGetInterface.
|
---|
101 | * @param u32Method The method VRDE_INPUT_METHOD_*.
|
---|
102 | * @param pvEvent The event data.
|
---|
103 | * @param cbEvent The size of buffer pointed by pvEvent.
|
---|
104 | */
|
---|
105 | DECLR3CALLBACKMEMBER(void, VRDECallbackInputEvent,(void *pvCallback,
|
---|
106 | uint32_t u32Method,
|
---|
107 | const void *pvEvent,
|
---|
108 | uint32_t cbEvent));
|
---|
109 | } VRDEINPUTCALLBACKS;
|
---|
110 |
|
---|
111 |
|
---|
112 | /*
|
---|
113 | * Touch input definitions VRDE_INPUT_METHOD_TOUCH.
|
---|
114 | */
|
---|
115 |
|
---|
116 | /* pvResult is not used */
|
---|
117 |
|
---|
118 | /* RDPINPUT_HEADER */
|
---|
119 | typedef struct VRDEINPUTHEADER
|
---|
120 | {
|
---|
121 | uint16_t u16EventId;
|
---|
122 | uint32_t u32PDULength;
|
---|
123 | } VRDEINPUTHEADER;
|
---|
124 |
|
---|
125 | /* VRDEINPUTHEADER::u16EventId */
|
---|
126 | #define VRDEINPUT_EVENTID_SC_READY 0x0001
|
---|
127 | #define VRDEINPUT_EVENTID_CS_READY 0x0002
|
---|
128 | #define VRDEINPUT_EVENTID_TOUCH 0x0003
|
---|
129 | #define VRDEINPUT_EVENTID_SUSPEND_TOUCH 0x0004
|
---|
130 | #define VRDEINPUT_EVENTID_RESUME_TOUCH 0x0005
|
---|
131 | #define VRDEINPUT_EVENTID_DISMISS_HOVERING_CONTACT 0x0006
|
---|
132 |
|
---|
133 | /* RDPINPUT_SC_READY_PDU */
|
---|
134 | typedef struct VRDEINPUT_SC_READY_PDU
|
---|
135 | {
|
---|
136 | VRDEINPUTHEADER header;
|
---|
137 | uint32_t u32ProtocolVersion;
|
---|
138 | } VRDEINPUT_SC_READY_PDU;
|
---|
139 |
|
---|
140 | #define VRDEINPUT_PROTOCOL_V1 0x00010000
|
---|
141 | #define VRDEINPUT_PROTOCOL_V101 0x00010001
|
---|
142 |
|
---|
143 | /* RDPINPUT_CS_READY_PDU */
|
---|
144 | typedef struct VRDEINPUT_CS_READY_PDU
|
---|
145 | {
|
---|
146 | VRDEINPUTHEADER header;
|
---|
147 | uint32_t u32Flags;
|
---|
148 | uint32_t u32ProtocolVersion;
|
---|
149 | uint16_t u16MaxTouchContacts;
|
---|
150 | } VRDEINPUT_CS_READY_PDU;
|
---|
151 |
|
---|
152 | #define VRDEINPUT_READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001
|
---|
153 | #define VRDEINPUT_READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002
|
---|
154 |
|
---|
155 | /* RDPINPUT_CONTACT_DATA */
|
---|
156 | typedef struct VRDEINPUT_CONTACT_DATA
|
---|
157 | {
|
---|
158 | uint8_t u8ContactId;
|
---|
159 | uint16_t u16FieldsPresent;
|
---|
160 | int32_t i32X;
|
---|
161 | int32_t i32Y;
|
---|
162 | uint32_t u32ContactFlags;
|
---|
163 | int16_t i16ContactRectLeft;
|
---|
164 | int16_t i16ContactRectTop;
|
---|
165 | int16_t i16ContactRectRight;
|
---|
166 | int16_t i16ContactRectBottom;
|
---|
167 | uint32_t u32Orientation;
|
---|
168 | uint32_t u32Pressure;
|
---|
169 | } VRDEINPUT_CONTACT_DATA;
|
---|
170 |
|
---|
171 | #define VRDEINPUT_CONTACT_DATA_CONTACTRECT_PRESENT 0x0001
|
---|
172 | #define VRDEINPUT_CONTACT_DATA_ORIENTATION_PRESENT 0x0002
|
---|
173 | #define VRDEINPUT_CONTACT_DATA_PRESSURE_PRESENT 0x0004
|
---|
174 |
|
---|
175 | #define VRDEINPUT_CONTACT_FLAG_DOWN 0x0001
|
---|
176 | #define VRDEINPUT_CONTACT_FLAG_UPDATE 0x0002
|
---|
177 | #define VRDEINPUT_CONTACT_FLAG_UP 0x0004
|
---|
178 | #define VRDEINPUT_CONTACT_FLAG_INRANGE 0x0008
|
---|
179 | #define VRDEINPUT_CONTACT_FLAG_INCONTACT 0x0010
|
---|
180 | #define VRDEINPUT_CONTACT_FLAG_CANCELED 0x0020
|
---|
181 |
|
---|
182 | /* RDPINPUT_TOUCH_FRAME */
|
---|
183 | typedef struct VRDEINPUT_TOUCH_FRAME
|
---|
184 | {
|
---|
185 | uint16_t u16ContactCount;
|
---|
186 | uint64_t u64FrameOffset;
|
---|
187 | VRDEINPUT_CONTACT_DATA aContacts[1];
|
---|
188 | } VRDEINPUT_TOUCH_FRAME;
|
---|
189 |
|
---|
190 | /* RDPINPUT_TOUCH_EVENT_PDU */
|
---|
191 | typedef struct VRDEINPUT_TOUCH_EVENT_PDU
|
---|
192 | {
|
---|
193 | VRDEINPUTHEADER header;
|
---|
194 | uint32_t u32EncodeTime;
|
---|
195 | uint16_t u16FrameCount;
|
---|
196 | VRDEINPUT_TOUCH_FRAME aFrames[1];
|
---|
197 | } VRDEINPUT_TOUCH_EVENT_PDU;
|
---|
198 |
|
---|
199 | /* RDPINPUT_SUSPEND_TOUCH_PDU */
|
---|
200 | typedef struct VRDEINPUT_SUSPEND_TOUCH_PDU
|
---|
201 | {
|
---|
202 | VRDEINPUTHEADER header;
|
---|
203 | } VRDEINPUT_SUSPEND_TOUCH_PDU;
|
---|
204 |
|
---|
205 | /* RDPINPUT_RESUME_TOUCH_PDU */
|
---|
206 | typedef struct VRDEINPUT_RESUME_TOUCH_PDU
|
---|
207 | {
|
---|
208 | VRDEINPUTHEADER header;
|
---|
209 | } VRDEINPUT_RESUME_TOUCH_PDU;
|
---|
210 |
|
---|
211 | /* RDPINPUT_DISMISS_HOVERING_CONTACT_PDU */
|
---|
212 | typedef struct VRDEINPUT_DISMISS_HOVERING_CONTACT_PDU
|
---|
213 | {
|
---|
214 | VRDEINPUTHEADER header;
|
---|
215 | uint8_t u8ContactId;
|
---|
216 | } VRDEINPUT_DISMISS_HOVERING_CONTACT_PDU;
|
---|
217 |
|
---|
218 | #pragma pack()
|
---|
219 |
|
---|
220 | #endif
|
---|