/soc/2012/michael/libpurple: 5470fffa699f: Added purple_buddy_ic...
Michael Zangl
michael at soc.pidgin.im
Thu May 9 05:53:20 EDT 2013
Changeset: 5470fffa699fc79ef34cd4b0f34dc68f1c3ad78d
Author: Michael Zangl <michael at soc.pidgin.im>
Date: 2013-05-09 10:30 +0200
Branch: default
URL: https://hg.pidgin.im/soc/2012/michael/libpurple/rev/5470fffa699f
Description:
Added purple_buddy_icon_get_image to directly access the image data for a given buddy icon.
diffstat:
libpurple/buddyicon.c | 6 ++++++
libpurple/buddyicon.h | 11 +++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diffs (37 lines):
diff --git a/libpurple/buddyicon.c b/libpurple/buddyicon.c
--- a/libpurple/buddyicon.c
+++ b/libpurple/buddyicon.c
@@ -508,6 +508,12 @@ purple_buddy_icon_get_data(const PurpleB
return NULL;
}
+PurpleStoredImage *
+purple_buddy_icon_get_image(const PurpleBuddyIcon *icon) {
+ return purple_imgstore_ref(icon->img);
+}
+
+
const char *
purple_buddy_icon_get_extension(const PurpleBuddyIcon *icon)
{
diff --git a/libpurple/buddyicon.h b/libpurple/buddyicon.h
--- a/libpurple/buddyicon.h
+++ b/libpurple/buddyicon.h
@@ -143,6 +143,17 @@ const char *purple_buddy_icon_get_checks
gconstpointer purple_buddy_icon_get_data(const PurpleBuddyIcon *icon, size_t *len);
/**
+ * Returns the buddy icon's stored image and increases the reference count
+ * of that stored image by one, so you should use purple_imgstore_unref after
+ * using the image.
+ *
+ * @param icon The buddy icon.
+ *
+ * @return A pointer to the icon data.
+ */
+PurpleStoredImage *purple_buddy_icon_get_image(const PurpleBuddyIcon *icon);
+
+/**
* Returns an extension corresponding to the buddy icon's file type.
*
* @param icon The buddy icon.
More information about the Commits
mailing list