Working RemoteApp with current FreeRDP.

This commit is contained in:
Michael Jumper 2014-01-30 00:04:31 -08:00
parent 47407a5b3d
commit 10d987a0c3
4 changed files with 175 additions and 1 deletions

View File

@ -38,6 +38,7 @@ libguac_client_rdp_la_SOURCES = \
rdp_glyph.c \
rdp_keymap.c \
rdp_pointer.c \
rdp_rail.c \
rdp_settings.c \
unicode.c
@ -79,6 +80,7 @@ noinst_HEADERS = \
rdp_glyph.h \
rdp_keymap.h \
rdp_pointer.h \
rdp_rail.h \
rdp_settings.h \
rdp_status.h \
unicode.h

View File

@ -26,6 +26,7 @@
#include "guac_handlers.h"
#include "rdp_cliprdr.h"
#include "rdp_keymap.h"
#include "rdp_rail.h"
#include <errno.h>
#include <pthread.h>
@ -210,13 +211,17 @@ int rdp_guac_client_handle_messages(guac_client* client) {
event = freerdp_channels_pop_event(channels);
if (event) {
/* Handle clipboard events */
/* Handle channel events (clipboard and RAIL) */
#ifdef LEGACY_EVENT
if (event->event_class == CliprdrChannel_Class)
guac_rdp_process_cliprdr_event(client, event);
else if (event->event_class == RailChannel_Class)
guac_rdp_process_rail_event(client, event);
#else
if (GetMessageClass(event->id) == CliprdrChannel_Class)
guac_rdp_process_cliprdr_event(client, event);
else if (GetMessageClass(event->id) == RailChannel_Class)
guac_rdp_process_rail_event(client, event);
#endif
freerdp_event_free(event);

View File

@ -0,0 +1,117 @@
/*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "config.h"
#include "client.h"
#include "rdp_rail.h"
#include <freerdp/channels/channels.h>
#include <freerdp/freerdp.h>
#include <freerdp/utils/event.h>
#include <guacamole/client.h>
#ifdef ENABLE_WINPR
#include <winpr/wtypes.h>
#else
#include "compat/winpr-wtypes.h"
#endif
#include <freerdp/rail.h>
void guac_rdp_process_rail_event(guac_client* client, wMessage* event) {
#ifdef LEGACY_EVENT
switch (event->event_type) {
#else
switch (GetMessageType(event->id)) {
#endif
/* Get system parameters */
case RailChannel_GetSystemParam:
guac_rdp_process_rail_get_sysparam(client, event);
break;
/* Currently ignored events */
case RailChannel_ServerSystemParam:
case RailChannel_ServerExecuteResult:
case RailChannel_ServerMinMaxInfo:
case RailChannel_ServerLocalMoveSize:
case RailChannel_ServerGetAppIdResponse:
case RailChannel_ServerLanguageBarInfo:
break;
default:
#ifdef LEGACY_EVENT
guac_client_log_info(client,
"Unknown rail event type: 0x%x",
event->event_type);
#else
guac_client_log_info(client,
"Unknown rail event type: 0x%x",
GetMessageType(event->id));
#endif
}
}
void guac_rdp_process_rail_get_sysparam(guac_client* client, wMessage* event) {
wMessage* response;
RAIL_SYSPARAM_ORDER* sysparam;
/* Get channels */
rdp_guac_client_data* client_data = (rdp_guac_client_data*) client->data;
rdpChannels* channels = client_data->rdp_inst->context->channels;
/* Get sysparam structure */
#ifdef LEGACY_EVENT
sysparam = (RAIL_SYSPARAM_ORDER*) event->user_data;
#else
sysparam = (RAIL_SYSPARAM_ORDER*) event->wParam;
#endif
response = freerdp_event_new(RailChannel_Class,
RailChannel_ClientSystemParam,
NULL,
sysparam);
/* Work area */
sysparam->workArea.left = 0;
sysparam->workArea.top = 0;
sysparam->workArea.right = client_data->settings.width;
sysparam->workArea.bottom = client_data->settings.height;
/* Taskbar */
sysparam->taskbarPos.left = 0;
sysparam->taskbarPos.top = 0;
sysparam->taskbarPos.right = 0;
sysparam->taskbarPos.bottom = 0;
sysparam->dragFullWindows = FALSE;
/* Send response */
freerdp_channels_send_event(channels, response);
}

View File

@ -0,0 +1,50 @@
/*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef __GUAC_RDP_RDP_RAIL_H
#define __GUAC_RDP_RDP_RAIL_H
#include "config.h"
#include <freerdp/freerdp.h>
#ifdef ENABLE_WINPR
#include <winpr/stream.h>
#else
#include "compat/winpr-stream.h"
#endif
#include <freerdp/rail.h>
/**
* Dispatches a given RAIL event to the appropriate handler.
*/
void guac_rdp_process_rail_event(guac_client* client, wMessage* event);
/**
* Handles the event sent when updating system parameters.
*/
void guac_rdp_process_rail_get_sysparam(guac_client* client, wMessage* event);
#endif