[evince] ev-mapping-list: make a boxed type
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] ev-mapping-list: make a boxed type
- Date: Mon, 28 Jan 2013 22:30:50 +0000 (UTC)
commit d6f7e03dd53639e2a3470f128d3b327636cf3dea
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Jan 7 08:23:37 2013 +0100
ev-mapping-list: make a boxed type
And fix a number of introspection warnings.
https://bugzilla.gnome.org/show_bug.cgi?id=691354
libdocument/ev-mapping-list.c | 46 +++++++++++++++++++++++++++++++++++++++++
libdocument/ev-mapping-list.h | 3 ++
2 files changed, 49 insertions(+), 0 deletions(-)
---
diff --git a/libdocument/ev-mapping-list.c b/libdocument/ev-mapping-list.c
index e8e1cae..e0a09a0 100644
--- a/libdocument/ev-mapping-list.c
+++ b/libdocument/ev-mapping-list.c
@@ -27,6 +27,15 @@ struct _EvMappingList {
volatile gint ref_count;
};
+G_DEFINE_BOXED_TYPE (EvMappingList, ev_mapping_list, ev_mapping_list_ref, ev_mapping_list_unref)
+
+/**
+ * ev_mapping_list_find:
+ * @mapping_list: an #EvMappingList
+ * @data: mapping data to find
+ *
+ * Returns: (transfer none): an #EvMapping
+ */
EvMapping *
ev_mapping_list_find (EvMappingList *mapping_list,
gconstpointer data)
@@ -43,6 +52,14 @@ ev_mapping_list_find (EvMappingList *mapping_list,
return NULL;
}
+/**
+ * ev_mapping_list_find_custom:
+ * @mapping_list: an #EvMappingList
+ * @data: mapping data to find
+ * @func: (scope call): function to use for equality check
+ *
+ * Returns: (transfer none): an #EvMapping
+ */
EvMapping *
ev_mapping_list_find_custom (EvMappingList *mapping_list,
gconstpointer data,
@@ -60,6 +77,13 @@ ev_mapping_list_find_custom (EvMappingList *mapping_list,
return NULL;
}
+/**
+ * ev_mapping_list_nth:
+ * @mapping_list: an #EvMappingList
+ * @n: the position to retrieve
+ *
+ * Returns: (transfer none): the #Evmapping at position @n in @mapping_list
+ */
EvMapping *
ev_mapping_list_nth (EvMappingList *mapping_list,
guint n)
@@ -69,6 +93,14 @@ ev_mapping_list_nth (EvMappingList *mapping_list,
return (EvMapping *)g_list_nth_data (mapping_list->list, n);
}
+/**
+ * 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,
@@ -90,6 +122,12 @@ ev_mapping_list_get_data (EvMappingList *mapping_list,
return NULL;
}
+/**
+ * ev_mapping_list_get_list:
+ * @mapping_list: an #EvMappingList
+ *
+ * Returns: (transfer none) (element-type EvMapping): the data for this mapping list
+ */
GList *
ev_mapping_list_get_list (EvMappingList *mapping_list)
{
@@ -110,6 +148,14 @@ ev_mapping_list_length (EvMappingList *mapping_list)
return g_list_length (mapping_list->list);
}
+/**
+ * ev_mapping_list_new:
+ * @page: page index for this mapping
+ * @list: (element-type EvMapping): a #GList of data for the page
+ * @data_destroy_func: function to free a list element
+ *
+ * Returns: an #EvMappingList
+ */
EvMappingList *
ev_mapping_list_new (guint page,
GList *list,
diff --git a/libdocument/ev-mapping-list.h b/libdocument/ev-mapping-list.h
index 46d848a..ada6296 100644
--- a/libdocument/ev-mapping-list.h
+++ b/libdocument/ev-mapping-list.h
@@ -31,6 +31,9 @@ G_BEGIN_DECLS
typedef struct _EvMappingList EvMappingList;
+#define EV_TYPE_MAPPING_LIST (ev_mapping_list_get_type())
+GType ev_mapping_list_get_type (void) G_GNUC_CONST;
+
EvMappingList *ev_mapping_list_new (guint page,
GList *list,
GDestroyNotify data_destroy_func);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]