comparison src/gtkimhtml.c @ 6046:19cb60247a6c

[gaim-migrate @ 6496] F2 toggles timestamps retroactively again. Very nice patch Ka-Hing. Thanks, thanks. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 06 Jul 2003 22:03:40 +0000
parents 460b4ba2d452
children 395116fdd270
comparison
equal deleted inserted replaced
6045:01aeab85636c 6046:19cb60247a6c
383 /* When hovering over a link, we show the hand cursor--elsewhere we show the plain ol' pointer cursor */ 383 /* When hovering over a link, we show the hand cursor--elsewhere we show the plain ol' pointer cursor */
384 imhtml->hand_cursor = gdk_cursor_new (GDK_HAND2); 384 imhtml->hand_cursor = gdk_cursor_new (GDK_HAND2);
385 imhtml->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR); 385 imhtml->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR);
386 386
387 imhtml->show_smileys = TRUE; 387 imhtml->show_smileys = TRUE;
388 imhtml->show_comments = TRUE;
389 388
390 imhtml->smiley_data = g_hash_table_new_full(g_str_hash, g_str_equal, 389 imhtml->smiley_data = g_hash_table_new_full(g_str_hash, g_str_equal,
391 g_free, (GDestroyNotify)gtk_smiley_tree_destroy); 390 g_free, (GDestroyNotify)gtk_smiley_tree_destroy);
392 imhtml->default_smilies = gtk_smiley_tree_new(); 391 imhtml->default_smilies = gtk_smiley_tree_new();
393 392
399 imhtml->tip = NULL; 398 imhtml->tip = NULL;
400 imhtml->tip_timer = 0; 399 imhtml->tip_timer = 0;
401 imhtml->tip_window = NULL; 400 imhtml->tip_window = NULL;
402 401
403 imhtml->scalables = NULL; 402 imhtml->scalables = NULL;
403
404 gtk_text_buffer_create_tag(imhtml->text_buffer, "comment", "invisible", FALSE, NULL);
404 } 405 }
405 406
406 GtkWidget *gtk_imhtml_new(void *a, void *b) 407 GtkWidget *gtk_imhtml_new(void *a, void *b)
407 { 408 {
408 return GTK_WIDGET(g_object_new(gtk_imhtml_get_type(), NULL)); 409 return GTK_WIDGET(g_object_new(gtk_imhtml_get_type(), NULL));
959 scalable->add_to(scalable, imhtml, &iter); \ 960 scalable->add_to(scalable, imhtml, &iter); \
960 scalable->scale(scalable, rect.width, rect.height); \ 961 scalable->scale(scalable, rect.width, rect.height); \
961 imhtml->scalables = g_list_append(imhtml->scalables, scalable); \ 962 imhtml->scalables = g_list_append(imhtml->scalables, scalable); \
962 gtk_text_buffer_get_end_iter(imhtml->text_buffer, &iter); \ 963 gtk_text_buffer_get_end_iter(imhtml->text_buffer, &iter); \
963 } \ 964 } \
965 if (x == NEW_COMMENT_BIT) { \
966 gtk_text_buffer_apply_tag_by_name(imhtml->text_buffer, "comment", &siter, &iter); \
967 } \
964 968
965 969
966 970
967 GString* gtk_imhtml_append_text (GtkIMHtml *imhtml, 971 GString* gtk_imhtml_append_text (GtkIMHtml *imhtml,
968 const gchar *text, 972 const gchar *text,
1315 case 56: /* SPAN */ 1319 case 56: /* SPAN */
1316 case 57: /* /SPAN */ 1320 case 57: /* /SPAN */
1317 break; 1321 break;
1318 case 59: /* comment */ 1322 case 59: /* comment */
1319 NEW_BIT (NEW_TEXT_BIT); 1323 NEW_BIT (NEW_TEXT_BIT);
1320 if (imhtml->show_comments) 1324 wpos = g_snprintf (ws, len, "%s", tag);
1321 wpos = g_snprintf (ws, len, "%s", tag);
1322 NEW_BIT (NEW_COMMENT_BIT); 1325 NEW_BIT (NEW_COMMENT_BIT);
1323 break; 1326 break;
1324 default: 1327 default:
1325 break; 1328 break;
1326 } 1329 }
1444 } 1447 }
1445 1448
1446 void gtk_imhtml_show_comments (GtkIMHtml *imhtml, 1449 void gtk_imhtml_show_comments (GtkIMHtml *imhtml,
1447 gboolean show) 1450 gboolean show)
1448 { 1451 {
1449 imhtml->show_comments = show; 1452 GtkTextTagTable *table = gtk_text_buffer_get_tag_table(imhtml->text_buffer);
1453 GtkTextTag *tag = gtk_text_tag_table_lookup(table, "comment");
1454 g_object_set(G_OBJECT(tag), "invisible", !show, NULL);
1450 } 1455 }
1451 1456
1452 void 1457 void
1453 gtk_imhtml_clear (GtkIMHtml *imhtml) 1458 gtk_imhtml_clear (GtkIMHtml *imhtml)
1454 { 1459 {