Switch to UINT* and BOOL types.

This commit is contained in:
Michael Jumper 2013-07-17 11:54:24 -07:00
parent 9ad3b18f77
commit 324d13853f
8 changed files with 106 additions and 58 deletions

View File

@ -58,6 +58,12 @@
#include <freerdp/input.h> #include <freerdp/input.h>
#include <freerdp/constants.h> #include <freerdp/constants.h>
#ifdef ENABLE_WINPR
#include <winpr/wtypes.h>
#else
#include "compat/winpr-wtypes.h"
#endif
#include <guacamole/socket.h> #include <guacamole/socket.h>
#include <guacamole/protocol.h> #include <guacamole/protocol.h>
#include <guacamole/client.h> #include <guacamole/client.h>
@ -117,11 +123,11 @@ enum RDP_ARGS_IDX {
RDP_ARGS_COUNT RDP_ARGS_COUNT
}; };
int __guac_receive_channel_data(freerdp* rdp_inst, int channelId, uint8* data, int size, int flags, int total_size) { int __guac_receive_channel_data(freerdp* rdp_inst, int channelId, UINT8* data, int size, int flags, int total_size) {
return freerdp_channels_data(rdp_inst, channelId, data, size, flags, total_size); return freerdp_channels_data(rdp_inst, channelId, data, size, flags, total_size);
} }
boolean rdp_freerdp_pre_connect(freerdp* instance) { BOOL rdp_freerdp_pre_connect(freerdp* instance) {
rdpContext* context = instance->context; rdpContext* context = instance->context;
guac_client* client = ((rdp_freerdp_context*) context)->client; guac_client* client = ((rdp_freerdp_context*) context)->client;
@ -270,14 +276,14 @@ boolean rdp_freerdp_pre_connect(freerdp* instance) {
if (freerdp_channels_pre_connect(channels, instance)) { if (freerdp_channels_pre_connect(channels, instance)) {
guac_protocol_send_error(client->socket, "Error initializing RDP client channel manager"); guac_protocol_send_error(client->socket, "Error initializing RDP client channel manager");
guac_socket_flush(client->socket); guac_socket_flush(client->socket);
return false; return FALSE;
} }
return true; return TRUE;
} }
boolean rdp_freerdp_post_connect(freerdp* instance) { BOOL rdp_freerdp_post_connect(freerdp* instance) {
rdpContext* context = instance->context; rdpContext* context = instance->context;
guac_client* client = ((rdp_freerdp_context*) context)->client; guac_client* client = ((rdp_freerdp_context*) context)->client;
@ -287,7 +293,7 @@ boolean rdp_freerdp_post_connect(freerdp* instance) {
if (freerdp_channels_post_connect(channels, instance)) { if (freerdp_channels_post_connect(channels, instance)) {
guac_protocol_send_error(client->socket, "Error initializing RDP client channel manager"); guac_protocol_send_error(client->socket, "Error initializing RDP client channel manager");
guac_socket_flush(client->socket); guac_socket_flush(client->socket);
return false; return FALSE;
} }
/* Client handlers */ /* Client handlers */
@ -297,7 +303,7 @@ boolean rdp_freerdp_post_connect(freerdp* instance) {
client->key_handler = rdp_guac_client_key_handler; client->key_handler = rdp_guac_client_key_handler;
client->clipboard_handler = rdp_guac_client_clipboard_handler; client->clipboard_handler = rdp_guac_client_clipboard_handler;
return true; return TRUE;
} }
@ -348,7 +354,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
char* hostname; char* hostname;
int port = RDP_DEFAULT_PORT; int port = RDP_DEFAULT_PORT;
boolean bitmap_cache; BOOL bitmap_cache;
/** /**
* Selected server-side keymap. Client will be assumed to also use this * Selected server-side keymap. Client will be assumed to also use this
@ -398,17 +404,17 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
settings = rdp_inst->settings; settings = rdp_inst->settings;
/* Console */ /* Console */
settings->console_session = (strcmp(argv[IDX_CONSOLE], "true") == 0); settings->console_session = (strcmp(argv[IDX_CONSOLE], "TRUE") == 0);
settings->console_audio = (strcmp(argv[IDX_CONSOLE_AUDIO], "true") == 0); settings->console_audio = (strcmp(argv[IDX_CONSOLE_AUDIO], "TRUE") == 0);
/* --no-auth */ /* --no-auth */
settings->authentication = false; settings->authentication = FALSE;
/* --sec rdp */ /* --sec rdp */
settings->rdp_security = true; settings->rdp_security = TRUE;
settings->tls_security = false; settings->tls_security = FALSE;
settings->nla_security = false; settings->nla_security = FALSE;
settings->encryption = true; settings->encryption = TRUE;
settings->encryption_method = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS; settings->encryption_method = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS;
settings->encryption_level = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE; settings->encryption_level = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE;
@ -479,44 +485,44 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
/* Audio enable/disable */ /* Audio enable/disable */
guac_client_data->audio_enabled = guac_client_data->audio_enabled =
(strcmp(argv[IDX_DISABLE_AUDIO], "true") != 0); (strcmp(argv[IDX_DISABLE_AUDIO], "TRUE") != 0);
/* Printing enable/disable */ /* Printing enable/disable */
guac_client_data->printing_enabled = guac_client_data->printing_enabled =
(strcmp(argv[IDX_ENABLE_PRINTING], "true") == 0); (strcmp(argv[IDX_ENABLE_PRINTING], "TRUE") == 0);
/* Order support */ /* Order support */
bitmap_cache = settings->bitmap_cache; bitmap_cache = settings->bitmap_cache;
settings->os_major_type = OSMAJORTYPE_UNSPECIFIED; settings->os_major_type = OSMAJORTYPE_UNSPECIFIED;
settings->os_minor_type = OSMINORTYPE_UNSPECIFIED; settings->os_minor_type = OSMINORTYPE_UNSPECIFIED;
settings->order_support[NEG_DSTBLT_INDEX] = true; settings->order_support[NEG_DSTBLT_INDEX] = TRUE;
settings->order_support[NEG_PATBLT_INDEX] = false; /* PATBLT not yet supported */ settings->order_support[NEG_PATBLT_INDEX] = FALSE; /* PATBLT not yet supported */
settings->order_support[NEG_SCRBLT_INDEX] = true; settings->order_support[NEG_SCRBLT_INDEX] = TRUE;
settings->order_support[NEG_OPAQUE_RECT_INDEX] = true; settings->order_support[NEG_OPAQUE_RECT_INDEX] = TRUE;
settings->order_support[NEG_DRAWNINEGRID_INDEX] = false; settings->order_support[NEG_DRAWNINEGRID_INDEX] = FALSE;
settings->order_support[NEG_MULTIDSTBLT_INDEX] = false; settings->order_support[NEG_MULTIDSTBLT_INDEX] = FALSE;
settings->order_support[NEG_MULTIPATBLT_INDEX] = false; settings->order_support[NEG_MULTIPATBLT_INDEX] = FALSE;
settings->order_support[NEG_MULTISCRBLT_INDEX] = false; settings->order_support[NEG_MULTISCRBLT_INDEX] = FALSE;
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = false; settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = FALSE;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = false; settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = FALSE;
settings->order_support[NEG_LINETO_INDEX] = false; settings->order_support[NEG_LINETO_INDEX] = FALSE;
settings->order_support[NEG_POLYLINE_INDEX] = false; settings->order_support[NEG_POLYLINE_INDEX] = FALSE;
settings->order_support[NEG_MEMBLT_INDEX] = bitmap_cache; settings->order_support[NEG_MEMBLT_INDEX] = bitmap_cache;
settings->order_support[NEG_MEM3BLT_INDEX] = false; settings->order_support[NEG_MEM3BLT_INDEX] = FALSE;
settings->order_support[NEG_MEMBLT_V2_INDEX] = bitmap_cache; settings->order_support[NEG_MEMBLT_V2_INDEX] = bitmap_cache;
settings->order_support[NEG_MEM3BLT_V2_INDEX] = false; settings->order_support[NEG_MEM3BLT_V2_INDEX] = FALSE;
settings->order_support[NEG_SAVEBITMAP_INDEX] = false; settings->order_support[NEG_SAVEBITMAP_INDEX] = FALSE;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = true; settings->order_support[NEG_GLYPH_INDEX_INDEX] = TRUE;
settings->order_support[NEG_FAST_INDEX_INDEX] = true; settings->order_support[NEG_FAST_INDEX_INDEX] = TRUE;
settings->order_support[NEG_FAST_GLYPH_INDEX] = true; settings->order_support[NEG_FAST_GLYPH_INDEX] = TRUE;
settings->order_support[NEG_POLYGON_SC_INDEX] = false; settings->order_support[NEG_POLYGON_SC_INDEX] = FALSE;
settings->order_support[NEG_POLYGON_CB_INDEX] = false; settings->order_support[NEG_POLYGON_CB_INDEX] = FALSE;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = false; settings->order_support[NEG_ELLIPSE_SC_INDEX] = FALSE;
settings->order_support[NEG_ELLIPSE_CB_INDEX] = false; settings->order_support[NEG_ELLIPSE_CB_INDEX] = FALSE;
/* Store client data */ /* Store client data */
guac_client_data->rdp_inst = rdp_inst; guac_client_data->rdp_inst = rdp_inst;
guac_client_data->bounded = false; guac_client_data->bounded = FALSE;
guac_client_data->mouse_button_mask = 0; guac_client_data->mouse_button_mask = 0;
guac_client_data->current_surface = GUAC_DEFAULT_LAYER; guac_client_data->current_surface = GUAC_DEFAULT_LAYER;
guac_client_data->clipboard = NULL; guac_client_data->clipboard = NULL;

View File

@ -54,6 +54,12 @@
#include <freerdp/utils/event.h> #include <freerdp/utils/event.h>
#include <freerdp/plugins/cliprdr.h> #include <freerdp/plugins/cliprdr.h>
#ifdef ENABLE_WINPR
#include <winpr/wtypes.h>
#else
#include "compat/winpr-wtypes.h"
#endif
#include <guacamole/socket.h> #include <guacamole/socket.h>
#include <guacamole/protocol.h> #include <guacamole/protocol.h>
#include <guacamole/client.h> #include <guacamole/client.h>
@ -424,7 +430,7 @@ int rdp_guac_client_clipboard_handler(guac_client* client, char* data) {
((rdp_guac_client_data*) client->data)->clipboard = strdup(data); ((rdp_guac_client_data*) client->data)->clipboard = strdup(data);
/* Notify server that text data is now available */ /* Notify server that text data is now available */
format_list->formats = (uint32*) malloc(sizeof(uint32)); format_list->formats = (UINT32*) malloc(sizeof(UINT32));
format_list->formats[0] = CB_FORMAT_TEXT; format_list->formats[0] = CB_FORMAT_TEXT;
format_list->num_formats = 1; format_list->num_formats = 1;

View File

@ -50,6 +50,12 @@
#include <freerdp/codec/color.h> #include <freerdp/codec/color.h>
#include <freerdp/codec/bitmap.h> #include <freerdp/codec/bitmap.h>
#ifdef ENABLE_WINPR
#include <winpr/wtypes.h>
#else
#include "compat/winpr-wtypes.h"
#endif
#include "client.h" #include "client.h"
#include "rdp_bitmap.h" #include "rdp_bitmap.h"
@ -165,7 +171,7 @@ void guac_rdp_bitmap_free(rdpContext* context, rdpBitmap* bitmap) {
} }
void guac_rdp_bitmap_setsurface(rdpContext* context, rdpBitmap* bitmap, boolean primary) { void guac_rdp_bitmap_setsurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary) {
guac_client* client = ((rdp_freerdp_context*) context)->client; guac_client* client = ((rdp_freerdp_context*) context)->client;
if (primary) if (primary)
@ -191,21 +197,21 @@ void guac_rdp_bitmap_setsurface(rdpContext* context, rdpBitmap* bitmap, boolean
} }
void guac_rdp_bitmap_decompress(rdpContext* context, rdpBitmap* bitmap, uint8* data, int width, int height, int bpp, int length, boolean compressed) { void guac_rdp_bitmap_decompress(rdpContext* context, rdpBitmap* bitmap, UINT8* data, int width, int height, int bpp, int length, BOOL compressed) {
int size = width * height * (bpp + 7) / 8; int size = width * height * (bpp + 7) / 8;
if (bitmap->data == NULL) if (bitmap->data == NULL)
bitmap->data = (uint8*) malloc(size); bitmap->data = (UINT8*) malloc(size);
else else
bitmap->data = (uint8*) realloc(bitmap->data, size); bitmap->data = (UINT8*) realloc(bitmap->data, size);
if (compressed) if (compressed)
bitmap_decompress(data, bitmap->data, width, height, length, bpp, bpp); bitmap_decompress(data, bitmap->data, width, height, length, bpp, bpp);
else else
freerdp_image_flip(data, bitmap->data, width, height, bpp); freerdp_image_flip(data, bitmap->data, width, height, bpp);
bitmap->compressed = false; bitmap->compressed = FALSE;
bitmap->length = size; bitmap->length = size;
bitmap->bpp = bpp; bitmap->bpp = bpp;

View File

@ -40,6 +40,12 @@
#include <freerdp/freerdp.h> #include <freerdp/freerdp.h>
#ifdef ENABLE_WINPR
#include <winpr/wtypes.h>
#else
#include "compat/winpr-wtypes.h"
#endif
#include <guacamole/protocol.h> #include <guacamole/protocol.h>
typedef struct guac_rdp_bitmap { typedef struct guac_rdp_bitmap {
@ -63,9 +69,9 @@ typedef struct guac_rdp_bitmap {
void guac_rdp_cache_bitmap(rdpContext* context, rdpBitmap* bitmap); void guac_rdp_cache_bitmap(rdpContext* context, rdpBitmap* bitmap);
void guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap); void guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap);
void guac_rdp_bitmap_decompress(rdpContext* context, rdpBitmap* bitmap, uint8* data, int width, int height, int bpp, int length, boolean compressed); void guac_rdp_bitmap_decompress(rdpContext* context, rdpBitmap* bitmap, UINT8* data, int width, int height, int bpp, int length, BOOL compressed);
void guac_rdp_bitmap_paint(rdpContext* context, rdpBitmap* bitmap); void guac_rdp_bitmap_paint(rdpContext* context, rdpBitmap* bitmap);
void guac_rdp_bitmap_free(rdpContext* context, rdpBitmap* bitmap); void guac_rdp_bitmap_free(rdpContext* context, rdpBitmap* bitmap);
void guac_rdp_bitmap_setsurface(rdpContext* context, rdpBitmap* bitmap, boolean primary); void guac_rdp_bitmap_setsurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary);
#endif #endif

View File

@ -41,6 +41,12 @@
#include <freerdp/utils/event.h> #include <freerdp/utils/event.h>
#include <freerdp/plugins/cliprdr.h> #include <freerdp/plugins/cliprdr.h>
#ifdef ENABLE_WINPR
#include <winpr/wtypes.h>
#else
#include "compat/winpr-wtypes.h"
#endif
#include <guacamole/client.h> #include <guacamole/client.h>
#include <guacamole/protocol.h> #include <guacamole/protocol.h>
@ -92,7 +98,7 @@ void guac_rdp_process_cb_monitor_ready(guac_client* client, RDP_EVENT* event) {
/* Received notification of clipboard support. */ /* Received notification of clipboard support. */
/* Respond with supported format list */ /* Respond with supported format list */
format_list->formats = (uint32*) malloc(sizeof(uint32)); format_list->formats = (UINT32*) malloc(sizeof(UINT32));
format_list->formats[0] = CB_FORMAT_TEXT; format_list->formats[0] = CB_FORMAT_TEXT;
format_list->num_formats = 1; format_list->num_formats = 1;
@ -159,11 +165,11 @@ void guac_rdp_process_cb_data_request(guac_client* client,
/* Set data and length */ /* Set data and length */
if (clipboard != NULL) { if (clipboard != NULL) {
data_response->data = (uint8*) strdup(clipboard); data_response->data = (UINT8*) strdup(clipboard);
data_response->size = strlen(clipboard) + 1; data_response->size = strlen(clipboard) + 1;
} }
else { else {
data_response->data = (uint8*) strdup(""); data_response->data = (UINT8*) strdup("");
data_response->size = 1; data_response->size = 1;
} }

View File

@ -39,6 +39,12 @@
#include <pthread.h> #include <pthread.h>
#include <freerdp/freerdp.h> #include <freerdp/freerdp.h>
#ifdef ENABLE_WINPR
#include <winpr/wtypes.h>
#else
#include "compat/winpr-wtypes.h"
#endif
#include <guacamole/client.h> #include <guacamole/client.h>
#include "client.h" #include "client.h"
@ -421,7 +427,7 @@ void guac_rdp_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) {
void guac_rdp_gdi_opaquerect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect) { void guac_rdp_gdi_opaquerect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect) {
guac_client* client = ((rdp_freerdp_context*) context)->client; guac_client* client = ((rdp_freerdp_context*) context)->client;
uint32 color = freerdp_color_convert_var(opaque_rect->color, UINT32 color = freerdp_color_convert_var(opaque_rect->color,
context->instance->settings->color_depth, 32, context->instance->settings->color_depth, 32,
((rdp_freerdp_context*) context)->clrconv); ((rdp_freerdp_context*) context)->clrconv);
@ -464,11 +470,11 @@ void guac_rdp_gdi_set_bounds(rdpContext* context, rdpBounds* bounds) {
/* If no bounds given, clear bounding rect */ /* If no bounds given, clear bounding rect */
if (bounds == NULL) if (bounds == NULL)
data->bounded = false; data->bounded = FALSE;
/* Otherwise, set bounding rectangle */ /* Otherwise, set bounding rectangle */
else { else {
data->bounded = true; data->bounded = TRUE;
data->bounds_left = bounds->left; data->bounds_left = bounds->left;
data->bounds_top = bounds->top; data->bounds_top = bounds->top;
data->bounds_right = bounds->right; data->bounds_right = bounds->right;

View File

@ -39,6 +39,12 @@
#include <pthread.h> #include <pthread.h>
#include <freerdp/freerdp.h> #include <freerdp/freerdp.h>
#ifdef ENABLE_WINPR
#include <winpr/wtypes.h>
#else
#include "compat/winpr-wtypes.h"
#endif
#include <guacamole/client.h> #include <guacamole/client.h>
#include <guacamole/error.h> #include <guacamole/error.h>
@ -131,7 +137,7 @@ void guac_rdp_glyph_free(rdpContext* context, rdpGlyph* glyph) {
} }
void guac_rdp_glyph_begindraw(rdpContext* context, void guac_rdp_glyph_begindraw(rdpContext* context,
int x, int y, int width, int height, uint32 fgcolor, uint32 bgcolor) { int x, int y, int width, int height, UINT32 fgcolor, UINT32 bgcolor) {
guac_client* client = ((rdp_freerdp_context*) context)->client; guac_client* client = ((rdp_freerdp_context*) context)->client;
rdp_guac_client_data* guac_client_data = rdp_guac_client_data* guac_client_data =
@ -203,7 +209,7 @@ void guac_rdp_glyph_begindraw(rdpContext* context,
} }
void guac_rdp_glyph_enddraw(rdpContext* context, void guac_rdp_glyph_enddraw(rdpContext* context,
int x, int y, int width, int height, uint32 fgcolor, uint32 bgcolor) { int x, int y, int width, int height, UINT32 fgcolor, UINT32 bgcolor) {
guac_client* client = ((rdp_freerdp_context*) context)->client; guac_client* client = ((rdp_freerdp_context*) context)->client;
rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data; rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;

View File

@ -40,6 +40,12 @@
#include <freerdp/freerdp.h> #include <freerdp/freerdp.h>
#ifdef ENABLE_WINPR
#include <winpr/wtypes.h>
#else
#include "compat/winpr-wtypes.h"
#endif
#include <guacamole/protocol.h> #include <guacamole/protocol.h>
typedef struct guac_rdp_glyph { typedef struct guac_rdp_glyph {
@ -60,8 +66,8 @@ void guac_rdp_glyph_new(rdpContext* context, rdpGlyph* glyph);
void guac_rdp_glyph_draw(rdpContext* context, rdpGlyph* glyph, int x, int y); void guac_rdp_glyph_draw(rdpContext* context, rdpGlyph* glyph, int x, int y);
void guac_rdp_glyph_free(rdpContext* context, rdpGlyph* glyph); void guac_rdp_glyph_free(rdpContext* context, rdpGlyph* glyph);
void guac_rdp_glyph_begindraw(rdpContext* context, void guac_rdp_glyph_begindraw(rdpContext* context,
int x, int y, int width, int height, uint32 fgcolor, uint32 bgcolor); int x, int y, int width, int height, UINT32 fgcolor, UINT32 bgcolor);
void guac_rdp_glyph_enddraw(rdpContext* context, void guac_rdp_glyph_enddraw(rdpContext* context,
int x, int y, int width, int height, uint32 fgcolor, uint32 bgcolor); int x, int y, int width, int height, UINT32 fgcolor, UINT32 bgcolor);
#endif #endif