cscg24-guacamole

CSCG 2024 Challenge 'Guacamole Mashup'
git clone https://git.sinitax.com/sinitax/cscg24-guacamole
Log | Files | Refs | sfeed.txt

rdpei.h (3802B)


      1/**
      2 * FreeRDP: A Remote Desktop Protocol Implementation
      3 * Extended Input channel common definitions
      4 *
      5 * Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
      6 * Copyright 2014 Thincast Technologies Gmbh.
      7 * Copyright 2014 David FORT <contact@hardening-consulting.com>
      8 *
      9 * Licensed under the Apache License, Version 2.0 (the "License");
     10 * you may not use this file except in compliance with the License.
     11 * You may obtain a copy of the License at
     12 *
     13 *     http://www.apache.org/licenses/LICENSE-2.0
     14 *
     15 * Unless required by applicable law or agreed to in writing, software
     16 * distributed under the License is distributed on an "AS IS" BASIS,
     17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     18 * See the License for the specific language governing permissions and
     19 * limitations under the License.
     20 */
     21
     22#ifndef FREERDP_CHANNEL_RDPEI_H
     23#define FREERDP_CHANNEL_RDPEI_H
     24
     25#include <winpr/wtypes.h>
     26
     27#define RDPINPUT_HEADER_LENGTH 6
     28
     29#define RDPEI_DVC_CHANNEL_NAME "Microsoft::Windows::RDS::Input"
     30
     31/** @brief protocol version */
     32enum
     33{
     34	RDPINPUT_PROTOCOL_V10 = 0x00010000,
     35	RDPINPUT_PROTOCOL_V101 = 0x00010001,
     36	RDPINPUT_PROTOCOL_V200 = 0x00020000,
     37	RDPINPUT_PROTOCOL_V300 = 0x00030000
     38};
     39
     40/* Client Ready Flags */
     41#if !defined(DEFINE_NO_DEPRECATED)
     42#define READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001          /* Deprecated */
     43#define READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002 /* Deprecated */
     44#endif
     45
     46#define CS_READY_FLAGS_SHOW_TOUCH_VISUALS 0x00000001
     47#define CS_READY_FLAGS_DISABLE_TIMESTAMP_INJECTION 0x00000002
     48#define CS_READY_FLAGS_ENABLE_MULTIPEN_INJECTION 0x00000004
     49
     50#define CONTACT_DATA_CONTACTRECT_PRESENT 0x0001
     51#define CONTACT_DATA_ORIENTATION_PRESENT 0x0002
     52#define CONTACT_DATA_PRESSURE_PRESENT 0x0004
     53
     54typedef enum
     55{
     56	PEN_CONTACT_PENFLAGS_PRESENT = 0x0001,
     57	PEN_CONTACT_PRESSURE_PRESENT = 0x0002,
     58	PEN_CONTACT_ROTATION_PRESENT = 0x0004,
     59	PEN_CONTACT_TILTX_PRESENT = 0x0008,
     60	PEN_CONTACT_TILTY_PRESENT = 0x0010
     61} RDPINPUT_PEN_FIELDS_PRESENT;
     62
     63typedef enum
     64{
     65	CONTACT_FLAG_DOWN = 0x0001,
     66	CONTACT_FLAG_UPDATE = 0x0002,
     67	CONTACT_FLAG_UP = 0x0004,
     68	CONTACT_FLAG_INRANGE = 0x0008,
     69	CONTACT_FLAG_INCONTACT = 0x0010,
     70	CONTACT_FLAG_CANCELED = 0x0020
     71} RDPINPUT_CONTACT_FLAGS;
     72
     73typedef enum
     74{
     75	PEN_FLAG_BARREL_PRESSED = 0x0001,
     76	PEN_FLAG_ERASER_PRESSED = 0x0002,
     77	PEN_FLAG_INVERTED = 0x0004
     78} RDPINPUT_PEN_FLAGS;
     79
     80/** @brief a contact point */
     81struct _RDPINPUT_CONTACT_DATA
     82{
     83	UINT32 contactId;
     84	UINT32 fieldsPresent;
     85	INT32 x;
     86	INT32 y;
     87	UINT32 contactFlags;
     88	INT32 contactRectLeft;
     89	INT32 contactRectTop;
     90	INT32 contactRectRight;
     91	INT32 contactRectBottom;
     92	UINT32 orientation;
     93	UINT32 pressure;
     94};
     95typedef struct _RDPINPUT_CONTACT_DATA RDPINPUT_CONTACT_DATA;
     96
     97/** @brief a frame containing contact points */
     98struct _RDPINPUT_TOUCH_FRAME
     99{
    100	UINT32 contactCount;
    101	UINT64 frameOffset;
    102	RDPINPUT_CONTACT_DATA* contacts;
    103};
    104typedef struct _RDPINPUT_TOUCH_FRAME RDPINPUT_TOUCH_FRAME;
    105
    106/** @brief a touch event with some frames*/
    107struct _RDPINPUT_TOUCH_EVENT
    108{
    109	UINT32 encodeTime;
    110	UINT16 frameCount;
    111	RDPINPUT_TOUCH_FRAME* frames;
    112};
    113typedef struct _RDPINPUT_TOUCH_EVENT RDPINPUT_TOUCH_EVENT;
    114
    115struct _RDPINPUT_PEN_CONTACT
    116{
    117	UINT8 deviceId;
    118	UINT16 fieldsPresent;
    119	INT32 x;
    120	INT32 y;
    121	UINT32 contactFlags;
    122	UINT32 penFlags;
    123	UINT32 pressure;
    124	UINT16 rotation;
    125	INT16 tiltX;
    126	INT16 tiltY;
    127};
    128typedef struct _RDPINPUT_PEN_CONTACT RDPINPUT_PEN_CONTACT;
    129
    130struct _RDPINPUT_PEN_FRAME
    131{
    132	UINT16 contactCount;
    133	UINT64 frameOffset;
    134	RDPINPUT_PEN_CONTACT* contacts;
    135};
    136typedef struct _RDPINPUT_PEN_FRAME RDPINPUT_PEN_FRAME;
    137
    138/** @brief a touch event with some frames*/
    139struct _RDPINPUT_PEN_EVENT
    140{
    141	UINT32 encodeTime;
    142	UINT16 frameCount;
    143	RDPINPUT_PEN_FRAME* frames;
    144};
    145typedef struct _RDPINPUT_PEN_EVENT RDPINPUT_PEN_EVENT;
    146#endif /* FREERDP_CHANNEL_RDPEI_H */