comparison pidgin/gtkimhtml.c @ 27760:e9cf897bd873

propagate from branch 'im.pidgin.pidgin' (head ae7f8e3acb446776f833c3b44514295ae56184b3) to branch 'im.pidgin.pidgin.yaz' (head 952151791a1f3b4e3469a5621f4cfa2de608a8b8)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 30 Jan 2008 10:53:22 +0000
parents 9a60b9fab0ea 80e5eaa8f580
children 085d0a18a7f7
comparison
equal deleted inserted replaced
27759:54479172725e 27760:e9cf897bd873
1461 gtk_text_buffer_create_tag(imhtml->text_buffer, "STRIKE", "strikethrough", TRUE, NULL); 1461 gtk_text_buffer_create_tag(imhtml->text_buffer, "STRIKE", "strikethrough", TRUE, NULL);
1462 gtk_text_buffer_create_tag(imhtml->text_buffer, "SUB", "rise", -5000, NULL); 1462 gtk_text_buffer_create_tag(imhtml->text_buffer, "SUB", "rise", -5000, NULL);
1463 gtk_text_buffer_create_tag(imhtml->text_buffer, "SUP", "rise", 5000, NULL); 1463 gtk_text_buffer_create_tag(imhtml->text_buffer, "SUP", "rise", 5000, NULL);
1464 gtk_text_buffer_create_tag(imhtml->text_buffer, "PRE", "family", "Monospace", NULL); 1464 gtk_text_buffer_create_tag(imhtml->text_buffer, "PRE", "family", "Monospace", NULL);
1465 gtk_text_buffer_create_tag(imhtml->text_buffer, "search", "background", "#22ff00", "weight", "bold", NULL); 1465 gtk_text_buffer_create_tag(imhtml->text_buffer, "search", "background", "#22ff00", "weight", "bold", NULL);
1466 #if GTK_CHECK_VERSION(2,10,10)
1467 gtk_text_buffer_create_tag(imhtml->text_buffer, "comment", "invisible", FALSE, NULL);
1468 #endif
1466 1469
1467 /* When hovering over a link, we show the hand cursor--elsewhere we show the plain ol' pointer cursor */ 1470 /* When hovering over a link, we show the hand cursor--elsewhere we show the plain ol' pointer cursor */
1468 imhtml->hand_cursor = gdk_cursor_new (GDK_HAND2); 1471 imhtml->hand_cursor = gdk_cursor_new (GDK_HAND2);
1469 imhtml->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR); 1472 imhtml->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR);
1470 imhtml->text_cursor = gdk_cursor_new (GDK_XTERM); 1473 imhtml->text_cursor = gdk_cursor_new (GDK_XTERM);
2987 /* NEW_BIT (NEW_TEXT_BIT); */ 2990 /* NEW_BIT (NEW_TEXT_BIT); */
2988 ws[wpos] = '\0'; 2991 ws[wpos] = '\0';
2989 2992
2990 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 2993 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2991 2994
2995 #if GTK_CHECK_VERSION(2,10,10)
2996 wpos = g_snprintf (ws, len, "%s", tag);
2997 gtk_text_buffer_insert_with_tags_by_name(imhtml->text_buffer, iter, ws, wpos, "comment", NULL);
2998 #else
2992 if (imhtml->show_comments && !(options & GTK_IMHTML_NO_COMMENTS)) { 2999 if (imhtml->show_comments && !(options & GTK_IMHTML_NO_COMMENTS)) {
2993 wpos = g_snprintf (ws, len, "%s", tag); 3000 wpos = g_snprintf (ws, len, "%s", tag);
2994 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 3001 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2995 } 3002 }
3003 #endif
2996 ws[0] = '\0'; wpos = 0; 3004 ws[0] = '\0'; wpos = 0;
2997 3005
2998 /* NEW_BIT (NEW_COMMENT_BIT); */ 3006 /* NEW_BIT (NEW_COMMENT_BIT); */
2999 break; 3007 break;
3000 default: 3008 default:
3136 } 3144 }
3137 3145
3138 void gtk_imhtml_show_comments (GtkIMHtml *imhtml, 3146 void gtk_imhtml_show_comments (GtkIMHtml *imhtml,
3139 gboolean show) 3147 gboolean show)
3140 { 3148 {
3149 #if GTK_CHECK_VERSION(2,10,10)
3150 GtkTextTag *tag;
3151 tag = gtk_text_tag_table_lookup(gtk_text_buffer_get_tag_table(imhtml->text_buffer), "comment");
3152 if (tag)
3153 g_object_set(G_OBJECT(tag), "invisible", !show, NULL);
3154 #endif
3141 imhtml->show_comments = show; 3155 imhtml->show_comments = show;
3142 } 3156 }
3143 3157
3144 const char * 3158 const char *
3145 gtk_imhtml_get_protocol_name(GtkIMHtml *imhtml) { 3159 gtk_imhtml_get_protocol_name(GtkIMHtml *imhtml) {