diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-03-18 23:43:17 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-03-18 23:43:17 -0700 |
commit | 12f7cd64f1642130b82f112b57e7a7993932cf1f (patch) | |
tree | 348dca0607e223dc7cad90db84fc07e96f218ba6 | |
parent | 561b263b9141cb56f315d754920bf07e26af7317 (diff) | |
download | xrdp-proprietary-12f7cd64f1642130b82f112b57e7a7993932cf1f.tar.gz xrdp-proprietary-12f7cd64f1642130b82f112b57e7a7993932cf1f.zip |
work on new(color) cursors
-rw-r--r-- | xorg/X11R7.6/rdp/rdp.h | 4 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpinput.c | 4 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpup.c | 32 | ||||
-rw-r--r-- | xrdp/xrdp.h | 6 | ||||
-rw-r--r-- | xrdp/xrdp_mm.c | 17 | ||||
-rw-r--r-- | xrdp/xrdp_types.h | 6 | ||||
-rw-r--r-- | xrdp/xrdp_wm.c | 14 | ||||
-rw-r--r-- | xup/xup.c | 28 | ||||
-rw-r--r-- | xup/xup.h | 7 |
9 files changed, 103 insertions, 15 deletions
diff --git a/xorg/X11R7.6/rdp/rdp.h b/xorg/X11R7.6/rdp/rdp.h index 920fe25d..ae08f38d 100644 --- a/xorg/X11R7.6/rdp/rdp.h +++ b/xorg/X11R7.6/rdp/rdp.h @@ -1,5 +1,5 @@ /* -Copyright 2005-2012 Jay Sorg +Copyright 2005-2013 Jay Sorg Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that @@ -500,6 +500,8 @@ rdpup_send_area(struct image_data* id, int x, int y, int w, int h); int rdpup_set_cursor(short x, short y, char* cur_data, char* cur_mask); int +rdpup_set_cursor_ex(short x, short y, char *cur_data, char *cur_mask, int bpp); +int rdpup_create_os_surface(int rdpindexd, int width, int height); int rdpup_switch_os_surface(int rdpindex); diff --git a/xorg/X11R7.6/rdp/rdpinput.c b/xorg/X11R7.6/rdp/rdpinput.c index cefb5156..319bdb87 100644 --- a/xorg/X11R7.6/rdp/rdpinput.c +++ b/xorg/X11R7.6/rdp/rdpinput.c @@ -1,5 +1,5 @@ /* -Copyright 2005-2012 Jay Sorg +Copyright 2005-2013 Jay Sorg Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that @@ -671,7 +671,7 @@ rdpSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScr, CursorPtr pCurs, } rdpup_begin_update(); - rdpup_set_cursor(xhot, yhot, cur_data, cur_mask); + rdpup_set_cursor_ex(xhot, yhot, cur_data, cur_mask, 0); rdpup_end_update(); } diff --git a/xorg/X11R7.6/rdp/rdpup.c b/xorg/X11R7.6/rdp/rdpup.c index d1d654de..78263b55 100644 --- a/xorg/X11R7.6/rdp/rdpup.c +++ b/xorg/X11R7.6/rdp/rdpup.c @@ -1,5 +1,5 @@ /* -Copyright 2005-2012 Jay Sorg +Copyright 2005-2013 Jay Sorg Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that @@ -1367,6 +1367,36 @@ rdpup_set_cursor(short x, short y, char *cur_data, char *cur_mask) /******************************************************************************/ int +rdpup_set_cursor_ex(short x, short y, char *cur_data, char *cur_mask, int bpp) +{ + int size; + int Bpp; + + if (g_connected) + { + LLOGLN(10, (" rdpup_set_cursor_ex")); + Bpp = (bpp == 0) ? 3 : (bpp + 7) / 8; + size = 10 + 32 * (32 * Bpp) + 32 * (32 / 8); + rdpup_pre_check(size); + out_uint16_le(g_out_s, 51); /* set cursor ex */ + out_uint16_le(g_out_s, size); /* size */ + g_count++; + x = MAX(0, x); + x = MIN(31, x); + y = MAX(0, y); + y = MIN(31, y); + out_uint16_le(g_out_s, x); + out_uint16_le(g_out_s, y); + out_uint16_le(g_out_s, bpp); + out_uint8a(g_out_s, cur_data, 32 * (32 * Bpp)); + out_uint8a(g_out_s, cur_mask, 32 * (32 / 8)); + } + + return 0; +} + +/******************************************************************************/ +int rdpup_create_os_surface(int rdpindex, int width, int height) { LLOGLN(10, ("rdpup_create_os_surface:")); diff --git a/xrdp/xrdp.h b/xrdp/xrdp.h index 123551fa..ed653741 100644 --- a/xrdp/xrdp.h +++ b/xrdp/xrdp.h @@ -128,7 +128,8 @@ int APP_CC xrdp_wm_send_pointer(struct xrdp_wm* self, int cache_idx, char* data, char* mask, int x, int y, int bpp); int APP_CC -xrdp_wm_pointer(struct xrdp_wm* self, char* data, char* mask, int x, int y); +xrdp_wm_pointer(struct xrdp_wm* self, char* data, char* mask, int x, int y, + int bpp); int callback(long id, int msg, long param1, long param2, long param3, long param4); int APP_CC @@ -376,6 +377,9 @@ int DEFAULT_CC server_set_pointer(struct xrdp_mod* mod, int x, int y, char* data, char* mask); int DEFAULT_CC +server_set_pointer_ex(struct xrdp_mod* mod, int x, int y, + char* data, char* mask, int bpp); +int DEFAULT_CC server_palette(struct xrdp_mod* mod, int* palette); int DEFAULT_CC server_msg(struct xrdp_mod* mod, char* msg, int code); diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index 6c01c85c..cd4006f4 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2012 + * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -383,6 +383,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm *self) self->mod->server_screen_blt = server_screen_blt; self->mod->server_paint_rect = server_paint_rect; self->mod->server_set_pointer = server_set_pointer; + self->mod->server_set_pointer_ex = server_set_pointer_ex; self->mod->server_palette = server_palette; self->mod->server_msg = server_msg; self->mod->server_is_term = server_is_term; @@ -1802,7 +1803,19 @@ server_set_pointer(struct xrdp_mod *mod, int x, int y, struct xrdp_wm *wm; wm = (struct xrdp_wm *)(mod->wm); - xrdp_wm_pointer(wm, data, mask, x, y); + xrdp_wm_pointer(wm, data, mask, x, y, 0); + return 0; +} + +/*****************************************************************************/ +int DEFAULT_CC +server_set_pointer_ex(struct xrdp_mod *mod, int x, int y, + char *data, char *mask, int bpp) +{ + struct xrdp_wm *wm; + + wm = (struct xrdp_wm *)(mod->wm); + xrdp_wm_pointer(wm, data, mask, x, y, bpp); return 0; } diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h index a4b4bc7a..e7bb7baf 100644 --- a/xrdp/xrdp_types.h +++ b/xrdp/xrdp_types.h @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2012 + * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -115,8 +115,10 @@ struct xrdp_mod int (*server_monitored_desktop)(struct xrdp_mod* mod, struct rail_monitored_desktop_order* mdo, int flags); + int (*server_set_pointer_ex)(struct xrdp_mod* v, int x, int y, char* data, + char* mask, int bpp); - long server_dumby[100 - 37]; /* align, 100 minus the number of server + long server_dumby[100 - 38]; /* align, 100 minus the number of server functions above */ /* common */ long handle; /* pointer to self as int */ diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c index 0aa0beed..89adc61b 100644 --- a/xrdp/xrdp_wm.c +++ b/xrdp/xrdp_wm.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2012 + * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -180,14 +180,22 @@ xrdp_wm_get_pixel(char *data, int x, int y, int width, int bpp) /*****************************************************************************/ int APP_CC -xrdp_wm_pointer(struct xrdp_wm *self, char *data, char *mask, int x, int y) +xrdp_wm_pointer(struct xrdp_wm *self, char *data, char *mask, int x, int y, + int bpp) { + int bytes; struct xrdp_pointer_item pointer_item; + if (bpp == 0) + { + bpp = 24; + } + bytes = ((bpp + 7) / 8) * 32 * 32; g_memset(&pointer_item, 0, sizeof(struct xrdp_pointer_item)); pointer_item.x = x; pointer_item.y = y; - g_memcpy(pointer_item.data, data, 32 * 32 * 3); + pointer_item.bpp = bpp; + g_memcpy(pointer_item.data, data, bytes); g_memcpy(pointer_item.mask, mask, 32 * 32 / 8); self->screen->pointer = xrdp_cache_add_pointer(self->cache, &pointer_item); return 0; @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2012 + * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -489,6 +489,29 @@ process_server_window_delete(struct mod *mod, struct stream *s) /******************************************************************************/ /* return error */ +static int APP_CC +process_server_set_pointer_ex(struct mod *mod, struct stream *s) +{ + int rv; + int x; + int y; + int bpp; + int Bpp; + char cur_data[32 * (32 * 4)]; + char cur_mask[32 * (32 / 8)]; + + in_sint16_le(s, x); + in_sint16_le(s, y); + in_uint16_le(s, bpp); + Bpp = (bpp == 0) ? 3 : (bpp + 7) / 8; + in_uint8a(s, cur_data, 32 * (32 * Bpp)); + in_uint8a(s, cur_mask, 32 * (32 / 8)); + rv = mod->server_set_cursor_ex(mod, x, y, cur_data, cur_mask, bpp); + return rv; +} + +/******************************************************************************/ +/* return error */ static int lib_mod_process_orders(struct mod *mod, int type, struct stream *s) { @@ -630,6 +653,9 @@ lib_mod_process_orders(struct mod *mod, int type, struct stream *s) case 26: /* server_window_delete */ rv = process_server_window_delete(mod, s); break; + case 51: /* server_set_pointer_ex */ + rv = process_server_set_pointer_ex(mod, s); + break; default: g_writeln("lib_mod_process_orders: unknown order type %d", type); rv = 0; @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2012 + * Copyright (C) Jay Sorg 2004-2013 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -117,7 +117,10 @@ struct mod int (*server_monitored_desktop)(struct mod* v, struct rail_monitored_desktop_order* mdo, int flags); - tbus server_dumby[100 - 37]; /* align, 100 minus the number of server + int (*server_set_cursor_ex)(struct mod* v, int x, int y, char* data, + char* mask, int bpp); + + tbus server_dumby[100 - 38]; /* align, 100 minus the number of server functions above */ /* common */ tbus handle; /* pointer to self as long */ |