+static void cache_add(gchar *key, GdkPixbuf *pixbuf)
+{
+ /* TODO: Check if already exists */
+ g_hash_table_insert ( cache, key, pixbuf );
+ queue_size += gdk_pixbuf_get_rowstride(pixbuf) * gdk_pixbuf_get_height(pixbuf);
+ queue_size += 100;
+ queue_count++;
+}
+
+static void cache_remove(const gchar *key)
+{
+ GdkPixbuf *buf = g_hash_table_lookup ( cache, key );
+ if (buf) {
+ queue_size -= gdk_pixbuf_get_rowstride(buf) * gdk_pixbuf_get_height(buf);
+ queue_size -= 100;
+ queue_count --;
+ g_hash_table_remove ( cache, key );
+ }
+}
+