/soc/2012/michael/android: ec209a1707ae: added purple_buddy_icon...
Michael Zangl
michael at soc.pidgin.im
Thu Aug 16 21:54:06 EDT 2012
Changeset: ec209a1707aea967d3ba86dfe2895c39e53e17b3
Author: Michael Zangl <michael at soc.pidgin.im>
Date: 2012-08-17 03:53 +0200
Branch: soc.2012.android
URL: http://hg.pidgin.im/soc/2012/michael/android/rev/ec209a1707ae
Description:
added purple_buddy_icon_get_image to get direct access to the stored image for a buddy.
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
@@ -522,6 +522,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
@@ -145,6 +145,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