Merge release 0.33 changes which were apparently missing in svn import.
This commit is contained in:
33
Makefile
33
Makefile
@@ -26,6 +26,7 @@
|
||||
#DEBUG=1
|
||||
#EFENCE=1
|
||||
#STATIC=1
|
||||
CTL_LANG=1
|
||||
|
||||
|
||||
CFLAGS = -Wall
|
||||
@@ -80,12 +81,23 @@ DISTNAME = $(PACKAGE)-$(VERSION)
|
||||
BIN_DISTFILES = COPYING README $(TARGETS)
|
||||
|
||||
|
||||
AUTO_CSRCS = scanner.c parser.tab.c bitblt_tables.c g4_tables.c
|
||||
AUTO_HDRS = parser.tab.h bitblt_tables.h g4_tables.h
|
||||
AUTO_CSRCS = bitblt_tables.c g4_tables.c
|
||||
AUTO_HDRS = bitblt_tables.h g4_tables.h
|
||||
|
||||
ifdef CTL_LANG
|
||||
AUTO_CSRCS += scanner.c parser.tab.c
|
||||
AUTO_HDRS += parser_tab.h
|
||||
AUTO_MISC = parser.output
|
||||
endif
|
||||
|
||||
|
||||
CFLAGS := $(CFLAGS) -DTUMBLE_VERSION=$(VERSION)
|
||||
CDEFINES = -DTUMBLE_VERSION=$(VERSION)
|
||||
|
||||
ifdef CTL_LANG
|
||||
CDEFINES += -DCTL_LANG
|
||||
endif
|
||||
|
||||
CFLAGS := $(CFLAGS) $(CDEFINES)
|
||||
|
||||
|
||||
-include Maketest
|
||||
@@ -94,13 +106,18 @@ CFLAGS := $(CFLAGS) -DTUMBLE_VERSION=$(VERSION)
|
||||
all: $(TARGETS) $(TEST_TARGETS)
|
||||
|
||||
|
||||
tumble: tumble.o semantics.o \
|
||||
TUMBLE_OBJS = tumble.o semantics.o \
|
||||
tumble_input.o tumble_tiff.o tumble_jpeg.o tumble_pbm.o \
|
||||
scanner.o parser.tab.o \
|
||||
bitblt.o bitblt_g4.o bitblt_tables.o g4_tables.o \
|
||||
pdf.o pdf_util.o pdf_prim.o pdf_name_tree.o \
|
||||
pdf_bookmark.o pdf_page_label.o \
|
||||
pdf_text.o pdf_g4.o pdf_jpeg.o
|
||||
|
||||
ifdef CTL_LANG
|
||||
TUMBLE_OBJS += scanner.o parser.tab.o
|
||||
endif
|
||||
|
||||
tumble: $(TUMBLE_OBJS)
|
||||
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
|
||||
ifndef DEBUG
|
||||
strip $@
|
||||
@@ -132,11 +149,11 @@ dist: $(DISTFILES)
|
||||
-rm -rf $(DISTNAME)
|
||||
|
||||
|
||||
rh-rel := $(shell sed 's/^Red Hat Linux release \([0-9][0-9]*\.[0-9][0-9]*\) (.*)/\1/' </etc/redhat-release)
|
||||
|
||||
bin-dist-rh: $(BIN_DISTFILES) /etc/redhat-release
|
||||
tar --gzip -chf $(DISTNAME)-rh${rh-rel}.tar.gz $(BIN_DISTFILES)
|
||||
tar --gzip -chf $(DISTNAME)-rh$(shell sed 's/^Red Hat Linux release \([0-9][0-9.]*\) (.*)/\1/' </etc/redhat-release).tar.gz $(BIN_DISTFILES)
|
||||
|
||||
bin-dist-fc: $(BIN_DISTFILES) /etc/fedora-release
|
||||
tar --gzip -chf $(DISTNAME)-fc$(shell sed 's/^Fedora Core release \([0-9][0-9.]*\) (.*)/\1/' </etc/fedora-release).tar.gz $(BIN_DISTFILES)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.d $(TARGETS) $(AUTO_CSRCS) $(AUTO_HDRS) $(AUTO_MISC)
|
||||
|
||||
114
bitblt_test.c
114
bitblt_test.c
@@ -1,114 +0,0 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "bitblt.h"
|
||||
|
||||
|
||||
#define WIDTH 44
|
||||
#define HEIGHT 9
|
||||
|
||||
char test_data [HEIGHT][WIDTH] =
|
||||
{
|
||||
".....XXXXXXXXXX.......XX............X......X",
|
||||
".....XX.......X.......X.X..........X......X.",
|
||||
"XXXXXX.X......XXXXXX..X..X........X......X..",
|
||||
".....X..X.....X.......XX.........X......X...",
|
||||
".....X...X....X.......X.X.......X......X....",
|
||||
".....X....X...X.......X..X.....X......X.....",
|
||||
".....X.....X..X.......XX..... X......X......",
|
||||
".....XXXXXXXXXX.......X.X....X......X.......",
|
||||
".....X.X.X.X.X........X..X..X......X........"
|
||||
};
|
||||
|
||||
Bitmap *setup (void)
|
||||
{
|
||||
Bitmap *b;
|
||||
Point p;
|
||||
Rect r = {{ 0, 0 }, { WIDTH, HEIGHT }};
|
||||
|
||||
b = create_bitmap (& r);
|
||||
if (! b)
|
||||
return (NULL);
|
||||
|
||||
for (p.y = 0; p.y < HEIGHT; p.y++)
|
||||
for (p.x = 0; p.x < WIDTH; p.x++)
|
||||
set_pixel (b, p, test_data [p.y][p.x] == 'X');
|
||||
|
||||
return (b);
|
||||
}
|
||||
|
||||
void print_bitmap (FILE *o, Bitmap *b)
|
||||
{
|
||||
Point p;
|
||||
printf ("row_words: %d\n", b->row_words);
|
||||
for (p.y = b->rect.min.y; p.y < b->rect.max.y; p.y++)
|
||||
{
|
||||
for (p.x = b->rect.min.x; p.x < b->rect.max.x; p.x++)
|
||||
fputc (".X" [get_pixel (b, p)], o);
|
||||
fprintf (o, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
Bitmap *b;
|
||||
Bitmap *b2;
|
||||
Rect r;
|
||||
Point p;
|
||||
|
||||
b = setup ();
|
||||
if (! b)
|
||||
{
|
||||
fprintf (stderr, "setup failed\n");
|
||||
exit (2);
|
||||
}
|
||||
|
||||
print_bitmap (stdout, b);
|
||||
printf ("\n");
|
||||
|
||||
flip_v (b);
|
||||
|
||||
printf ("flipped vertically:\n");
|
||||
print_bitmap (stdout, b);
|
||||
printf ("\n");
|
||||
|
||||
flip_h (b);
|
||||
|
||||
printf ("flipped horizontally:\n");
|
||||
print_bitmap (stdout, b);
|
||||
printf ("\n");
|
||||
|
||||
#if 1
|
||||
r.min.x = r.min.y = 0;
|
||||
r.max.x = b->rect.max.x + 8;
|
||||
r.max.y = b->rect.max.y + 8;
|
||||
|
||||
b2 = create_bitmap (& r);
|
||||
|
||||
r.min.x = r.min.y = 0;
|
||||
r.max.x = b->rect.max.x;
|
||||
r.max.y = b->rect.max.y;
|
||||
|
||||
p.x = -3;
|
||||
p.y = -3;
|
||||
|
||||
b2 = bitblt (b, & r,
|
||||
b2, & p,
|
||||
TF_SRC, 0);
|
||||
if (! b2)
|
||||
{
|
||||
fprintf (stderr, "bitblt failed\n");
|
||||
exit (2);
|
||||
}
|
||||
|
||||
printf ("after bitblt\n");
|
||||
print_bitmap (stdout, b2);
|
||||
#endif
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,11 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "semantics.h"
|
||||
|
||||
#ifdef CTL_LANG
|
||||
#include "parser.tab.h"
|
||||
#endif
|
||||
|
||||
#include "tumble.h"
|
||||
|
||||
|
||||
@@ -596,6 +600,7 @@ static inline int range_count (range_t range)
|
||||
}
|
||||
|
||||
|
||||
#ifdef CTL_LANG
|
||||
bool parse_control_file (char *fn)
|
||||
{
|
||||
bool result = 0;
|
||||
@@ -736,3 +741,4 @@ bool process_controls (void)
|
||||
page_index++;
|
||||
}
|
||||
}
|
||||
#endif /* CTL_LANG */
|
||||
|
||||
8
tumble.c
8
tumble.c
@@ -32,7 +32,11 @@
|
||||
|
||||
|
||||
#include "semantics.h"
|
||||
|
||||
#ifdef CTL_LANG
|
||||
#include "parser.tab.h"
|
||||
#endif
|
||||
|
||||
#include "tumble.h"
|
||||
#include "bitblt.h"
|
||||
#include "pdf.h"
|
||||
@@ -73,7 +77,9 @@ void usage (void)
|
||||
fprintf (stderr, "http://tumble.brouhaha.com/\n");
|
||||
fprintf (stderr, "\n");
|
||||
fprintf (stderr, "usage:\n");
|
||||
#ifdef CTL_LANG
|
||||
fprintf (stderr, " %s [options] -c <control.tum>\n", progname);
|
||||
#endif
|
||||
fprintf (stderr, " %s [options] <input.tif>... -o <output.pdf>\n", progname);
|
||||
fprintf (stderr, "options:\n");
|
||||
fprintf (stderr, " -v verbose\n");
|
||||
@@ -389,6 +395,7 @@ int main (int argc, char *argv[])
|
||||
else
|
||||
fatal (1, "missing filename after \"-o\" option\n");
|
||||
}
|
||||
#ifdef CTL_LANG
|
||||
else if (strcmp (argv [1], "-c") == 0)
|
||||
{
|
||||
if (argc)
|
||||
@@ -400,6 +407,7 @@ int main (int argc, char *argv[])
|
||||
else
|
||||
fatal (1, "missing filename after \"-s\" option\n");
|
||||
}
|
||||
#endif
|
||||
else if (strcmp (argv [1], "-b") == 0)
|
||||
{
|
||||
if (argc)
|
||||
|
||||
Reference in New Issue
Block a user