| 4864 if (ebox) |
4864 if (ebox) |
| 4865 gtk_container_add(GTK_CONTAINER(ebox), icon); |
4865 gtk_container_add(GTK_CONTAINER(ebox), icon); |
| 4866 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), ebox ? ebox : icon, anchor); |
4866 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), ebox ? ebox : icon, anchor); |
| 4867 } else if (imhtml_smiley != NULL && (imhtml->format_functions & GTK_IMHTML_SMILEY)) { |
4867 } else if (imhtml_smiley != NULL && (imhtml->format_functions & GTK_IMHTML_SMILEY)) { |
| 4868 anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, iter); |
4868 anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, iter); |
| 4869 imhtml_smiley->anchors = g_slist_append(imhtml_smiley->anchors, anchor); |
4869 imhtml_smiley->anchors = g_slist_append(imhtml_smiley->anchors, g_object_ref(anchor)); |
| 4870 if (ebox) { |
4870 if (ebox) { |
| 4871 GtkWidget *img = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_MENU); |
4871 GtkWidget *img = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_MENU); |
| 4872 char *text = g_strdup(unescaped); |
4872 char *text = g_strdup(unescaped); |
| 4873 gtk_container_add(GTK_CONTAINER(ebox), img); |
4873 gtk_container_add(GTK_CONTAINER(ebox), img); |
| 4874 gtk_widget_show(img); |
4874 gtk_widget_show(img); |
| 5504 smiley->loader = NULL; |
5504 smiley->loader = NULL; |
| 5505 return; |
5505 return; |
| 5506 } |
5506 } |
| 5507 |
5507 |
| 5508 for (current = smiley->anchors; current; current = g_slist_next(current)) { |
5508 for (current = smiley->anchors; current; current = g_slist_next(current)) { |
| 5509 |
5509 anchor = GTK_TEXT_CHILD_ANCHOR(current->data); |
| 5510 icon = gtk_image_new_from_animation(smiley->icon); |
5510 if (gtk_text_child_anchor_get_deleted(anchor)) |
| |
5511 icon = NULL; |
| |
5512 else |
| |
5513 icon = gtk_image_new_from_animation(smiley->icon); |
| 5511 |
5514 |
| 5512 #ifdef DEBUG_CUSTOM_SMILEY |
5515 #ifdef DEBUG_CUSTOM_SMILEY |
| 5513 purple_debug_info("custom-smiley", "gtk_custom_smiley_closed(): got GtkImage %p from GtkPixbufAnimation %p for smiley '%s'\n", |
5516 purple_debug_info("custom-smiley", "gtk_custom_smiley_closed(): got GtkImage %p from GtkPixbufAnimation %p for smiley '%s'\n", |
| 5514 icon, smiley->icon, smiley->smile); |
5517 icon, smiley->icon, smiley->smile); |
| 5515 #endif |
5518 #endif |
| 5516 if (icon) { |
5519 if (icon) { |
| 5517 GList *wids; |
5520 GList *wids; |
| 5518 gtk_widget_show(icon); |
5521 gtk_widget_show(icon); |
| 5519 |
5522 |
| 5520 anchor = GTK_TEXT_CHILD_ANCHOR(current->data); |
|
| 5521 wids = gtk_text_child_anchor_get_widgets(anchor); |
5523 wids = gtk_text_child_anchor_get_widgets(anchor); |
| 5522 |
5524 |
| 5523 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", purple_unescape_html(smiley->smile), g_free); |
5525 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", purple_unescape_html(smiley->smile), g_free); |
| 5524 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley->smile), g_free); |
5526 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley->smile), g_free); |
| 5525 |
5527 |