diff options
author | jsorg71 <jsorg71> | 2005-08-24 01:09:33 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2005-08-24 01:09:33 +0000 |
commit | 7d891a1bde2f8287f333fda9acc88310d783da73 (patch) | |
tree | 5202a565b2bee120ed075a0cac95221b3f1e0427 /xrdp/xrdp_cache.c | |
parent | 1881c8b1b847ef0de1c42f635ee9e10b99b5863e (diff) | |
download | xrdp-proprietary-7d891a1bde2f8287f333fda9acc88310d783da73.tar.gz xrdp-proprietary-7d891a1bde2f8287f333fda9acc88310d783da73.zip |
added server_reset(which uses demand_active) for resizing the rdp client
Diffstat (limited to 'xrdp/xrdp_cache.c')
-rw-r--r-- | xrdp/xrdp_cache.c | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/xrdp/xrdp_cache.c b/xrdp/xrdp_cache.c index 99cc8f31..57ec1f72 100644 --- a/xrdp/xrdp_cache.c +++ b/xrdp/xrdp_cache.c @@ -75,6 +75,51 @@ xrdp_cache_delete(struct xrdp_cache* self) } /*****************************************************************************/ +int APP_CC +xrdp_cache_reset(struct xrdp_cache* self, + struct xrdp_client_info* client_info) +{ + struct xrdp_wm* wm; + struct xrdp_session* session; + int i; + int j; + + /* free all the cached bitmaps */ + for (i = 0; i < 3; i++) + { + for (j = 0; j < 600; j++) + { + xrdp_bitmap_delete(self->bitmap_items[i][j].bitmap); + } + } + /* free all the cached font items */ + for (i = 0; i < 12; i++) + { + for (j = 0; j < 256; j++) + { + g_free(self->char_items[i][j].font_item.data); + } + } + /* save these */ + wm = self->wm; + session = self->session; + /* set whole struct to zero */ + g_memset(self, 0, sizeof(struct xrdp_cache)); + /* set some stuff back */ + self->wm = wm; + self->session = session; + self->use_bitmap_comp = client_info->use_bitmap_comp; + self->cache1_entries = client_info->cache1_entries; + self->cache1_size = client_info->cache1_size; + self->cache2_entries = client_info->cache2_entries; + self->cache2_size = client_info->cache2_size; + self->cache3_entries = client_info->cache3_entries; + self->cache3_size = client_info->cache3_size; + self->pointer_cache_entries = client_info->pointer_cache_entries; + return 0; +} + +/*****************************************************************************/ /* returns cache id */ int APP_CC xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap) @@ -110,7 +155,6 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap) { self->bitmap_items[i][j].stamp = self->bitmap_stamp; DEBUG(("found bitmap at %d %d\n\r", i, j)); - //g_printf("found bitmap at %d %d\n\r", i, j); xrdp_bitmap_delete(bitmap); return MAKELONG(i, j); } @@ -129,7 +173,6 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap) { self->bitmap_items[i][j].stamp = self->bitmap_stamp; DEBUG(("found bitmap at %d %d\n\r", i, j)); - //g_printf("found bitmap at %d %d\n\r", i, j); xrdp_bitmap_delete(bitmap); return MAKELONG(i, j); } @@ -148,7 +191,6 @@ xrdp_cache_add_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap) { self->bitmap_items[i][j].stamp = self->bitmap_stamp; DEBUG(("found bitmap at %d %d\n\r", i, j)); - //g_printf("found bitmap at %d %d\n\r", i, j); xrdp_bitmap_delete(bitmap); return MAKELONG(i, j); } |