- GdkBitmap *mask = g_new(GdkBitmap, 1);
- GdkPixmap *icon_pixmap = g_new(GdkPixmap, 1);
- GdkGC *gc = gdk_gc_new(Draw_Context->drawable);
- gdk_gc_copy(gc, Draw_Context->gc);
-
- icon_pixmap = gdk_pixmap_create_from_xpm(Draw_Context->drawable, &mask, NULL,
- Properties->icon_name);
-
- gdk_gc_set_clip_mask(gc, mask);
-
+ LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
+ LttvAttributeValue value;
+ gchar icon_name[MAX_PATH_LEN] = "icons/";
+ IconStruct *icon_info;
+
+ strcat(icon_name, Properties->icon_name);
+
+ g_assert(lttv_iattribute_find_by_path(attributes, icon_name,
+ LTTV_POINTER, &value));
+ if(*(value.v_pointer) == NULL)
+ {
+ *(value.v_pointer) = icon_info = g_new(IconStruct,1);
+
+ icon_info->pixmap = gdk_pixmap_create_from_xpm(Draw_Context->drawable,
+ &icon_info->mask, NULL, Properties->icon_name);
+ }
+ else
+ {
+ icon_info = *(value.v_pointer);
+ }
+
+ gdk_gc_set_clip_mask(Draw_Context->gc, icon_info->mask);
+