Mercurial > pidgin
comparison src/conversation.c @ 2264:2993b6091a53
[gaim-migrate @ 2274]
fun.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 10 Sep 2001 23:09:58 +0000 |
parents | 933346315b9b |
children | 837aa71710c5 |
comparison
equal
deleted
inserted
replaced
2263:52e4d896b7f1 | 2264:2993b6091a53 |
---|---|
2594 | 2594 |
2595 GdkPixbufLoader *load; | 2595 GdkPixbufLoader *load; |
2596 GdkPixbuf *scale; | 2596 GdkPixbuf *scale; |
2597 GdkPixmap *pm; | 2597 GdkPixmap *pm; |
2598 GdkBitmap *bm; | 2598 GdkBitmap *bm; |
2599 int sf = 0; | |
2599 | 2600 |
2600 if (!c) | 2601 if (!c) |
2601 return; | 2602 return; |
2602 | 2603 |
2603 remove_icon(c); | 2604 remove_icon(c); |
2614 c->anim = gdk_pixbuf_loader_get_animation(load); | 2615 c->anim = gdk_pixbuf_loader_get_animation(load); |
2615 | 2616 |
2616 if (c->anim) { | 2617 if (c->anim) { |
2617 GList *frames = gdk_pixbuf_animation_get_frames(c->anim); | 2618 GList *frames = gdk_pixbuf_animation_get_frames(c->anim); |
2618 GdkPixbuf *buf = gdk_pixbuf_frame_get_pixbuf(frames->data); | 2619 GdkPixbuf *buf = gdk_pixbuf_frame_get_pixbuf(frames->data); |
2620 sf = SCALE(c->anim); | |
2619 scale = gdk_pixbuf_scale_simple(buf, | 2621 scale = gdk_pixbuf_scale_simple(buf, |
2620 MAX(gdk_pixbuf_get_width(buf) * SCALE(c->anim) / | 2622 MAX(gdk_pixbuf_get_width(buf) * sf / |
2621 gdk_pixbuf_animation_get_width(c->anim), 1), | 2623 gdk_pixbuf_animation_get_width(c->anim), 1), |
2622 MAX(gdk_pixbuf_get_height(buf) * SCALE(c->anim) / | 2624 MAX(gdk_pixbuf_get_height(buf) * sf / |
2623 gdk_pixbuf_animation_get_height(c->anim), 1), | 2625 gdk_pixbuf_animation_get_height(c->anim), 1), |
2624 GDK_INTERP_NEAREST); | 2626 GDK_INTERP_NEAREST); |
2625 | 2627 |
2626 if (gdk_pixbuf_animation_get_num_frames(c->anim) > 1) { | 2628 if (gdk_pixbuf_animation_get_num_frames(c->anim) > 1) { |
2627 int delay = MAX(gdk_pixbuf_frame_get_delay_time(frames->data), 13); | 2629 int delay = MAX(gdk_pixbuf_frame_get_delay_time(frames->data), 13); |
2628 c->frame = 1; | 2630 c->frame = 1; |
2629 c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c); | 2631 c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c); |
2630 } | 2632 } |
2631 } else { | 2633 } else { |
2632 int s; | |
2633 c->unanim = gdk_pixbuf_loader_get_pixbuf(load); | 2634 c->unanim = gdk_pixbuf_loader_get_pixbuf(load); |
2634 if (!c->unanim) { | 2635 if (!c->unanim) { |
2635 gdk_pixbuf_loader_close(load); | 2636 gdk_pixbuf_loader_close(load); |
2636 return; | 2637 return; |
2637 } | 2638 } |
2638 s = SCALEBUF(c->unanim); | 2639 sf = SCALEBUF(c->unanim); |
2639 scale = gdk_pixbuf_scale_simple(c->unanim, s, s, GDK_INTERP_NEAREST); | 2640 scale = gdk_pixbuf_scale_simple(c->unanim, sf, sf, GDK_INTERP_NEAREST); |
2640 } | 2641 } |
2641 | 2642 |
2642 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0); | 2643 gdk_pixbuf_render_pixmap_and_mask(scale, &pm, &bm, 0); |
2643 gdk_pixbuf_unref(scale); | 2644 gdk_pixbuf_unref(scale); |
2644 | 2645 |
2645 c->icon = gtk_pixmap_new(pm, bm); | 2646 c->icon = gtk_pixmap_new(pm, bm); |
2647 gtk_widget_set_usize(c->icon, sf, sf); | |
2646 gtk_box_pack_start(GTK_BOX(c->bbox), c->icon, FALSE, FALSE, 5); | 2648 gtk_box_pack_start(GTK_BOX(c->bbox), c->icon, FALSE, FALSE, 5); |
2647 gtk_widget_show(c->icon); | 2649 gtk_widget_show(c->icon); |
2648 gdk_pixmap_unref(pm); | 2650 gdk_pixmap_unref(pm); |
2649 if (bm) | 2651 if (bm) |
2650 gdk_bitmap_unref(bm); | 2652 gdk_bitmap_unref(bm); |