work on new(color) cursors

ulab-next
Jay Sorg 12 years ago
parent 494150f1a9
commit 39a828d52f

@ -425,73 +425,94 @@ libxrdp_send_pointer(struct xrdp_session *session, int cache_idx,
tui32 *p32; tui32 *p32;
int i; int i;
int j; int j;
int data_bytes;
DEBUG(("libxrdp_send_pointer sending cursor")); DEBUG(("libxrdp_send_pointer sending cursor"));
/* error check */
if ((session->client_info->pointer_flags & 1) == 0)
{
if (bpp != 0)
{
g_writeln("libxrdp_send_pointer: error");
return 1;
}
}
if ((bpp != 0) && (bpp == 15) && (bpp != 16) &&
(bpp != 24) && (bpp != 32))
{
g_writeln("libxrdp_send_pointer: error");
return 1;
}
make_stream(s); make_stream(s);
init_stream(s, 8192); init_stream(s, 8192);
xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s); xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s);
if (bpp == 0) if (bpp == 0)
{ {
out_uint16_le(s, RDP_POINTER_COLOR); out_uint16_le(s, RDP_POINTER_COLOR);
out_uint16_le(s, 0); /* pad */
data_bytes = 3072;
} }
else else
{ {
out_uint16_le(s, RDP_POINTER_POINTER); out_uint16_le(s, RDP_POINTER_POINTER);
out_uint16_le(s, 0); /* pad */
out_uint16_le(s, bpp); out_uint16_le(s, bpp);
data_bytes = ((bpp + 7) / 8) * 32 * 32;
} }
out_uint16_le(s, 0); /* pad */
out_uint16_le(s, cache_idx); /* cache_idx */ out_uint16_le(s, cache_idx); /* cache_idx */
out_uint16_le(s, x); out_uint16_le(s, x);
out_uint16_le(s, y); out_uint16_le(s, y);
out_uint16_le(s, 32); out_uint16_le(s, 32);
out_uint16_le(s, 32); out_uint16_le(s, 32);
out_uint16_le(s, 128); out_uint16_le(s, 128);
out_uint16_le(s, 3072); out_uint16_le(s, data_bytes);
if (bpp == 16) switch (bpp)
{ {
p16 = (tui16 *) data; case 15:
for (i = 0; i < 32; i++) case 16:
{ p16 = (tui16 *) data;
for (j = 0; j < 32; j++) for (i = 0; i < 32; i++)
{ {
out_uint16_le(s, *p16); for (j = 0; j < 32; j++)
p16++; {
out_uint16_le(s, *p16);
p16++;
}
} }
} break;
} case 0:
else if (bpp == 32) case 24:
{ p = data;
p32 = (tui32 *) data; for (i = 0; i < 32; i++)
for (i = 0; i < 32; i++)
{
for (j = 0; j < 32; j++)
{ {
out_uint32_le(s, *p32); for (j = 0; j < 32; j++)
p32++; {
out_uint8(s, *p);
p++;
out_uint8(s, *p);
p++;
out_uint8(s, *p);
p++;
}
} }
} break;
} case 32:
else if ((bpp == 0) || (bpp == 24)) p32 = (tui32 *) data;
{ for (i = 0; i < 32; i++)
p = data;
for (i = 0; i < 32; i++)
{
for (j = 0; j < 32; j++)
{ {
out_uint8(s, *p); for (j = 0; j < 32; j++)
p++; {
out_uint8(s, *p); out_uint32_le(s, *p32);
p++; p32++;
out_uint8(s, *p); }
p++;
} }
} break;
} }
out_uint8a(s, mask, 128); /* mask */ out_uint8a(s, mask, 128); /* mask */
s_mark_end(s); s_mark_end(s);
xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s, xrdp_rdp_send_data((struct xrdp_rdp *)(session->rdp), s,
RDP_DATA_PDU_POINTER); RDP_DATA_PDU_POINTER);
free_stream(s); free_stream(s);
return 0; return 0;

Loading…
Cancel
Save