From 54d815f258dcdeb3642d21c76638499c8883ae7d Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 3 Jan 2012 00:24:03 -0800 Subject: [PATCH] Added missing .c file to Makefile.am, fix guac_handlers.c --- protocols/rdp/Makefile.am | 2 +- protocols/rdp/src/guac_handlers.c | 47 +++++++++++++------------------ 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/protocols/rdp/Makefile.am b/protocols/rdp/Makefile.am index 1243f245..c9f6055f 100644 --- a/protocols/rdp/Makefile.am +++ b/protocols/rdp/Makefile.am @@ -41,7 +41,7 @@ AM_CFLAGS = -Werror -Wall -pedantic -Iinclude lib_LTLIBRARIES = libguac-client-rdp.la -libguac_client_rdp_la_SOURCES = src/client.c src/rdp_keymap.c src/rdp_bitmap.c +libguac_client_rdp_la_SOURCES = src/client.c src/rdp_keymap.c src/rdp_bitmap.c src/guac_handlers.c libguac_client_rdp_la_LDFLAGS = -version-info 0:0:0 diff --git a/protocols/rdp/src/guac_handlers.c b/protocols/rdp/src/guac_handlers.c index 357b5725..2832635f 100644 --- a/protocols/rdp/src/guac_handlers.c +++ b/protocols/rdp/src/guac_handlers.c @@ -50,23 +50,14 @@ #include #include "client.h" -#include "rdp_handlers.h" #include "rdp_keymap.h" +#include "guac_handlers.h" int rdp_guac_client_free_handler(guac_client* client) { - rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data; + /* STUB */ - /* Disconnect client */ - guac_client_data->rdp_inst->rdp_disconnect(guac_client_data->rdp_inst); - - /* Free RDP client */ - freerdp_free(guac_client_data->rdp_inst); - freerdp_channels_free(guac_client_data->channels); - free(guac_client_data->settings); - - /* Free guac client data */ - free(guac_client_data); + /* FIXME: Clean up RDP client + disconnect */ return 0; @@ -75,7 +66,7 @@ int rdp_guac_client_free_handler(guac_client* client) { int rdp_guac_client_handle_messages(guac_client* client) { rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data; - rdpInst* rdp_inst = guac_client_data->rdp_inst; + freerdp* rdp_inst = guac_client_data->rdp_inst; rdpChannels* channels = guac_client_data->channels; int index; @@ -88,7 +79,7 @@ int rdp_guac_client_handle_messages(guac_client* client) { fd_set rfds, wfds; /* get rdp fds */ - if (rdp_inst->rdp_get_fds(rdp_inst, read_fds, &read_count, write_fds, &write_count) != 0) { + if (freerdp_get_fds(rdp_inst, read_fds, &read_count, write_fds, &write_count) != 0) { guac_client_log_error(client, "Unable to read RDP file descriptors."); return 1; } @@ -138,7 +129,7 @@ int rdp_guac_client_handle_messages(guac_client* client) { } /* check the libfreerdp fds */ - if (rdp_inst->rdp_check_fds(rdp_inst) != 0) { + if (freerdp_check_fds(rdp_inst) != 0) { guac_client_log_error(client, "Error handling RDP file descriptors."); return 1; } @@ -157,11 +148,11 @@ int rdp_guac_client_handle_messages(guac_client* client) { int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) { rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data; - rdpInst* rdp_inst = guac_client_data->rdp_inst; + freerdp* rdp_inst = guac_client_data->rdp_inst; /* If button mask unchanged, just send move event */ if (mask == guac_client_data->mouse_button_mask) - rdp_inst->rdp_send_input_mouse(rdp_inst, PTR_FLAGS_MOVE, x, y); + rdp_inst->input->MouseEvent(rdp_inst->input, PTR_FLAGS_MOVE, x, y); /* Otherwise, send events describing button change */ else { @@ -181,7 +172,7 @@ int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) { if (released_mask & 0x02) flags |= PTR_FLAGS_BUTTON3; if (released_mask & 0x04) flags |= PTR_FLAGS_BUTTON2; - rdp_inst->rdp_send_input_mouse(rdp_inst, flags, x, y); + rdp_inst->input->MouseEvent(rdp_inst->input, flags, x, y); } @@ -197,7 +188,7 @@ int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) { if (pressed_mask & 0x10) flags |= PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x88; /* Send event */ - rdp_inst->rdp_send_input_mouse(rdp_inst, flags, x, y); + rdp_inst->input->MouseEvent(rdp_inst->input, flags, x, y); } @@ -206,15 +197,15 @@ int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) { /* Down */ if (pressed_mask & 0x08) - rdp_inst->rdp_send_input_mouse( - rdp_inst, + rdp_inst->input->MouseEvent( + rdp_inst->input, PTR_FLAGS_WHEEL | 0x78, x, y); /* Up */ if (pressed_mask & 0x10) - rdp_inst->rdp_send_input_mouse( - rdp_inst, + rdp_inst->input->MouseEvent( + rdp_inst->input, PTR_FLAGS_WHEEL | PTR_FLAGS_WHEEL_NEGATIVE | 0x88, x, y); @@ -230,7 +221,7 @@ int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) { int rdp_guac_client_key_handler(guac_client* client, int keysym, int pressed) { rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data; - rdpInst* rdp_inst = guac_client_data->rdp_inst; + freerdp* rdp_inst = guac_client_data->rdp_inst; /* If keysym can be in lookup table */ if (keysym <= 0xFFFF) { @@ -241,10 +232,10 @@ int rdp_guac_client_key_handler(guac_client* client, int keysym, int pressed) { /* If defined, send event */ if (keymap->scancode != 0) - rdp_inst->rdp_send_input_scancode( - rdp_inst, - !pressed, - keymap->flags & KBD_FLAGS_EXTENDED, + rdp_inst->input->KeyboardEvent( + rdp_inst->input, + keymap->flags + | (pressed ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE), keymap->scancode); else guac_client_log_info(client, "unmapped keysym: 0x%x", keysym);