diff --git a/Makefile b/Makefile index 6ef84fe1d..4c355dd41 100644 --- a/Makefile +++ b/Makefile @@ -85,6 +85,7 @@ endif # standard includes KPDFREADER_CFLAGS=$(CFLAGS) -I$(LUADIR)/src -I$(MUPDFDIR)/ +K2PDFOPT_CFLAGS=-I$(MUPDFDIR)/ -I$(DJVUDIR)/ -I$(K2PDFOPTLIBDIR)/ # enable tracing output: @@ -166,11 +167,14 @@ slider_watcher: slider_watcher.o $(POPENNSLIB) ft.o: %.o: %.c $(THIRDPARTYLIBS) $(CC) -c $(KPDFREADER_CFLAGS) -I$(FREETYPEDIR)/include -I$(MUPDFDIR)/fitz $< -o $@ -kpdfview.o pdf.o blitbuffer.o util.o drawcontext.o koptcontext.o einkfb.o input.o mupdfimg.o: %.o: %.c +blitbuffer.o util.o drawcontext.o einkfb.o input.o mupdfimg.o: %.o: %.c $(CC) -c $(KPDFREADER_CFLAGS) $(EMU_CFLAGS) -I$(LFSDIR)/src $< -o $@ +kpdfview.o koptcontext.o pdf.o: %.o: %.c + $(CC) -c $(KPDFREADER_CFLAGS) $(K2PDFOPT_CFLAGS) $(EMU_CFLAGS) -I$(LFSDIR)/src $< -o $@ + djvu.o: %.o: %.c - $(CC) -c $(KPDFREADER_CFLAGS) -I$(DJVUDIR)/ $< -o $@ + $(CC) -c $(KPDFREADER_CFLAGS) $(K2PDFOPT_CFLAGS) -I$(DJVUDIR)/ $< -o $@ pic.o: %.o: %.c $(CC) -c $(KPDFREADER_CFLAGS) $< -o $@ diff --git a/djvu.c b/djvu.c index 3874bdcfd..13a09f742 100644 --- a/djvu.c +++ b/djvu.c @@ -24,6 +24,7 @@ #include "blitbuffer.h" #include "drawcontext.h" #include "koptcontext.h" +#include "k2pdfopt.h" #include "djvu.h" #define MIN(a, b) ((a) < (b) ? (a) : (b)) diff --git a/koptcontext.h b/koptcontext.h index 977f74210..d788f897e 100644 --- a/koptcontext.h +++ b/koptcontext.h @@ -21,33 +21,7 @@ #include #include #include - -typedef unsigned char uint8_t; -typedef struct KOPTContext { - int trim; - int wrap; - int indent; - int rotate; - int columns; - int offset_x; - int offset_y; - int dev_width; - int dev_height; - int page_width; - int page_height; - int straighten; - int justification; - - double zoom; - double margin; - double quality; - double contrast; - double defect_size; - double line_spacing; - double word_spacing; - - uint8_t *data; -} KOPTContext; +#include "k2pdfopt.h" int luaopen_koptcontext(lua_State *L); #endif diff --git a/pdf.c b/pdf.c index 528572565..d3dacbd0b 100644 --- a/pdf.c +++ b/pdf.c @@ -20,6 +20,7 @@ #include "blitbuffer.h" #include "drawcontext.h" #include "koptcontext.h" +#include "k2pdfopt.h" #include "pdf.h" #include #include