Mercurial > pidgin
comparison src/gtkimhtml.c @ 11525:b47708f46a38
[gaim-migrate @ 13773]
Here's the rest of that custom smiley receiving patch, with some changes
from me. I'm still not all that happy with it, but that's probably not
the author's fault, and I don't have time to take it further right now.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Mon, 12 Sep 2005 13:25:41 +0000 |
parents | 16b0da1f376f |
children | 7be60d01519f |
comparison
equal
deleted
inserted
replaced
11524:4fd0c3a663b8 | 11525:b47708f46a38 |
---|---|
4309 GdkPixbuf *pixbuf = NULL; | 4309 GdkPixbuf *pixbuf = NULL; |
4310 GdkPixbufAnimation *annipixbuf = NULL; | 4310 GdkPixbufAnimation *annipixbuf = NULL; |
4311 GtkWidget *icon = NULL; | 4311 GtkWidget *icon = NULL; |
4312 GtkTextChildAnchor *anchor; | 4312 GtkTextChildAnchor *anchor; |
4313 char *unescaped = gaim_unescape_html(smiley); | 4313 char *unescaped = gaim_unescape_html(smiley); |
4314 GtkIMHtmlSmiley *imhtml_smiley = gtk_imhtml_smiley_get(imhtml, sml, unescaped); | |
4314 | 4315 |
4315 if (imhtml->format_functions & GTK_IMHTML_SMILEY) { | 4316 if (imhtml->format_functions & GTK_IMHTML_SMILEY) { |
4316 annipixbuf = gtk_smiley_tree_image(imhtml, sml, unescaped); | 4317 annipixbuf = gtk_smiley_tree_image(imhtml, sml, unescaped); |
4317 if (annipixbuf) { | 4318 if (annipixbuf) { |
4318 if (gdk_pixbuf_animation_is_static_image(annipixbuf)) { | 4319 if (gdk_pixbuf_animation_is_static_image(annipixbuf)) { |
4343 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", g_strdup(unescaped), g_free); | 4344 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", g_strdup(unescaped), g_free); |
4344 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free); | 4345 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free); |
4345 | 4346 |
4346 gtk_widget_show(icon); | 4347 gtk_widget_show(icon); |
4347 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), icon, anchor); | 4348 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), icon, anchor); |
4349 } else if (imhtml_smiley != NULL && (imhtml->format_functions & GTK_IMHTML_SMILEY)) { | |
4350 anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, iter); | |
4351 imhtml_smiley->anchors = g_slist_append(imhtml_smiley->anchors, anchor); | |
4348 } else { | 4352 } else { |
4349 gtk_text_buffer_insert(imhtml->text_buffer, iter, smiley, -1); | 4353 gtk_text_buffer_insert(imhtml->text_buffer, iter, smiley, -1); |
4350 } | 4354 } |
4351 | 4355 |
4352 g_free(unescaped); | 4356 g_free(unescaped); |