| 4927 if (icon) { |
4927 if (icon) { |
| 4928 char *text = g_strdup(unescaped); /* Do not g_free 'text'. |
4928 char *text = g_strdup(unescaped); /* Do not g_free 'text'. |
| 4929 It will be destroyed when 'anchor' is destroyed. */ |
4929 It will be destroyed when 'anchor' is destroyed. */ |
| 4930 anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, iter); |
4930 anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, iter); |
| 4931 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", text, g_free); |
4931 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", text, g_free); |
| 4932 g_object_set_data(G_OBJECT(anchor), "gtkimhtml_tiptext", text); |
4932 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_tiptext", g_strdup(text), g_free); |
| 4933 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free); |
4933 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free); |
| 4934 |
4934 |
| 4935 /* This catches the expose events generated by animated |
4935 /* This catches the expose events generated by animated |
| 4936 * images, and ensures that they are handled by the image |
4936 * images, and ensures that they are handled by the image |
| 4937 * itself, without propagating to the textview and causing |
4937 * itself, without propagating to the textview and causing |
| 4949 GtkWidget *img = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_MENU); |
4949 GtkWidget *img = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_MENU); |
| 4950 char *text = g_strdup(unescaped); |
4950 char *text = g_strdup(unescaped); |
| 4951 gtk_container_add(GTK_CONTAINER(ebox), img); |
4951 gtk_container_add(GTK_CONTAINER(ebox), img); |
| 4952 gtk_widget_show(img); |
4952 gtk_widget_show(img); |
| 4953 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", text, g_free); |
4953 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", text, g_free); |
| 4954 g_object_set_data(G_OBJECT(anchor), "gtkimhtml_tiptext", text); |
4954 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_tiptext", |
| |
4955 g_strdup(text), g_free); |
| 4955 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free); |
4956 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free); |
| 4956 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), ebox, anchor); |
4957 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), ebox, anchor); |
| 4957 } |
4958 } |
| 4958 } else { |
4959 } else { |
| 4959 gtk_text_buffer_insert(imhtml->text_buffer, iter, smiley, -1); |
4960 gtk_text_buffer_insert(imhtml->text_buffer, iter, smiley, -1); |