windows-kfw-sdk-20060921
[openafs.git] / src / WINNT / kfw / inc / netidmgr / khrescache.h
1 /*
2  * Copyright (c) 2005 Massachusetts Institute of Technology
3  *
4  * Permission is hereby granted, free of charge, to any person
5  * obtaining a copy of this software and associated documentation
6  * files (the "Software"), to deal in the Software without
7  * restriction, including without limitation the rights to use, copy,
8  * modify, merge, publish, distribute, sublicense, and/or sell copies
9  * of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24
25 /* $Id$ */
26
27 #ifndef __KHIMAIRA_RESCACHE_H
28 #define __KHIMAIRA_RESCACHE_H
29
30 #include<khdefs.h>
31
32 KHMEXP void KHMAPI 
33 khui_init_rescache(void);
34
35 KHMEXP void KHMAPI 
36 khui_exit_rescache(void);
37
38 KHMEXP void KHMAPI 
39 khui_cache_bitmap(UINT id, HBITMAP hbm);
40
41 KHMEXP HBITMAP KHMAPI 
42 khui_get_cached_bitmap(UINT id);
43
44 typedef struct khui_ilist_t {
45     int cx;
46     int cy;
47     int n;
48     int ng;
49     int nused;
50     HBITMAP img;
51     HBITMAP mask;
52     int *idlist;
53 } khui_ilist;
54
55 typedef struct khui_bitmap_t {
56     HBITMAP hbmp;
57     int cx;
58     int cy;
59 } khui_bitmap;
60
61 KHMEXP void KHMAPI  
62 khui_bitmap_from_hbmp(khui_bitmap * kbm, HBITMAP hbm);
63
64 KHMEXP void KHMAPI
65 khui_delete_bitmap(khui_bitmap * kbm);
66
67 KHMEXP void KHMAPI
68 khui_draw_bitmap(HDC hdc, int x, int y, khui_bitmap * kbm);
69
70 /* image lists */
71 KHMEXP khui_ilist * KHMAPI  
72 khui_create_ilist(int cx, int cy, int n, int ng, int opt);
73
74 KHMEXP BOOL KHMAPI          
75 khui_delete_ilist(khui_ilist * il);
76
77 KHMEXP int KHMAPI           
78 khui_ilist_add_masked(khui_ilist * il, HBITMAP hbm, COLORREF cbkg);
79
80 KHMEXP int KHMAPI           
81 khui_ilist_add_masked_id(khui_ilist *il, HBITMAP hbm, 
82                          COLORREF cbkg, int id);
83
84 KHMEXP int KHMAPI           
85 khui_ilist_lookup_id(khui_ilist *il, int id);
86
87 KHMEXP void KHMAPI          
88 khui_ilist_draw(khui_ilist * il, int idx, HDC dc, int x, int y, int opt);
89
90 KHMEXP void KHMAPI          
91 khui_ilist_draw_bg(khui_ilist * il, int idx, HDC dc, int x, int y, 
92                    int opt, COLORREF bgcolor);
93
94 #define khui_ilist_draw_id(il, id, dc, x, y, opt) \
95     khui_ilist_draw((il),khui_ilist_lookup_id((il),(id)),(dc),(x),(y),(opt))
96
97 #define KHUI_SMICON_CX 16
98 #define KHUI_SMICON_CY 16
99
100 #endif