comparison pidgin/gtkimhtml.c @ 28873:3e5a37c743df

commit differences as a revision for now.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 04 Nov 2009 16:58:41 +0900
parents 766f7905314a 1cf8826f901c
children 1929b7a0c2c8
comparison
equal deleted inserted replaced
28801:d7c49598cef2 28873:3e5a37c743df
5066 if (icon) { 5066 if (icon) {
5067 char *text = g_strdup(unescaped); /* Do not g_free 'text'. 5067 char *text = g_strdup(unescaped); /* Do not g_free 'text'.
5068 It will be destroyed when 'anchor' is destroyed. */ 5068 It will be destroyed when 'anchor' is destroyed. */
5069 anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, iter); 5069 anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, iter);
5070 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", text, g_free); 5070 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", text, g_free);
5071 g_object_set_data(G_OBJECT(anchor), "gtkimhtml_tiptext", text); 5071 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_tiptext", g_strdup(text), g_free);
5072 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free); 5072 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free);
5073 5073
5074 /* This catches the expose events generated by animated 5074 /* This catches the expose events generated by animated
5075 * images, and ensures that they are handled by the image 5075 * images, and ensures that they are handled by the image
5076 * itself, without propagating to the textview and causing 5076 * itself, without propagating to the textview and causing
5088 GtkWidget *img = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_MENU); 5088 GtkWidget *img = gtk_image_new_from_stock(GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_MENU);
5089 char *text = g_strdup(unescaped); 5089 char *text = g_strdup(unescaped);
5090 gtk_container_add(GTK_CONTAINER(ebox), img); 5090 gtk_container_add(GTK_CONTAINER(ebox), img);
5091 gtk_widget_show(img); 5091 gtk_widget_show(img);
5092 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", text, g_free); 5092 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", text, g_free);
5093 g_object_set_data(G_OBJECT(anchor), "gtkimhtml_tiptext", text); 5093 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_tiptext",
5094 g_strdup(text), g_free);
5094 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free); 5095 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free);
5095 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), ebox, anchor); 5096 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), ebox, anchor);
5096 } 5097 }
5097 } else { 5098 } else {
5098 gtk_text_buffer_insert(imhtml->text_buffer, iter, smiley, -1); 5099 gtk_text_buffer_insert(imhtml->text_buffer, iter, smiley, -1);