2 * Copyright (c) 2005 Massachusetts Institute of Technology
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:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
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
27 #ifndef __KHIMAIRA_RESCACHE_H
28 #define __KHIMAIRA_RESCACHE_H
33 khui_init_rescache(void);
36 khui_exit_rescache(void);
39 khui_cache_bitmap(UINT id, HBITMAP hbm);
42 khui_get_cached_bitmap(UINT id);
44 typedef struct khui_ilist_t {
55 typedef struct khui_bitmap_t {
62 khui_bitmap_from_hbmp(khui_bitmap * kbm, HBITMAP hbm);
65 khui_delete_bitmap(khui_bitmap * kbm);
68 khui_draw_bitmap(HDC hdc, int x, int y, khui_bitmap * kbm);
71 KHMEXP khui_ilist * KHMAPI
72 khui_create_ilist(int cx, int cy, int n, int ng, int opt);
75 khui_delete_ilist(khui_ilist * il);
78 khui_ilist_add_masked(khui_ilist * il, HBITMAP hbm, COLORREF cbkg);
81 khui_ilist_add_masked_id(khui_ilist *il, HBITMAP hbm,
82 COLORREF cbkg, int id);
85 khui_ilist_lookup_id(khui_ilist *il, int id);
88 khui_ilist_draw(khui_ilist * il, int idx, HDC dc, int x, int y, int opt);
91 khui_ilist_draw_bg(khui_ilist * il, int idx, HDC dc, int x, int y,
92 int opt, COLORREF bgcolor);
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))
97 #define KHUI_SMICON_CX 16
98 #define KHUI_SMICON_CY 16