# HG changeset patch # User Luke Schierer # Date 1080577230 0 # Node ID f8ab826e11ad98efc41e8031384c29e97f181d72 # Parent 833dd756dcc3138b3d59741aa996c96e34eaa183 [gaim-migrate @ 9258] " this patch will return the text for the smileys instead of skipping them. This patch also gets rid of two members in the gtkimhtml stuct that weren't being used anywhere. They were gboolean smileys, comments; which got replace with show_smileys, and show_comments. Also an fixes the gtk_imhtml_class_init so that if it's being compiled in c++, it will compile..." --Gary Kramlich committer: Tailor Script diff -r 833dd756dcc3 -r f8ab826e11ad src/gtkimhtml.c --- a/src/gtkimhtml.c Sun Mar 28 21:38:22 2004 +0000 +++ b/src/gtkimhtml.c Mon Mar 29 16:20:30 2004 +0000 @@ -610,12 +610,12 @@ } /* Boring GTK stuff */ -static void gtk_imhtml_class_init (GtkIMHtmlClass *class) +static void gtk_imhtml_class_init (GtkIMHtmlClass *klass) { GtkObjectClass *object_class; GObjectClass *gobject_class; - object_class = (GtkObjectClass*) class; - gobject_class = (GObjectClass*) class; + object_class = (GtkObjectClass*) klass; + gobject_class = (GObjectClass*) klass; parent_class = gtk_type_class(GTK_TYPE_TEXT_VIEW); signals[URL_CLICKED] = g_signal_new("url_clicked", G_TYPE_FROM_CLASS(gobject_class), @@ -3166,9 +3166,23 @@ char *gtk_imhtml_get_text(GtkIMHtml *imhtml) { - GtkTextIter start_iter, end_iter; - gtk_text_buffer_get_start_iter(imhtml->text_buffer, &start_iter); - gtk_text_buffer_get_end_iter(imhtml->text_buffer, &end_iter); - return gtk_text_buffer_get_text(imhtml->text_buffer, &start_iter, &end_iter, FALSE); - + GString *str = g_string_new(""); + GtkTextIter iter, end; + gunichar c; + + gtk_text_buffer_get_start_iter(imhtml->text_buffer, &iter); + gtk_text_buffer_get_end_iter(imhtml->text_buffer, &end); + + while ((c = gtk_text_iter_get_char(&iter)) != 0 && !gtk_text_iter_equal(&iter, &end)) { + if (c == 0xFFFC) { + GtkTextChildAnchor* anchor = gtk_text_iter_get_child_anchor(&iter); + char *text = g_object_get_data(G_OBJECT(anchor), "text_tag"); + str = g_string_append(str, text); + } else { + g_string_append_unichar(str, c); + } + gtk_text_iter_forward_char(&iter); + } + + return g_string_free(str, FALSE); } diff -r 833dd756dcc3 -r f8ab826e11ad src/gtkimhtml.h --- a/src/gtkimhtml.h Sun Mar 28 21:38:22 2004 +0000 +++ b/src/gtkimhtml.h Mon Mar 29 16:20:30 2004 +0000 @@ -76,7 +76,6 @@ GtkTextView text_view; GtkTextBuffer *text_buffer; GtkTextMark *end; - gboolean comments, smileys; GdkCursor *hand_cursor; GdkCursor *arrow_cursor; GdkCursor *text_cursor;