comparison src/protocols/oscar/oscar.c @ 2141:1fc962350561

[gaim-migrate @ 2151] because one time, at band camp, there was this guy, and no matter what he did, there was always something wrong with it, and other people had to keep correcting him, and at first it was really annoying but then it became really funny committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 09 Aug 2001 23:24:09 +0000
parents 18722ae5b882
children cff133e0ec0c
comparison
equal deleted inserted replaced
2140:66a84ff0445a 2141:1fc962350561
1613 frame = g_list_nth_data(frames, ir->curframe); 1613 frame = g_list_nth_data(frames, ir->curframe);
1614 switch (gdk_pixbuf_frame_get_action(frame)) { 1614 switch (gdk_pixbuf_frame_get_action(frame)) {
1615 case GDK_PIXBUF_FRAME_RETAIN: 1615 case GDK_PIXBUF_FRAME_RETAIN:
1616 buf = gdk_pixbuf_frame_get_pixbuf(frame); 1616 buf = gdk_pixbuf_frame_get_pixbuf(frame);
1617 scale = gdk_pixbuf_scale_simple(buf, 1617 scale = gdk_pixbuf_scale_simple(buf,
1618 gdk_pixbuf_get_width(buf) * SCALE / 1618 MAX(gdk_pixbuf_get_width(buf) * SCALE /
1619 gdk_pixbuf_animation_get_width(ir->anim), 1619 gdk_pixbuf_animation_get_width(ir->anim), 1),
1620 gdk_pixbuf_get_height(buf) * SCALE / 1620 MAX(gdk_pixbuf_get_height(buf) * SCALE /
1621 gdk_pixbuf_animation_get_height(ir->anim), 1621 gdk_pixbuf_animation_get_height(ir->anim), 1),
1622 GDK_INTERP_NEAREST); 1622 GDK_INTERP_NEAREST);
1623 gdk_pixbuf_render_pixmap_and_mask(scale, &src, NULL, 0); 1623 gdk_pixbuf_render_pixmap_and_mask(scale, &src, NULL, 0);
1624 gdk_pixbuf_unref(scale); 1624 gdk_pixbuf_unref(scale);
1625 gtk_pixmap_get(GTK_PIXMAP(ir->pix), &pm, &bm); 1625 gtk_pixmap_get(GTK_PIXMAP(ir->pix), &pm, &bm);
1626 gc = gdk_gc_new(pm); 1626 gc = gdk_gc_new(pm);
1627 gdk_draw_pixmap(pm, gc, src, 0, 0, 1627 gdk_draw_pixmap(pm, gc, src, 0, 0,
1628 gdk_pixbuf_frame_get_x_offset(frame) * SCALE / 1628 MAX(gdk_pixbuf_frame_get_x_offset(frame) * SCALE /
1629 gdk_pixbuf_animation_get_width(ir->anim), 1629 gdk_pixbuf_animation_get_width(ir->anim), 1),
1630 gdk_pixbuf_frame_get_y_offset(frame) * SCALE / 1630 MAX(gdk_pixbuf_frame_get_y_offset(frame) * SCALE /
1631 gdk_pixbuf_animation_get_height(ir->anim), 1631 gdk_pixbuf_animation_get_height(ir->anim), 1),
1632 -1, -1); 1632 -1, -1);
1633 gdk_pixmap_unref(src); 1633 gdk_pixmap_unref(src);
1634 gtk_widget_queue_draw(ir->pix); 1634 gtk_widget_queue_draw(ir->pix);
1635 gdk_gc_unref(gc); 1635 gdk_gc_unref(gc);
1636 break; 1636 break;
1637 case GDK_PIXBUF_FRAME_DISPOSE: 1637 case GDK_PIXBUF_FRAME_DISPOSE:
1638 buf = gdk_pixbuf_frame_get_pixbuf(frame); 1638 buf = gdk_pixbuf_frame_get_pixbuf(frame);
1639 scale = gdk_pixbuf_scale_simple(buf, 1639 scale = gdk_pixbuf_scale_simple(buf,
1640 gdk_pixbuf_get_width(buf) * SCALE / 1640 MAX(gdk_pixbuf_get_width(buf) * SCALE /
1641 gdk_pixbuf_animation_get_width(ir->anim), 1641 gdk_pixbuf_animation_get_width(ir->anim), 1),
1642 gdk_pixbuf_get_height(buf) * SCALE / 1642 MAX(gdk_pixbuf_get_height(buf) * SCALE /
1643 gdk_pixbuf_animation_get_height(ir->anim), 1643 gdk_pixbuf_animation_get_height(ir->anim), 1),
1644 GDK_INTERP_NEAREST); 1644 GDK_INTERP_NEAREST);
1645 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0); 1645 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0);
1646 gdk_pixbuf_unref(scale); 1646 gdk_pixbuf_unref(scale);
1647 gtk_pixmap_set(GTK_PIXMAP(ir->pix), pm, bm); 1647 gtk_pixmap_set(GTK_PIXMAP(ir->pix), pm, bm);
1648 gdk_pixmap_unref(pm); 1648 gdk_pixmap_unref(pm);
1651 break; 1651 break;
1652 case GDK_PIXBUF_FRAME_REVERT: 1652 case GDK_PIXBUF_FRAME_REVERT:
1653 frame = frames->data; 1653 frame = frames->data;
1654 buf = gdk_pixbuf_frame_get_pixbuf(frame); 1654 buf = gdk_pixbuf_frame_get_pixbuf(frame);
1655 scale = gdk_pixbuf_scale_simple(buf, 1655 scale = gdk_pixbuf_scale_simple(buf,
1656 gdk_pixbuf_get_width(buf) * SCALE / 1656 MAX(gdk_pixbuf_get_width(buf) * SCALE /
1657 gdk_pixbuf_animation_get_width(ir->anim), 1657 gdk_pixbuf_animation_get_width(ir->anim), 1),
1658 gdk_pixbuf_get_height(buf) * SCALE / 1658 MAX(gdk_pixbuf_get_height(buf) * SCALE /
1659 gdk_pixbuf_animation_get_height(ir->anim), 1659 gdk_pixbuf_animation_get_height(ir->anim), 1),
1660 GDK_INTERP_NEAREST); 1660 GDK_INTERP_NEAREST);
1661 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0); 1661 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0);
1662 gdk_pixbuf_unref(scale); 1662 gdk_pixbuf_unref(scale);
1663 gtk_pixmap_set(GTK_PIXMAP(ir->pix), pm, bm); 1663 gtk_pixmap_set(GTK_PIXMAP(ir->pix), pm, bm);
1664 gdk_pixmap_unref(pm); 1664 gdk_pixmap_unref(pm);
1838 1838
1839 if (ir->anim) { 1839 if (ir->anim) {
1840 frames = gdk_pixbuf_animation_get_frames(ir->anim); 1840 frames = gdk_pixbuf_animation_get_frames(ir->anim);
1841 buf = gdk_pixbuf_frame_get_pixbuf(frames->data); 1841 buf = gdk_pixbuf_frame_get_pixbuf(frames->data);
1842 scale = gdk_pixbuf_scale_simple(buf, 1842 scale = gdk_pixbuf_scale_simple(buf,
1843 gdk_pixbuf_get_width(buf) * SCALE / 1843 MAX(gdk_pixbuf_get_width(buf) * SCALE /
1844 gdk_pixbuf_animation_get_width(ir->anim), 1844 gdk_pixbuf_animation_get_width(ir->anim), 1),
1845 gdk_pixbuf_get_height(buf) * SCALE / 1845 MAX(gdk_pixbuf_get_height(buf) * SCALE /
1846 gdk_pixbuf_animation_get_height(ir->anim), 1846 gdk_pixbuf_animation_get_height(ir->anim), 1),
1847 GDK_INTERP_NEAREST); 1847 GDK_INTERP_NEAREST);
1848 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0); 1848 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0);
1849 gdk_pixbuf_unref(scale); 1849 gdk_pixbuf_unref(scale);
1850 1850
1851 if (gdk_pixbuf_animation_get_num_frames(ir->anim) > 1) { 1851 if (gdk_pixbuf_animation_get_num_frames(ir->anim) > 1) {
3208 3208
3209 if (ir->anim) { 3209 if (ir->anim) {
3210 frames = gdk_pixbuf_animation_get_frames(ir->anim); 3210 frames = gdk_pixbuf_animation_get_frames(ir->anim);
3211 buf = gdk_pixbuf_frame_get_pixbuf(frames->data); 3211 buf = gdk_pixbuf_frame_get_pixbuf(frames->data);
3212 scale = gdk_pixbuf_scale_simple(buf, 3212 scale = gdk_pixbuf_scale_simple(buf,
3213 gdk_pixbuf_get_width(buf) * SCALE / 3213 MAX(gdk_pixbuf_get_width(buf) * SCALE /
3214 gdk_pixbuf_animation_get_width(ir->anim), 3214 gdk_pixbuf_animation_get_width(ir->anim), 1),
3215 gdk_pixbuf_get_height(buf) * SCALE / 3215 MAX(gdk_pixbuf_get_height(buf) * SCALE /
3216 gdk_pixbuf_animation_get_height(ir->anim), 3216 gdk_pixbuf_animation_get_height(ir->anim), 1),
3217 GDK_INTERP_NEAREST); 3217 GDK_INTERP_NEAREST);
3218 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0); 3218 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0);
3219 gdk_pixbuf_unref(scale); 3219 gdk_pixbuf_unref(scale);
3220 3220
3221 if (gdk_pixbuf_animation_get_num_frames(ir->anim) > 1) { 3221 if (gdk_pixbuf_animation_get_num_frames(ir->anim) > 1) {