e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/** @file
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * VBox Remote Desktop Extension (VRDE) - Input interface.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/*
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * Copyright (C) 2013 Oracle Corporation
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync *
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * available from http://www.virtualbox.org. This file is free software;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * you can redistribute it and/or modify it under the terms of the GNU
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * General Public License (GPL) as published by the Free Software
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync *
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * The contents of this file may alternatively be used under the terms
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * of the Common Development and Distribution License Version 1.0
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * VirtualBox OSE distribution, in which case the provisions of the
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * CDDL are applicable instead of those of the GPL.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync *
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * You may elect to license modified versions of this file under the
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * terms and conditions of either the GPL or the CDDL or both.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#ifndef ___VBox_RemoteDesktop_VRDEInput_h
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define ___VBox_RemoteDesktop_VRDEInput_h
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/*
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * Interface for receiving input events from the client.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* All structures in this file are packed.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * Everything is little-endian.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#pragma pack(1)
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/*
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * The application interface between VirtualBox and the VRDE server.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDE_INPUT_INTERFACE_NAME "VRDE::INPUT"
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/*
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * Supported input methods.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDE_INPUT_METHOD_TOUCH 1
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/*
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * fu32Flags for VRDEInputSetup
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDE_INPUT_F_ENABLE 1
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* The interface entry points. Interface version 1. */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsynctypedef struct VRDEINPUTINTERFACE
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync{
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync /* The header. */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync VRDEINTERFACEHDR header;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync /* Tell the server that an input method will be used or disabled, etc.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * VRDECallbackInputSetup will be called with a result.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync *
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param hServer The VRDE server instance.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param u32Method The method VRDE_INPUT_METHOD_*.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param fu32Flags What to do with the method VRDE_INPUT_F_*.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param pvSetup Method specific parameters (optional).
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param cbSetup Size of method specific parameters (optional).
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync DECLR3CALLBACKMEMBER(void, VRDEInputSetup, (HVRDESERVER hServer,
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t u32Method,
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t fu32Flags,
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync const void *pvSetup,
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t cbSetup));
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync} VRDEINPUTINTERFACE;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* Interface callbacks. */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsynctypedef struct VRDEINPUTCALLBACKS
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync{
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync /* The header. */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync VRDEINTERFACEHDR header;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync /* VRDPInputSetup async result.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync *
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param pvCallback The callbacks context specified in VRDEGetInterface.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param rcSetup The result code of the request.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param u32Method The method VRDE_INPUT_METHOD_*.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param pvResult The result information.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param cbResult The size of buffer pointed by pvResult.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync DECLR3CALLBACKMEMBER(void, VRDECallbackInputSetup,(void *pvCallback,
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync int rcRequest,
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t u32Method,
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync const void *pvResult,
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t cbResult));
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync /* Input event.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync *
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param pvCallback The callbacks context specified in VRDEGetInterface.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param u32Method The method VRDE_INPUT_METHOD_*.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param pvEvent The event data.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * @param cbEvent The size of buffer pointed by pvEvent.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync DECLR3CALLBACKMEMBER(void, VRDECallbackInputEvent,(void *pvCallback,
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t u32Method,
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync const void *pvEvent,
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t cbEvent));
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync} VRDEINPUTCALLBACKS;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/*
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync * Touch input definitions VRDE_INPUT_METHOD_TOUCH.
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* pvResult is not used */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* RDPINPUT_HEADER */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsynctypedef struct VRDEINPUTHEADER
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync{
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint16_t u16EventId;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t u32PDULength;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync} VRDEINPUTHEADER;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* VRDEINPUTHEADER::u16EventId */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_EVENTID_SC_READY 0x0001
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_EVENTID_CS_READY 0x0002
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_EVENTID_TOUCH 0x0003
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_EVENTID_SUSPEND_TOUCH 0x0004
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_EVENTID_RESUME_TOUCH 0x0005
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_EVENTID_DISMISS_HOVERING_CONTACT 0x0006
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* RDPINPUT_SC_READY_PDU */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsynctypedef struct VRDEINPUT_SC_READY_PDU
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync{
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync VRDEINPUTHEADER header;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t u32ProtocolVersion;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync} VRDEINPUT_SC_READY_PDU;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_PROTOCOL_V1 0x00010000
c6c158ce65149c5dcaa612aa185ec9f0f9872c0bvboxsync#define VRDEINPUT_PROTOCOL_V101 0x00010001
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* RDPINPUT_CS_READY_PDU */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsynctypedef struct VRDEINPUT_CS_READY_PDU
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync{
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync VRDEINPUTHEADER header;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t u32Flags;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t u32ProtocolVersion;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint16_t u16MaxTouchContacts;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync} VRDEINPUT_CS_READY_PDU;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* RDPINPUT_CONTACT_DATA */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsynctypedef struct VRDEINPUT_CONTACT_DATA
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync{
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint8_t u8ContactId;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint16_t u16FieldsPresent;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync int32_t i32X;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync int32_t i32Y;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t u32ContactFlags;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync int16_t i16ContactRectLeft;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync int16_t i16ContactRectTop;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync int16_t i16ContactRectRight;
bbb3fa7d95d57bcc15fdbe080ec52063d398ddf3vboxsync int16_t i16ContactRectBottom;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t u32Orientation;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t u32Pressure;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync} VRDEINPUT_CONTACT_DATA;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_CONTACT_DATA_CONTACTRECT_PRESENT 0x0001
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_CONTACT_DATA_ORIENTATION_PRESENT 0x0002
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_CONTACT_DATA_PRESSURE_PRESENT 0x0004
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_CONTACT_FLAG_DOWN 0x0001
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_CONTACT_FLAG_UPDATE 0x0002
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_CONTACT_FLAG_UP 0x0004
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_CONTACT_FLAG_INRANGE 0x0008
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_CONTACT_FLAG_INCONTACT 0x0010
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#define VRDEINPUT_CONTACT_FLAG_CANCELED 0x0020
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* RDPINPUT_TOUCH_FRAME */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsynctypedef struct VRDEINPUT_TOUCH_FRAME
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync{
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint16_t u16ContactCount;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint64_t u64FrameOffset;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync VRDEINPUT_CONTACT_DATA aContacts[1];
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync} VRDEINPUT_TOUCH_FRAME;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* RDPINPUT_TOUCH_EVENT_PDU */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsynctypedef struct VRDEINPUT_TOUCH_EVENT_PDU
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync{
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync VRDEINPUTHEADER header;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint32_t u32EncodeTime;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint16_t u16FrameCount;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync VRDEINPUT_TOUCH_FRAME aFrames[1];
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync} VRDEINPUT_TOUCH_EVENT_PDU;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* RDPINPUT_SUSPEND_TOUCH_PDU */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsynctypedef struct VRDEINPUT_SUSPEND_TOUCH_PDU
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync{
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync VRDEINPUTHEADER header;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync} VRDEINPUT_SUSPEND_TOUCH_PDU;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* RDPINPUT_RESUME_TOUCH_PDU */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsynctypedef struct VRDEINPUT_RESUME_TOUCH_PDU
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync{
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync VRDEINPUTHEADER header;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync} VRDEINPUT_RESUME_TOUCH_PDU;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync/* RDPINPUT_DISMISS_HOVERING_CONTACT_PDU */
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsynctypedef struct VRDEINPUT_DISMISS_HOVERING_CONTACT_PDU
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync{
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync VRDEINPUTHEADER header;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync uint8_t u8ContactId;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync} VRDEINPUT_DISMISS_HOVERING_CONTACT_PDU;
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#pragma pack()
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync
e6725710856db1d20c16eb103a0d3ea8f46a982avboxsync#endif