Mercurial > pidgin.yaz
diff pidgin/gtkutils.c @ 30868:d487a2adc3a6
merge of '86d9ff7ca5af691007b1e85ef39959fa13e7d996'
and 'd0cbcbb1a25505fd8801dd556c1ec42e98414c9a'
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Mon, 23 Aug 2010 05:22:11 +0000 (2010-08-23) |
parents | 351d07aefb09 |
children | c5ba7dd399fa 695b6e57e255 |
line wrap: on
line diff
--- a/pidgin/gtkutils.c Mon Aug 23 01:18:12 2010 +0000 +++ b/pidgin/gtkutils.c Mon Aug 23 05:22:11 2010 +0000 @@ -680,7 +680,6 @@ create_protocols_menu(const char *default_proto_id) { AopMenu *aop_menu = NULL; - PurplePluginProtocolInfo *prpl_info; PurplePlugin *plugin; GdkPixbuf *pixbuf = NULL; GtkSizeGroup *sg; @@ -702,7 +701,6 @@ p = p->next, i++) { plugin = (PurplePlugin *)p->data; - prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin); if (gtalk_name && strcmp(gtalk_name, plugin->info->name) < 0) { char *filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", @@ -784,8 +782,6 @@ sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); for (p = list, i = 0; p != NULL; p = p->next, i++) { - PurplePlugin *plugin; - if (show_all) account = (PurpleAccount *)p->data; else { @@ -799,8 +795,6 @@ continue; } - plugin = purple_find_prpl(purple_account_get_protocol_id(account)); - pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); if (pixbuf) { @@ -2790,79 +2784,78 @@ gboolean pidgin_gdk_pixbuf_is_opaque(GdkPixbuf *pixbuf) { - int width, height, rowstride, i; - unsigned char *pixels; - unsigned char *row; - - if (!gdk_pixbuf_get_has_alpha(pixbuf)) - return TRUE; - - width = gdk_pixbuf_get_width (pixbuf); - height = gdk_pixbuf_get_height (pixbuf); - rowstride = gdk_pixbuf_get_rowstride (pixbuf); - pixels = gdk_pixbuf_get_pixels (pixbuf); - - row = pixels; - for (i = 3; i < rowstride; i+=4) { - if (row[i] < 0xfe) - return FALSE; - } - - for (i = 1; i < height - 1; i++) { - row = pixels + (i*rowstride); - if (row[3] < 0xfe || row[rowstride-1] < 0xfe) { - return FALSE; - } - } - - row = pixels + ((height-1) * rowstride); - for (i = 3; i < rowstride; i+=4) { - if (row[i] < 0xfe) - return FALSE; - } - - return TRUE; + int height, rowstride, i; + unsigned char *pixels; + unsigned char *row; + + if (!gdk_pixbuf_get_has_alpha(pixbuf)) + return TRUE; + + height = gdk_pixbuf_get_height (pixbuf); + rowstride = gdk_pixbuf_get_rowstride (pixbuf); + pixels = gdk_pixbuf_get_pixels (pixbuf); + + row = pixels; + for (i = 3; i < rowstride; i+=4) { + if (row[i] < 0xfe) + return FALSE; + } + + for (i = 1; i < height - 1; i++) { + row = pixels + (i * rowstride); + if (row[3] < 0xfe || row[rowstride - 1] < 0xfe) { + return FALSE; + } + } + + row = pixels + ((height - 1) * rowstride); + for (i = 3; i < rowstride; i += 4) { + if (row[i] < 0xfe) + return FALSE; + } + + return TRUE; } void pidgin_gdk_pixbuf_make_round(GdkPixbuf *pixbuf) { int width, height, rowstride; - guchar *pixels; - if (!gdk_pixbuf_get_has_alpha(pixbuf)) - return; - width = gdk_pixbuf_get_width(pixbuf); - height = gdk_pixbuf_get_height(pixbuf); - rowstride = gdk_pixbuf_get_rowstride(pixbuf); - pixels = gdk_pixbuf_get_pixels(pixbuf); - - if (width < 6 || height < 6) - return; - /* Top left */ - pixels[3] = 0; - pixels[7] = 0x80; - pixels[11] = 0xC0; - pixels[rowstride + 3] = 0x80; - pixels[rowstride * 2 + 3] = 0xC0; - - /* Top right */ - pixels[width * 4 - 1] = 0; - pixels[width * 4 - 5] = 0x80; - pixels[width * 4 - 9] = 0xC0; - pixels[rowstride + (width * 4) - 1] = 0x80; - pixels[(2 * rowstride) + (width * 4) - 1] = 0xC0; - - /* Bottom left */ - pixels[(height - 1) * rowstride + 3] = 0; - pixels[(height - 1) * rowstride + 7] = 0x80; - pixels[(height - 1) * rowstride + 11] = 0xC0; - pixels[(height - 2) * rowstride + 3] = 0x80; - pixels[(height - 3) * rowstride + 3] = 0xC0; - - /* Bottom right */ - pixels[height * rowstride - 1] = 0; - pixels[(height - 1) * rowstride - 1] = 0x80; - pixels[(height - 2) * rowstride - 1] = 0xC0; - pixels[height * rowstride - 5] = 0x80; - pixels[height * rowstride - 9] = 0xC0; + guchar *pixels; + if (!gdk_pixbuf_get_has_alpha(pixbuf)) + return; + width = gdk_pixbuf_get_width(pixbuf); + height = gdk_pixbuf_get_height(pixbuf); + rowstride = gdk_pixbuf_get_rowstride(pixbuf); + pixels = gdk_pixbuf_get_pixels(pixbuf); + + if (width < 6 || height < 6) + return; + /* Top left */ + pixels[3] = 0; + pixels[7] = 0x80; + pixels[11] = 0xC0; + pixels[rowstride + 3] = 0x80; + pixels[rowstride * 2 + 3] = 0xC0; + + /* Top right */ + pixels[width * 4 - 1] = 0; + pixels[width * 4 - 5] = 0x80; + pixels[width * 4 - 9] = 0xC0; + pixels[rowstride + (width * 4) - 1] = 0x80; + pixels[(2 * rowstride) + (width * 4) - 1] = 0xC0; + + /* Bottom left */ + pixels[(height - 1) * rowstride + 3] = 0; + pixels[(height - 1) * rowstride + 7] = 0x80; + pixels[(height - 1) * rowstride + 11] = 0xC0; + pixels[(height - 2) * rowstride + 3] = 0x80; + pixels[(height - 3) * rowstride + 3] = 0xC0; + + /* Bottom right */ + pixels[height * rowstride - 1] = 0; + pixels[(height - 1) * rowstride - 1] = 0x80; + pixels[(height - 2) * rowstride - 1] = 0xC0; + pixels[height * rowstride - 5] = 0x80; + pixels[height * rowstride - 9] = 0xC0; } const char *pidgin_get_dim_grey_string(GtkWidget *widget) {