summaryrefslogtreecommitdiffstats
path: root/libxrdp
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2013-03-12 22:50:10 -0700
committerJay Sorg <jay.sorg@gmail.com>2013-03-12 22:50:10 -0700
commit494150f1a9fd8ae717b8f4e41f6e13f6f89d3bef (patch)
treeca403563b6eace7c7453e2160f22c6262c117c86 /libxrdp
parenta47a3cee1af35b404df371ad0d19eee1cdd943c7 (diff)
downloadxrdp-proprietary-494150f1a9fd8ae717b8f4e41f6e13f6f89d3bef.tar.gz
xrdp-proprietary-494150f1a9fd8ae717b8f4e41f6e13f6f89d3bef.zip
work on new(color) cursors
Diffstat (limited to 'libxrdp')
-rw-r--r--libxrdp/libxrdp.c62
-rw-r--r--libxrdp/libxrdpinc.h2
2 files changed, 51 insertions, 13 deletions
diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c
index d4c9d372..78823135 100644
--- a/libxrdp/libxrdp.c
+++ b/libxrdp/libxrdp.c
@@ -417,10 +417,12 @@ libxrdp_send_bitmap(struct xrdp_session *session, int width, int height,
/*****************************************************************************/
int EXPORT_CC
libxrdp_send_pointer(struct xrdp_session *session, int cache_idx,
- char *data, char *mask, int x, int y)
+ char *data, char *mask, int x, int y, int bpp)
{
struct stream *s;
char *p;
+ tui16 *p16;
+ tui32 *p32;
int i;
int j;
@@ -428,7 +430,15 @@ libxrdp_send_pointer(struct xrdp_session *session, int cache_idx,
make_stream(s);
init_stream(s, 8192);
xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s);
- out_uint16_le(s, RDP_POINTER_COLOR);
+ if (bpp == 0)
+ {
+ out_uint16_le(s, RDP_POINTER_COLOR);
+ }
+ else
+ {
+ out_uint16_le(s, RDP_POINTER_POINTER);
+ out_uint16_le(s, bpp);
+ }
out_uint16_le(s, 0); /* pad */
out_uint16_le(s, cache_idx); /* cache_idx */
out_uint16_le(s, x);
@@ -437,24 +447,52 @@ libxrdp_send_pointer(struct xrdp_session *session, int cache_idx,
out_uint16_le(s, 32);
out_uint16_le(s, 128);
out_uint16_le(s, 3072);
- p = data;
- for (i = 0; i < 32; i++)
+ if (bpp == 16)
{
- for (j = 0; j < 32; j++)
+ p16 = (tui16 *) data;
+ for (i = 0; i < 32; i++)
{
- out_uint8(s, *p);
- p++;
- out_uint8(s, *p);
- p++;
- out_uint8(s, *p);
- p++;
+ for (j = 0; j < 32; j++)
+ {
+ out_uint16_le(s, *p16);
+ p16++;
+ }
+ }
+ }
+ else if (bpp == 32)
+ {
+ p32 = (tui32 *) data;
+ for (i = 0; i < 32; i++)
+ {
+ for (j = 0; j < 32; j++)
+ {
+ out_uint32_le(s, *p32);
+ p32++;
+ }
+ }
+ }
+ else if ((bpp == 0) || (bpp == 24))
+ {
+ p = data;
+ for (i = 0; i < 32; i++)
+ {
+ for (j = 0; j < 32; j++)
+ {
+ out_uint8(s, *p);
+ p++;
+ out_uint8(s, *p);
+ p++;
+ out_uint8(s, *p);
+ p++;
+ }
}
}
out_uint8a(s, mask, 128); /* mask */
s_mark_end(s);
- xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s, RDP_DATA_PDU_POINTER);
+ xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s,
+ RDP_DATA_PDU_POINTER);
free_stream(s);
return 0;
}
diff --git a/libxrdp/libxrdpinc.h b/libxrdp/libxrdpinc.h
index ebfc348c..9eac9733 100644
--- a/libxrdp/libxrdpinc.h
+++ b/libxrdp/libxrdpinc.h
@@ -91,7 +91,7 @@ libxrdp_send_bitmap(struct xrdp_session* session, int width, int height,
int bpp, char* data, int x, int y, int cx, int cy);
int DEFAULT_CC
libxrdp_send_pointer(struct xrdp_session* session, int cache_idx,
- char* data, char* mask, int x, int y);
+ char* data, char* mask, int x, int y, int bpp);
int DEFAULT_CC
libxrdp_set_pointer(struct xrdp_session* session, int cache_idx);
int DEFAULT_CC