Merge branch 'master' of github.com:FreeRDP/FreeRDP

This commit is contained in:
Marc-André Moreau 2012-01-08 20:33:24 -05:00
commit b67a4157f9
13 changed files with 71 additions and 33 deletions

View File

@ -243,8 +243,8 @@ void xf_Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height
{
xfInfo* xfi = ((xfContext*) context)->xfi;
bgcolor = freerdp_color_convert_rgb(bgcolor, xfi->srcBpp, 32, xfi->clrconv);
fgcolor = freerdp_color_convert_rgb(fgcolor, xfi->srcBpp, 32, xfi->clrconv);
bgcolor = freerdp_color_convert_var_rgb(bgcolor, xfi->srcBpp, 32, xfi->clrconv);
fgcolor = freerdp_color_convert_var_rgb(fgcolor, xfi->srcBpp, 32, xfi->clrconv);
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);

View File

@ -81,7 +81,7 @@ void update_process_glyph_fragments(rdpContext* context, uint8* data, uint32 len
graphics = context->graphics;
glyph_cache = context->cache->glyph;
if (opWidth > 1)
if (opWidth > 0 && opHeight > 0)
Glyph_BeginDraw(context, opX, opY, opWidth, opHeight, bgcolor, fgcolor);
else
Glyph_BeginDraw(context, 0, 0, 0, 0, bgcolor, fgcolor);

View File

@ -36,6 +36,14 @@ void rdp_write_synchronize_pdu(STREAM* s, rdpSettings* settings)
stream_write_uint16(s, settings->pdu_source); /* targetUser (2 bytes) */
}
boolean rdp_recv_synchronize_pdu(rdpRdp* rdp, STREAM* s)
{
if (rdp->settings->server_mode)
return rdp_recv_server_synchronize_pdu(rdp, s);
else
return rdp_recv_client_synchronize_pdu(rdp, s);
}
boolean rdp_recv_server_synchronize_pdu(rdpRdp* rdp, STREAM* s)
{
rdp->finalize_sc_pdus |= FINALIZE_SC_SYNCHRONIZE_PDU;
@ -54,17 +62,22 @@ boolean rdp_send_server_synchronize_pdu(rdpRdp* rdp)
return true;
}
boolean rdp_recv_client_synchronize_pdu(STREAM* s)
boolean rdp_recv_client_synchronize_pdu(rdpRdp* rdp, STREAM* s)
{
uint16 messageType;
rdp->finalize_sc_pdus |= FINALIZE_SC_SYNCHRONIZE_PDU;
if (stream_get_left(s) < 4)
return false;
stream_read_uint16(s, messageType); /* messageType (2 bytes) */
if (messageType != SYNCMSGTYPE_SYNC)
return false;
/* targetUser (2 bytes) */
stream_seek_uint16(s);
return true;
}
@ -220,12 +233,32 @@ boolean rdp_send_client_font_list_pdu(rdpRdp* rdp, uint16 flags)
return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FONT_LIST, rdp->mcs->user_id);
}
boolean rdp_recv_font_map_pdu(rdpRdp* rdp, STREAM* s)
{
if (rdp->settings->server_mode)
return rdp_recv_server_font_map_pdu(rdp, s);
else
return rdp_recv_client_font_map_pdu(rdp, s);
}
boolean rdp_recv_server_font_map_pdu(rdpRdp* rdp, STREAM* s)
{
rdp->finalize_sc_pdus |= FINALIZE_SC_FONT_MAP_PDU;
return true;
}
boolean rdp_recv_client_font_map_pdu(rdpRdp* rdp, STREAM* s)
{
rdp->finalize_sc_pdus |= FINALIZE_SC_FONT_MAP_PDU;
stream_seek_uint16(s); /* numberEntries (2 bytes) */
stream_seek_uint16(s); /* totalNumEntries (2 bytes) */
stream_seek_uint16(s); /* mapFlags (2 bytes) */
stream_seek_uint16(s); /* entrySize (2 bytes) */
return true;
}
boolean rdp_send_server_font_map_pdu(rdpRdp* rdp)
{
STREAM* s;

View File

@ -41,9 +41,10 @@
boolean rdp_recv_deactivate_all(rdpRdp* rdp, STREAM* s);
boolean rdp_send_deactivate_all(rdpRdp* rdp);
boolean rdp_recv_synchronize_pdu(rdpRdp* rdp, STREAM* s);
boolean rdp_recv_server_synchronize_pdu(rdpRdp* rdp, STREAM* s);
boolean rdp_send_server_synchronize_pdu(rdpRdp* rdp);
boolean rdp_recv_client_synchronize_pdu(STREAM* s);
boolean rdp_recv_client_synchronize_pdu(rdpRdp* rdp, STREAM* s);
boolean rdp_send_client_synchronize_pdu(rdpRdp* rdp);
boolean rdp_recv_control_pdu(STREAM* s, uint16* action);
boolean rdp_recv_server_control_pdu(rdpRdp* rdp, STREAM* s);
@ -53,7 +54,9 @@ boolean rdp_send_client_control_pdu(rdpRdp* rdp, uint16 action);
boolean rdp_send_client_persistent_key_list_pdu(rdpRdp* rdp);
boolean rdp_recv_client_font_list_pdu(STREAM* s);
boolean rdp_send_client_font_list_pdu(rdpRdp* rdp, uint16 flags);
boolean rdp_recv_font_map_pdu(rdpRdp* rdp, STREAM* s);
boolean rdp_recv_server_font_map_pdu(rdpRdp* rdp, STREAM* s);
boolean rdp_recv_client_font_map_pdu(rdpRdp* rdp, STREAM* s);
boolean rdp_send_server_font_map_pdu(rdpRdp* rdp);
boolean rdp_server_accept_client_control_pdu(rdpRdp* rdp, STREAM* s);

View File

@ -612,6 +612,7 @@ void rdp_recv_logon_info_v2(rdpRdp* rdp, STREAM* s)
stream_seek_uint16(s); /* version (2 bytes) */
stream_seek_uint32(s); /* size (4 bytes) */
stream_seek_uint32(s); /* sessionId (4 bytes) */
stream_read_uint32(s, cbDomain); /* cbDomain (4 bytes) */
stream_read_uint32(s, cbUserName); /* cbUserName (4 bytes) */
stream_seek(s, 558); /* pad */

View File

@ -64,7 +64,7 @@ static boolean peer_recv_data_pdu(freerdp_peer* client, STREAM* s)
switch (type)
{
case DATA_PDU_TYPE_SYNCHRONIZE:
if (!rdp_recv_client_synchronize_pdu(s))
if (!rdp_recv_client_synchronize_pdu(client->context->rdp, s))
return false;
break;

View File

@ -466,7 +466,7 @@ void rdp_recv_data_pdu(rdpRdp* rdp, STREAM* s)
break;
case DATA_PDU_TYPE_SYNCHRONIZE:
rdp_recv_server_synchronize_pdu(rdp, s);
rdp_recv_synchronize_pdu(rdp, s);
break;
case DATA_PDU_TYPE_REFRESH_RECT:
@ -493,7 +493,7 @@ void rdp_recv_data_pdu(rdpRdp* rdp, STREAM* s)
break;
case DATA_PDU_TYPE_FONT_MAP:
rdp_recv_server_font_map_pdu(rdp, s);
rdp_recv_font_map_pdu(rdp, s);
break;
case DATA_PDU_TYPE_SET_KEYBOARD_INDICATORS:

View File

@ -177,6 +177,7 @@ boolean rdp_send_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id);
STREAM* rdp_data_pdu_init(rdpRdp* rdp);
boolean rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, uint8 type, uint16 channel_id);
void rdp_recv_data_pdu(rdpRdp* rdp, STREAM* s);
boolean rdp_send(rdpRdp* rdp, STREAM* s, uint16 channel_id);
void rdp_recv(rdpRdp* rdp);

View File

@ -187,7 +187,8 @@ void update_read_pointer_color(STREAM* s, POINTER_COLOR_UPDATE* pointer_color)
stream_read(s, pointer_color->andMaskData, pointer_color->lengthAndMask);
}
stream_seek_uint8(s); /* pad (1 byte) */
if (stream_get_left(s) > 0)
stream_seek_uint8(s); /* pad (1 byte) */
}
void update_read_pointer_new(STREAM* s, POINTER_NEW_UPDATE* pointer_new)
@ -279,23 +280,16 @@ void update_recv(rdpUpdate* update, STREAM* s)
if (stream_get_left(s) > RDP_SHARE_DATA_HEADER_LENGTH)
{
uint8 type;
uint16 pduType;
uint16 length;
uint16 source;
uint32 shareId;
uint8 compressed_type;
uint16 compressed_len;
rdp_read_share_control_header(s, &length, &pduType, &source);
if (pduType != PDU_TYPE_DATA)
return;
rdp_read_share_data_header(s, &length, &type, &shareId, &compressed_type, &compressed_len);
if (type == DATA_PDU_TYPE_UPDATE)
update_recv(update, s);
rdp_recv_data_pdu(update->context->rdp, s);
}
}

View File

@ -368,9 +368,9 @@ static int BitBlt_SRCPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nW
static int BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
uint16* srcp;
uint8* srcp;
uint16* dstp;
uint16* patp;
uint16 src16;
uint16 color16;
HGDI_BITMAP hSrcBmp;
@ -380,7 +380,6 @@ static int BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWi
color16 = gdi_get_color_16bpp(hdcDest, hdcDest->textColor);
hSrcBmp = (HGDI_BITMAP) hdcSrc->selectedObject;
srcp = (uint16*) hSrcBmp->data;
if (hdcSrc->bytesPerPixel != 1)
{
@ -390,15 +389,15 @@ static int BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWi
for (y = 0; y < nHeight; y++)
{
srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
srcp = (uint8*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
patp = (uint16*) &color16;
*dstp = (*srcp & *patp) | (~(*srcp) & *dstp);
src16 = (*srcp << 8) | *srcp;
*dstp = (src16 & color16) | (~src16 & *dstp);
srcp++;
dstp++;
}

View File

@ -186,10 +186,11 @@ void gdi_Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int heigh
HGDI_BRUSH brush;
rdpGdi* gdi = context->gdi;
bgcolor = freerdp_color_convert_rgb(bgcolor, gdi->srcBpp, 32, gdi->clrconv);
fgcolor = freerdp_color_convert_rgb(fgcolor, gdi->srcBpp, 32, gdi->clrconv);
bgcolor = freerdp_color_convert_var_bgr(bgcolor, gdi->srcBpp, 32, gdi->clrconv);
fgcolor = freerdp_color_convert_var_bgr(fgcolor, gdi->srcBpp, 32, gdi->clrconv);
gdi_CRgnToRect(x, y, width, height, &rect);
brush = gdi_CreateSolidBrush(fgcolor);
gdi_FillRect(gdi->drawing->hdc, &rect, brush);
@ -201,7 +202,7 @@ void gdi_Glyph_EndDraw(rdpContext* context, int x, int y, int width, int height,
{
rdpGdi* gdi = context->gdi;
bgcolor = freerdp_color_convert_rgb(bgcolor, gdi->srcBpp, 32, gdi->clrconv);
bgcolor = freerdp_color_convert_var_bgr(bgcolor, gdi->srcBpp, 32, gdi->clrconv);
gdi->textColor = gdi_SetTextColor(gdi->drawing->hdc, bgcolor);
}

View File

@ -34,11 +34,13 @@ if(X11_FOUND)
target_link_libraries(freerdp-kbd ${X11_LIBRARIES})
endif()
find_suggested_package(XKBFile)
if(XKBFILE_FOUND)
add_definitions(-DWITH_XKBFILE)
include_directories(${XKBFILE_INCLUDE_DIRS})
target_link_libraries(freerdp-kbd ${XKBFILE_LIBRARIES})
if(NOT APPLE)
find_suggested_package(XKBFile)
if(XKBFILE_FOUND)
add_definitions(-DWITH_XKBFILE)
include_directories(${XKBFILE_INCLUDE_DIRS})
target_link_libraries(freerdp-kbd ${XKBFILE_LIBRARIES})
endif()
endif()
add_definitions(-DKEYMAP_PATH="${FREERDP_KEYMAP_PATH}")

View File

@ -240,8 +240,12 @@ static int load_xkb_keyboard(KeycodeToVkcode map, char* kbd)
if ((fp = fopen(xkbfilepath, "r")) == NULL)
{
/* If ran from the source tree, the keymaps will be in the parent directory */
snprintf(xkbfilepath, sizeof(xkbfilepath), "../keymaps/%s", xkbfile);
/* If ran from the root of the source tree */
snprintf(xkbfilepath, sizeof(xkbfilepath), "./keymaps/%s", xkbfile);
/* If ran from the client directory */
if((fp = fopen(xkbfilepath, "r")) == NULL)
snprintf(xkbfilepath, sizeof(xkbfilepath), "../../keymaps/%s", xkbfile);
if ((fp = fopen(xkbfilepath, "r")) == NULL)
{