--- sourceforge.net/trunk/rdesktop/cliprdr.c 2005/04/14 16:46:13 885 +++ sourceforge.net/trunk/rdesktop/cliprdr.c 2005/11/07 13:15:19 1025 @@ -50,30 +50,29 @@ channel_send(s, cliprdr_channel); } +/* 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 -cliprdr_send_text_format_announce(void) +cliprdr_send_simple_native_format_announce(uint32 format) { uint8 buffer[36]; - buf_out_uint32(buffer, CF_TEXT); - memset(buffer + 4, 0, sizeof(buffer) - 4); /* description */ - cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, buffer, sizeof(buffer)); -} - -void -cliprdr_send_blah_format_announce(void) -{ - uint8 buffer[36]; - - buf_out_uint32(buffer, CF_OEMTEXT); + buf_out_uint32(buffer, format); memset(buffer + 4, 0, sizeof(buffer) - 4); /* description */ - cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, buffer, sizeof(buffer)); + cliprdr_send_native_format_announce(buffer, sizeof(buffer)); } +/* 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 -cliprdr_send_native_format_announce(uint8 * data, uint32 length) +cliprdr_send_native_format_announce(uint8 * formats_data, uint32 formats_data_length) { - cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, data, length); + cliprdr_send_packet(CLIPRDR_FORMAT_ANNOUNCE, CLIPRDR_REQUEST, formats_data, formats_data_length); } void @@ -111,7 +110,7 @@ { /* FIXME: We seem to get this when we send an announce while the server is still processing a paste. Try sending another announce. */ - cliprdr_send_text_format_announce(); + cliprdr_send_simple_native_format_announce(CF_TEXT); return; }