[w3m-dev 03829] w3mimgdisplay -anim

* w3mimgdisplay.c (maxAnim): added, default 100
	(main): add --anim option, w_op->max_anim
* w3mimg/w3mimg.h (w3mimg_op): add max_anim
* w3mimg/fb/fb_gdkpixbuf.c (fb_image_load): add max_anim
* w3mimg/fb/fb_img.h (fb_image_load): add max_anim args
* w3mimg/fb/fb_imlib2.c (fb_image_load): add max_anim args
* w3mimg/fb/fb_w3mimg.c (w3mfb_load_image): pass max_anim
* w3mimg/x11/x11_w3mimg.c (x11_load_image): max_anim
From: Hiroyuki Ito <hito@crl.go.jp>
This commit is contained in:
Fumitoshi UKAI
2003-03-24 15:45:55 +00:00
parent aa96462650
commit b8b37f8727
8 changed files with 39 additions and 13 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);

View File

@@ -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;