diff options
author | Cosimo Cecchi <[email protected]> | 2013-01-07 08:23:37 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-08-24 11:58:27 +0200 |
commit | 1c0f5a75fcccb9cd2b1a5e1655e3d7d0e39144d5 (patch) | |
tree | 05b7e5533f70d3c539ac03bbc96d5ad1aed30df2 | |
parent | d06cb3dabbd7fbb87cb2763e69bce9ac782450eb (diff) | |
download | atril-1c0f5a75fcccb9cd2b1a5e1655e3d7d0e39144d5.tar.bz2 atril-1c0f5a75fcccb9cd2b1a5e1655e3d7d0e39144d5.tar.xz |
ev-mapping-list: make a boxed type
And fix a number of introspection warnings.
https://bugzilla.gnome.org/show_bug.cgi?id=691354
origin commit:
https://git.gnome.org/browse/evince/commit/?h=gnome-3-8&id=d6f7e03dd53639e2a3470f128d3b327636cf3dea
-rw-r--r-- | libdocument/ev-mapping-list.c | 46 | ||||
-rw-r--r-- | 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 7bae11da..672d5297 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 2a713b16..ad509674 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); |