[evince] libdocument: add ev_mapping_list_remove



commit 5aac9acbe697ace5f238a381cf139dd2e73293f5
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Fri May 2 23:08:53 2014 -0700

    libdocument: add ev_mapping_list_remove
    
    Needed to remove annotations from a mapping list
    
    https://bugzilla.gnome.org/show_bug.cgi?id=649044

 libdocument/ev-mapping-list.c |   19 +++++++++++++++++++
 libdocument/ev-mapping-list.h |    2 ++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/libdocument/ev-mapping-list.c b/libdocument/ev-mapping-list.c
index cf7a59a..67c99ca 100644
--- a/libdocument/ev-mapping-list.c
+++ b/libdocument/ev-mapping-list.c
@@ -166,6 +166,25 @@ ev_mapping_list_get_list (EvMappingList *mapping_list)
        return mapping_list ? mapping_list->list : NULL;
 }
 
+/**
+ * ev_mapping_list_remove:
+ * @mapping_list: an #EvMappingList
+ * @mapping: #EvMapping to remove
+ *
+ * Returns: an #EvMappingList
+ *
+ * Since: 3.14
+ */
+EvMappingList *
+ev_mapping_list_remove (EvMappingList *mapping_list,
+                       EvMapping     *mapping)
+{
+       mapping_list->list = g_list_remove (mapping_list->list, mapping);
+        mapping_list->data_destroy_func (mapping->data);
+        g_free (mapping);
+       return mapping_list;
+}
+
 guint
 ev_mapping_list_get_page (EvMappingList *mapping_list)
 {
diff --git a/libdocument/ev-mapping-list.h b/libdocument/ev-mapping-list.h
index 4bc3db2..bdb6280 100644
--- a/libdocument/ev-mapping-list.h
+++ b/libdocument/ev-mapping-list.h
@@ -42,6 +42,8 @@ void           ev_mapping_list_unref       (EvMappingList *mapping_list);
 
 guint          ev_mapping_list_get_page    (EvMappingList *mapping_list);
 GList         *ev_mapping_list_get_list    (EvMappingList *mapping_list);
+EvMappingList *ev_mapping_list_remove      (EvMappingList *mapping_list,
+                                           EvMapping     *mapping);
 EvMapping     *ev_mapping_list_find        (EvMappingList *mapping_list,
                                            gconstpointer  data);
 EvMapping     *ev_mapping_list_find_custom (EvMappingList *mapping_list,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]