summaryrefslogtreecommitdiff
path: root/libdocument/ev-mapping-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdocument/ev-mapping-list.c')
-rw-r--r--libdocument/ev-mapping-list.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/libdocument/ev-mapping-list.c b/libdocument/ev-mapping-list.c
index 672d5297..8c639e8e 100644
--- a/libdocument/ev-mapping-list.c
+++ b/libdocument/ev-mapping-list.c
@@ -94,17 +94,17 @@ ev_mapping_list_nth (EvMappingList *mapping_list,
}
/**
- * ev_mapping_list_get_data:
+ * ev_mapping_list_get:
* @mapping_list: an #EvMappingList
* @x: X coordinate
* @y: Y coordinate
*
- * Returns: (transfer none): the data of a mapping in the list at coordinates (x, y)
+ * Returns: (transfer none): the #EvMapping in the list at coordinates (x, y)
*/
-gpointer
-ev_mapping_list_get_data (EvMappingList *mapping_list,
- gdouble x,
- gdouble y)
+EvMapping *
+ev_mapping_list_get (EvMappingList *mapping_list,
+ gdouble x,
+ gdouble y)
{
GList *list;
@@ -115,7 +115,7 @@ ev_mapping_list_get_data (EvMappingList *mapping_list,
(y >= mapping->area.y1) &&
(x <= mapping->area.x2) &&
(y <= mapping->area.y2)) {
- return mapping->data;
+ return mapping;
}
}
@@ -123,6 +123,28 @@ ev_mapping_list_get_data (EvMappingList *mapping_list,
}
/**
+ * ev_mapping_list_get_data:
+ * @mapping_list: an #EvMappingList
+ * @x: X coordinate
+ * @y: Y coordinate
+ *
+ * Returns: (transfer none): the data of a mapping in the list at coordinates (x, y)
+ */
+gpointer
+ev_mapping_list_get_data (EvMappingList *mapping_list,
+ gdouble x,
+ gdouble y)
+{
+ EvMapping *mapping;
+
+ mapping = ev_mapping_list_get (mapping_list, x, y);
+ if (mapping)
+ return mapping->data;
+
+ return NULL;
+}
+
+/**
* ev_mapping_list_get_list:
* @mapping_list: an #EvMappingList
*