FreeRDP
client/rdpei_main.c File Reference
#include <freerdp/config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <winpr/crt.h>
#include <winpr/synch.h>
#include <winpr/thread.h>
#include <winpr/stream.h>
#include <winpr/sysinfo.h>
#include <winpr/cmdline.h>
#include <winpr/collections.h>
#include <freerdp/addin.h>
#include <freerdp/freerdp.h>
#include <freerdp/client/channels.h>
#include "rdpei_common.h"
#include "rdpei_main.h"

Macros

#define MAX_CONTACTS   64
 
#define MAX_PEN_CONTACTS   4
 

Functions

static UINT rdpei_send_frame (RdpeiClientContext *context, RDPINPUT_TOUCH_FRAME *frame)
 
static RDPINPUT_CONTACT_POINTrdpei_contact (RDPEI_PLUGIN *rdpei, INT32 externalId, BOOL active)
 
static UINT rdpei_add_frame (RdpeiClientContext *context)
 
static UINT rdpei_send_pdu (GENERIC_CHANNEL_CALLBACK *callback, wStream *s, UINT16 eventId, UINT32 pduLength)
 
static UINT rdpei_write_pen_frame (wStream *s, const RDPINPUT_PEN_FRAME *frame)
 
static UINT rdpei_send_pen_event_pdu (GENERIC_CHANNEL_CALLBACK *callback, UINT32 frameOffset, const RDPINPUT_PEN_FRAME *frames, UINT16 count)
 
static UINT rdpei_send_pen_frame (RdpeiClientContext *context, RDPINPUT_PEN_FRAME *frame)
 
static UINT rdpei_add_pen_frame (RdpeiClientContext *context)
 
static UINT rdpei_update (RdpeiClientContext *context)
 
static DWORD WINAPI rdpei_periodic_update (LPVOID arg)
 
static UINT rdpei_send_cs_ready_pdu (GENERIC_CHANNEL_CALLBACK *callback)
 
static void rdpei_print_contact_flags (UINT32 contactFlags)
 
static INT16 bounded (INT32 val)
 
static UINT rdpei_write_touch_frame (wStream *s, RDPINPUT_TOUCH_FRAME *frame)
 
static UINT rdpei_send_touch_event_pdu (GENERIC_CHANNEL_CALLBACK *callback, RDPINPUT_TOUCH_FRAME *frame)
 
static UINT rdpei_recv_sc_ready_pdu (GENERIC_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT rdpei_recv_suspend_touch_pdu (GENERIC_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT rdpei_recv_resume_touch_pdu (GENERIC_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT rdpei_recv_pdu (GENERIC_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT rdpei_on_data_received (IWTSVirtualChannelCallback *pChannelCallback, wStream *data)
 
static UINT rdpei_on_close (IWTSVirtualChannelCallback *pChannelCallback)
 
static UINT32 rdpei_get_version (RdpeiClientContext *context)
 
static UINT32 rdpei_get_features (RdpeiClientContext *context)
 
static UINT rdpei_add_contact (RdpeiClientContext *context, const RDPINPUT_CONTACT_DATA *contact)
 
static UINT rdpei_touch_process (RdpeiClientContext *context, INT32 externalId, UINT32 contactFlags, INT32 x, INT32 y, INT32 *contactId, UINT32 fieldFlags, va_list ap)
 
static UINT rdpei_touch_begin (RdpeiClientContext *context, INT32 externalId, INT32 x, INT32 y, INT32 *contactId)
 
static UINT rdpei_touch_update (RdpeiClientContext *context, INT32 externalId, INT32 x, INT32 y, INT32 *contactId)
 
static UINT rdpei_touch_end (RdpeiClientContext *context, INT32 externalId, INT32 x, INT32 y, INT32 *contactId)
 
static UINT rdpei_touch_cancel (RdpeiClientContext *context, INT32 externalId, INT32 x, INT32 y, INT32 *contactId)
 
static UINT rdpei_touch_raw_event (RdpeiClientContext *context, INT32 externalId, INT32 x, INT32 y, INT32 *contactId, UINT32 flags, UINT32 fieldFlags,...)
 
static UINT rdpei_touch_raw_event_va (RdpeiClientContext *context, INT32 externalId, INT32 x, INT32 y, INT32 *contactId, UINT32 flags, UINT32 fieldFlags, va_list args)
 
static RDPINPUT_PEN_CONTACT_POINTrdpei_pen_contact (RDPEI_PLUGIN *rdpei, INT32 externalId, BOOL active)
 
static UINT rdpei_add_pen (RdpeiClientContext *context, INT32 externalId, const RDPINPUT_PEN_CONTACT *contact)
 
static UINT rdpei_pen_process (RdpeiClientContext *context, INT32 externalId, UINT32 contactFlags, UINT32 fieldFlags, INT32 x, INT32 y, va_list ap)
 
static UINT rdpei_pen_begin (RdpeiClientContext *context, INT32 externalId, UINT32 fieldFlags, INT32 x, INT32 y,...)
 
static UINT rdpei_pen_update (RdpeiClientContext *context, INT32 externalId, UINT32 fieldFlags, INT32 x, INT32 y,...)
 
static UINT rdpei_pen_end (RdpeiClientContext *context, INT32 externalId, UINT32 fieldFlags, INT32 x, INT32 y,...)
 
static UINT rdpei_pen_hover_begin (RdpeiClientContext *context, INT32 externalId, UINT32 fieldFlags, INT32 x, INT32 y,...)
 
static UINT rdpei_pen_hover_update (RdpeiClientContext *context, INT32 externalId, UINT32 fieldFlags, INT32 x, INT32 y,...)
 
static UINT rdpei_pen_hover_cancel (RdpeiClientContext *context, INT32 externalId, UINT32 fieldFlags, INT32 x, INT32 y,...)
 
static UINT rdpei_pen_raw_event (RdpeiClientContext *context, INT32 externalId, UINT32 contactFlags, UINT32 fieldFlags, INT32 x, INT32 y,...)
 
static UINT rdpei_pen_raw_event_va (RdpeiClientContext *context, INT32 externalId, UINT32 contactFlags, UINT32 fieldFlags, INT32 x, INT32 y, va_list args)
 
static UINT init_plugin_cb (GENERIC_DYNVC_PLUGIN *base, rdpContext *rcontext, rdpSettings *settings)
 
static void terminate_plugin_cb (GENERIC_DYNVC_PLUGIN *base)
 

Variables

static const IWTSVirtualChannelCallback geometry_callbacks
 

Macro Definition Documentation

◆ MAX_CONTACTS

#define MAX_CONTACTS   64

FreeRDP: A Remote Desktop Protocol Implementation Input Virtual Channel Extension

Copyright 2013 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2015 Thincast Technologies GmbH Copyright 2015 DI (FH) Martin Haimberger marti.nosp@m.n.ha.nosp@m.imber.nosp@m.ger@.nosp@m.thinc.nosp@m.ast..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Touch Input http://msdn.microsoft.com/en-us/library/windows/desktop/dd562197/

Windows Touch Input http://msdn.microsoft.com/en-us/library/windows/desktop/dd317321/

Input: Touch injection sample http://code.msdn.microsoft.com/windowsdesktop/Touch-Injection-Sample-444d9bf7

Pointer Input Message Reference http://msdn.microsoft.com/en-us/library/hh454916/

POINTER_INFO Structure http://msdn.microsoft.com/en-us/library/hh454907/

POINTER_TOUCH_INFO Structure http://msdn.microsoft.com/en-us/library/hh454910/

◆ MAX_PEN_CONTACTS

#define MAX_PEN_CONTACTS   4

Function Documentation

◆ bounded()

static INT16 bounded ( INT32  val)
static
Here is the caller graph for this function:

◆ init_plugin_cb()

static UINT init_plugin_cb ( GENERIC_DYNVC_PLUGIN base,
rdpContext *  rcontext,
rdpSettings *  settings 
)
static
Here is the call graph for this function:

◆ rdpei_add_contact()

static UINT rdpei_add_contact ( RdpeiClientContext *  context,
const RDPINPUT_CONTACT_DATA contact 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_add_frame()

static UINT rdpei_add_frame ( RdpeiClientContext *  context)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_add_pen()

static UINT rdpei_add_pen ( RdpeiClientContext *  context,
INT32  externalId,
const RDPINPUT_PEN_CONTACT contact 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_add_pen_frame()

static UINT rdpei_add_pen_frame ( RdpeiClientContext *  context)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_contact()

static RDPINPUT_CONTACT_POINT* rdpei_contact ( RDPEI_PLUGIN *  rdpei,
INT32  externalId,
BOOL  active 
)
static
Here is the caller graph for this function:

◆ rdpei_get_features()

static UINT32 rdpei_get_features ( RdpeiClientContext *  context)
static
Here is the caller graph for this function:

◆ rdpei_get_version()

static UINT32 rdpei_get_version ( RdpeiClientContext *  context)
static

Channel Client Interface

Here is the caller graph for this function:

◆ rdpei_on_close()

static UINT rdpei_on_close ( IWTSVirtualChannelCallback *  pChannelCallback)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:

◆ rdpei_on_data_received()

static UINT rdpei_on_data_received ( IWTSVirtualChannelCallback *  pChannelCallback,
wStream data 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:

◆ rdpei_pen_begin()

static UINT rdpei_pen_begin ( RdpeiClientContext *  context,
INT32  externalId,
UINT32  fieldFlags,
INT32  x,
INT32  y,
  ... 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_pen_contact()

static RDPINPUT_PEN_CONTACT_POINT* rdpei_pen_contact ( RDPEI_PLUGIN *  rdpei,
INT32  externalId,
BOOL  active 
)
static
Here is the caller graph for this function:

◆ rdpei_pen_end()

static UINT rdpei_pen_end ( RdpeiClientContext *  context,
INT32  externalId,
UINT32  fieldFlags,
INT32  x,
INT32  y,
  ... 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_pen_hover_begin()

static UINT rdpei_pen_hover_begin ( RdpeiClientContext *  context,
INT32  externalId,
UINT32  fieldFlags,
INT32  x,
INT32  y,
  ... 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_pen_hover_cancel()

static UINT rdpei_pen_hover_cancel ( RdpeiClientContext *  context,
INT32  externalId,
UINT32  fieldFlags,
INT32  x,
INT32  y,
  ... 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_pen_hover_update()

static UINT rdpei_pen_hover_update ( RdpeiClientContext *  context,
INT32  externalId,
UINT32  fieldFlags,
INT32  x,
INT32  y,
  ... 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_pen_process()

static UINT rdpei_pen_process ( RdpeiClientContext *  context,
INT32  externalId,
UINT32  contactFlags,
UINT32  fieldFlags,
INT32  x,
INT32  y,
va_list  ap 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_pen_raw_event()

static UINT rdpei_pen_raw_event ( RdpeiClientContext *  context,
INT32  externalId,
UINT32  contactFlags,
UINT32  fieldFlags,
INT32  x,
INT32  y,
  ... 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_pen_raw_event_va()

static UINT rdpei_pen_raw_event_va ( RdpeiClientContext *  context,
INT32  externalId,
UINT32  contactFlags,
UINT32  fieldFlags,
INT32  x,
INT32  y,
va_list  args 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_pen_update()

static UINT rdpei_pen_update ( RdpeiClientContext *  context,
INT32  externalId,
UINT32  fieldFlags,
INT32  x,
INT32  y,
  ... 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_periodic_update()

static DWORD WINAPI rdpei_periodic_update ( LPVOID  arg)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_print_contact_flags()

static void rdpei_print_contact_flags ( UINT32  contactFlags)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_recv_pdu()

static UINT rdpei_recv_pdu ( GENERIC_CHANNEL_CALLBACK callback,
wStream s 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_recv_resume_touch_pdu()

static UINT rdpei_recv_resume_touch_pdu ( GENERIC_CHANNEL_CALLBACK callback,
wStream s 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_recv_sc_ready_pdu()

static UINT rdpei_recv_sc_ready_pdu ( GENERIC_CHANNEL_CALLBACK callback,
wStream s 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_recv_suspend_touch_pdu()

static UINT rdpei_recv_suspend_touch_pdu ( GENERIC_CHANNEL_CALLBACK callback,
wStream s 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_send_cs_ready_pdu()

static UINT rdpei_send_cs_ready_pdu ( GENERIC_CHANNEL_CALLBACK callback)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_send_frame()

UINT rdpei_send_frame ( RdpeiClientContext *  context,
RDPINPUT_TOUCH_FRAME frame 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_send_pdu()

static UINT rdpei_send_pdu ( GENERIC_CHANNEL_CALLBACK callback,
wStream s,
UINT16  eventId,
UINT32  pduLength 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_send_pen_event_pdu()

static UINT rdpei_send_pen_event_pdu ( GENERIC_CHANNEL_CALLBACK callback,
UINT32  frameOffset,
const RDPINPUT_PEN_FRAME frames,
UINT16  count 
)
static

the time that has elapsed (in milliseconds) from when the oldest touch frame was generated to when it was encoded for transmission by the client.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_send_pen_frame()

static UINT rdpei_send_pen_frame ( RdpeiClientContext *  context,
RDPINPUT_PEN_FRAME frame 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_send_touch_event_pdu()

static UINT rdpei_send_touch_event_pdu ( GENERIC_CHANNEL_CALLBACK callback,
RDPINPUT_TOUCH_FRAME frame 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

the time that has elapsed (in milliseconds) from when the oldest touch frame was generated to when it was encoded for transmission by the client.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_touch_begin()

static UINT rdpei_touch_begin ( RdpeiClientContext *  context,
INT32  externalId,
INT32  x,
INT32  y,
INT32 *  contactId 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_touch_cancel()

static UINT rdpei_touch_cancel ( RdpeiClientContext *  context,
INT32  externalId,
INT32  x,
INT32  y,
INT32 *  contactId 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_touch_end()

static UINT rdpei_touch_end ( RdpeiClientContext *  context,
INT32  externalId,
INT32  x,
INT32  y,
INT32 *  contactId 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_touch_process()

static UINT rdpei_touch_process ( RdpeiClientContext *  context,
INT32  externalId,
UINT32  contactFlags,
INT32  x,
INT32  y,
INT32 *  contactId,
UINT32  fieldFlags,
va_list  ap 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_touch_raw_event()

static UINT rdpei_touch_raw_event ( RdpeiClientContext *  context,
INT32  externalId,
INT32  x,
INT32  y,
INT32 *  contactId,
UINT32  flags,
UINT32  fieldFlags,
  ... 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_touch_raw_event_va()

static UINT rdpei_touch_raw_event_va ( RdpeiClientContext *  context,
INT32  externalId,
INT32  x,
INT32  y,
INT32 *  contactId,
UINT32  flags,
UINT32  fieldFlags,
va_list  args 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_touch_update()

static UINT rdpei_touch_update ( RdpeiClientContext *  context,
INT32  externalId,
INT32  x,
INT32  y,
INT32 *  contactId 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_update()

static UINT rdpei_update ( RdpeiClientContext *  context)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_write_pen_frame()

static UINT rdpei_write_pen_frame ( wStream s,
const RDPINPUT_PEN_FRAME frame 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rdpei_write_touch_frame()

static UINT rdpei_write_touch_frame ( wStream s,
RDPINPUT_TOUCH_FRAME frame 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

the time offset from the previous frame (in microseconds). If this is the first frame being transmitted then this field MUST be set to zero.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ terminate_plugin_cb()

static void terminate_plugin_cb ( GENERIC_DYNVC_PLUGIN base)
static
Here is the call graph for this function:

Variable Documentation

◆ geometry_callbacks

const IWTSVirtualChannelCallback geometry_callbacks
static
Initial value:
NULL,
if availableBytes return NULL
Definition: TPCircularBuffer.h:109
static UINT rdpei_on_data_received(IWTSVirtualChannelCallback *pChannelCallback, wStream *data)
Definition: client/rdpei_main.c:860
static UINT rdpei_on_close(IWTSVirtualChannelCallback *pChannelCallback)
Definition: client/rdpei_main.c:871