+struct Item *click_is_in_text_or_image(struct Layer *layer, double x, double y)
+{
+ GList *itemlist;
+ struct Item *item, *val;
+
+ val = NULL;
+ for (itemlist = layer->items; itemlist!=NULL; itemlist = itemlist->next) {
+ item = (struct Item *)itemlist->data;
+ if (item->type != ITEM_TEXT && item->type != ITEM_IMAGE) continue;
+ if (x<item->bbox.left || x>item->bbox.right) continue;
+ if (y<item->bbox.top || y>item->bbox.bottom) continue;
+ val = item;
+ }
+ return val;
+}
+