pidgin/gtkutils.c

changeset 30706
612b36b49058
parent 30705
7ff782ca5089
child 31217
d9b13102a21c
child 32391
5f9f23a48f82
equal deleted inserted replaced
30705:7ff782ca5089 30706:612b36b49058
678 678
679 static AopMenu * 679 static AopMenu *
680 create_protocols_menu(const char *default_proto_id) 680 create_protocols_menu(const char *default_proto_id)
681 { 681 {
682 AopMenu *aop_menu = NULL; 682 AopMenu *aop_menu = NULL;
683 PurplePluginProtocolInfo *prpl_info;
684 PurplePlugin *plugin; 683 PurplePlugin *plugin;
685 GdkPixbuf *pixbuf = NULL; 684 GdkPixbuf *pixbuf = NULL;
686 GtkSizeGroup *sg; 685 GtkSizeGroup *sg;
687 GList *p; 686 GList *p;
688 const char *gtalk_name = NULL; 687 const char *gtalk_name = NULL;
700 for (p = purple_plugins_get_protocols(), i = 0; 699 for (p = purple_plugins_get_protocols(), i = 0;
701 p != NULL; 700 p != NULL;
702 p = p->next, i++) { 701 p = p->next, i++) {
703 702
704 plugin = (PurplePlugin *)p->data; 703 plugin = (PurplePlugin *)p->data;
705 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin);
706 704
707 if (gtalk_name && strcmp(gtalk_name, plugin->info->name) < 0) { 705 if (gtalk_name && strcmp(gtalk_name, plugin->info->name) < 0) {
708 char *filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", 706 char *filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols",
709 "16", "google-talk.png", NULL); 707 "16", "google-talk.png", NULL);
710 GtkWidget *item; 708 GtkWidget *item;
782 aop_menu->menu = gtk_menu_new(); 780 aop_menu->menu = gtk_menu_new();
783 gtk_widget_show(aop_menu->menu); 781 gtk_widget_show(aop_menu->menu);
784 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); 782 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
785 783
786 for (p = list, i = 0; p != NULL; p = p->next, i++) { 784 for (p = list, i = 0; p != NULL; p = p->next, i++) {
787 PurplePlugin *plugin;
788
789 if (show_all) 785 if (show_all)
790 account = (PurpleAccount *)p->data; 786 account = (PurpleAccount *)p->data;
791 else { 787 else {
792 PurpleConnection *gc = (PurpleConnection *)p->data; 788 PurpleConnection *gc = (PurpleConnection *)p->data;
793 789
796 792
797 if (filter_func && !filter_func(account)) { 793 if (filter_func && !filter_func(account)) {
798 i--; 794 i--;
799 continue; 795 continue;
800 } 796 }
801
802 plugin = purple_find_prpl(purple_account_get_protocol_id(account));
803 797
804 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL); 798 pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_SMALL);
805 799
806 if (pixbuf) { 800 if (pixbuf) {
807 if (purple_account_is_disconnected(account) && show_all && 801 if (purple_account_is_disconnected(account) && show_all &&
2788 return result; 2782 return result;
2789 } 2783 }
2790 2784
2791 2785
2792 gboolean pidgin_gdk_pixbuf_is_opaque(GdkPixbuf *pixbuf) { 2786 gboolean pidgin_gdk_pixbuf_is_opaque(GdkPixbuf *pixbuf) {
2793 int width, height, rowstride, i; 2787 int height, rowstride, i;
2794 unsigned char *pixels; 2788 unsigned char *pixels;
2795 unsigned char *row; 2789 unsigned char *row;
2796 2790
2797 if (!gdk_pixbuf_get_has_alpha(pixbuf)) 2791 if (!gdk_pixbuf_get_has_alpha(pixbuf))
2798 return TRUE; 2792 return TRUE;
2799 2793
2800 width = gdk_pixbuf_get_width (pixbuf);
2801 height = gdk_pixbuf_get_height (pixbuf); 2794 height = gdk_pixbuf_get_height (pixbuf);
2802 rowstride = gdk_pixbuf_get_rowstride (pixbuf); 2795 rowstride = gdk_pixbuf_get_rowstride (pixbuf);
2803 pixels = gdk_pixbuf_get_pixels (pixbuf); 2796 pixels = gdk_pixbuf_get_pixels (pixbuf);
2804 2797
2805 row = pixels; 2798 row = pixels;

mercurial