2 * Simple Image cache for images
3 * Copyright (C) 1998 the Free Software Foundation
5 * Author: Miguel de Icaza (miguel@kernel.org)
10 static GHashTable
*image_cache
;
13 destroy_image_callback (gpointer key
, gpointer data
, gpointer user_data
)
15 gdk_imlib_destroy_image (data
);
20 image_cache_destroy ()
22 g_hash_table_foreach (image_cache
, destroy_image_callback
, NULL
);
23 g_hash_table_destroy (image_cache
);
27 image_cache_load_image (char *file
)
32 image_cache
= g_hash_table_new (g_str_hash
, g_str_equal
);
34 data
= g_hash_table_lookup (image_cache
, file
);
38 data
= gdk_imlib_load_image (file
);
40 g_hash_table_insert (image_cache
, g_strdup (file
), data
);