Mercurial > pidgin
comparison src/gtkimhtml.c @ 6882:4f8258b2bb8d
[gaim-migrate @ 7428]
Tim Ringenbach (marv_sf) writes:
" This fixes the issues with nonannimated yahoo smilies
having black backgrounds."
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Thu, 18 Sep 2003 02:53:11 +0000 |
parents | bdc4e73f354d |
children | 083d1e4a9c78 |
comparison
equal
deleted
inserted
replaced
6881:b1c21872cf0f | 6882:4f8258b2bb8d |
---|---|
1351 if (imhtml->show_comments) | 1351 if (imhtml->show_comments) |
1352 wpos = g_snprintf (ws, len, "%s", tag); | 1352 wpos = g_snprintf (ws, len, "%s", tag); |
1353 NEW_BIT (NEW_COMMENT_BIT); | 1353 NEW_BIT (NEW_COMMENT_BIT); |
1354 break; | 1354 break; |
1355 default: | 1355 default: |
1356 break; | 1356 break; |
1357 } | 1357 } |
1358 c += tlen; | 1358 c += tlen; |
1359 pos += tlen; | 1359 pos += tlen; |
1360 if(tag) | 1360 if(tag) |
1361 g_free(tag); /* This was allocated back in VALID_TAG() */ | 1361 g_free(tag); /* This was allocated back in VALID_TAG() */ |
1371 } | 1371 } |
1372 c++; | 1372 c++; |
1373 pos++; | 1373 pos++; |
1374 } else if (imhtml->show_smileys && (gtk_imhtml_is_smiley (imhtml, fonts, c, &smilelen) || gtk_imhtml_is_smiley(imhtml, NULL, c, &smilelen))) { | 1374 } else if (imhtml->show_smileys && (gtk_imhtml_is_smiley (imhtml, fonts, c, &smilelen) || gtk_imhtml_is_smiley(imhtml, NULL, c, &smilelen))) { |
1375 GtkTextChildAnchor *anchor; | 1375 GtkTextChildAnchor *anchor; |
1376 GtkWidget *icon; | 1376 GtkWidget *icon = NULL; |
1377 GdkPixbufAnimation *pixbuf; | 1377 GdkPixbufAnimation *annipixbuf = NULL; |
1378 GdkPixbuf *pixbuf = NULL; | |
1378 GtkIMHtmlFontDetail *fd; | 1379 GtkIMHtmlFontDetail *fd; |
1379 gchar *sml = NULL; | 1380 gchar *sml = NULL; |
1380 if (fonts) { | 1381 if (fonts) { |
1381 fd = fonts->data; | 1382 fd = fonts->data; |
1382 sml = fd->sml; | 1383 sml = fd->sml; |
1383 } | 1384 } |
1384 NEW_BIT (NEW_TEXT_BIT); | 1385 NEW_BIT (NEW_TEXT_BIT); |
1385 wpos = g_snprintf (ws, smilelen + 1, "%s", c); | 1386 wpos = g_snprintf (ws, smilelen + 1, "%s", c); |
1386 anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, &iter); | 1387 anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, &iter); |
1387 pixbuf = gtk_smiley_tree_image(imhtml, sml, ws); | 1388 annipixbuf = gtk_smiley_tree_image(imhtml, sml, ws); |
1388 if(pixbuf){ | 1389 if(annipixbuf) { |
1389 icon = gtk_image_new_from_animation(pixbuf); | 1390 if(gdk_pixbuf_animation_is_static_image(annipixbuf)) { |
1391 pixbuf = gdk_pixbuf_animation_get_static_image(annipixbuf); | |
1392 if(pixbuf) | |
1393 icon = gtk_image_new_from_pixbuf(pixbuf); | |
1394 } else { | |
1395 icon = gtk_image_new_from_animation(annipixbuf); | |
1396 } | |
1397 } | |
1398 | |
1399 if (icon) { | |
1390 gtk_widget_show(icon); | 1400 gtk_widget_show(icon); |
1391 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), icon, anchor); | 1401 gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), icon, anchor); |
1392 } | 1402 } |
1393 | 1403 |
1394 c += smilelen; | 1404 c += smilelen; |