comparison src/gtkconv.c @ 10884:5cda52915a1f

[gaim-migrate @ 12582] Rename create_prpl_icon to gaim_gtk_create_prpl_icon, remove some dead code from gtkconv, and use G_MODULE_BIND_LOCAL - this breaks perl plugins, and should be added to the list of things that need fixing to save perl. Semi-fix the raw plugin too, but only if your filesystem is being friendly in where it puts stuff. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Thu, 28 Apr 2005 01:06:31 +0000
parents b0fdadf463d4
children 175167f62c28
comparison
equal deleted inserted replaced
10883:b0fdadf463d4 10884:5cda52915a1f
2319 } 2319 }
2320 } 2320 }
2321 2321
2322 if (!status) { 2322 if (!status) {
2323 GdkPixbuf *pixbuf; 2323 GdkPixbuf *pixbuf;
2324 pixbuf = create_prpl_icon(account); 2324 pixbuf = gaim_gtk_create_prpl_icon(account);
2325 2325
2326 if (small_icon && pixbuf != NULL) 2326 if (small_icon && pixbuf != NULL)
2327 { 2327 {
2328 status = gdk_pixbuf_scale_simple(pixbuf, 15, 15, 2328 status = gdk_pixbuf_scale_simple(pixbuf, 15, 15,
2329 GDK_INTERP_BILINEAR); 2329 GDK_INTERP_BILINEAR);
3078 found_online = TRUE; 3078 found_online = TRUE;
3079 3079
3080 gc = (GaimConnection *)gcs->data; 3080 gc = (GaimConnection *)gcs->data;
3081 3081
3082 /* Create a pixmap for the protocol icon. */ 3082 /* Create a pixmap for the protocol icon. */
3083 pixbuf = create_prpl_icon(gc->account); 3083 pixbuf = gaim_gtk_create_prpl_icon(gc->account);
3084 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR); 3084 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR);
3085 3085
3086 /* Now convert it to GtkImage */ 3086 /* Now convert it to GtkImage */
3087 if (pixbuf == NULL) 3087 if (pixbuf == NULL)
3088 image = gtk_image_new(); 3088 image = gtk_image_new();
3160 3160
3161 first_offline = FALSE; 3161 first_offline = FALSE;
3162 } 3162 }
3163 3163
3164 /* Create a pixmap for the protocol icon. */ 3164 /* Create a pixmap for the protocol icon. */
3165 pixbuf = create_prpl_icon(account); 3165 pixbuf = gaim_gtk_create_prpl_icon(account);
3166 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, 3166 scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16,
3167 GDK_INTERP_BILINEAR); 3167 GDK_INTERP_BILINEAR);
3168 3168
3169 /* Now convert it to GtkImage */ 3169 /* Now convert it to GtkImage */
3170 if (pixbuf == NULL) 3170 if (pixbuf == NULL)
4761 { 4761 {
4762 GaimGtkConversation *gtkconv; 4762 GaimGtkConversation *gtkconv;
4763 GaimConvWindow *win; 4763 GaimConvWindow *win;
4764 GaimConnection *gc; 4764 GaimConnection *gc;
4765 int gtk_font_options = 0; 4765 int gtk_font_options = 0;
4766 char buf[BUF_LONG];
4767 char buf2[BUF_LONG]; 4766 char buf2[BUF_LONG];
4768 char mdate[64]; 4767 char mdate[64];
4769 char color[10]; 4768 char color[10];
4770 char *str; 4769 char *str;
4771 char *with_font_tag; 4770 char *with_font_tag;
4801 gtk_font_options |= GTK_IMHTML_USE_POINTSIZE; 4800 gtk_font_options |= GTK_IMHTML_USE_POINTSIZE;
4802 } 4801 }
4803 4802
4804 /* TODO: These colors should not be hardcoded so log.c can use them */ 4803 /* TODO: These colors should not be hardcoded so log.c can use them */
4805 if (flags & GAIM_MESSAGE_SYSTEM) { 4804 if (flags & GAIM_MESSAGE_SYSTEM) {
4806 g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s)</FONT> <B>%s</B>",
4807 mdate, message);
4808
4809 g_snprintf(buf2, sizeof(buf2), 4805 g_snprintf(buf2, sizeof(buf2),
4810 "<FONT %s><FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B></FONT>", 4806 "<FONT %s><FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B></FONT>",
4811 sml_attrib ? sml_attrib : "", mdate, message); 4807 sml_attrib ? sml_attrib : "", mdate, message);
4812 4808
4813 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0); 4809 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0);
4814 4810
4815 } else if (flags & GAIM_MESSAGE_ERROR) { 4811 } else if (flags & GAIM_MESSAGE_ERROR) {
4816 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"#ff0000\"><FONT SIZE=\"2\">(%s)</FONT> <B>%s</B></FONT>",
4817 mdate, message);
4818
4819 g_snprintf(buf2, sizeof(buf2), 4812 g_snprintf(buf2, sizeof(buf2),
4820 "<FONT COLOR=\"#ff0000\"><FONT %s><FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B></FONT></FONT>", 4813 "<FONT COLOR=\"#ff0000\"><FONT %s><FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B></FONT></FONT>",
4821 sml_attrib ? sml_attrib : "", mdate, message); 4814 sml_attrib ? sml_attrib : "", mdate, message);
4822 4815
4823 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0); 4816 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0);
4824 4817
4825 } else if (flags & GAIM_MESSAGE_NO_LOG) { 4818 } else if (flags & GAIM_MESSAGE_NO_LOG) {
4826 g_snprintf(buf, BUF_LONG, 4819 g_snprintf(buf2, BUF_LONG,
4827 "<B><FONT %s COLOR=\"#777777\">%s</FONT></B>", 4820 "<B><FONT %s COLOR=\"#777777\">%s</FONT></B>",
4828 sml_attrib ? sml_attrib : "", message); 4821 sml_attrib ? sml_attrib : "", message);
4829 4822
4830 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf, 0); 4823 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0);
4831 } else if (flags & GAIM_MESSAGE_RAW) { 4824 } else if (flags & GAIM_MESSAGE_RAW) {
4832 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), message, 0); 4825 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), message, 0);
4833 } else { 4826 } else {
4834 char *new_message = g_memdup(message, length); 4827 char *new_message = g_memdup(message, length);
4835 char *who_escaped = (who ? g_markup_escape_text(who, strlen(who)) : g_strdup("")); 4828 char *who_escaped = (who ? g_markup_escape_text(who, strlen(who)) : g_strdup(""));
4891 } 4884 }
4892 4885
4893 if(who_escaped) 4886 if(who_escaped)
4894 g_free(who_escaped); 4887 g_free(who_escaped);
4895 } 4888 }
4896 g_snprintf(buf, BUF_LONG,
4897 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\">(%s)</FONT> "
4898 "<B>%s</B></FONT> ", color,
4899 sml_attrib ? sml_attrib : "", mdate, str);
4900
4901 g_snprintf(buf2, BUF_LONG, 4889 g_snprintf(buf2, BUF_LONG,
4902 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\"><!--(%s) --></FONT>" 4890 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\"><!--(%s) --></FONT>"
4903 "<B>%s</B></FONT> ", 4891 "<B>%s</B></FONT> ",
4904 color, sml_attrib ? sml_attrib : "", mdate, str); 4892 color, sml_attrib ? sml_attrib : "", mdate, str);
4905 4893
4906 g_free(str); 4894 g_free(str);
4907 4895
4908 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), 4896 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0);
4909 buf2, 0);
4910 4897
4911 if(gc){ 4898 if(gc){
4912 char *pre = g_strdup_printf("<font %s>", sml_attrib ? sml_attrib : ""); 4899 char *pre = g_strdup_printf("<font %s>", sml_attrib ? sml_attrib : "");
4913 char *post = "</font>"; 4900 char *post = "</font>";
4914 int pre_len = strlen(pre); 4901 int pre_len = strlen(pre);
4930 with_font_tag, gtk_font_options); 4917 with_font_tag, gtk_font_options);
4931 4918
4932 g_free(with_font_tag); 4919 g_free(with_font_tag);
4933 g_free(new_message); 4920 g_free(new_message);
4934 } 4921 }
4935
4936 4922
4937 if(sml_attrib) 4923 if(sml_attrib)
4938 g_free(sml_attrib); 4924 g_free(sml_attrib);
4939 } 4925 }
4940 4926