[w3m-dev 03167] xface2xbm -> xface2xpm (current imlib can't handle XBM)
* configure: s/XFACE2XBM/XFACE2XPM/ * config.h.dist: ditto * file.c (xface2xpm): renamed from xface2xbm modified for xpm (readHeader): s/xface2xbm/xface2xpm/ * scripts/Makefile (LIB_TARGETS): s/xface2xbm/xface2xpm/ * scripts/xface2xpm.in: added From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
@@ -1,3 +1,14 @@
|
|||||||
|
2002-04-09 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
|
* [w3m-dev 03167] xface2xbm -> xface2xpm (current imlib can't handle XBM)
|
||||||
|
* configure: s/XFACE2XBM/XFACE2XPM/
|
||||||
|
* config.h.dist: ditto
|
||||||
|
* file.c (xface2xpm): renamed from xface2xbm
|
||||||
|
modified for xpm
|
||||||
|
(readHeader): s/xface2xbm/xface2xpm/
|
||||||
|
* scripts/Makefile (LIB_TARGETS): s/xface2xbm/xface2xpm/
|
||||||
|
* scripts/xface2xpm.in: added
|
||||||
|
|
||||||
2002-03-30 Fumitoshi UKAI <ukai@debian.or.jp>
|
2002-03-30 Fumitoshi UKAI <ukai@debian.or.jp>
|
||||||
|
|
||||||
* [w3m-dev 03162] Re: "ttp:" is marked instead of "http:" by MARL_URL
|
* [w3m-dev 03162] Re: "ttp:" is marked instead of "http:" by MARL_URL
|
||||||
@@ -3323,4 +3334,4 @@
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-0.2.1
|
* import w3m-0.2.1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.367 2002/04/09 04:34:36 ukai Exp $
|
$Id: ChangeLog,v 1.368 2002/04/09 14:45:58 ukai Exp $
|
||||||
|
|||||||
+1
-1
@@ -147,7 +147,7 @@ MODEL=Linux.i686-monster-ja
|
|||||||
#define W3MCONFIG "w3mconfig"
|
#define W3MCONFIG "w3mconfig"
|
||||||
#define IMGSIZE "w3mimgsize"
|
#define IMGSIZE "w3mimgsize"
|
||||||
#define IMGDISPLAY "w3mimgdisplay"
|
#define IMGDISPLAY "w3mimgdisplay"
|
||||||
#define XFACE2XBM "xface2xbm"
|
#define XFACE2XPM "xface2xpm"
|
||||||
|
|
||||||
#define RC_DIR "~/.w3m"
|
#define RC_DIR "~/.w3m"
|
||||||
#define BOOKMARK "bookmark.html"
|
#define BOOKMARK "bookmark.html"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# $Id: configure,v 1.66 2002/03/19 16:27:20 ukai Exp $
|
# $Id: configure,v 1.67 2002/04/09 14:45:58 ukai Exp $
|
||||||
# Configuration.
|
# Configuration.
|
||||||
#
|
#
|
||||||
|
|
||||||
@@ -2170,7 +2170,7 @@ $def_use_xface
|
|||||||
#define W3MCONFIG "w3mconfig"
|
#define W3MCONFIG "w3mconfig"
|
||||||
#define IMGSIZE "w3mimgsize"
|
#define IMGSIZE "w3mimgsize"
|
||||||
#define IMGDISPLAY "w3mimgdisplay"
|
#define IMGDISPLAY "w3mimgdisplay"
|
||||||
#define XFACE2XBM "xface2xbm"
|
#define XFACE2XPM "xface2xpm"
|
||||||
|
|
||||||
#define RC_DIR "~/.w3m"
|
#define RC_DIR "~/.w3m"
|
||||||
#define BOOKMARK "bookmark.html"
|
#define BOOKMARK "bookmark.html"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: file.c,v 1.88 2002/03/19 15:54:47 ukai Exp $ */
|
/* $Id: file.c,v 1.89 2002/04/09 14:45:58 ukai Exp $ */
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "myctype.h"
|
#include "myctype.h"
|
||||||
@@ -507,22 +507,24 @@ matchattr(char *p, char *attr, int len, Str *value)
|
|||||||
#ifdef USE_IMAGE
|
#ifdef USE_IMAGE
|
||||||
#ifdef USE_XFACE
|
#ifdef USE_XFACE
|
||||||
static char *
|
static char *
|
||||||
xface2xbm(char *xface)
|
xface2xpm(char *xface)
|
||||||
{
|
{
|
||||||
char *xbm;
|
char *xpm;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
xbm = tmpfname(TMPF_DFL, ".xbm")->ptr;
|
xpm = tmpfname(TMPF_DFL, ".xpm")->ptr;
|
||||||
f = popen(Sprintf("%s - %s", libFile(XFACE2XBM), xbm)->ptr, "w");
|
f = popen(Sprintf("%s > %s", libFile(XFACE2XPM), xpm)->ptr, "w");
|
||||||
if (!f)
|
if (!f)
|
||||||
return NULL;
|
return NULL;
|
||||||
fprintf(f, "%s", xface);
|
fprintf(f, "%s", xface);
|
||||||
pclose(f);
|
pclose(f);
|
||||||
if (stat(xbm, &st))
|
if (stat(xpm, &st))
|
||||||
return NULL;
|
return NULL;
|
||||||
pushText(fileToDelete, xbm);
|
pushText(fileToDelete, xpm);
|
||||||
return xbm;
|
if (!st.st_size)
|
||||||
|
return NULL;
|
||||||
|
return xpm;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -631,7 +633,7 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
|
|||||||
URLFile f;
|
URLFile f;
|
||||||
Line *l;
|
Line *l;
|
||||||
|
|
||||||
tmpf = xface2xbm(&tmp->ptr[7]);
|
tmpf = xface2xpm(&tmp->ptr[7]);
|
||||||
if (tmpf) {
|
if (tmpf) {
|
||||||
src =
|
src =
|
||||||
Sprintf
|
Sprintf
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ LIB_DIR = $(prefix)/lib/w3m
|
|||||||
HELP_DIR = $(prefix)/lib/w3m
|
HELP_DIR = $(prefix)/lib/w3m
|
||||||
RC_DIR = ~/.w3m
|
RC_DIR = ~/.w3m
|
||||||
|
|
||||||
LIB_TARGETS = dirlist.cgi w3mhelp.cgi w3mmail.cgi xface2xbm
|
LIB_TARGETS = dirlist.cgi w3mhelp.cgi w3mmail.cgi xface2xpm
|
||||||
HELP_LIBS = w3mhelp-funcname.pl w3mhelp-funcdesc.pl
|
HELP_LIBS = w3mhelp-funcname.pl w3mhelp-funcdesc.pl
|
||||||
|
|
||||||
MKDIR = mkdir -p
|
MKDIR = mkdir -p
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
#!@PERL@
|
||||||
|
|
||||||
|
$USAGE = "xface2xpm [-t] [-fg <color>] [-bg <color>] [<file>]";
|
||||||
|
|
||||||
|
# compface/uncompface
|
||||||
|
# ftp://metalab.unc.edu/pub/Linux/apps/graphics/convert/
|
||||||
|
$UNCOMPFACE = "uncompface";
|
||||||
|
|
||||||
|
$T = "c";
|
||||||
|
$BG = "white";
|
||||||
|
$FG = "black";
|
||||||
|
while (@ARGV) {
|
||||||
|
$_ = shift @ARGV;
|
||||||
|
if (/^-h/) {
|
||||||
|
&usage(0);
|
||||||
|
} elsif (/^-t/) {
|
||||||
|
$T = "s";
|
||||||
|
$BG = "none";
|
||||||
|
} elsif (/^-bg/) {
|
||||||
|
@ARGV || &usage(1);
|
||||||
|
$BG = shift @ARGV;
|
||||||
|
} elsif (/^-fg/) {
|
||||||
|
@ARGV || &usage(1);
|
||||||
|
$FG = shift @ARGV;
|
||||||
|
} elsif (/^-./) {
|
||||||
|
&usage(1);
|
||||||
|
} else {
|
||||||
|
unshift(@ARGV, $_);
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$xf = "";
|
||||||
|
while(<>) {
|
||||||
|
# s/^X-Face://i if ($xf eq "");
|
||||||
|
$xf .= $_;
|
||||||
|
}
|
||||||
|
|
||||||
|
pipe(R, W2);
|
||||||
|
pipe(R2, W);
|
||||||
|
if (! fork()) {
|
||||||
|
close(R);
|
||||||
|
close(W);
|
||||||
|
open(STDIN, "<&R2");
|
||||||
|
open(STDOUT, ">&W2");
|
||||||
|
exec $UNCOMPFACE;
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
close(R2);
|
||||||
|
close(W2);
|
||||||
|
print W $xf;
|
||||||
|
close(W);
|
||||||
|
while(<R>) {
|
||||||
|
while(s/0x(..)(..)//) {
|
||||||
|
push(@bm, hex($1), hex($2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(R);
|
||||||
|
@bm || exit 1;
|
||||||
|
|
||||||
|
$W = 48;
|
||||||
|
$H = @bm * 8 / $W; # must be 48
|
||||||
|
print <<EOF;
|
||||||
|
/* XPM */
|
||||||
|
static char *xf[] = {
|
||||||
|
/* columns rows colors chars-per-pixel */
|
||||||
|
"$W $H 2 1",
|
||||||
|
" $T $BG",
|
||||||
|
". c $FG",
|
||||||
|
/* pixels */
|
||||||
|
EOF
|
||||||
|
while (@bm) {
|
||||||
|
print "\"";
|
||||||
|
for (1..6) {
|
||||||
|
$x = shift @bm;
|
||||||
|
for $i (1 .. 8) {
|
||||||
|
print ((($x >> (8-$i)) & 1) ? "." : " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print (@bm ? "\",\n" : "\"\n");
|
||||||
|
}
|
||||||
|
print <<EOF;
|
||||||
|
};
|
||||||
|
EOF
|
||||||
|
|
||||||
|
sub usage {
|
||||||
|
local($err) = @_;
|
||||||
|
if ($err) {
|
||||||
|
print STDERR "$USAGE\n";
|
||||||
|
} else {
|
||||||
|
print "$USAGE\n";
|
||||||
|
}
|
||||||
|
exit $err;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user