FreeRDP
client/rdpei_main.c File Reference
#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 "rdpei_common.h"
#include "rdpei_main.h"

Macros

#define MAX_CONTACTS   64
 
#define MAX_PEN_CONTACTS   4
 
#define DVCPluginEntry   FREERDP_API DVCPluginEntry
 

Functions

static UINT rdpei_send_frame (RdpeiClientContext *context, RDPINPUT_TOUCH_FRAME *frame)
 
static RDPINPUT_CONTACT_POINT * rdpei_contact (RDPEI_PLUGIN *rdpei, INT32 externalId, BOOL active)
 
static UINT rdpei_add_frame (RdpeiClientContext *context)
 
static UINT rdpei_send_pdu (RDPEI_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 (RDPEI_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 (RDPEI_CHANNEL_CALLBACK *callback)
 
static void rdpei_print_contact_flags (UINT32 contactFlags)
 
static UINT rdpei_write_touch_frame (wStream *s, RDPINPUT_TOUCH_FRAME *frame)
 
static UINT rdpei_send_touch_event_pdu (RDPEI_CHANNEL_CALLBACK *callback, RDPINPUT_TOUCH_FRAME *frame)
 
static UINT rdpei_recv_sc_ready_pdu (RDPEI_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT rdpei_recv_suspend_touch_pdu (RDPEI_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT rdpei_recv_resume_touch_pdu (RDPEI_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT rdpei_recv_pdu (RDPEI_CHANNEL_CALLBACK *callback, wStream *s)
 
static UINT rdpei_on_data_received (IWTSVirtualChannelCallback *pChannelCallback, wStream *data)
 
static UINT rdpei_on_close (IWTSVirtualChannelCallback *pChannelCallback)
 
static UINT rdpei_on_new_channel_connection (IWTSListenerCallback *pListenerCallback, IWTSVirtualChannel *pChannel, BYTE *Data, BOOL *pbAccept, IWTSVirtualChannelCallback **ppCallback)
 
static UINT rdpei_plugin_terminated (IWTSPlugin *pPlugin)
 
static UINT rdpei_plugin_initialize (IWTSPlugin *pPlugin, IWTSVirtualChannelManager *pChannelMgr)
 
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 RDPINPUT_PEN_CONTACT_POINT * rdpei_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_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,...)
 
UINT DVCPluginEntry (IDRDYNVC_ENTRY_POINTS *pEntryPoints)
 

Macro Definition Documentation

◆ DVCPluginEntry

#define DVCPluginEntry   FREERDP_API DVCPluginEntry

◆ 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

◆ DVCPluginEntry()

UINT DVCPluginEntry ( IDRDYNVC_ENTRY_POINTS *  pEntryPoints)

Function description

Returns
0 on success, otherwise a Win32 error code
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:
Here is the caller 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:
Here is the caller graph for this function:

◆ rdpei_on_new_channel_connection()

static UINT rdpei_on_new_channel_connection ( IWTSListenerCallback *  pListenerCallback,
IWTSVirtualChannel *  pChannel,
BYTE Data,
BOOL *  pbAccept,
IWTSVirtualChannelCallback **  ppCallback 
)
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_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_cancel()

static UINT rdpei_pen_cancel ( RdpeiClientContext *  context,
INT32  externalId,
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_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_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_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_plugin_initialize()

static UINT rdpei_plugin_initialize ( IWTSPlugin *  pPlugin,
IWTSVirtualChannelManager *  pChannelMgr 
)
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_plugin_terminated()

static UINT rdpei_plugin_terminated ( IWTSPlugin *  pPlugin)
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_print_contact_flags()

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

◆ rdpei_recv_pdu()

static UINT rdpei_recv_pdu ( RDPEI_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 ( RDPEI_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 ( RDPEI_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 ( RDPEI_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 ( RDPEI_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 ( RDPEI_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 ( RDPEI_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 ( RDPEI_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_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: