Initial commit - from Precise source
[freerdp-ubuntu-pcb-backport.git] / include / freerdp / cache / bitmap.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * Bitmap Cache V2
4  *
5  * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #ifndef __BITMAP_V2_CACHE_H
21 #define __BITMAP_V2_CACHE_H
22
23 #include <freerdp/api.h>
24 #include <freerdp/types.h>
25 #include <freerdp/update.h>
26 #include <freerdp/freerdp.h>
27 #include <freerdp/utils/stream.h>
28
29 typedef struct _BITMAP_V2_CELL BITMAP_V2_CELL;
30 typedef struct rdp_bitmap_cache rdpBitmapCache;
31
32 #include <freerdp/cache/cache.h>
33
34 struct _BITMAP_V2_CELL
35 {
36         uint32 number;
37         rdpBitmap** entries;
38 };
39
40 struct rdp_bitmap_cache
41 {
42         pMemBlt MemBlt; /* 0 */
43         pMem3Blt Mem3Blt; /* 1 */
44         pCacheBitmap CacheBitmap; /* 2 */
45         pCacheBitmapV2 CacheBitmapV2; /* 3 */
46         pCacheBitmapV3 CacheBitmapV3; /* 4 */
47         pBitmapUpdate BitmapUpdate; /* 5 */
48         uint32 paddingA[16 - 6]; /* 6 */
49
50         uint32 maxCells; /* 16 */
51         BITMAP_V2_CELL* cells; /* 17 */
52         uint32 paddingB[32 - 18]; /* 18 */
53
54         /* internal */
55
56         rdpBitmap* bitmap;
57         rdpUpdate* update;
58         rdpContext* context;
59         rdpSettings* settings;
60 };
61
62 FREERDP_API rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, uint32 id, uint32 index);
63 FREERDP_API void bitmap_cache_put(rdpBitmapCache* bitmap_cache, uint32 id, uint32 index, rdpBitmap* bitmap);
64
65 FREERDP_API void bitmap_cache_register_callbacks(rdpUpdate* update);
66
67 FREERDP_API rdpBitmapCache* bitmap_cache_new(rdpSettings* settings);
68 FREERDP_API void bitmap_cache_free(rdpBitmapCache* bitmap_cache);
69
70 #endif /* __BITMAP_V2_CACHE_H */