aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-01-28 16:40:58 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-01-28 16:40:58 +0000
commit58259b5c340410d6025e592d78db6f6987316d5e (patch)
tree4007807744841a5a0f7462102f992e760059ce72
parent[w3m-dev 03705] goodict.cgi (was: Re: google.cgi (was: Re: keymap key SEARCH ... (diff)
downloadw3m-58259b5c340410d6025e592d78db6f6987316d5e.tar.gz
w3m-58259b5c340410d6025e592d78db6f6987316d5e.zip
[w3m-dev 03706] X-Image-URL: support, bug fix of reshapeBuffer()
* buffer.c (reshapeBuffer): rewrite * file.c (readHeader): rewrite From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
-rw-r--r--ChangeLog8
-rw-r--r--buffer.c37
-rw-r--r--file.c44
3 files changed, 57 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index 706dc1d..53983a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2003-01-29 NAKAJIMA Mikio <minakaji@osaka.email.ne.jp>
+ * [w3m-dev 03706] X-Image-URL: support, bug fix of reshapeBuffer()
+ * buffer.c (reshapeBuffer): rewrite
+ * file.c (readHeader): rewrite
+
+2003-01-29 NAKAJIMA Mikio <minakaji@osaka.email.ne.jp>
+
* [w3m-dev 03705] goodict.cgi (was: Re: google.cgi (was: Re: keymap key SEARCH string))
* Bonus/goodict.cgi: added
@@ -6886,4 +6892,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.720 2003/01/28 16:36:49 ukai Exp $
+$Id: ChangeLog,v 1.721 2003/01/28 16:40:58 ukai Exp $
diff --git a/buffer.c b/buffer.c
index d350e22..2c986ed 100644
--- a/buffer.c
+++ b/buffer.c
@@ -1,4 +1,4 @@
-/* $Id: buffer.c,v 1.24 2003/01/25 18:06:25 ukai Exp $ */
+/* $Id: buffer.c,v 1.25 2003/01/28 16:41:03 ukai Exp $ */
#include "fm.h"
#ifdef USE_MOUSE
@@ -527,10 +527,6 @@ reshapeBuffer(Buffer *buf)
buf->imarklist->nmark = 0;
buf->width = INIT_BUFFER_WIDTH;
-#ifdef JP_CHARSET
- UseContentCharset = FALSE;
- UseAutoDetect = FALSE;
-#endif
if (buf->header_source) {
if (buf->currentURL.scheme != SCM_LOCAL ||
buf->mailcap_source || !strcmp(buf->currentURL.file, "-")) {
@@ -546,6 +542,10 @@ reshapeBuffer(Buffer *buf)
readHeader(&f, buf, TRUE, NULL);
}
+#ifdef JP_CHARSET
+ UseContentCharset = FALSE;
+ UseAutoDetect = FALSE;
+#endif
if (!strcasecmp(buf->type, "text/html"))
loadHTMLBuffer(&f, buf);
else
@@ -558,20 +558,27 @@ reshapeBuffer(Buffer *buf)
buf->height = LASTLINE + 1;
if (buf->firstLine && sbuf.firstLine) {
+ Line *cur = sbuf.currentLine;
int n;
- buf->pos = sbuf.pos;
- if (sbuf.currentLine)
- buf->pos += sbuf.currentLine->bpos;
- while (sbuf.currentLine->bpos && sbuf.currentLine->prev)
- sbuf.currentLine = sbuf.currentLine->prev;
- gotoRealLine(buf, sbuf.currentLine->real_linenumber);
+
+ buf->pos = sbuf.pos + cur->bpos;
+ while (cur->bpos && cur->prev)
+ cur = cur->prev;
+ if (cur->real_linenumber > 0)
+ gotoRealLine(buf, cur->real_linenumber);
+ else
+ gotoLine(buf, cur->linenumber);
n = (buf->currentLine->linenumber - buf->topLine->linenumber)
- - (sbuf.currentLine->linenumber - sbuf.topLine->linenumber);
+ - (cur->linenumber - sbuf.topLine->linenumber);
if (n) {
buf->topLine = lineSkip(buf, buf->topLine, n, FALSE);
- gotoRealLine(buf, sbuf.currentLine->real_linenumber);
+ if (cur->real_linenumber > 0)
+ gotoRealLine(buf, cur->real_linenumber);
+ else
+ gotoLine(buf, cur->linenumber);
}
- if (FoldLine)
+ buf->pos -= buf->currentLine->bpos;
+ if (FoldLine && strcasecmp(buf->type, "text/html"))
buf->currentColumn = 0;
else
buf->currentColumn = sbuf.currentColumn;
@@ -582,6 +589,8 @@ reshapeBuffer(Buffer *buf)
#ifdef USE_NNTP
if (buf->check_url & CHK_NMID)
chkNMIDBuffer(buf);
+ if (buf->real_scheme == SCM_NNTP || buf->real_scheme == SCM_NEWS)
+ reAnchorNewsheader(buf);
#endif
formResetBuffer(buf, sbuf.formitem);
}
diff --git a/file.c b/file.c
index 22c81c9..ccc1566 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.209 2003/01/24 17:57:54 ukai Exp $ */
+/* $Id: file.c,v 1.210 2003/01/28 16:41:05 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -669,24 +669,34 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
for (; *q && (*q == '\r' || *q == '\n'); q++) ;
}
#ifdef USE_IMAGE
+ if (thru && activeImage && displayImage) {
+ Str src = NULL;
+ if (!strncasecmp(tmp->ptr, "X-Image-URL:", 12)) {
+ tmpf = &tmp->ptr[12];
+ SKIP_BLANKS(tmpf);
+ src = Strnew_m_charp("<img src=\"", html_quote(tmpf),
+ "\" alt=\"X-Image-URL\">", NULL);
+ }
#ifdef USE_XFACE
- if (thru && activeImage && displayImage &&
- !strncasecmp(tmp->ptr, "X-Face:", 7) &&
- (tmpf = xface2xpm(&tmp->ptr[7])) != NULL) {
- Str src;
- URLFile f;
- Line *l;
-
- src = Strnew_m_charp("<img src=\"file:", html_quote(tmpf),
- "\" alt=\"X-Face\" width=48 height=48>",
- NULL);
- init_stream(&f, SCM_LOCAL, newStrStream(src));
- loadHTMLstream(&f, newBuf, NULL, TRUE);
- for (l = newBuf->lastLine; l && l->real_linenumber;
- l = l->prev)
- l->real_linenumber = 0;
- }
+ else if (!strncasecmp(tmp->ptr, "X-Face:", 7)) {
+ tmpf = xface2xpm(&tmp->ptr[7]);
+ if (tmpf)
+ src = Strnew_m_charp("<img src=\"file:",
+ html_quote(tmpf),
+ "\" alt=\"X-Face\"",
+ " width=48 height=48>", NULL);
+ }
#endif
+ if (src) {
+ URLFile f;
+ Line *l;
+ init_stream(&f, SCM_LOCAL, newStrStream(src));
+ loadHTMLstream(&f, newBuf, NULL, TRUE);
+ for (l = newBuf->lastLine; l && l->real_linenumber;
+ l = l->prev)
+ l->real_linenumber = 0;
+ }
+ }
#endif
lineBuf2 = tmp;
}