aboutsummaryrefslogtreecommitdiffstats
path: root/rc.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-01-31 17:54:47 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-01-31 17:54:47 +0000
commit9efbc0885687b07cfe35e5933ebcc202aeff6bef (patch)
tree03909b91dc1b5c7b0074bea51a549b357b8b9694 /rc.c
parentversion.c.in: 0.2.5+cvs (diff)
downloadw3m-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--rc.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/rc.c b/rc.c
index 4666273..a572e28 100644
--- a/rc.c
+++ b/rc.c
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.37 2002/01/25 15:13:55 ukai Exp $ */
+/* $Id: rc.c,v 1.38 2002/01/31 17:54:56 ukai Exp $ */
/*
* Initialization file etc.
*/
@@ -52,11 +52,13 @@ static char *config_file = NULL;
#endif
#define P_PIXELS 8
#define P_NZINT 9
+#define P_SCALE 10
#if LANG == JA
#define CMT_HELPER "外部ビューアの編集"
#define CMT_TABSTOP "タブ幅"
#define CMT_PIXEL_PER_CHAR "文字幅 (4.0...32.0)"
+#define CMT_PIXEL_PER_LINE "一行の高さ (4.0...64.0)"
#define CMT_PAGERLINE "ページャとして利用した時に保存される行数"
#define CMT_HISTSIZE "保持するURL履歴の数"
#define CMT_SAVEHIST "URL履歴の保存"
@@ -65,6 +67,14 @@ static char *config_file = NULL;
#define CMT_ARGV_IS_URL "scheme のない引数も URL とみなす"
#define CMT_TSELF "targetが未指定の場合に_selfを使用する"
#define CMT_DISPLINK "リンク先の自動表示"
+#ifdef USE_IMAGE
+#define CMT_DISP_IMAGE "インライン画像を表示"
+#define CMT_AUTO_IMAGE "インライン画像を自動で読み込む"
+#define CMT_EXT_IMAGE_VIEWER "画像を外部ビューワで表示"
+#define CMT_IMAGE_SCALE "画像のスケール(%)"
+#define CMT_IMGDISPLAY "画像を表示するためのコマンド"
+#define CMT_IMGSIZE "画像の大きさを得るためのコマンド"
+#endif
#define CMT_MULTICOL "ファイル名のマルチカラム表示"
#define CMT_ALT_ENTITY "エンティティを ASCII の代替表現で表す"
#define CMT_FOLD_TEXTAREA "TEXTAREA の行を折り返して表示"
@@ -181,6 +191,7 @@ static char *config_file = NULL;
#define CMT_HELPER "External Viewer Setup"
#define CMT_TABSTOP "Tab width"
#define CMT_PIXEL_PER_CHAR "# of pixels per character (4.0...32.0)"
+#define CMT_PIXEL_PER_LINE "# of pixels per line (4.0...64.0)"
#define CMT_PAGERLINE "# of reserved line when w3m is used as a pager"
#define CMT_HISTSIZE "# of reserved URL"
#define CMT_SAVEHIST "Save URL history"
@@ -189,6 +200,14 @@ static char *config_file = NULL;
#define CMT_ARGV_IS_URL "Force argument without scheme to URL"
#define CMT_TSELF "Use _self as default target"
#define CMT_DISPLINK "Automatic display of link URL"
+#ifdef USE_IMAGE
+#define CMT_DISP_IMAGE "Display of inline image"
+#define CMT_AUTO_IMAGE "Automatic loading of inline image"
+#define CMT_EXT_IMAGE_VIEWER "Use external image viewer"
+#define CMT_IMAGE_SCALE "Scale of image (%)"
+#define CMT_IMGDISPLAY "External command to display image"
+#define CMT_IMGSIZE "External command to get size of image"
+#endif
#define CMT_MULTICOL "Multi-column output of file names"
#define CMT_ALT_ENTITY "Use alternate expression with ASCII for entity"
#define CMT_FOLD_TEXTAREA "Fold lines of TEXTAREA"
@@ -413,6 +432,10 @@ struct param_ptr params1[] = {
{"tabstop", P_NZINT, PI_TEXT, (void *)&Tabstop, CMT_TABSTOP, NULL},
{"pixel_per_char", P_PIXELS, PI_TEXT, (void *)&pixel_per_char,
CMT_PIXEL_PER_CHAR, NULL},
+#ifdef USE_IMAGE
+ {"pixel_per_line", P_PIXELS, PI_TEXT, (void *)&pixel_per_line,
+ CMT_PIXEL_PER_LINE, NULL},
+#endif
#ifdef JP_CHARSET
{"kanjicode", P_CODE, PI_SEL_C, (void *)&DisplayCode, CMT_KANJICODE,
kcodestr},
@@ -438,6 +461,18 @@ struct param_ptr params1[] = {
CMT_IGNORE_NULL_IMG_ALT, NULL},
{"view_unseenobject", P_INT, PI_ONOFF, (void *)&view_unseenobject,
CMT_VIEW_UNSEENOBJECTS, NULL},
+#ifdef USE_IMAGE
+ {"display_image", P_INT, PI_ONOFF, (void *)&displayImage, CMT_DISP_IMAGE,
+ NULL},
+ {"auto_image", P_INT, PI_ONOFF, (void *)&autoImage, CMT_AUTO_IMAGE, NULL},
+ {"ext_image_viewer", P_INT, PI_ONOFF, (void *)&useExtImageViewer,
+ CMT_EXT_IMAGE_VIEWER, NULL},
+ {"image_scale", P_SCALE, PI_TEXT, (void *)&image_scale, CMT_IMAGE_SCALE,
+ NULL},
+ {"imgdisplay", P_STRING, PI_TEXT, (void *)&Imgdisplay, CMT_IMGDISPLAY,
+ NULL},
+ {"imgsize", P_STRING, PI_TEXT, (void *)&Imgsize, CMT_IMGSIZE, NULL},
+#endif
{"show_lnum", P_INT, PI_ONOFF, (void *)&showLineNum, CMT_SHOW_NUM, NULL},
{"show_srch_str", P_INT, PI_ONOFF, (void *)&show_srch_str,
CMT_SHOW_SRCH_STR, NULL},
@@ -818,6 +853,9 @@ show_params(FILE * fp)
case P_PIXELS:
t = "number";
break;
+ case P_SCALE:
+ t = "percent";
+ break;
}
#ifdef JP_CHARSET
if (InnerCode != DisplayCode)
@@ -1019,7 +1057,12 @@ set_param(char *name, char *value)
#endif
case P_PIXELS:
ppc = atof(value);
- if (ppc >= MINIMUM_PIXEL_PER_CHAR && ppc <= MAXIMUM_PIXEL_PER_CHAR)
+ if (ppc >= MINIMUM_PIXEL_PER_CHAR && ppc <= MAXIMUM_PIXEL_PER_CHAR * 2)
+ *(double *)p->varptr = ppc;
+ break;
+ case P_SCALE:
+ ppc = atof(value);
+ if (ppc >= 10 && ppc <= 1000)
*(double *)p->varptr = ppc;
break;
}
@@ -1159,6 +1202,10 @@ sync_with_option(void)
#ifdef USE_MIGEMO
init_migemo();
#endif
+#ifdef USE_IMAGE
+ if (fmInitialized && displayImage)
+ initImage();
+#endif
if (AcceptLang == NULL || *AcceptLang == '\0') {
#if LANG == JA
@@ -1261,6 +1308,7 @@ to_str(struct param_ptr *p)
#endif
return Strnew_charp(*(char **)p->varptr);
case P_PIXELS:
+ case P_SCALE:
return Sprintf("%g", *(double *)p->varptr);
}
/* not reached */