diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-31 17:54:47 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-01-31 17:54:47 +0000 |
commit | 9efbc0885687b07cfe35e5933ebcc202aeff6bef (patch) | |
tree | 03909b91dc1b5c7b0074bea51a549b357b8b9694 /fm.h | |
parent | version.c.in: 0.2.5+cvs (diff) | |
download | w3m-9efbc0885687b07cfe35e5933ebcc202aeff6bef.tar.gz w3m-9efbc0885687b07cfe35e5933ebcc202aeff6bef.zip |
w3m-img merge (w3m-0.2.4+cvs-1.278-img-2.2.patch.gz)
* NEWS: w3m-img merge
* .cvsignore: add w3mimgdisplay, w3mimgsize
* XMakefile: add image.c to SRCS
add image.o to OBJS
add IMGDISPLAY, IMGSIZE
* config.h.dist: USE_IMAGE, IMGSIZE, IMGDISPLAY
* configure: add find_imlib
ask use_image
(config.h) add $imgtarget to EXT_TARGETS
$def_use_image
IMGSIZE, IMGDISPLAY
* fm.h (MAX_IMAGE): added
* fm.h (DEFAULT_PIXEL_PER_CHAR): fix for USE_IMAGE
* fm.h (DEFAULT_PIXEL_PER_LINE): added
* fm.h (B_REDRAW_IMAGE): added
* fm.h (IMG_FLAG_SKIP): added
* fm.h (IMG_FLAG_AUTO): added
* fm.h (IMG_FLAG_START): added
* fm.h (IMG_FLAG_STOP): added
* fm.h (IMG_FLAG_NEXT): added
* fm.h (IMG_FLAG_UNLOADED): added
* fm.h (IMG_FLAG_LOADED): added
* fm.h (IMG_FLAG_ERROR): added
* fm.h (MapArea): added
* fm.h (MapList): s/urls/alts/, add area
* fm.h (ImageCache): added
* fm.h (Image): added
* fm.h (Anchor): add image
* fm.h (Buffer): add imarklist, image_flag, need_reshape
* fm.h (RG_FRAME_SRC): added
* fm.h (ALIGN_MIDDLE): added
* fm.h (ALIGN_TOP): added
* fm.h (ALIGN_BOTTOM): added
* fm.h (QuietMessage): added
* fm.h (Imgdisplay): added
* fm.h (Imgsize): added
* fm.h (activeImage): added
* fm.h (displayImage): added
* fm.h (autoImage): added
* fm.h (useExtImageViewer): added
* fm.h (image_source): added
* fm.h (view_unseenobject): change default if USE_IMAGE
* fm.h (set_pixel_per_char): added
* fm.h (pixel_per_line): added
* fm.h (set_pixel_per_line): added
* fm.h (image_scale): added
* proto.h (dispI): added
* proto.h (stopI): added
* proto.h (deleteImage): added
* proto.h (getAllImage): added
* proto.h (loadImage): added
* proto.h (getImage): added
* proto.h (getImageSize): added
* proto.h (process_img): add width arg
* proto.h (loadImageBuffer): added
* proto.h (follow_map_menu): add a_img arg
* proto.h (getMapXY): added
* proto.h (newMapArea): added
* proto.h (touch_cursor): added
* proto.h (cURLcode): added
* proto.h (initImage): added
* proto.h (termImage): added
* proto.h (addImage): added
* proto.h (drawImage): added
* proto.h (clearImage): added
* anchor.c (addMultirowsImg): added
* buffer.c (discardBuffer): deleteImage if USE_IMAGE
* buffer.c (reshapeBuffer): buf->need_reshape check
* display.c (fmTerm): if activeImage, stop load image
* display.c (fmInit): if displayImage, initImage
* display.c (image_touch): added
* display.c (draw_image_flag): added
* display.c (redrawLineImage): added
* display.c (displayBuffer): buf->need_reshape = TRUE
mode == B_REDRAW_IMAGE
image flag checks
force redraw image in mode == B_REDRAW_IMAGE
displayBuffer if need reshape
drawImage
* display.c (redrawNLine): redrawLineImage
* display.c (redrawLineImage): added
* display.c (disp_message_nsec): return immediately if QuietMessage
* etc.c (reset_signals): ignore SIGUSR1
* file.c (frame_source): added
* file.c (_MoveFile): added
* file.c (cur_baseURL): added
* file.c (cur_document_code): added
* file.c (cur_iseq): added
* file.c (loadGeneralFile): fix fmInitialized and prevtrap checks
save cur_baseURL
image_source load
loadImageBuffer for "image/*"
frame_source flag
fix b->type when proc is loadImageBuffer
* file.c (process_img): add width arg
parse height and width attr, align
fix for inline-image
* file.c (process_input): fix for form <input type="image">
* file.c (HTMLtagproc1): pass h_env->limit to process_img()
fix <img_alt> for inline-image
save cur_baseURL
* file.c (HTMLlineproc2body): fix <img_alt> for inline-image
* file.c (loadHTMLstream): fix for inline-image
fix fmInitialized and prevtrap checks
save cur_document_code
save image_flag
* file.c (loadGopherDir): save cur_document_code
fix fmInitialized and prevtrap checks
* file.c (loadImageBuffer): added for inline-image
* file.c (save2tmp): fix fmInitialized and prevtrap checks
* frame.c (frame_download_source): set RG_FRAME_SRC flag
image check
* funcname.tab (DISPLAY_IMAGE): added
* funcname.tab (STOP_IMAGE): added
* html.c (ALST_IMG): add align, ismap
* html.c (ALST_AREA): add shape, coords
* html.c (ALST_IMG_ALT): add width, height, usemap, ismap, hseq,
xoffset, yoffset, top_margin, bottom_margin
* html.c (AttrMap): add shape, coords, ismap, xoffset, yoffset
* html.h (ATTR_SHAPE): added
* html.h (ATTR_COORDS): added
* html.h (ATTR_ISMAP): added
* html.h (ATTR_XOFFSET): added
* html.h (ATTR_YOFFSET): added
* html.h (ATTR_TOP_MARGIN): added
* html.h (ATTR_BOTTOM_MARGIN): added
* html.h (SHAPE_UNKNOWN): added
* html.h (SHAPE_DEFAULT): added
* html.h (SHAPE_RECT): added
* html.h (SHAPE_CIRCLE): added
* html.h (SHAPE_POLY): added
* image.c: added
* main.c (fversion): add USE_IMAGE
* main.c (fusage): -ppl option
* main.c (MAIN): set_pixel_per_char if ppc specified
-ppl option
loadImage
* main.c (pushBuffer): deleteImage
* main.c (quitfm): termImage
* main.c (selBuf): deleteImage
* main.c (followA): fix for inline-image and map area
* main.c (query_from_followform): getMapXY()
* main.c (setOpt): displayBuffer B_REDRAW_IMAGE
* main.c (follow_map): fix calculate x, y
* main.c (dispI): added
* main.c (stopI): added
* map.c: include <math.h>
* map.c (inMapArea): added
* map.c (follow_map_menu): add a_img arg to handle inline-image
* map.c (follow_map_panel): use MapArea
* map.c (getMapXY): added
* map.c (newMapArea): added
* menu.c (smChBuf): deleteImage
* parsetagx.c (toAlign): align top, bottom, middle
* rc.c (P_SCALE): added
* rc.c (CMT_PIXEL_PER_LINE): added
* rc.c (CMT_DISP_IMAGE): added
* rc.c (CMT_AUTO_IMAGE): added
* rc.c (CMT_EXT_IMAGE_VIEWER): added
* rc.c (CMT_IMAGE_SCALE): added
* rc.c (CMT_IMGDISPLAY): added
* rc.c (CMT_IMGSIZE): added
* rc.c (show_param): P_PIXELS
* rc.c (set_param): P_PIXELS
* rc.c (sync_with_option): initImage
* rc.c (to_str): P_PIXELS
* table.c (feed_table_tag): fix <img> for inline-image
* tagtable.tab (image): added
* terms.c (wgetch): retry read when EINTR or EAGAIN
* terms.c (touch_cursor): added
* w3mimgdisplay.c: added
* w3mimgsize.c: added
* doc/README.func (DISPLAY_IMAGE): added
* doc/README.func (STOP_IMAGE): added
* doc/README.img: added
* doc-jp/README.func (DISPLAY_IMAGE): added
* doc-jp/README.func (STOP_IMAGE): added
* doc-jp/README.img: added
* scripts/w3mhelp.cgi.in: show dispI, stopI
* scripts/multipart/multipart.cgi.in: inline image support
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to '')
-rw-r--r-- | fm.h | 95 |
1 files changed, 92 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $Id: fm.h,v 1.45 2002/01/31 03:55:35 ukai Exp $ */ +/* $Id: fm.h,v 1.46 2002/01/31 17:54:51 ukai Exp $ */ /* * w3m: WWW wo Miru utility * @@ -73,7 +73,14 @@ void bzero(void *, int); #define PAGER_MAX_LINE 10000 /* Maximum line kept as pager */ #define FNLEN 80 +#ifdef USE_IMAGE +#define MAX_IMAGE 1000 + +#define DEFAULT_PIXEL_PER_CHAR 7.0 /* arbitrary */ +#define DEFAULT_PIXEL_PER_LINE 14.0 /* arbitrary */ +#else #define DEFAULT_PIXEL_PER_CHAR 8.0 /* arbitrary */ +#endif #define MINIMUM_PIXEL_PER_CHAR 4.0 #define MAXIMUM_PIXEL_PER_CHAR 32.0 @@ -157,6 +164,7 @@ void bzero(void *, int); #define B_FORCE_REDRAW 1 #define B_REDRAW 2 #define B_SCROLL 3 +#define B_REDRAW_IMAGE 4 /* Buffer Property */ #define BP_NORMAL 0x0 @@ -219,6 +227,17 @@ extern int REV_LB[]; #define IN_URL 0x100 #define IN_CHAR 0x200 +#define IMG_FLAG_SKIP 1 +#define IMG_FLAG_AUTO 2 + +#define IMG_FLAG_START 0 +#define IMG_FLAG_STOP 1 +#define IMG_FLAG_NEXT 2 + +#define IMG_FLAG_UNLOADED 0 +#define IMG_FLAG_LOADED 1 +#define IMG_FLAG_ERROR 2 + /* * Macros. */ @@ -263,10 +282,21 @@ typedef unsigned short Lineprop; typedef unsigned char Linecolor; #endif +typedef struct _MapArea { + char *url; + char *alt; +#ifdef MENU_MAP +#ifdef USE_IMAGE + char shape; + short *coords; + int ncoords; +#endif +#endif +} MapArea; + typedef struct _MapList { Str name; - TextList *urls; - TextList *alts; + GeneralList *area; struct _MapList *next; } MapList; @@ -290,6 +320,33 @@ typedef struct { short pos; } BufferPoint; +#ifdef USE_IMAGE +typedef struct _imageCache { + char *url; + ParsedURL *current; + char *file; + char loaded; + int index; + short width; + short height; +} ImageCache; + +typedef struct _image { + char *url; + char *ext; + short width; + short height; + short xoffset; + short yoffset; + short y; + short rows; + char *map; + char ismap; + int touch; + ImageCache *cache; +} Image; +#endif + typedef struct _anchor { char *url; char *target; @@ -299,6 +356,9 @@ typedef struct _anchor { int hseq; short y; short rows; +#ifdef USE_IMAGE + Image *image; +#endif } Anchor; #define NO_REFERER ((char*)-1) @@ -347,6 +407,7 @@ typedef struct _Buffer { FormList *formlist; MapList *maplist; HmarkerList *hmarklist; + HmarkerList *imarklist; ParsedURL currentURL; ParsedURL *baseURL; char *baseTarget; @@ -371,6 +432,8 @@ typedef struct _Buffer { #ifdef USE_SSL char *ssl_certificate; #endif + char image_flag; + char need_reshape; } Buffer; @@ -515,6 +578,7 @@ struct readbuffer { /* flags for loadGeneralFile */ #define RG_NOCACHE 1 #define RG_FRAME 2 +#define RG_FRAME_SRC 4 struct html_feed_environ { struct readbuffer *obuf; @@ -587,6 +651,9 @@ struct cookie { #define ALIGN_CENTER 0 #define ALIGN_LEFT 1 #define ALIGN_RIGHT 2 +#define ALIGN_MIDDLE 4 +#define ALIGN_TOP 5 +#define ALIGN_BOTTOM 6 #define VALIGN_MIDDLE 0 #define VALIGN_TOP 1 @@ -647,6 +714,7 @@ global char ArgvIsURL init(FALSE); global char MetaRefresh init(FALSE); global char fmInitialized init(FALSE); +global char QuietMessage init(FALSE); extern char GlobalKeymap[]; extern char EscKeymap[]; @@ -746,6 +814,14 @@ global int displayLink init(FALSE); global int retryAsHttp init(TRUE); global int showLineNum init(FALSE); global int show_srch_str init(TRUE); +#ifdef USE_IMAGE +global char *Imgdisplay init(IMGDISPLAY); +global char *Imgsize init(IMGSIZE); +global int activeImage init(FALSE); +global int displayImage init(TRUE); +global int autoImage init(TRUE); +global int useExtImageViewer init(TRUE); +#endif global char *Editor init(DEF_EDITOR); #ifndef USE_W3MMAILER global char *Mailer init(DEF_MAILER); @@ -759,6 +835,9 @@ global char *ftppasswd init(NULL); global int ftppass_hostnamegen init(TRUE); #endif global int do_download init(FALSE); +#ifdef USE_IMAGE +global char *image_source init(NULL); +#endif global char *UserAgent init(NULL); global int NoSendReferer init(FALSE); global char *AcceptLang init(NULL); @@ -857,7 +936,11 @@ global TextList *Cookie_reject_domains; global TextList *Cookie_accept_domains; #endif /* USE_COOKIE */ +#ifdef USE_IMAGE +global int view_unseenobject init(FALSE); +#else global int view_unseenobject init(TRUE); +#endif #if defined(USE_SSL) && defined(USE_SSL_VERIFY) global int ssl_verify_server init(FALSE); @@ -875,6 +958,12 @@ global char *ssl_forbid_method init(NULL); global int is_redisplay init(FALSE); global int clear_buffer init(TRUE); global double pixel_per_char init(DEFAULT_PIXEL_PER_CHAR); +global int set_pixel_per_char init(FALSE); +#ifdef USE_IMAGE +global double pixel_per_line init(DEFAULT_PIXEL_PER_LINE); +global int set_pixel_per_line init(FALSE); +global double image_scale init(100); +#endif global int use_lessopen init(FALSE); #ifdef JP_CHARSET |