mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-04 23:35:58 +01:00
Update for 0.51.0
This commit is contained in:
@@ -4,11 +4,13 @@ AUTOMAKE_OPTIONS = no-dependencies
|
||||
|
||||
lib_LTLIBRARIES = libwraster.la
|
||||
|
||||
libwraster_la_LDFLAGS = -version-info 1:1:0
|
||||
libwraster_la_LDFLAGS = -version-info 1:1:1
|
||||
|
||||
noinst_PROGRAMS = test testgrad testdraw view
|
||||
bin_SCRIPTS = get-wraster-flags
|
||||
|
||||
EXTRA_DIST = test.png tile.xpm ballot_box.xpm ballot_box.tiff
|
||||
noinst_PROGRAMS = testgrad testdraw view
|
||||
|
||||
EXTRA_DIST = test.png tile.xpm ballot_box.xpm
|
||||
|
||||
include_HEADERS = wraster.h
|
||||
|
||||
@@ -35,7 +37,7 @@ libwraster_la_SOURCES = \
|
||||
gif.c
|
||||
|
||||
|
||||
INCLUDES = @DFLAGS@ @XCFLAGS@ @GFXFLAGS@ @XSHM@
|
||||
INCLUDES = @DFLAGS@ @XCFLAGS@ @GFXFLAGS@
|
||||
|
||||
LIBLIST = libwraster.la @GFXLFLAGS@ @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
|
||||
@@ -43,10 +45,6 @@ view_SOURCES= view.c
|
||||
|
||||
view_LDADD = $(LIBLIST)
|
||||
|
||||
test_SOURCES = test.c
|
||||
|
||||
test_LDADD = $(LIBLIST)
|
||||
|
||||
testgrad_SOURCES = testgrad.c
|
||||
|
||||
testgrad_LDADD = $(LIBLIST)
|
||||
|
||||
@@ -65,8 +65,6 @@ DFLAGS = @DFLAGS@
|
||||
GFXFLAGS = @GFXFLAGS@
|
||||
GFXLFLAGS = @GFXLFLAGS@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
I18N = @I18N@
|
||||
I18N_MB = @I18N_MB@
|
||||
ICONEXT = @ICONEXT@
|
||||
INTLIBS = @INTLIBS@
|
||||
LD = @LD@
|
||||
@@ -79,30 +77,26 @@ NLSDIR = @NLSDIR@
|
||||
NM = @NM@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
REDUCE_APPICONS = @REDUCE_APPICONS@
|
||||
SHAPE = @SHAPE@
|
||||
SOUND = @SOUND@
|
||||
VERSION = @VERSION@
|
||||
WPMOFILES = @WPMOFILES@
|
||||
XCFLAGS = @XCFLAGS@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XLFLAGS = @XLFLAGS@
|
||||
XLIBS = @XLIBS@
|
||||
XSHM = @XSHM@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LOCALE = @X_LOCALE@
|
||||
pixmapdir = @pixmapdir@
|
||||
wprefsdir = @wprefsdir@
|
||||
|
||||
AUTOMAKE_OPTIONS = no-dependencies
|
||||
|
||||
lib_LTLIBRARIES = libwraster.la
|
||||
|
||||
libwraster_la_LDFLAGS = -version-info 1:1:0
|
||||
libwraster_la_LDFLAGS = -version-info 1:1:1
|
||||
|
||||
noinst_PROGRAMS = test testgrad testdraw view
|
||||
bin_SCRIPTS = get-wraster-flags
|
||||
|
||||
EXTRA_DIST = test.png tile.xpm ballot_box.xpm ballot_box.tiff
|
||||
noinst_PROGRAMS = testgrad testdraw view
|
||||
|
||||
EXTRA_DIST = test.png tile.xpm ballot_box.xpm
|
||||
|
||||
include_HEADERS = wraster.h
|
||||
|
||||
@@ -128,7 +122,7 @@ libwraster_la_SOURCES = \
|
||||
tiff.c \
|
||||
gif.c
|
||||
|
||||
INCLUDES = @DFLAGS@ @XCFLAGS@ @GFXFLAGS@ @XSHM@
|
||||
INCLUDES = @DFLAGS@ @XCFLAGS@ @GFXFLAGS@
|
||||
|
||||
LIBLIST = libwraster.la @GFXLFLAGS@ @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
|
||||
|
||||
@@ -136,10 +130,6 @@ view_SOURCES= view.c
|
||||
|
||||
view_LDADD = $(LIBLIST)
|
||||
|
||||
test_SOURCES = test.c
|
||||
|
||||
test_LDADD = $(LIBLIST)
|
||||
|
||||
testgrad_SOURCES = testgrad.c
|
||||
|
||||
testgrad_LDADD = $(LIBLIST)
|
||||
@@ -169,9 +159,6 @@ convolve.lo nxpm.lo xpm.lo xutil.lo ppm.lo png.lo jpeg.lo tiff.lo \
|
||||
gif.lo
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
|
||||
test_OBJECTS = test.o
|
||||
test_DEPENDENCIES = libwraster.la
|
||||
test_LDFLAGS =
|
||||
testgrad_OBJECTS = testgrad.o
|
||||
testgrad_DEPENDENCIES = libwraster.la
|
||||
testgrad_LDFLAGS =
|
||||
@@ -181,6 +168,8 @@ testdraw_LDFLAGS =
|
||||
view_OBJECTS = view.o
|
||||
view_DEPENDENCIES = libwraster.la
|
||||
view_LDFLAGS =
|
||||
SCRIPTS = $(bin_SCRIPTS)
|
||||
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
@@ -195,10 +184,10 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
SOURCES = $(libwraster_la_SOURCES) $(test_SOURCES) $(testgrad_SOURCES) $(testdraw_SOURCES) $(view_SOURCES)
|
||||
OBJECTS = $(libwraster_la_OBJECTS) $(test_OBJECTS) $(testgrad_OBJECTS) $(testdraw_OBJECTS) $(view_OBJECTS)
|
||||
SOURCES = $(libwraster_la_SOURCES) $(testgrad_SOURCES) $(testdraw_SOURCES) $(view_SOURCES)
|
||||
OBJECTS = $(libwraster_la_OBJECTS) $(testgrad_OBJECTS) $(testdraw_OBJECTS) $(view_OBJECTS)
|
||||
|
||||
all: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS)
|
||||
all: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .lo .o .s
|
||||
@@ -285,10 +274,6 @@ distclean-noinstPROGRAMS:
|
||||
|
||||
maintainer-clean-noinstPROGRAMS:
|
||||
|
||||
test: $(test_OBJECTS) $(test_DEPENDENCIES)
|
||||
@rm -f test
|
||||
$(LINK) $(test_LDFLAGS) $(test_OBJECTS) $(test_LDADD) $(LIBS)
|
||||
|
||||
testgrad: $(testgrad_OBJECTS) $(testgrad_DEPENDENCIES)
|
||||
@rm -f testgrad
|
||||
$(LINK) $(testgrad_LDFLAGS) $(testgrad_OBJECTS) $(testgrad_LDADD) $(LIBS)
|
||||
@@ -301,6 +286,25 @@ view: $(view_OBJECTS) $(view_DEPENDENCIES)
|
||||
@rm -f view
|
||||
$(LINK) $(view_LDFLAGS) $(view_OBJECTS) $(view_LDADD) $(LIBS)
|
||||
|
||||
install-binSCRIPTS: $(bin_SCRIPTS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_SCRIPTS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
else if test -f $(srcdir)/$$p; then \
|
||||
echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
else :; fi; fi; \
|
||||
done
|
||||
|
||||
uninstall-binSCRIPTS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(bin_SCRIPTS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
done
|
||||
|
||||
install-includeHEADERS: $(include_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(includedir)
|
||||
@@ -357,7 +361,7 @@ dvi:
|
||||
check: all
|
||||
$(MAKE)
|
||||
installcheck:
|
||||
install-exec: install-libLTLIBRARIES
|
||||
install-exec: install-libLTLIBRARIES install-binSCRIPTS
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install-data: install-includeHEADERS
|
||||
@@ -366,12 +370,13 @@ install-data: install-includeHEADERS
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall: uninstall-libLTLIBRARIES uninstall-includeHEADERS
|
||||
uninstall: uninstall-libLTLIBRARIES uninstall-binSCRIPTS uninstall-includeHEADERS
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DATADIR)$(libdir) $(DATADIR)$(includedir)
|
||||
$(mkinstalldirs) $(DATADIR)$(libdir) $(DATADIR)$(bindir) \
|
||||
$(DATADIR)$(includedir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
@@ -416,12 +421,12 @@ distclean-compile clean-compile maintainer-clean-compile \
|
||||
mostlyclean-libtool distclean-libtool clean-libtool \
|
||||
maintainer-clean-libtool mostlyclean-noinstPROGRAMS \
|
||||
distclean-noinstPROGRAMS clean-noinstPROGRAMS \
|
||||
maintainer-clean-noinstPROGRAMS uninstall-includeHEADERS \
|
||||
install-includeHEADERS tags mostlyclean-tags distclean-tags clean-tags \
|
||||
maintainer-clean-tags distdir info dvi installcheck install-exec \
|
||||
install-data install uninstall all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
maintainer-clean-noinstPROGRAMS uninstall-binSCRIPTS install-binSCRIPTS \
|
||||
uninstall-includeHEADERS install-includeHEADERS tags mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
|
||||
installcheck install-exec install-data install uninstall all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
|
||||
Binary file not shown.
@@ -716,12 +716,12 @@ RGetClosestXColor(RContext *context, RColor *color, XColor *retColor)
|
||||
gtable = computeTable(gmask);
|
||||
btable = computeTable(bmask);
|
||||
|
||||
retColor->pixel = (rtable[color->red]<<roffs) |
|
||||
(rtable[color->green]<<goffs) | (rtable[color->blue]<<boffs);
|
||||
retColor->pixel = (rtable[color->red]<<roffs) |
|
||||
(gtable[color->green]<<goffs) | (btable[color->blue]<<boffs);
|
||||
|
||||
retColor->red = rtable[color->red] << 8;
|
||||
retColor->green = rtable[color->green] << 8;
|
||||
retColor->blue = rtable[color->blue] << 8;
|
||||
retColor->red = color->red << 8;
|
||||
retColor->green = color->green << 8;
|
||||
retColor->blue = color->blue << 8;
|
||||
retColor->flags = DoRed|DoGreen|DoBlue;
|
||||
|
||||
} else if (context->vclass == PseudoColor || context->vclass == StaticColor) {
|
||||
|
||||
@@ -159,11 +159,11 @@ RLoadJPEG(RContext *context, char *file_name, int index)
|
||||
while (cinfo.output_scanline < cinfo.output_height) {
|
||||
jpeg_read_scanlines(&cinfo, buffer,(JDIMENSION) 1);
|
||||
for (i=0,j=0; i<cinfo.image_width; i++) {
|
||||
if(cinfo.out_color_space==JCS_RGB) {
|
||||
if (cinfo.out_color_space==JCS_RGB) {
|
||||
*(r++) = buffer[0][j++];
|
||||
*(g++) = buffer[0][j++];
|
||||
*(b++) = buffer[0][j++];}
|
||||
else {
|
||||
*(b++) = buffer[0][j++];
|
||||
} else {
|
||||
*(r++) = *(g++) = *(b++) = buffer[0][j++];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ RMessageForError(int errorCode)
|
||||
return "invalid or corrupted image file";
|
||||
break;
|
||||
case RERR_BADFORMAT:
|
||||
return "unsupported image format";
|
||||
return "the image format in the file is not supported and can't be loaded";
|
||||
break;
|
||||
case RERR_BADINDEX:
|
||||
return "image file does not contain requested image index";
|
||||
|
||||
@@ -154,10 +154,9 @@ RLoadPNG(RContext *context, char *file, int index)
|
||||
if (sgamma==0)
|
||||
sgamma = 1;
|
||||
} else {
|
||||
/*
|
||||
/* no, this is correct. Old gimp versions are broken and save wrong
|
||||
* data. Upgrade gimp */
|
||||
sgamma = 2.0;
|
||||
*/
|
||||
sgamma = 1.0;
|
||||
}
|
||||
|
||||
if (png_get_gAMA(png, pinfo, &gamma))
|
||||
|
||||
84
wrlib/test.c
84
wrlib/test.c
@@ -1,84 +0,0 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include "wraster.h"
|
||||
#include <stdio.h>
|
||||
|
||||
Display *dpy;
|
||||
Window win;
|
||||
RContext *ctx;
|
||||
RImage *img, *tile, *new, *mini, *tiled;
|
||||
Pixmap pix;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
RContextAttributes attr;
|
||||
int a=0;
|
||||
|
||||
if (argc<1) {
|
||||
puts("You must supply t,p or x as the file type to load");
|
||||
puts("t is tiff, p is png and x is xpm");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (argc>1) {
|
||||
if (argv[1][0]=='t')
|
||||
a=1;
|
||||
else if (argv[1][0]=='p')
|
||||
a=2;
|
||||
else a=0;
|
||||
}
|
||||
|
||||
dpy = XOpenDisplay("");
|
||||
if (!dpy) {
|
||||
puts("cant open display");
|
||||
exit(1);
|
||||
}
|
||||
win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10, 250, 250,
|
||||
0, 0, 0);
|
||||
XMapRaised(dpy, win);
|
||||
XFlush(dpy);
|
||||
attr.flags = RC_RenderMode | RC_ColorsPerChannel | RC_DefaultVisual;
|
||||
|
||||
attr.render_mode = RM_DITHER;
|
||||
attr.colors_per_channel = 4;
|
||||
ctx = RCreateContext(dpy, DefaultScreen(dpy), &attr);
|
||||
#ifdef USE_TIFF
|
||||
if (a==1)
|
||||
img = RLoadImage(ctx, "ballot_box.tiff", 0);
|
||||
#endif
|
||||
#ifdef USE_PNG
|
||||
if (a==2)
|
||||
img = RLoadImage(ctx, "test.png", 0);
|
||||
#endif
|
||||
#ifdef USE_XPM
|
||||
if (a==0)
|
||||
img = RLoadImage(ctx, "ballot_box.xpm", 0);
|
||||
#endif
|
||||
|
||||
if (!img) {
|
||||
puts(RMessageForError(RErrorCode));
|
||||
exit(1);
|
||||
}
|
||||
new = RLoadImage(ctx, "tile.xpm", 0);
|
||||
if (!new) {
|
||||
puts(RMessageForError(RErrorCode));
|
||||
exit(1);
|
||||
}
|
||||
RCombineArea(new, img, 0, 0, img->width, img->height, 8, 8);
|
||||
RConvertImage(ctx, new, &pix);
|
||||
XCopyArea(dpy, pix, win, ctx->copy_gc, 0, 0, new->width, new->height,
|
||||
0, 0);
|
||||
|
||||
mini = RScaleImage(new, 20, 20);
|
||||
RConvertImage(ctx, mini, &pix);
|
||||
XCopyArea(dpy, pix, win, ctx->copy_gc, 0, 0, 20, 20,
|
||||
new->width, new->height);
|
||||
|
||||
tiled = RMakeTiledImage(img, 160, 160);
|
||||
RConvertImage(ctx, tiled, &pix);
|
||||
XCopyArea(dpy, pix, win, ctx->copy_gc, 0, 0, 160, 160,
|
||||
new->width+mini->width, new->height+mini->height);
|
||||
|
||||
XFlush(dpy);
|
||||
getchar();
|
||||
}
|
||||
@@ -552,4 +552,5 @@ int main(int argc, char **argv)
|
||||
/* benchmark();*/
|
||||
|
||||
getchar();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,16 @@ int main(int argc, char **argv)
|
||||
RConvertImage(ctx, imgd, &pix);
|
||||
XCopyArea(dpy, pix, win, ctx->copy_gc, 0, 0, 250, 250, 500, 0);
|
||||
|
||||
{
|
||||
GC gc;
|
||||
|
||||
gc = DefaultGC(dpy, DefaultScreen(dpy));
|
||||
|
||||
XSetTile(dpy, gc, ParentRelative);
|
||||
}
|
||||
|
||||
XFlush(dpy);
|
||||
#endif
|
||||
getchar();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include "wraster.h"
|
||||
#include <stdlib.h>
|
||||
@@ -23,7 +22,6 @@ int main(int argc, char **argv)
|
||||
attr.render_mode = RM_DITHER;
|
||||
attr.colors_per_channel = 4;
|
||||
ctx = RCreateContext(dpy, DefaultScreen(dpy), &attr);
|
||||
|
||||
if (argc<2)
|
||||
img = RGetImageFromXPMData(ctx, image_name);
|
||||
else
|
||||
|
||||
@@ -42,10 +42,6 @@
|
||||
/* version of the header for the library: 0.11 */
|
||||
#define WRASTER_HEADER_VERSION 11
|
||||
|
||||
#ifdef HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
Reference in New Issue
Block a user