FreeRDP
wlf_cliprdr.c File Reference
#include <stdlib.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 "wlf_cliprdr.h"

Macros

#define TAG   CLIENT_TAG("wayland.cliprdr")
 
#define MAX_CLIPBOARD_FORMATS   255
 

Functions

static BOOL wlf_mime_is_text (const char *mime)
 
static BOOL wlf_mime_is_image (const char *mime)
 
static BOOL wlf_mime_is_html (const char *mime)
 
static void wlf_cliprdr_free_server_formats (wfClipboard *clipboard)
 
static void wlf_cliprdr_free_client_formats (wfClipboard *clipboard)
 
static UINT wlf_cliprdr_send_client_format_list (wfClipboard *clipboard)
 
static void wfl_cliprdr_add_client_format_id (wfClipboard *clipboard, UINT32 formatId)
 
static void wlf_cliprdr_add_client_format (wfClipboard *clipboard, const char *mime)
 
static UINT wlf_cliprdr_send_data_request (wfClipboard *clipboard, UINT32 formatId)
 
static UINT wlf_cliprdr_send_data_response (wfClipboard *clipboard, const BYTE *data, size_t size)
 
BOOL wlf_cliprdr_handle_event (wfClipboard *clipboard, const UwacClipboardEvent *event)
 
static UINT wlf_cliprdr_send_client_capabilities (wfClipboard *clipboard)
 
static UINT wlf_cliprdr_send_client_format_list_response (wfClipboard *clipboard, BOOL status)
 
static UINT wlf_cliprdr_monitor_ready (CliprdrClientContext *context, const CLIPRDR_MONITOR_READY *monitorReady)
 
static UINT wlf_cliprdr_server_capabilities (CliprdrClientContext *context, const CLIPRDR_CAPABILITIES *capabilities)
 
static void wlf_cliprdr_transfer_data (UwacSeat *seat, void *context, const char *mime, int fd)
 
static void wlf_cliprdr_cancel_data (UwacSeat *seat, void *context)
 
static UINT wlf_cliprdr_server_format_list (CliprdrClientContext *context, const CLIPRDR_FORMAT_LIST *formatList)
 
static UINT wlf_cliprdr_server_format_list_response (CliprdrClientContext *context, const CLIPRDR_FORMAT_LIST_RESPONSE *formatListResponse)
 
static UINT wlf_cliprdr_server_format_data_request (CliprdrClientContext *context, const CLIPRDR_FORMAT_DATA_REQUEST *formatDataRequest)
 
static UINT wlf_cliprdr_server_format_data_response (CliprdrClientContext *context, const CLIPRDR_FORMAT_DATA_RESPONSE *formatDataResponse)
 
static UINT wlf_cliprdr_server_file_size_request (wfClipboard *clipboard, const CLIPRDR_FILE_CONTENTS_REQUEST *fileContentsRequest)
 
static UINT wlf_cliprdr_server_file_range_request (wfClipboard *clipboard, const CLIPRDR_FILE_CONTENTS_REQUEST *fileContentsRequest)
 
static UINT wlf_cliprdr_send_file_contents_failure (CliprdrClientContext *context, const CLIPRDR_FILE_CONTENTS_REQUEST *fileContentsRequest)
 
static UINT wlf_cliprdr_server_file_contents_request (CliprdrClientContext *context, const CLIPRDR_FILE_CONTENTS_REQUEST *fileContentsRequest)
 
static UINT wlf_cliprdr_clipboard_file_size_success (wClipboardDelegate *delegate, const wClipboardFileSizeRequest *request, UINT64 fileSize)
 
static UINT wlf_cliprdr_clipboard_file_size_failure (wClipboardDelegate *delegate, const wClipboardFileSizeRequest *request, UINT errorCode)
 
static UINT wlf_cliprdr_clipboard_file_range_success (wClipboardDelegate *delegate, const wClipboardFileRangeRequest *request, const BYTE *data, UINT32 size)
 
static UINT wlf_cliprdr_clipboard_file_range_failure (wClipboardDelegate *delegate, const wClipboardFileRangeRequest *request, UINT errorCode)
 
wfClipboard * wlf_clipboard_new (wlfContext *wfc)
 
void wlf_clipboard_free (wfClipboard *clipboard)
 
BOOL wlf_cliprdr_init (wfClipboard *clipboard, CliprdrClientContext *cliprdr)
 
BOOL wlf_cliprdr_uninit (wfClipboard *clipboard, CliprdrClientContext *cliprdr)
 

Variables

static const char * mime_text []
 
static const char * mime_image []
 
static const char * mime_html []
 

Macro Definition Documentation

#define MAX_CLIPBOARD_FORMATS   255
#define TAG   CLIENT_TAG("wayland.cliprdr")

FreeRDP: A Remote Desktop Protocol Implementation Wayland Clipboard Redirection

Copyright 2018 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2018 Thincast Technologies GmbH

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

static void wfl_cliprdr_add_client_format_id ( wfClipboard *  clipboard,
UINT32  formatId 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

void wlf_clipboard_free ( wfClipboard *  clipboard)

Here is the call graph for this function:

Here is the caller graph for this function:

wfClipboard* wlf_clipboard_new ( wlfContext *  wlc)

FreeRDP: A Remote Desktop Protocol Implementation Wayland Clipboard Redirection

Copyright 2018 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2018 Thincast Technologies GmbH

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 wlf_cliprdr_add_client_format ( wfClipboard *  clipboard,
const char *  mime 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void wlf_cliprdr_cancel_data ( UwacSeat *  seat,
void context 
)
static

Here is the caller graph for this function:

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

Here is the caller graph for this function:

static UINT wlf_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 wlf_cliprdr_clipboard_file_size_failure ( wClipboardDelegate *  delegate,
const wClipboardFileSizeRequest *  request,
UINT  errorCode 
)
static

Here is the caller graph for this function:

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

Here is the caller graph for this function:

static void wlf_cliprdr_free_client_formats ( wfClipboard *  clipboard)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void wlf_cliprdr_free_server_formats ( wfClipboard *  clipboard)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL wlf_cliprdr_handle_event ( wfClipboard *  clipboard,
const UwacClipboardEvent *  event 
)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL wlf_cliprdr_init ( wfClipboard *  clipboard,
CliprdrClientContext *  cliprdr 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT wlf_cliprdr_monitor_ready ( CliprdrClientContext *  context,
const 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 UINT wlf_cliprdr_send_client_capabilities ( wfClipboard *  clipboard)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

static UINT wlf_cliprdr_send_client_format_list ( wfClipboard *  clipboard)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

static UINT wlf_cliprdr_send_client_format_list_response ( wfClipboard *  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 wlf_cliprdr_send_data_request ( wfClipboard *  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 wlf_cliprdr_send_data_response ( wfClipboard *  clipboard,
const BYTE data,
size_t  size 
)
static

Function description

Returns
0 on success, otherwise a Win32 error code

Here is the caller graph for this function:

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

Here is the caller graph for this function:

static UINT wlf_cliprdr_server_capabilities ( CliprdrClientContext *  context,
const 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 wlf_cliprdr_server_file_contents_request ( CliprdrClientContext *  context,
const CLIPRDR_FILE_CONTENTS_REQUEST *  fileContentsRequest 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static UINT wlf_cliprdr_server_file_range_request ( wfClipboard *  clipboard,
const CLIPRDR_FILE_CONTENTS_REQUEST *  fileContentsRequest 
)
static

Here is the caller graph for this function:

static UINT wlf_cliprdr_server_file_size_request ( wfClipboard *  clipboard,
const CLIPRDR_FILE_CONTENTS_REQUEST *  fileContentsRequest 
)
static

Here is the caller graph for this function:

static UINT wlf_cliprdr_server_format_data_request ( CliprdrClientContext *  context,
const 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 wlf_cliprdr_server_format_data_response ( CliprdrClientContext *  context,
const 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 wlf_cliprdr_server_format_list ( CliprdrClientContext *  context,
const CLIPRDR_FORMAT_LIST *  formatList 
)
static

Called when the clipboard changes server side.

Clear the local clipboard offer and replace it with a new one that announces the formats we get listed here.

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 wlf_cliprdr_server_format_list_response ( CliprdrClientContext *  context,
const 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 wlf_cliprdr_transfer_data ( UwacSeat *  seat,
void context,
const char *  mime,
int  fd 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL wlf_cliprdr_uninit ( wfClipboard *  clipboard,
CliprdrClientContext *  cliprdr 
)

Here is the caller graph for this function:

static BOOL wlf_mime_is_html ( const char *  mime)
static

Here is the caller graph for this function:

static BOOL wlf_mime_is_image ( const char *  mime)
static

Here is the caller graph for this function:

static BOOL wlf_mime_is_text ( const char *  mime)
static

Here is the caller graph for this function:

Variable Documentation

const char* mime_html[]
static
Initial value:
=
{
"text/html"
}
const char* mime_image[]
static
Initial value:
=
{
"image/png",
"image/bmp",
"image/x-bmp",
"image/x-MS-bmp",
"image/x-icon",
"image/x-ico",
"image/x-win-bitmap",
"image/vmd.microsoft.icon",
"application/ico",
"image/ico",
"image/icon",
"image/jpeg",
"image/tiff"
}
const char* mime_text[]
static
Initial value:
=
{
"text/plain",
"text/plain;charset=utf-8",
"UTF8_STRING",
"COMPOUND_TEXT",
"TEXT",
"STRING"
}