Mercurial > pidgin
diff src/gtkutils.h @ 13090:0aa231ebbfd5
[gaim-migrate @ 15452]
Changes to some pixbuf stuff.
I added a 'gaim_gtk_create_gaim_icon_with_status()' function to util.c,
and changed 'gaim_gtk_create_prpl_icon_with_status()' to accept a scale
factor because almost everywhere this function was used we would scale
the pixbuf to a smaller size as soon as we got it. So there's a bit less
code duplication.
Also, I think I added some g_object_unref()'s in one or two places where
it was missing.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 01 Feb 2006 22:38:34 +0000 |
parents | 248b8b39c671 |
children | 079f7a452e3a |
line wrap: on
line diff
--- a/src/gtkutils.h Wed Feb 01 06:07:53 2006 +0000 +++ b/src/gtkutils.h Wed Feb 01 22:38:34 2006 +0000 @@ -355,21 +355,63 @@ * Returns the base image to represent the account, based on * the currently selected theme. * - * @param account The account. + * @param account The account. + * @param scale_factor The amount to scale to the original image. + * The default size is 30x30 pixels. A scale + * factor of 1 means no scaling will be done. + * A scale factor of 0.5 means the length + * and width will be 15 pixels each. * - * @return The icon. + * @return A newly-created pixbuf with a reference count of 1, + * or NULL if any of several error conditions occurred: + * the file could not be opened, there was no loader + * for the file's format, there was not enough memory + * to allocate the image buffer, or the image file + * contained invalid data. */ -GdkPixbuf *gaim_gtk_create_prpl_icon(GaimAccount *account); +GdkPixbuf *gaim_gtk_create_prpl_icon(GaimAccount *account, double scale_factor); /** - * Create a protocol-icon with the status emblem. + * Create a protocol icon with the status emblem overlayed in + * the lower right corner. + * + * @param account The account. + * @param status_type The status type of the emblem to overlay. + * @param scale_factor The amount to scale to the original image. + * The default size is 30x30 pixels. A scale + * factor of 1 means no scaling will be done. + * A scale factor of 0.5 means the length + * and width will be 15 pixels each. * - * @param account The account. - * @param status_type The status type to set the emblem for. + * @return A newly-created pixbuf with a reference count of 1, + * or NULL if any of several error conditions occurred: + * the file could not be opened, there was no loader + * for the file's format, there was not enough memory + * to allocate the image buffer, or the image file + * contained invalid data. + */ +GdkPixbuf *gaim_gtk_create_prpl_icon_with_status(GaimAccount *account, GaimStatusType *status_type, double scale_factor); + +/** + * Create a Gaim running-man icon with the status emblem overlayed + * in the lower right corner. * - * @return The icon. + * @param status_type The status type to set the emblem for. + * @param scale_factor The amount to scale to the original image. + * The default size is 30x30 pixels. A scale + * factor of 1 means no scaling will be done. + * A scale factor of 0.5 means the length + * and width will be 15 pixels each. + * + * @return A newly-created pixbuf with a reference count of 1, + * or NULL if any of several error conditions occurred: + * the file could not be opened, there was no loader for + * the file's format, there was not enough memory to + * allocate the image buffer, or the image file contained + * invalid data. */ -GdkPixbuf * gaim_gtk_create_prpl_icon_with_status(GaimAccount *account, GaimStatusType *status_type); +GdkPixbuf *gaim_gtk_create_gaim_icon_with_status(GaimStatusPrimitive primitve, double scale_factor); + /** * Append a GaimMenuAction to a menu.