| 631 |
631 |
| 632 static void |
632 static void |
| 633 insert_smiley_text(GtkWidget *widget, PidginWebViewToolbar *toolbar) |
633 insert_smiley_text(GtkWidget *widget, PidginWebViewToolbar *toolbar) |
| 634 { |
634 { |
| 635 PurpleSmiley *smiley; |
635 PurpleSmiley *smiley; |
| 636 PurpleImage *image; |
|
| 637 guint image_id; |
636 guint image_id; |
| 638 gchar *escaped_smiley, *smiley_html; |
637 gchar *escaped_smiley, *smiley_html; |
| 639 const gchar *smiley_class; |
638 const gchar *smiley_class; |
| 640 |
639 |
| 641 smiley = g_object_get_data(G_OBJECT(widget), "smiley"); |
640 smiley = g_object_get_data(G_OBJECT(widget), "smiley"); |
| 642 smiley_class = g_object_get_data(G_OBJECT(widget), "smiley-class"); |
641 smiley_class = g_object_get_data(G_OBJECT(widget), "smiley-class"); |
| 643 image = purple_smiley_get_image(smiley); |
642 image_id = purple_image_store_add(PURPLE_IMAGE(smiley)); |
| 644 image_id = purple_image_store_add(image); |
|
| 645 |
643 |
| 646 escaped_smiley = g_markup_escape_text( |
644 escaped_smiley = g_markup_escape_text( |
| 647 purple_smiley_get_shortcut(smiley), -1); |
645 purple_smiley_get_shortcut(smiley), -1); |
| 648 smiley_html = g_strdup_printf("<img src=\"" PURPLE_IMAGE_STORE_PROTOCOL |
646 smiley_html = g_strdup_printf("<img src=\"" PURPLE_IMAGE_STORE_PROTOCOL |
| 649 "%u\" class=\"emoticon %s-emoticon\" alt=\"%s\" title=\"%s\">", |
647 "%u\" class=\"emoticon %s-emoticon\" alt=\"%s\" title=\"%s\">", |
| 692 if (width > 0) { |
690 if (width > 0) { |
| 693 total_width += width; |
691 total_width += width; |
| 694 continue; |
692 continue; |
| 695 } |
693 } |
| 696 |
694 |
| 697 pixbuf = pidgin_pixbuf_from_image( |
695 pixbuf = pidgin_pixbuf_from_image(PURPLE_IMAGE(smiley)); |
| 698 purple_smiley_get_image(smiley)); |
|
| 699 pixbuf = pidgin_pixbuf_scale_down(pixbuf, |
696 pixbuf = pidgin_pixbuf_scale_down(pixbuf, |
| 700 24, 24, GDK_INTERP_BILINEAR, TRUE); |
697 24, 24, GDK_INTERP_BILINEAR, TRUE); |
| 701 |
698 |
| 702 if (pixbuf) |
699 if (pixbuf) |
| 703 width = gdk_pixbuf_get_width(pixbuf); |
700 width = gdk_pixbuf_get_width(pixbuf); |