work on new(color) cursors

ulab-next
Jay Sorg 11 years ago
parent 561b263b91
commit 12f7cd64f1

@ -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);

@ -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();
}

@ -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
@ -1365,6 +1365,36 @@ rdpup_set_cursor(short x, short y, char *cur_data, char *cur_mask)
return 0;
}
/******************************************************************************/
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)

@ -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);

@ -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;
}

@ -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 */

@ -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.
@ -487,6 +487,29 @@ process_server_window_delete(struct mod *mod, struct stream *s)
return rv;
}
/******************************************************************************/
/* 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
@ -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 */

Loading…
Cancel
Save