Minimal changes to work with FreeRDP 0.8.2
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Tue, 16 Aug 2011 02:31:53 +0000 (19:31 -0700)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Tue, 16 Aug 2011 02:31:53 +0000 (19:31 -0700)
configure.in
include/rdp_handlers.h
src/rdp_client.c
src/rdp_handlers.c
src/rdp_keymap.c

index 1b6b23d..13b9e1f 100644 (file)
@@ -46,8 +46,8 @@ AC_PROG_LIBTOOL
 # Checks for libraries.
 AC_CHECK_LIB([guac], [guac_get_client],, AC_MSG_ERROR("libguac is required for communication via the guacamole protocol"))
 AC_CHECK_LIB([cairo], [cairo_create],, AC_MSG_ERROR("cairo is required for drawing instructions"))
-AC_CHECK_LIB([freerdp], [freerdp_new],, AC_MSG_ERROR("libfreerdp is required"))
-AC_CHECK_LIB([freerdpchanman], [freerdp_chanman_new],, AC_MSG_ERROR("libfreerdp is required"))
+AC_CHECK_LIB([freerdp-core], [freerdp_new],, AC_MSG_ERROR("libfreerdp is required"))
+AC_CHECK_LIB([freerdp-chanman], [freerdp_chanman_new],, AC_MSG_ERROR("libfreerdp is required"))
 
 # Checks for header files.
 AC_CHECK_HEADERS([guacamole/client.h guacamole/guacio.h guacamole/protocol.h])
index 4a50b51..3b78392 100644 (file)
@@ -51,20 +51,20 @@ RD_HBITMAP guac_rdp_ui_create_bitmap(rdpInst* inst, int width, int height, uint8
 void guac_rdp_ui_paint_bitmap(rdpInst* inst, int x, int y, int cx, int cy, int width, int height, uint8* data);
 void guac_rdp_ui_destroy_bitmap(rdpInst* inst, RD_HBITMAP bmp);
 void guac_rdp_ui_line(rdpInst* inst, uint8 opcode, int startx, int starty, int endx, int endy, RD_PEN* pen);
-void guac_rdp_ui_rect(rdpInst* inst, int x, int y, int cx, int cy, int colour);
-void guac_rdp_ui_polygon(rdpInst* inst, uint8 opcode, uint8 fillmode, RD_POINT* point, int npoints, RD_BRUSH* brush, int bgcolour, int fgcolour);
+void guac_rdp_ui_rect(rdpInst* inst, int x, int y, int cx, int cy, uint32 colour);
+void guac_rdp_ui_polygon(rdpInst* inst, uint8 opcode, uint8 fillmode, RD_POINT* point, int npoints, RD_BRUSH* brush, uint32 bgcolor, uint32 fgcolor);
 void guac_rdp_ui_polyline(rdpInst* inst, uint8 opcode, RD_POINT* points, int npoints, RD_PEN* pen);
-void guac_rdp_ui_ellipse(rdpInst* inst, uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, RD_BRUSH* brush, int bgcolour, int fgcolour);
-void guac_rdp_ui_start_draw_glyphs(rdpInst* inst, int bgcolour, int fgcolour);
+void guac_rdp_ui_ellipse(rdpInst* inst, uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, RD_BRUSH* brush, uint32 bgcolor, uint32 fgcolor);
+void guac_rdp_ui_start_draw_glyphs(rdpInst* inst, uint32 bgcolor, uint32 fgcolor);
 void guac_rdp_ui_draw_glyph(rdpInst* inst, int x, int y, int cx, int cy, RD_HGLYPH glyph);
 void guac_rdp_ui_end_draw_glyphs(rdpInst* inst, int x, int y, int cx, int cy);
 uint32 guac_rdp_ui_get_toggle_keys_state(rdpInst* inst);
 void guac_rdp_ui_bell(rdpInst* inst);
 void guac_rdp_ui_destblt(rdpInst* inst, uint8 opcode, int x, int y, int cx, int cy);
-void guac_rdp_ui_patblt(rdpInst* inst, uint8 opcode, int x, int y, int cx, int cy, RD_BRUSH* brush, int bgcolour, int fgcolour);
+void guac_rdp_ui_patblt(rdpInst* inst, uint8 opcode, int x, int y, int cx, int cy, RD_BRUSH* brush, uint32 bgcolor, uint32 fgcolor);
 void guac_rdp_ui_screenblt(rdpInst* inst, uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy);
 void guac_rdp_ui_memblt(rdpInst* inst, uint8 opcode, int x, int y, int width, int height, RD_HBITMAP src, int srcx, int srcy);
-void guac_rdp_ui_triblt(rdpInst* inst, uint8 opcode, int x, int y, int cx, int cy, RD_HBITMAP src, int srcx, int srcy, RD_BRUSH* brush, int bgcolour,  int fgcolour);
+void guac_rdp_ui_triblt(rdpInst* inst, uint8 opcode, int x, int y, int cx, int cy, RD_HBITMAP src, int srcx, int srcy, RD_BRUSH* brush, uint32 bgcolor,  uint32 fgcolor);
 RD_HGLYPH guac_rdp_ui_create_glyph(rdpInst* inst, int width, int height, uint8* data);
 void guac_rdp_ui_destroy_glyph(rdpInst* inst, RD_HGLYPH glyph);
 int guac_rdp_ui_select(rdpInst* inst, int rdp_socket);
@@ -76,13 +76,13 @@ void guac_rdp_ui_destroy_cursor(rdpInst* inst, RD_HCURSOR cursor);
 RD_HCURSOR guac_rdp_ui_create_cursor(rdpInst* inst, unsigned int x, unsigned int y, int width, int height, uint8* andmask, uint8* xormask, int bpp);
 void guac_rdp_ui_set_null_cursor(rdpInst* inst);
 void guac_rdp_ui_set_default_cursor(rdpInst* inst);
-RD_HPALETTE guac_rdp_ui_create_colormap(rdpInst* inst, RD_PALETTE* colours);
 void guac_rdp_ui_move_pointer(rdpInst* inst, int x, int y);
-void guac_rdp_ui_set_colormap(rdpInst* inst, RD_HPALETTE map);
 RD_HBITMAP guac_rdp_ui_create_surface(rdpInst* inst, int width, int height, RD_HBITMAP old);
 void guac_rdp_ui_set_surface(rdpInst* inst, RD_HBITMAP surface);
 void guac_rdp_ui_destroy_surface(rdpInst* inst, RD_HBITMAP surface);
 void guac_rdp_ui_channel_data(rdpInst* inst, int chan_id, char* data, int data_size, int flags, int total_size);
+RD_HPALETTE guac_rdp_ui_create_palette(rdpInst* inst, RD_PALETTE* colours);
+void guac_rdp_ui_set_palette(rdpInst* inst, RD_HPALETTE map);
 
 extern const int guac_rdp_letter_scancodes[];
 
index 42b8f4f..dfc8dff 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <freerdp/freerdp.h>
 #include <freerdp/chanman.h>
-#include <freerdp/constants_ui.h>
+#include <freerdp/constants/core.h>
 
 #include <guacamole/log.h>
 #include <guacamole/guacio.h>
@@ -274,9 +274,9 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
        rdp_inst->ui_create_cursor = guac_rdp_ui_create_cursor;
        rdp_inst->ui_set_null_cursor = guac_rdp_ui_set_null_cursor;
        rdp_inst->ui_set_default_cursor = guac_rdp_ui_set_default_cursor;
-       rdp_inst->ui_create_colormap = guac_rdp_ui_create_colormap;
+       rdp_inst->ui_create_palette = guac_rdp_ui_create_palette;
        rdp_inst->ui_move_pointer = guac_rdp_ui_move_pointer;
-       rdp_inst->ui_set_colormap = guac_rdp_ui_set_colormap;
+       rdp_inst->ui_set_palette = guac_rdp_ui_set_palette;
        rdp_inst->ui_create_surface = guac_rdp_ui_create_surface;
        rdp_inst->ui_set_surface = guac_rdp_ui_set_surface;
        rdp_inst->ui_destroy_surface = guac_rdp_ui_destroy_surface;
@@ -321,7 +321,7 @@ int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) {
 
     /* If button mask unchanged, just send move event */
     if (mask == guac_client_data->mouse_button_mask)
-        rdp_inst->rdp_send_input(rdp_inst, RDP_INPUT_MOUSE, PTRFLAGS_MOVE, x, y);
+        rdp_inst->rdp_send_input_mouse(rdp_inst, PTRFLAGS_MOVE, x, y);
 
     /* Otherwise, send events describing button change */
     else {
@@ -341,7 +341,7 @@ int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) {
             if (released_mask & 0x02) flags |= PTRFLAGS_BUTTON3;
             if (released_mask & 0x04) flags |= PTRFLAGS_BUTTON2;
 
-            rdp_inst->rdp_send_input(rdp_inst, RDP_INPUT_MOUSE, flags, x, y);
+            rdp_inst->rdp_send_input_mouse(rdp_inst, flags, x, y);
 
         }
 
@@ -357,7 +357,7 @@ int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) {
             if (pressed_mask & 0x10) flags |= PTRFLAGS_WHEEL | PTRFLAGS_WHEEL_NEGATIVE | 0x88;
 
             /* Send event */
-            rdp_inst->rdp_send_input(rdp_inst, RDP_INPUT_MOUSE, flags, x, y);
+            rdp_inst->rdp_send_input_mouse(rdp_inst, flags, x, y);
 
         }
 
@@ -366,17 +366,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(
+                rdp_inst->rdp_send_input_mouse(
                         rdp_inst,
-                        RDP_INPUT_MOUSE,
                         PTRFLAGS_WHEEL | 0x78,
                         x, y);
 
             /* Up */
             if (pressed_mask & 0x10)
-                rdp_inst->rdp_send_input(
+                rdp_inst->rdp_send_input_mouse(
                         rdp_inst,
-                        RDP_INPUT_MOUSE,
                         PTRFLAGS_WHEEL | PTRFLAGS_WHEEL_NEGATIVE | 0x88,
                         x, y);
 
@@ -403,9 +401,9 @@ 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(
-                    rdp_inst, RDP_INPUT_SCANCODE,
-                    (pressed ? RDP_KEYPRESS : RDP_KEYRELEASE) | keymap->flags,
+            rdp_inst->rdp_send_input_scancode(
+                    rdp_inst,
+                    (pressed ? KBDFLAGS_DOWN : KBDFLAGS_RELEASE) | keymap->flags,
                     keymap->scancode, 
                     0);
         else
index 6d396d6..be3faa3 100644 (file)
@@ -277,7 +277,7 @@ void guac_rdp_ui_line(rdpInst* inst, uint8 opcode, int startx, int starty, int e
     guac_log_info("guac_rdp_ui_line: STUB\n");
 }
 
-void guac_rdp_ui_rect(rdpInst* inst, int x, int y, int cx, int cy, int color) {
+void guac_rdp_ui_rect(rdpInst* inst, int x, int y, int cx, int cy, uint32 color) {
 
     guac_client* client = (guac_client*) inst->param1;
     rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
@@ -312,7 +312,7 @@ void guac_rdp_ui_rect(rdpInst* inst, int x, int y, int cx, int cy, int color) {
 
 }
 
-void guac_rdp_ui_polygon(rdpInst* inst, uint8 opcode, uint8 fillmode, RD_POINT* point, int npoints, RD_BRUSH* brush, int bgcolor, int fgcolor) {
+void guac_rdp_ui_polygon(rdpInst* inst, uint8 opcode, uint8 fillmode, RD_POINT* point, int npoints, RD_BRUSH* brush, uint32 bgcolor, uint32 fgcolor) {
     guac_log_info("guac_rdp_ui_polygon: STUB\n");
 }
 
@@ -320,11 +320,11 @@ void guac_rdp_ui_polyline(rdpInst* inst, uint8 opcode, RD_POINT* points, int npo
     guac_log_info("guac_rdp_ui_polyline: STUB\n");
 }
 
-void guac_rdp_ui_ellipse(rdpInst* inst, uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, RD_BRUSH*  brush, int bgcolor, int fgcolor) {
+void guac_rdp_ui_ellipse(rdpInst* inst, uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, RD_BRUSH*  brush, uint32 bgcolor, uint32 fgcolor) {
     guac_log_info("guac_rdp_ui_ellipse: STUB\n");
 }
 
-void guac_rdp_ui_start_draw_glyphs(rdpInst* inst, int bgcolor, int fgcolor) {
+void guac_rdp_ui_start_draw_glyphs(rdpInst* inst, uint32 bgcolor, uint32 fgcolor) {
 
     guac_client* client = (guac_client*) inst->param1;
     rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
@@ -391,7 +391,7 @@ void guac_rdp_ui_destblt(rdpInst* inst, uint8 opcode, int x, int y, int cx, int
     guac_log_info("guac_rdp_ui_destblt: STUB\n");
 }
 
-void guac_rdp_ui_patblt(rdpInst* inst, uint8 opcode, int x, int y, int cx, int cy, RD_BRUSH* brush, int bgcolor, int fgcolor) {
+void guac_rdp_ui_patblt(rdpInst* inst, uint8 opcode, int x, int y, int cx, int cy, RD_BRUSH* brush, uint32 bgcolor, uint32 fgcolor) {
     guac_log_info("guac_rdp_ui_patblt: STUB\n");
 }
 
@@ -425,7 +425,7 @@ void guac_rdp_ui_memblt(rdpInst* inst, uint8 opcode, int x, int y, int width, in
 
 }
 
-void guac_rdp_ui_triblt(rdpInst* inst, uint8 opcode, int x, int y, int cx, int cy, RD_HBITMAP src, int srcx, int srcy, RD_BRUSH* brush, int bgcolor,  int fgcolor) {
+void guac_rdp_ui_triblt(rdpInst* inst, uint8 opcode, int x, int y, int cx, int cy, RD_HBITMAP src, int srcx, int srcy, RD_BRUSH* brush, uint32 bgcolor,  uint32 fgcolor) {
     guac_log_info("guac_rdp_ui_triblt: STUB\n");
 }
 
index eebf350..908b2c1 100644 (file)
@@ -35,7 +35,7 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include <freerdp/constants_ui.h>
+#include <freerdp/constants/core.h>
 
 #include "rdp_keymap.h"
 
@@ -5260,10 +5260,10 @@ const guac_rdp_keymap guac_rdp_keysym_scancode[256][256] = {
         { .scancode = 0x00, .flags = 0x00 }, /* 0xff4e */
         { .scancode = 0x00, .flags = 0x00 }, /* 0xff4f */
         { .scancode = 0x00, .flags = 0x00 }, /* 0xff50 (Home) */
-        { .scancode = 0x4B, .flags = KBD_FLAG_EXT }, /* 0xff51 (Left) */
-        { .scancode = 0x48, .flags = KBD_FLAG_EXT }, /* 0xff52 (Up) */
-        { .scancode = 0x4D, .flags = KBD_FLAG_EXT }, /* 0xff53 (Right) */
-        { .scancode = 0x50, .flags = KBD_FLAG_EXT }, /* 0xff54 (Down) */
+        { .scancode = 0x4B, .flags = KBDFLAGS_EXTENDED }, /* 0xff51 (Left) */
+        { .scancode = 0x48, .flags = KBDFLAGS_EXTENDED }, /* 0xff52 (Up) */
+        { .scancode = 0x4D, .flags = KBDFLAGS_EXTENDED }, /* 0xff53 (Right) */
+        { .scancode = 0x50, .flags = KBDFLAGS_EXTENDED }, /* 0xff54 (Down) */
         { .scancode = 0x00, .flags = 0x00 }, /* 0xff55 (Page_Up) */
         { .scancode = 0x00, .flags = 0x00 }, /* 0xff56 (Page_Down) */
         { .scancode = 0x00, .flags = 0x00 }, /* 0xff57 (End) */
@@ -5434,7 +5434,7 @@ const guac_rdp_keymap guac_rdp_keysym_scancode[256][256] = {
         { .scancode = 0x00, .flags = 0x00 }, /* 0xfffc */
         { .scancode = 0x00, .flags = 0x00 }, /* 0xfffd */
         { .scancode = 0x00, .flags = 0x00 }, /* 0xfffe */
-        { .scancode = 0x53, .flags = KBD_FLAG_EXT }, /* 0xffff (Delete) */
+        { .scancode = 0x53, .flags = KBDFLAGS_EXTENDED }, /* 0xffff (Delete) */
     },
 };