~ubuntu-branches/ubuntu/raring/freerdp/raring

« back to all changes in this revision

Viewing changes to libfreerdp/cache.h

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2010-06-23 21:39:09 UTC
  • Revision ID: james.westby@ubuntu.com-20100623213909-bb9pvvv03913tdv6
Tags: upstream-0.7.1
ImportĀ upstreamĀ versionĀ 0.7.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- c-basic-offset: 8 -*-
 
2
   freerdp: A Remote Desktop Protocol client.
 
3
   Cache routines
 
4
   Copyright (C) Jay Sorg 2009
 
5
 
 
6
   This program is free software; you can redistribute it and/or modify
 
7
   it under the terms of the GNU General Public License as published by
 
8
   the Free Software Foundation; either version 2 of the License, or
 
9
   (at your option) any later version.
 
10
 
 
11
   This program is distributed in the hope that it will be useful,
 
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
   GNU General Public License for more details.
 
15
 
 
16
   You should have received a copy of the GNU General Public License
 
17
   along with this program; if not, write to the Free Software
 
18
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
19
*/
 
20
 
 
21
#ifndef __CACHE_H
 
22
#define __CACHE_H
 
23
 
 
24
struct bmpcache_entry
 
25
{
 
26
        RD_HBITMAP bitmap;
 
27
        sint16 previous;
 
28
        sint16 next;
 
29
};
 
30
 
 
31
struct rdp_cache
 
32
{
 
33
        struct rdp_rdp * rdp;
 
34
        struct bmpcache_entry bmpcache[3][0xa00];
 
35
        RD_HBITMAP volatile_bc[3];
 
36
        RD_HBITMAP drawing_surface[100];
 
37
        int bmpcache_lru[3];
 
38
        int bmpcache_mru[3];
 
39
        int bmpcache_count[3];
 
40
        FONTGLYPH fontcache[12][256];
 
41
        DATABLOB textcache[256];
 
42
        RD_HCURSOR cursorcache[0x20];
 
43
        RD_BRUSHDATA brushcache[2][64];
 
44
};
 
45
typedef struct rdp_cache rdpCache;
 
46
 
 
47
void
 
48
cache_rebuild_bmpcache_linked_list(rdpCache * cache, uint8 id, sint16 * idx, int count);
 
49
void
 
50
cache_bump_bitmap(rdpCache * cache, uint8 id, uint16 idx, int bump);
 
51
void
 
52
cache_evict_bitmap(rdpCache * cache, uint8 id);
 
53
RD_HBITMAP
 
54
cache_get_bitmap(rdpCache * cache, uint8 id, uint16 idx);
 
55
void
 
56
cache_put_bitmap(rdpCache * cache, uint8 id, uint16 idx, RD_HBITMAP bitmap);
 
57
void
 
58
cache_save_state(rdpCache * cache);
 
59
FONTGLYPH *
 
60
cache_get_font(rdpCache * cache, uint8 font, uint16 character);
 
61
void
 
62
cache_put_font(rdpCache * cache, uint8 font, uint16 character, uint16 offset, uint16 baseline,
 
63
               uint16 width, uint16 height, RD_HGLYPH pixmap);
 
64
DATABLOB *
 
65
cache_get_text(rdpCache * cache, uint8 cache_id);
 
66
void
 
67
cache_put_text(rdpCache * cache, uint8 cache_id, void *data, int length);
 
68
RD_HCURSOR
 
69
cache_get_cursor(rdpCache * cache, uint16 cache_idx);
 
70
void
 
71
cache_put_cursor(rdpCache * cache, uint16 cache_idx, RD_HCURSOR cursor);
 
72
RD_BRUSHDATA *
 
73
cache_get_brush_data(rdpCache * cache, uint8 colour_code, uint8 idx);
 
74
void
 
75
cache_put_brush_data(rdpCache * cache, uint8 colour_code, uint8 idx, RD_BRUSHDATA * brush_data);
 
76
rdpCache *
 
77
cache_new(struct rdp_rdp * rdp);
 
78
void
 
79
cache_free(rdpCache * cache);
 
80
 
 
81
#endif