Mercurial > pidgin
comparison src/gtkimhtml.c @ 8881:1ab2a9c17f4a
[gaim-migrate @ 9650]
I'm going to thoroughly remove the prefs that we're sure about.
Starting with the show_smileys one.
I also tagged the commented out preferences with /* PREFSLASH04 */
to make them easily findable. And got rid of a compile warning or 5.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 06 May 2004 04:44:33 +0000 |
parents | ab5a46dd132a |
children | 6c98b883580a |
comparison
equal
deleted
inserted
replaced
8880:ec3e041dc3bd | 8881:1ab2a9c17f4a |
---|---|
966 /* When hovering over a link, we show the hand cursor--elsewhere we show the plain ol' pointer cursor */ | 966 /* When hovering over a link, we show the hand cursor--elsewhere we show the plain ol' pointer cursor */ |
967 imhtml->hand_cursor = gdk_cursor_new (GDK_HAND2); | 967 imhtml->hand_cursor = gdk_cursor_new (GDK_HAND2); |
968 imhtml->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR); | 968 imhtml->arrow_cursor = gdk_cursor_new (GDK_LEFT_PTR); |
969 imhtml->text_cursor = gdk_cursor_new (GDK_XTERM); | 969 imhtml->text_cursor = gdk_cursor_new (GDK_XTERM); |
970 | 970 |
971 imhtml->show_smileys = TRUE; | |
972 imhtml->show_comments = TRUE; | 971 imhtml->show_comments = TRUE; |
973 | 972 |
974 imhtml->zoom = 1.0; | 973 imhtml->zoom = 1.0; |
975 imhtml->original_fsize = 0; | 974 imhtml->original_fsize = 0; |
976 | 975 |
2321 } | 2320 } |
2322 c += tlen; | 2321 c += tlen; |
2323 pos += tlen; | 2322 pos += tlen; |
2324 if(tag) | 2323 if(tag) |
2325 g_free(tag); /* This was allocated back in VALID_TAG() */ | 2324 g_free(tag); /* This was allocated back in VALID_TAG() */ |
2326 } else if (imhtml->show_smileys && (gtk_imhtml_is_smiley (imhtml, fonts, c, &smilelen) || gtk_imhtml_is_smiley(imhtml, NULL, c, &smilelen))) { | 2325 } else if (gtk_imhtml_is_smiley (imhtml, fonts, c, &smilelen) || gtk_imhtml_is_smiley(imhtml, NULL, c, &smilelen)) { |
2327 GtkIMHtmlFontDetail *fd; | 2326 GtkIMHtmlFontDetail *fd; |
2328 | 2327 |
2329 gchar *sml = NULL; | 2328 gchar *sml = NULL; |
2330 if (fonts) { | 2329 if (fonts) { |
2331 fd = fonts->data; | 2330 fd = fonts->data; |
2448 imhtml->smiley_data = g_hash_table_new_full(g_str_hash, g_str_equal, | 2447 imhtml->smiley_data = g_hash_table_new_full(g_str_hash, g_str_equal, |
2449 g_free, (GDestroyNotify)gtk_smiley_tree_destroy); | 2448 g_free, (GDestroyNotify)gtk_smiley_tree_destroy); |
2450 imhtml->default_smilies = gtk_smiley_tree_new(); | 2449 imhtml->default_smilies = gtk_smiley_tree_new(); |
2451 } | 2450 } |
2452 | 2451 |
2453 void gtk_imhtml_show_smileys (GtkIMHtml *imhtml, | |
2454 gboolean show) | |
2455 { | |
2456 imhtml->show_smileys = show; | |
2457 } | |
2458 | |
2459 void gtk_imhtml_show_comments (GtkIMHtml *imhtml, | 2452 void gtk_imhtml_show_comments (GtkIMHtml *imhtml, |
2460 gboolean show) | 2453 gboolean show) |
2461 { | 2454 { |
2462 imhtml->show_comments = show; | 2455 imhtml->show_comments = show; |
2463 } | 2456 } |
3473 GdkPixbuf *pixbuf = NULL; | 3466 GdkPixbuf *pixbuf = NULL; |
3474 GdkPixbufAnimation *annipixbuf = NULL; | 3467 GdkPixbufAnimation *annipixbuf = NULL; |
3475 GtkWidget *icon = NULL; | 3468 GtkWidget *icon = NULL; |
3476 GtkTextChildAnchor *anchor; | 3469 GtkTextChildAnchor *anchor; |
3477 char *unescaped = gaim_unescape_html(smiley); | 3470 char *unescaped = gaim_unescape_html(smiley); |
3478 | |
3479 if (!imhtml->show_smileys) { | |
3480 gtk_text_buffer_insert(imhtml->text_buffer, iter, smiley, strlen(smiley)); | |
3481 return; | |
3482 } | |
3483 | 3471 |
3484 anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, iter); | 3472 anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, iter); |
3485 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", unescaped, g_free); | 3473 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_plaintext", unescaped, g_free); |
3486 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free); | 3474 g_object_set_data_full(G_OBJECT(anchor), "gtkimhtml_htmltext", g_strdup(smiley), g_free); |
3487 | 3475 |