aboutsummaryrefslogtreecommitdiffstats
path: root/w3mimg
diff options
context:
space:
mode:
Diffstat (limited to 'w3mimg')
-rw-r--r--w3mimg/fb/fb_gdkpixbuf.c7
-rw-r--r--w3mimg/fb/fb_img.h4
-rw-r--r--w3mimg/fb/fb_imlib2.c4
-rw-r--r--w3mimg/fb/fb_w3mimg.c4
-rw-r--r--w3mimg/w3mimg.h3
-rw-r--r--w3mimg/x11/x11_w3mimg.c6
6 files changed, 18 insertions, 10 deletions
diff --git a/w3mimg/fb/fb_gdkpixbuf.c b/w3mimg/fb/fb_gdkpixbuf.c
index 45fabd7..e0c1775 100644
--- a/w3mimg/fb/fb_gdkpixbuf.c
+++ b/w3mimg/fb/fb_gdkpixbuf.c
@@ -1,4 +1,4 @@
-/* $Id: fb_gdkpixbuf.c,v 1.8 2002/09/09 14:00:18 ukai Exp $ */
+/* $Id: fb_gdkpixbuf.c,v 1.9 2003/03/24 15:45:59 ukai Exp $ */
/**************************************************************************
fb_gdkpixbuf.c 0.3 Copyright (C) 2002, hito
**************************************************************************/
@@ -27,7 +27,7 @@ get_image_size(char *filename, int *w, int *h)
}
FB_IMAGE **
-fb_image_load(char *filename, int w, int h)
+fb_image_load(char *filename, int w, int h, int max_anim)
{
GdkPixbufAnimation *animation;
GList *frames;
@@ -44,6 +44,9 @@ fb_image_load(char *filename, int w, int h)
fw = gdk_pixbuf_animation_get_width(animation);
fh = gdk_pixbuf_animation_get_height(animation);
n = gdk_pixbuf_animation_get_num_frames(animation);
+ if (max_anim > 0) {
+ n = (max_anim > n)? n : max_anim;
+ }
if (w < 1 || h < 1) {
w = fw;
h = fh;
diff --git a/w3mimg/fb/fb_img.h b/w3mimg/fb/fb_img.h
index 2e64717..f607bde 100644
--- a/w3mimg/fb/fb_img.h
+++ b/w3mimg/fb/fb_img.h
@@ -1,9 +1,9 @@
-/* $Id: fb_img.h,v 1.6 2002/10/10 16:16:04 ukai Exp $ */
+/* $Id: fb_img.h,v 1.7 2003/03/24 15:45:59 ukai Exp $ */
#ifndef fb_img_header
#define fb_img_header
#include "fb.h"
-FB_IMAGE **fb_image_load(char *filename, int w, int h);
+FB_IMAGE **fb_image_load(char *filename, int w, int h, int n);
void fb_image_set_bg(int r, int g, int b);
int get_image_size(char *filename, int *w, int *h);
diff --git a/w3mimg/fb/fb_imlib2.c b/w3mimg/fb/fb_imlib2.c
index 49a17a5..972f06e 100644
--- a/w3mimg/fb/fb_imlib2.c
+++ b/w3mimg/fb/fb_imlib2.c
@@ -1,4 +1,4 @@
-/* $Id: fb_imlib2.c,v 1.8 2002/09/09 14:00:42 ukai Exp $ */
+/* $Id: fb_imlib2.c,v 1.9 2003/03/24 15:45:59 ukai Exp $ */
/**************************************************************************
fb_imlib2.c 0.3 Copyright (C) 2002, hito
**************************************************************************/
@@ -32,7 +32,7 @@ get_image_size(char *filename, int *w, int *h)
}
FB_IMAGE **
-fb_image_load(char *filename, int w, int h)
+fb_image_load(char *filename, int w, int h, int n)
{
Imlib_Image image;
FB_IMAGE **frame;
diff --git a/w3mimg/fb/fb_w3mimg.c b/w3mimg/fb/fb_w3mimg.c
index e7cb1eb..bac9dcc 100644
--- a/w3mimg/fb/fb_w3mimg.c
+++ b/w3mimg/fb/fb_w3mimg.c
@@ -1,4 +1,4 @@
-/* $Id: fb_w3mimg.c,v 1.8 2002/12/25 16:18:19 ukai Exp $ */
+/* $Id: fb_w3mimg.c,v 1.9 2003/03/24 15:46:00 ukai Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -67,7 +67,7 @@ w3mfb_load_image(w3mimg_op * self, W3MImage * img, char *fname, int w, int h)
if (self == NULL)
return 0;
- im = fb_image_load(fname, w, h);
+ im = fb_image_load(fname, w, h, self->max_anim);
if (!im)
return 0;
img->pixmap = im;
diff --git a/w3mimg/w3mimg.h b/w3mimg/w3mimg.h
index 639d41c..0e7bc26 100644
--- a/w3mimg/w3mimg.h
+++ b/w3mimg/w3mimg.h
@@ -1,4 +1,4 @@
-/* $Id: w3mimg.h,v 1.5 2002/09/09 13:59:24 ukai Exp $ */
+/* $Id: w3mimg.h,v 1.6 2003/03/24 15:45:58 ukai Exp $ */
#include "config.h"
#ifdef USE_W3MIMG_FB
@@ -16,6 +16,7 @@ typedef struct _w3mimg_op {
void *priv; /* driver specific data */
int width, height; /* window width, height */
int offset_x, offset_y; /* offset */
+ int max_anim;
int (*init) (struct _w3mimg_op * self);
int (*finish) (struct _w3mimg_op * self);
diff --git a/w3mimg/x11/x11_w3mimg.c b/w3mimg/x11/x11_w3mimg.c
index b2d928d..0be4cfe 100644
--- a/w3mimg/x11/x11_w3mimg.c
+++ b/w3mimg/x11/x11_w3mimg.c
@@ -1,4 +1,4 @@
-/* $Id: x11_w3mimg.c,v 1.12 2003/01/21 15:38:59 ukai Exp $ */
+/* $Id: x11_w3mimg.c,v 1.13 2003/03/24 15:46:00 ukai Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -294,6 +294,10 @@ x11_load_image(w3mimg_op * self, W3MImage * img, char *fname, int w, int h)
iw = gdk_pixbuf_animation_get_width(animation);
ih = gdk_pixbuf_animation_get_height(animation);
+ if (self->max_anim > 0) {
+ n = (self->max_anim > n)? n : self->max_anim;
+ }
+
if (w < 1 || h < 1) {
w = iw;
h = ih;