cliprdr.c revision a180a41bba1d50822df23fff0099e90b86638b89
/* -*- c-basic-offset: 8 -*-
rdesktop: A Remote Desktop Protocol client.
Protocol services - Clipboard functions
Copyright 2003 Erik Forsberg <forsberg@cendio.se> for Cendio AB
Copyright (C) Matthew Chapman <matthewc.unsw.edu.au> 2003-2008
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "rdesktop.h"
#define CLIPRDR_CONNECT 1
#define CLIPRDR_FORMAT_ANNOUNCE 2
#define CLIPRDR_FORMAT_ACK 3
#define CLIPRDR_DATA_REQUEST 4
#define CLIPRDR_DATA_RESPONSE 5
#define CLIPRDR_REQUEST 0
#define CLIPRDR_RESPONSE 1
#define CLIPRDR_ERROR 2
static VCHANNEL *cliprdr_channel;
static uint32 last_formats_length = 0;
static void
{
STREAM s;
out_uint16_le(s, type);
out_uint16_le(s, status);
out_uint32_le(s, length);
out_uint32(s, 0); /* pad? */
s_mark_end(s);
}
/* Helper which announces our readiness to supply clipboard data
in a single format (such as CF_TEXT) to the RDP side.
To announce more than one format at a time, use
cliprdr_send_native_format_announce.
*/
void
{
DEBUG_CLIPBOARD(("cliprdr_send_simple_native_format_announce\n"));
}
/* Announces our readiness to supply clipboard data in multiple
formats, each denoted by a 36-byte format descriptor of
[ uint32 format + 32-byte description ].
*/
void
{
DEBUG_CLIPBOARD(("cliprdr_send_native_format_announce\n"));
if (formats_data != last_formats)
{
if (last_formats)
}
}
void
{
DEBUG_CLIPBOARD(("cliprdr_send_data_request\n"));
}
void
{
DEBUG_CLIPBOARD(("cliprdr_send_data\n"));
}
static void
{
in_uint16_le(s, type);
in_uint16_le(s, status);
in_uint32_le(s, length);
data = s->p;
if (status == CLIPRDR_ERROR)
{
switch (type)
{
case CLIPRDR_FORMAT_ACK:
/* FIXME: We seem to get this when we send an announce while the server is
still processing a paste. Try sending another announce. */
break;
case CLIPRDR_DATA_RESPONSE:
break;
default:
}
return;
}
switch (type)
{
case CLIPRDR_CONNECT:
ui_clip_sync();
break;
case CLIPRDR_FORMAT_ANNOUNCE:
return;
case CLIPRDR_FORMAT_ACK:
break;
case CLIPRDR_DATA_REQUEST:
in_uint32_le(s, format);
break;
case CLIPRDR_DATA_RESPONSE:
break;
case 7: /* TODO: W2K3 SP1 sends this on connect with a value of 1 */
break;
default:
}
}
void
cliprdr_set_mode(const char *optarg)
{
}
cliprdr_init(void)
{
channel_register("cliprdr",
return (cliprdr_channel != NULL);
}