More fixes for cliprdr, fix color_depth.

This commit is contained in:
Michael Jumper 2013-07-18 15:27:06 -07:00
parent 3e9f551c4e
commit 0e4dcff4f5
3 changed files with 30 additions and 13 deletions

View File

@ -39,8 +39,11 @@
#include <freerdp/plugins/cliprdr.h>
#define CliprdrChannel_Class RDP_EVENT_CLASS_CLIPRDR
#define CliprdrChannel_FormatList RDP_EVENT_TYPE_CB_FORMAT_LIST
#define CliprdrChannel_Class RDP_EVENT_CLASS_CLIPRDR
#define CliprdrChannel_FormatList RDP_EVENT_TYPE_CB_FORMAT_LIST
#define CliprdrChannel_MonitorReady RDP_EVENT_TYPE_CB_MONITOR_READY
#define CliprdrChannel_DataRequest RDP_EVENT_TYPE_CB_DATA_REQUEST
#define CliprdrChannel_DataResponse RDP_EVENT_TYPE_CB_DATA_RESPONSE
#endif

View File

@ -60,31 +60,42 @@
void guac_rdp_process_cliprdr_event(guac_client* client, wMessage* event) {
#ifdef LEGACY_EVENT
switch (event->event_type) {
#else
switch (GetMessageType(event->id)) {
#endif
case RDP_EVENT_TYPE_CB_MONITOR_READY:
case CliprdrChannel_MonitorReady:
guac_rdp_process_cb_monitor_ready(client, event);
break;
case RDP_EVENT_TYPE_CB_FORMAT_LIST:
case CliprdrChannel_FormatList:
guac_rdp_process_cb_format_list(client,
(RDP_CB_FORMAT_LIST_EVENT*) event);
break;
case RDP_EVENT_TYPE_CB_DATA_REQUEST:
case CliprdrChannel_DataRequest:
guac_rdp_process_cb_data_request(client,
(RDP_CB_DATA_REQUEST_EVENT*) event);
break;
case RDP_EVENT_TYPE_CB_DATA_RESPONSE:
case CliprdrChannel_DataResponse:
guac_rdp_process_cb_data_response(client,
(RDP_CB_DATA_RESPONSE_EVENT*) event);
break;
default:
#ifdef LEGACY_EVENT
guac_client_log_info(client,
"Unknown cliprdr event type: 0x%x",
event->event_type);
#else
guac_client_log_info(client,
"Unknown cliprdr event type: 0x%x",
GetMessageType(event->id));
#endif
}
}
@ -96,8 +107,8 @@ void guac_rdp_process_cb_monitor_ready(guac_client* client, wMessage* event) {
RDP_CB_FORMAT_LIST_EVENT* format_list =
(RDP_CB_FORMAT_LIST_EVENT*) freerdp_event_new(
RDP_EVENT_CLASS_CLIPRDR,
RDP_EVENT_TYPE_CB_FORMAT_LIST,
CliprdrChannel_Class,
CliprdrChannel_FormatList,
NULL, NULL);
/* Received notification of clipboard support. */
@ -128,8 +139,8 @@ void guac_rdp_process_cb_format_list(guac_client* client,
/* Create new data request */
RDP_CB_DATA_REQUEST_EVENT* data_request =
(RDP_CB_DATA_REQUEST_EVENT*) freerdp_event_new(
RDP_EVENT_CLASS_CLIPRDR,
RDP_EVENT_TYPE_CB_DATA_REQUEST,
CliprdrChannel_Class,
CliprdrChannel_DataRequest,
NULL, NULL);
/* We want plain text */
@ -164,8 +175,8 @@ void guac_rdp_process_cb_data_request(guac_client* client,
/* Create new data response */
RDP_CB_DATA_RESPONSE_EVENT* data_response =
(RDP_CB_DATA_RESPONSE_EVENT*) freerdp_event_new(
RDP_EVENT_CLASS_CLIPRDR,
RDP_EVENT_TYPE_CB_DATA_RESPONSE,
CliprdrChannel_Class,
CliprdrChannel_DataResponse,
NULL, NULL);
/* Set data and length */

View File

@ -426,9 +426,12 @@ void guac_rdp_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) {
void guac_rdp_gdi_opaquerect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect) {
/* Get client data */
guac_client* client = ((rdp_freerdp_context*) context)->client;
rdp_guac_client_data* client_data = (rdp_guac_client_data*) client->data;
UINT32 color = freerdp_color_convert_var(opaque_rect->color,
context->instance->settings->color_depth, 32,
client_data->settings.color_depth, 32,
((rdp_freerdp_context*) context)->clrconv);
const guac_layer* current_layer = ((rdp_guac_client_data*) client->data)->current_surface;