summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_mm.c
diff options
context:
space:
mode:
Diffstat (limited to 'xrdp/xrdp_mm.c')
-rw-r--r--xrdp/xrdp_mm.c102
1 files changed, 100 insertions, 2 deletions
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index 88f888c7..b1499984 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -414,6 +414,9 @@ xrdp_mm_setup_mod1(struct xrdp_mm *self)
self->mod->server_notify_delete = server_notify_delete;
self->mod->server_monitored_desktop = server_monitored_desktop;
self->mod->server_add_char_alpha = server_add_char_alpha;
+ self->mod->server_create_os_surface_bpp = server_create_os_surface_bpp;
+ self->mod->server_paint_rect_bpp = server_paint_rect_bpp;
+ self->mod->server_composite = server_composite;
}
}
@@ -906,7 +909,6 @@ xrdp_mm_process_rail_drawing_orders(struct xrdp_mm* self, struct trans* trans)
struct stream* s;
int order_type;
int rv = 0;
- struct rail_window_state_order rwso;
s = trans_get_in_s(trans);
if (s == 0)
@@ -1057,7 +1059,7 @@ xrdp_mm_connect_chansrv(struct xrdp_mm *self, char *ip, char *port)
self->usechansrv = 1;
/* connect channel redir */
- if ((ip == 0) || (g_strcmp(ip, "127.0.0.1") == 0) || (ip[0] == 0))
+ if ((g_strcmp(ip, "127.0.0.1") == 0) || (ip[0] == 0))
{
/* unix socket */
self->chan_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192);
@@ -2060,6 +2062,79 @@ server_paint_rect(struct xrdp_mod *mod, int x, int y, int cx, int cy,
/*****************************************************************************/
int DEFAULT_CC
+server_paint_rect_bpp(struct xrdp_mod* mod, int x, int y, int cx, int cy,
+ char* data, int width, int height, int srcx, int srcy,
+ int bpp)
+{
+ struct xrdp_wm* wm;
+ struct xrdp_bitmap* b;
+ struct xrdp_painter* p;
+
+ p = (struct xrdp_painter*)(mod->painter);
+ if (p == 0)
+ {
+ return 0;
+ }
+ wm = (struct xrdp_wm*)(mod->wm);
+ b = xrdp_bitmap_create_with_data(width, height, bpp, data, wm);
+ xrdp_painter_copy(p, b, wm->target_surface, x, y, cx, cy, srcx, srcy);
+ xrdp_bitmap_delete(b);
+ return 0;
+}
+
+/*****************************************************************************/
+int DEFAULT_CC
+server_composite(struct xrdp_mod* mod, int srcidx, int srcformat,
+ int srcwidth, int srcrepeat, int* srctransform,
+ int mskflags, int mskidx, int mskformat, int mskwidth,
+ int mskrepeat, int op, int srcx, int srcy,
+ int mskx, int msky, int dstx, int dsty,
+ int width, int height, int dstformat)
+{
+ struct xrdp_wm* wm;
+ struct xrdp_bitmap* b;
+ struct xrdp_bitmap* msk;
+ struct xrdp_painter* p;
+ struct xrdp_os_bitmap_item* bi;
+
+ p = (struct xrdp_painter*)(mod->painter);
+ if (p == 0)
+ {
+ return 0;
+ }
+ wm = (struct xrdp_wm*)(mod->wm);
+ b = 0;
+ msk = 0;
+ bi = xrdp_cache_get_os_bitmap(wm->cache, srcidx);
+ if (bi != 0)
+ {
+ b = bi->bitmap;
+ }
+ if (mskflags & 1)
+ {
+ bi = xrdp_cache_get_os_bitmap(wm->cache, mskidx);
+ if (bi != 0)
+ {
+ msk = bi->bitmap;
+ }
+ }
+ if (b != 0)
+ {
+ xrdp_painter_composite(p, b, srcformat, srcwidth, srcrepeat,
+ wm->target_surface, srctransform,
+ mskflags, msk, mskformat, mskwidth, mskrepeat,
+ op, srcx, srcy, mskx, msky, dstx, dsty,
+ width, height, dstformat);
+ }
+ else
+ {
+ g_writeln("server_composite: error finding id %d or %d", srcidx, mskidx);
+ }
+ return 0;
+}
+
+/*****************************************************************************/
+int DEFAULT_CC
server_set_pointer(struct xrdp_mod *mod, int x, int y,
char *data, char *mask)
{
@@ -2675,6 +2750,29 @@ server_create_os_surface(struct xrdp_mod *mod, int rdpindex,
/*****************************************************************************/
int DEFAULT_CC
+server_create_os_surface_bpp(struct xrdp_mod* mod, int rdpindex,
+ int width, int height, int bpp)
+{
+ struct xrdp_wm* wm;
+ struct xrdp_bitmap* bitmap;
+ int error;
+
+ wm = (struct xrdp_wm*)(mod->wm);
+ bitmap = xrdp_bitmap_create(width, height, bpp,
+ WND_TYPE_OFFSCREEN, wm);
+ error = xrdp_cache_add_os_bitmap(wm->cache, bitmap, rdpindex);
+ if (error != 0)
+ {
+ g_writeln("server_create_os_surface_bpp: xrdp_cache_add_os_bitmap failed");
+ return 1;
+ }
+ bitmap->item_index = rdpindex;
+ bitmap->id = rdpindex;
+ return 0;
+}
+
+/*****************************************************************************/
+int DEFAULT_CC
server_switch_os_surface(struct xrdp_mod *mod, int rdpindex)
{
struct xrdp_wm *wm;