[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:
14
ChangeLog
14
ChangeLog
@@ -1,3 +1,15 @@
|
|||||||
|
2003-03-25 Hiroyuki Ito <hito@crl.go.jp>
|
||||||
|
|
||||||
|
* [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
|
||||||
|
|
||||||
2003-03-24 Daiki Ueno <ueno@unixuser.org>
|
2003-03-24 Daiki Ueno <ueno@unixuser.org>
|
||||||
|
|
||||||
* [w3m-dev 03828] possible typo in nextA
|
* [w3m-dev 03828] possible typo in nextA
|
||||||
@@ -7568,4 +7580,4 @@ a * [w3m-dev 03276] compile error on EWS4800
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-0.2.1
|
* import w3m-0.2.1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.800 2003/03/23 15:21:01 ukai Exp $
|
$Id: ChangeLog,v 1.801 2003/03/24 15:45:55 ukai Exp $
|
||||||
|
@@ -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
|
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 **
|
||||||
fb_image_load(char *filename, int w, int h)
|
fb_image_load(char *filename, int w, int h, int max_anim)
|
||||||
{
|
{
|
||||||
GdkPixbufAnimation *animation;
|
GdkPixbufAnimation *animation;
|
||||||
GList *frames;
|
GList *frames;
|
||||||
@@ -44,6 +44,9 @@ fb_image_load(char *filename, int w, int h)
|
|||||||
fw = gdk_pixbuf_animation_get_width(animation);
|
fw = gdk_pixbuf_animation_get_width(animation);
|
||||||
fh = gdk_pixbuf_animation_get_height(animation);
|
fh = gdk_pixbuf_animation_get_height(animation);
|
||||||
n = gdk_pixbuf_animation_get_num_frames(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) {
|
if (w < 1 || h < 1) {
|
||||||
w = fw;
|
w = fw;
|
||||||
h = fh;
|
h = fh;
|
||||||
|
@@ -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
|
#ifndef fb_img_header
|
||||||
#define fb_img_header
|
#define fb_img_header
|
||||||
#include "fb.h"
|
#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);
|
void fb_image_set_bg(int r, int g, int b);
|
||||||
int get_image_size(char *filename, int *w, int *h);
|
int get_image_size(char *filename, int *w, int *h);
|
||||||
|
|
||||||
|
@@ -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
|
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 **
|
||||||
fb_image_load(char *filename, int w, int h)
|
fb_image_load(char *filename, int w, int h, int n)
|
||||||
{
|
{
|
||||||
Imlib_Image image;
|
Imlib_Image image;
|
||||||
FB_IMAGE **frame;
|
FB_IMAGE **frame;
|
||||||
|
@@ -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 <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.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)
|
if (self == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
im = fb_image_load(fname, w, h);
|
im = fb_image_load(fname, w, h, self->max_anim);
|
||||||
if (!im)
|
if (!im)
|
||||||
return 0;
|
return 0;
|
||||||
img->pixmap = im;
|
img->pixmap = im;
|
||||||
|
@@ -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"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef USE_W3MIMG_FB
|
#ifdef USE_W3MIMG_FB
|
||||||
@@ -16,6 +16,7 @@ typedef struct _w3mimg_op {
|
|||||||
void *priv; /* driver specific data */
|
void *priv; /* driver specific data */
|
||||||
int width, height; /* window width, height */
|
int width, height; /* window width, height */
|
||||||
int offset_x, offset_y; /* offset */
|
int offset_x, offset_y; /* offset */
|
||||||
|
int max_anim;
|
||||||
|
|
||||||
int (*init) (struct _w3mimg_op * self);
|
int (*init) (struct _w3mimg_op * self);
|
||||||
int (*finish) (struct _w3mimg_op * self);
|
int (*finish) (struct _w3mimg_op * self);
|
||||||
|
@@ -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 <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.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);
|
iw = gdk_pixbuf_animation_get_width(animation);
|
||||||
ih = gdk_pixbuf_animation_get_height(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) {
|
if (w < 1 || h < 1) {
|
||||||
w = iw;
|
w = iw;
|
||||||
h = ih;
|
h = ih;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: w3mimgdisplay.c,v 1.12 2003/01/17 16:57:21 ukai Exp $ */
|
/* $Id: w3mimgdisplay.c,v 1.13 2003/03/24 15:45:57 ukai Exp $ */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -17,7 +17,7 @@ static char *defined_size = NULL;
|
|||||||
|
|
||||||
#define MAX_IMAGE 1000
|
#define MAX_IMAGE 1000
|
||||||
static W3MImage *imageBuf = NULL;
|
static W3MImage *imageBuf = NULL;
|
||||||
static int maxImage = 0;
|
static int maxImage = 0, maxAnim = 100;
|
||||||
|
|
||||||
static void GetOption(int argc, char **argv);
|
static void GetOption(int argc, char **argv);
|
||||||
static void DrawImage(char *buf, int redraw);
|
static void DrawImage(char *buf, int redraw);
|
||||||
@@ -57,6 +57,7 @@ main(int argc, char **argv)
|
|||||||
w_op->offset_x = offset_x;
|
w_op->offset_x = offset_x;
|
||||||
if (defined_y)
|
if (defined_y)
|
||||||
w_op->offset_y = offset_y;
|
w_op->offset_y = offset_y;
|
||||||
|
w_op->max_anim = maxAnim;
|
||||||
|
|
||||||
if (defined_test) {
|
if (defined_test) {
|
||||||
printf("%d %d\n", w_op->width - w_op->offset_x,
|
printf("%d %d\n", w_op->width - w_op->offset_x,
|
||||||
@@ -177,6 +178,11 @@ GetOption(int argc, char **argv)
|
|||||||
else if (!strcmp("-test", argv[i])) {
|
else if (!strcmp("-test", argv[i])) {
|
||||||
defined_test = 1;
|
defined_test = 1;
|
||||||
}
|
}
|
||||||
|
else if (!strcmp("-anim", argv[i])) {
|
||||||
|
if (++i >= argc)
|
||||||
|
exit(1);
|
||||||
|
maxAnim = atoi(argv[i]);
|
||||||
|
}
|
||||||
else if (!strcmp("-size", argv[i])) {
|
else if (!strcmp("-size", argv[i])) {
|
||||||
if (++i >= argc)
|
if (++i >= argc)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Reference in New Issue
Block a user