FreeRDP
xf_cliprdr.c File Reference
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <winpr/crt.h>
#include <winpr/image.h>
#include <winpr/stream.h>
#include <winpr/clipboard.h>
#include <freerdp/log.h>
#include <freerdp/client/cliprdr.h>
#include <freerdp/channels/channels.h>
#include <freerdp/channels/cliprdr.h>
#include "xf_cliprdr.h"

Macros

#define TAG   CLIENT_TAG("x11")
 
#define MAX_CLIPBOARD_FORMATS   255
 

Functions

static UINT xf_cliprdr_send_client_format_list (xfClipboard *clipboard)
 
static void xf_cliprdr_check_owner (xfClipboard *clipboard)
 
static BOOL xf_cliprdr_is_self_owned (xfClipboard *clipboard)
 
static void xf_cliprdr_set_raw_transfer_enabled (xfClipboard *clipboard, BOOL enabled)
 
static BOOL xf_cliprdr_is_raw_transfer_available (xfClipboard *clipboard)
 
static BOOL xf_cliprdr_formats_equal (const CLIPRDR_FORMAT *server, const xfCliprdrFormat *client)
 
static xfCliprdrFormat * xf_cliprdr_get_client_format_by_id (xfClipboard *clipboard, UINT32 formatId)
 
static xfCliprdrFormat * xf_cliprdr_get_client_format_by_atom (xfClipboard *clipboard, Atom atom)
 
static CLIPRDR_FORMAT * xf_cliprdr_get_server_format_by_atom (xfClipboard *clipboard, Atom atom)
 
static UINT xf_cliprdr_send_data_request (xfClipboard *clipboard, UINT32 formatId)
 
static UINT xf_cliprdr_send_data_response (xfClipboard *clipboard, BYTE *data, int size)
 
static wStream * xf_cliprdr_serialize_server_format_list (xfClipboard *clipboard)
 
static CLIPRDR_FORMAT * xf_cliprdr_parse_server_format_list (BYTE *data, size_t length, UINT32 *numFormats)
 
static void xf_cliprdr_free_formats (CLIPRDR_FORMAT *formats, UINT32 numFormats)
 
static CLIPRDR_FORMAT * xf_cliprdr_get_raw_server_formats (xfClipboard *clipboard, UINT32 *numFormats)
 
static CLIPRDR_FORMAT * xf_cliprdr_get_formats_from_targets (xfClipboard *clipboard, UINT32 *numFormats)
 
static CLIPRDR_FORMAT * xf_cliprdr_get_client_formats (xfClipboard *clipboard, UINT32 *numFormats)
 
static void xf_cliprdr_provide_server_format_list (xfClipboard *clipboard)
 
static void xf_cliprdr_get_requested_targets (xfClipboard *clipboard)
 
static void xf_cliprdr_process_requested_data (xfClipboard *clipboard, BOOL hasData, BYTE *data, int size)
 
static BOOL xf_cliprdr_get_requested_data (xfClipboard *clipboard, Atom target)
 
static void xf_cliprdr_append_target (xfClipboard *clipboard, Atom target)
 
static void xf_cliprdr_provide_targets (xfClipboard *clipboard, XEvent *respond)
 
static void xf_cliprdr_provide_data (xfClipboard *clipboard, XEvent *respond, BYTE *data, UINT32 size)
 
static BOOL xf_cliprdr_process_selection_notify (xfClipboard *clipboard, XEvent *xevent)
 
static void xf_cliprdr_clear_cached_data (xfClipboard *clipboard)
 
static BOOL xf_cliprdr_process_selection_request (xfClipboard *clipboard, XEvent *xevent)
 
static BOOL xf_cliprdr_process_selection_clear (xfClipboard *clipboard, XEvent *xevent)
 
static BOOL xf_cliprdr_process_property_notify (xfClipboard *clipboard, XEvent *xevent)
 
void xf_cliprdr_handle_xevent (xfContext *xfc, XEvent *event)
 
static UINT xf_cliprdr_send_client_capabilities (xfClipboard *clipboard)
 
static UINT xf_cliprdr_send_client_format_list_response (xfClipboard *clipboard, BOOL status)
 
static UINT xf_cliprdr_monitor_ready (CliprdrClientContext *context, CLIPRDR_MONITOR_READY *monitorReady)
 
static UINT xf_cliprdr_server_capabilities (CliprdrClientContext *context, CLIPRDR_CAPABILITIES *capabilities)
 
static UINT xf_cliprdr_server_format_list (CliprdrClientContext *context, CLIPRDR_FORMAT_LIST *formatList)
 
static UINT xf_cliprdr_server_format_list_response (CliprdrClientContext *context, CLIPRDR_FORMAT_LIST_RESPONSE *formatListResponse)
 
static UINT xf_cliprdr_server_format_data_request (CliprdrClientContext *context, CLIPRDR_FORMAT_DATA_REQUEST *formatDataRequest)
 
static UINT xf_cliprdr_server_format_data_response (CliprdrClientContext *context, CLIPRDR_FORMAT_DATA_RESPONSE *formatDataResponse)
 
static UINT xf_cliprdr_server_file_size_request (xfClipboard *clipboard, const CLIPRDR_FILE_CONTENTS_REQUEST *fileContentsRequest)
 
static UINT xf_cliprdr_server_file_range_request (xfClipboard *clipboard, const CLIPRDR_FILE_CONTENTS_REQUEST *fileContentsRequest)
 
static UINT xf_cliprdr_send_file_contents_failure (CliprdrClientContext *context, const CLIPRDR_FILE_CONTENTS_REQUEST *fileContentsRequest)
 
static UINT xf_cliprdr_server_file_contents_request (CliprdrClientContext *context, CLIPRDR_FILE_CONTENTS_REQUEST *fileContentsRequest)
 
static UINT xf_cliprdr_clipboard_file_size_success (wClipboardDelegate *delegate, const wClipboardFileSizeRequest *request, UINT64 fileSize)
 
static UINT xf_cliprdr_clipboard_file_size_failure (wClipboardDelegate *delegate, const wClipboardFileSizeRequest *request, UINT errorCode)
 
static UINT xf_cliprdr_clipboard_file_range_success (wClipboardDelegate *delegate, const wClipboardFileRangeRequest *request, const BYTE *data, UINT32 size)
 
static UINT xf_cliprdr_clipboard_file_range_failure (wClipboardDelegate *delegate, const wClipboardFileRangeRequest *request, UINT errorCode)
 
xfClipboard * xf_clipboard_new (xfContext *xfc)
 
void xf_clipboard_free (xfClipboard *clipboard)
 
void xf_cliprdr_init (xfContext *xfc, CliprdrClientContext *cliprdr)
 
void xf_cliprdr_uninit (xfContext *xfc, CliprdrClientContext *cliprdr)
 

Macro Definition Documentation

#define MAX_CLIPBOARD_FORMATS   255
#define TAG   CLIENT_TAG("x11")

FreeRDP: A Remote Desktop Protocol Implementation X11 Clipboard Redirection

Copyright 2010-2011 Vic Lee 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.

Function Documentation

void xf_clipboard_free ( xfClipboard *  clipboard)

Here is the call graph for this function:

Here is the caller graph for this function:

xfClipboard* xf_clipboard_new ( xfContext *  xfc)

FreeRDP: A Remote Desktop Protocol Implementation X11 Clipboard Redirection

Copyright 2010-2011 Vic Lee

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.

Here is the call graph for this function:

Here is the caller graph for this function:

static void xf_cliprdr_append_target ( xfClipboard *  clipboard,
Atom  target 
)
static

Here is the caller graph for this function:

static void xf_cliprdr_check_owner ( xfClipboard *  clipboard)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void xf_cliprdr_clear_cached_data ( xfClipboard *  clipboard)
static

Here is the caller graph for this function:

static UINT xf_cliprdr_clipboard_file_range_failure ( wClipboardDelegate *  delegate,
const wClipboardFileRangeRequest *  request,
UINT  errorCode 
)
static

Here is the caller graph for this function:

static UINT xf_cliprdr_clipboard_file_range_success ( wClipboardDelegate *  delegate,
const wClipboardFileRangeRequest *  request,
const BYTE data,
UINT32  size 
)
static

Here is the caller graph for this function:

static UINT xf_cliprdr_clipboard_file_size_failure ( wClipboardDelegate *  delegate,
const wClipboardFileSizeRequest *  request,
UINT  errorCode 
)
static

Here is the caller graph for this function:

static UINT xf_cliprdr_clipboard_file_size_success ( wClipboardDelegate *  delegate,
const wClipboardFileSizeRequest *  request,
UINT64  fileSize 
)
static

Here is the caller graph for this function:

static BOOL xf_cliprdr_formats_equal ( const CLIPRDR_FORMAT *  server,
const xfCliprdrFormat *  client 
)
static

Here is the caller graph for this function:

static void xf_cliprdr_free_formats ( CLIPRDR_FORMAT *  formats,
UINT32  numFormats 
)
static

Here is the caller graph for this function:

static xfCliprdrFormat* xf_cliprdr_get_client_format_by_atom ( xfClipboard *  clipboard,
Atom  atom 
)
static

Here is the caller graph for this function:

static xfCliprdrFormat* xf_cliprdr_get_client_format_by_id ( xfClipboard *  clipboard,
UINT32  formatId 
)
static

Here is the caller graph for this function:

static CLIPRDR_FORMAT* xf_cliprdr_get_client_formats ( xfClipboard *  clipboard,
UINT32 numFormats 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static CLIPRDR_FORMAT* xf_cliprdr_get_formats_from_targets ( xfClipboard *  clipboard,
UINT32 numFormats 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static CLIPRDR_FORMAT* xf_cliprdr_get_raw_server_formats ( xfClipboard *  clipboard,
UINT32 numFormats 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_cliprdr_get_requested_data ( xfClipboard *  clipboard,
Atom  target 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void xf_cliprdr_get_requested_targets ( xfClipboard *  clipboard)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static CLIPRDR_FORMAT* xf_cliprdr_get_server_format_by_atom ( xfClipboard *  clipboard,
Atom  atom 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

void xf_cliprdr_handle_xevent ( xfContext *  xfc,
XEvent *  event 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void xf_cliprdr_init ( xfContext *  xfc,
CliprdrClientContext *  cliprdr 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_cliprdr_is_raw_transfer_available ( xfClipboard *  clipboard)
static

Here is the caller graph for this function:

static BOOL xf_cliprdr_is_self_owned ( xfClipboard *  clipboard)
static

Here is the caller graph for this function:

static UINT xf_cliprdr_monitor_ready ( CliprdrClientContext *  context,
CLIPRDR_MONITOR_READY *  monitorReady 
)
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:

static CLIPRDR_FORMAT* xf_cliprdr_parse_server_format_list ( BYTE data,
size_t  length,
UINT32 numFormats 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_cliprdr_process_property_notify ( xfClipboard *  clipboard,
XEvent *  xevent 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void xf_cliprdr_process_requested_data ( xfClipboard *  clipboard,
BOOL  hasData,
BYTE data,
int  size 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_cliprdr_process_selection_clear ( xfClipboard *  clipboard,
XEvent *  xevent 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_cliprdr_process_selection_notify ( xfClipboard *  clipboard,
XEvent *  xevent 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static BOOL xf_cliprdr_process_selection_request ( xfClipboard *  clipboard,
XEvent *  xevent 
)
static

Send clipboard data request to the server. Response will be postponed after receiving the data

Here is the call graph for this function:

Here is the caller graph for this function:

static void xf_cliprdr_provide_data ( xfClipboard *  clipboard,
XEvent *  respond,
BYTE data,
UINT32  size 
)
static

Here is the caller graph for this function:

static void xf_cliprdr_provide_server_format_list ( xfClipboard *  clipboard)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void xf_cliprdr_provide_targets ( xfClipboard *  clipboard,
XEvent *  respond 
)
static

Here is the caller graph for this function:

static UINT xf_cliprdr_send_client_capabilities ( xfClipboard *  clipboard)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

static UINT xf_cliprdr_send_client_format_list ( xfClipboard *  clipboard)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

static UINT xf_cliprdr_send_client_format_list_response ( xfClipboard *  clipboard,
BOOL  status 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

static UINT xf_cliprdr_send_data_request ( xfClipboard *  clipboard,
UINT32  formatId 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

static UINT xf_cliprdr_send_data_response ( xfClipboard *  clipboard,
BYTE data,
int  size 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

static UINT xf_cliprdr_send_file_contents_failure ( CliprdrClientContext *  context,
const CLIPRDR_FILE_CONTENTS_REQUEST *  fileContentsRequest 
)
static

Here is the caller graph for this function:

static wStream* xf_cliprdr_serialize_server_format_list ( xfClipboard *  clipboard)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT xf_cliprdr_server_capabilities ( CliprdrClientContext *  context,
CLIPRDR_CAPABILITIES *  capabilities 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

static UINT xf_cliprdr_server_file_contents_request ( CliprdrClientContext *  context,
CLIPRDR_FILE_CONTENTS_REQUEST *  fileContentsRequest 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT xf_cliprdr_server_file_range_request ( xfClipboard *  clipboard,
const CLIPRDR_FILE_CONTENTS_REQUEST *  fileContentsRequest 
)
static

Here is the caller graph for this function:

static UINT xf_cliprdr_server_file_size_request ( xfClipboard *  clipboard,
const CLIPRDR_FILE_CONTENTS_REQUEST *  fileContentsRequest 
)
static

Here is the caller graph for this function:

static UINT xf_cliprdr_server_format_data_request ( CliprdrClientContext *  context,
CLIPRDR_FORMAT_DATA_REQUEST *  formatDataRequest 
)
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:

static UINT xf_cliprdr_server_format_data_response ( CliprdrClientContext *  context,
CLIPRDR_FORMAT_DATA_RESPONSE *  formatDataResponse 
)
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:

static UINT xf_cliprdr_server_format_list ( CliprdrClientContext *  context,
CLIPRDR_FORMAT_LIST *  formatList 
)
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:

static UINT xf_cliprdr_server_format_list_response ( CliprdrClientContext *  context,
CLIPRDR_FORMAT_LIST_RESPONSE *  formatListResponse 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

static void xf_cliprdr_set_raw_transfer_enabled ( xfClipboard *  clipboard,
BOOL  enabled 
)
static

Here is the caller graph for this function:

void xf_cliprdr_uninit ( xfContext *  xfc,
CliprdrClientContext *  cliprdr 
)

Here is the caller graph for this function: