summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_cache.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2012-05-13 14:40:14 -0700
committerJay Sorg <jay.sorg@gmail.com>2012-05-13 14:40:14 -0700
commit76e070e4f141c868fd4a4432985028c6a67bc643 (patch)
tree6cc4d9c9b9e1cc5f41e7ac453672d45f2cf692ac /xrdp/xrdp_cache.c
parente8d2e4b6ad7538fc8f87bbe285d7d2a2413a734e (diff)
downloadxrdp-proprietary-76e070e4f141c868fd4a4432985028c6a67bc643.tar.gz
xrdp-proprietary-76e070e4f141c868fd4a4432985028c6a67bc643.zip
started work on off screen bitmap support
Diffstat (limited to 'xrdp/xrdp_cache.c')
-rw-r--r--xrdp/xrdp_cache.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/xrdp/xrdp_cache.c b/xrdp/xrdp_cache.c
index 83e91ed9..88180491 100644
--- a/xrdp/xrdp_cache.c
+++ b/xrdp/xrdp_cache.c
@@ -73,6 +73,11 @@ xrdp_cache_delete(struct xrdp_cache* self)
g_free(self->char_items[i][j].font_item.data);
}
}
+ for (i = 0; i < 2000; i++)
+ {
+ xrdp_bitmap_delete(self->os_bitmap_items[i].bitmap);
+ }
+
g_free(self);
}
@@ -532,3 +537,78 @@ xrdp_cache_add_brush(struct xrdp_cache* self,
DEBUG(("adding brush at %d", index));
return index;
}
+
+/*****************************************************************************/
+/* returns index */
+int APP_CC
+xrdp_cache_add_os_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap,
+ int id)
+{
+ int index;
+ struct xrdp_os_bitmap_item* bi;
+
+ if (id < 1)
+ {
+ return -1;
+ }
+ index = 0;
+ for (index = 0; index < 2000; index++)
+ {
+ bi = self->os_bitmap_items + index;
+ if (bi->bitmap == 0)
+ {
+ bi->id = id;
+ bi->bitmap = bitmap;
+ //g_writeln("xrdp_cache_add_os_bitmap: bitmap id 0x%x added at index %d", id, index);
+ return index;
+ }
+ }
+ g_writeln("xrdp_cache_add_os_bitmap: bitmap id 0x%x not added, full", id);
+ return -1;
+}
+
+/*****************************************************************************/
+/* returns index */
+int APP_CC
+xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int id)
+{
+ int index;
+ struct xrdp_os_bitmap_item* bi;
+
+ if (id < 1)
+ {
+ return -1;
+ }
+ for (index = 0; index < 2000; index++)
+ {
+ bi = self->os_bitmap_items + index;
+ if (bi->id == id)
+ {
+ xrdp_bitmap_delete(bi->bitmap);
+ g_memset(bi, 0, sizeof(struct xrdp_os_bitmap_item));
+ //g_writeln("xrdp_cache_remove_os_bitmap: bitmap id 0x%x removed from index %d", id, index);
+ return index;
+ }
+ }
+ return -1;
+}
+
+/*****************************************************************************/
+struct xrdp_os_bitmap_item* APP_CC
+xrdp_cache_get_os_bitmap(struct xrdp_cache* self, int id)
+{
+ int index;
+ struct xrdp_os_bitmap_item* bi;
+
+ for (index = 0; index < 2000; index++)
+ {
+ bi = self->os_bitmap_items + index;
+ if (bi->id == id)
+ {
+ //g_writeln("xrdp_cache_get_os_bitmap: bitmap id 0x%x found at index %d", id, index);
+ return bi;
+ }
+ }
+ g_writeln("xrdp_cache_get_os_bitmap: bitmap id 0x%x not found", id);
+ return 0;
+}