From 8566cfff1ec2c27f4232d3b9872239c0d0201501 Mon Sep 17 00:00:00 2001 From: NuPogodi Date: Sat, 19 May 2012 13:09:37 +0200 Subject: [PATCH 2/8] added cr3.css for files without one --- kpvcrlib/cr3.css | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 kpvcrlib/cr3.css diff --git a/kpvcrlib/cr3.css b/kpvcrlib/cr3.css new file mode 100644 index 000000000..4fd4e1d66 --- /dev/null +++ b/kpvcrlib/cr3.css @@ -0,0 +1,74 @@ +body { text-align: left; text-indent: 0px } +p { text-align: justify; text-indent: 2em; margin-top:0em; margin-bottom: 0em } + +empty-line { height: 1em } + +hr { height: 1px; /* background-color: #808080; */ margin-top: 0.5em; margin-bottom: 0.5em } + +sub { vertical-align: sub; font-size: 70% } +sup { vertical-align: super; font-size: 70% } +strong, b { font-weight: bold } +emphasis, i { font-style: italic } + +a { text-decoration: underline } +a[type="note"] { vertical-align: super; font-size: 70%; text-decoration: none } + +image { text-align: center; text-indent: 0px } +p image { display: inline } + +title p, subtitle p, h1 p, h2 p, h3 p, h4 p, h5 p, h6 p { text-align: center; text-indent: 0px } +cite p, epigraph p { text-align: left; text-indent: 0px } +v { text-align: left; text-indent: 0px } + +stanza + stanza { margin-top: 1em; } +stanza { margin-left: 30%; text-align: left; font-style: italic } +poem { margin-top: 1em; margin-bottom: 1em; text-indent: 0px } +text-author { font-weight: bold; font-style: italic; margin-left: 5%} +epigraph { margin-left: 25%; margin-right: 1em; text-align: left; text-indent: + 1px; font-style: italic; margin-top: 15px; margin-bottom: 25px } +cite { font-style: italic; margin-left: 5%; margin-right: 5%; text-align: justify; + margin-top: 20px; margin-bottom: 20px } + +title, h1, h2 { text-align: center; text-indent: 0px; font-weight: bold; hyphenate: none; + page-break-before: always; page-break-inside: avoid; page-break-after: avoid; } +subtitle, h3, h4, h5, h6 { text-align: center; text-indent: 0px; font-weight: bold; + hyphenate: none; page-break-inside: avoid; page-break-after: avoid; } +title { font-size: 110%; margin-top: 0.7em; margin-bottom: 0.5em } +subtitle { font-style: italic; margin-top: 0.3em; margin-bottom: 0.3em } +h1 { font-size: 150% } +h2 { font-size: 140% } +h3 { font-size: 130% } +h4 { font-size: 120% } +h5 { font-size: 110% } + + +table { font-size: 80% } +td, th { text-indent: 0px; padding: 3px } +th { font-weight: bold; /* background-color: #DDD */ } +table > caption { text-indent: 0px; padding: 4px; /* background-color: #EEE */ } + +code, pre { display: block; white-space: pre; text-align: left; + font-family: "Droid Sans Mono", monospace; text-align: left } + +body[name="notes"] { font-size: 70%; } +body[name="notes"] section title { display: run-in; text-align: left; font-size: 110%; + font-weight: bold; page-break-before: auto; page-break-inside: auto; + page-break-after: auto; } +body[name="notes"] section title p { display: inline } + +description { display: block; } +title-info { display: block; } +annotation { margin-left: 5%; margin-right: 5%; font-size: 80%; font-style: italic; + text-align: justify; text-indent: 2em } +date { display: block; font-size: 80%; font-style: italic; text-align: center } +genre { display: none; } +author { display: none; } +book-title { display: none; } +keywords { display: none; } +lang { display: none; } +src-lang { display: none; } +translator { display: none; } +document-info { display: none; } +publish-info { display: none; } +custom-info { display: none; } +coverpage { display: none } From 59e81a0345a8a8626973f0f21adac5b0be2d887f Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Fri, 13 Jul 2012 22:33:32 +0800 Subject: [PATCH 3/8] fix typo in makefile --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d58ac18d1..988904a5a 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ MUPDFDIR=mupdf MUPDFTARGET=build/debug MUPDFLIBDIR=$(MUPDFDIR)/$(MUPDFTARGET) DJVUDIR=djvulibre -KPVCRLIGDIR=kpvcrlib -CRENGINEDIR=$(KPVCRLIGDIR)/crengine +KPVCRLIBDIR=kpvcrlib +CRENGINEDIR=$(KPVCRLIBDIR)/crengine FREETYPEDIR=$(MUPDFDIR)/thirdparty/freetype-2.4.9 LFSDIR=luafilesystem @@ -160,7 +160,7 @@ cleanthirdparty: test -d $(CRENGINEDIR)/thirdparty/chmlib && make -C $(CRENGINEDIR)/thirdparty/chmlib clean || echo warn: chmlib folder not found test -d $(CRENGINEDIR)/thirdparty/libpng && (make -C $(CRENGINEDIR)/thirdparty/libpng clean) || echo warn: chmlib folder not found test -d $(CRENGINEDIR)/crengine && (make -C $(CRENGINEDIR)/crengine clean) || echo warn: chmlib folder not found - test -d $(KPVCRLIGDIR) && (make -C $(KPVCRLIGDIR) clean) || echo warn: chmlib folder not found + test -d $(KPVCRLIBDIR) && (make -C $(KPVCRLIBDIR) clean) || echo warn: chmlib folder not found -rm -rf $(DJVUDIR)/build -rm -f $(MUPDFDIR)/fontdump.host -rm -f $(MUPDFDIR)/cmapdump.host @@ -189,7 +189,7 @@ endif make -C $(DJVUDIR)/build $(CRENGINELIBS): - cd $(KPVCRLIGDIR) && rm -rf CMakeCache.txt CMakeFiles && \ + cd $(KPVCRLIBDIR) && rm -rf CMakeCache.txt CMakeFiles && \ CFLAGS="$(CFLAGS)" CC="$(CC)" CXX="$(CXX)" cmake . && \ make From 10e723896bf56d3bce927fddb13e52454c388bf7 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Fri, 13 Jul 2012 22:35:51 +0800 Subject: [PATCH 4/8] fix wrong warnning message in Makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 988904a5a..b7098d4b3 100644 --- a/Makefile +++ b/Makefile @@ -158,9 +158,9 @@ cleanthirdparty: -make -C $(MUPDFDIR) clean -make -C $(CRENGINEDIR)/thirdparty/antiword clean test -d $(CRENGINEDIR)/thirdparty/chmlib && make -C $(CRENGINEDIR)/thirdparty/chmlib clean || echo warn: chmlib folder not found - test -d $(CRENGINEDIR)/thirdparty/libpng && (make -C $(CRENGINEDIR)/thirdparty/libpng clean) || echo warn: chmlib folder not found - test -d $(CRENGINEDIR)/crengine && (make -C $(CRENGINEDIR)/crengine clean) || echo warn: chmlib folder not found - test -d $(KPVCRLIBDIR) && (make -C $(KPVCRLIBDIR) clean) || echo warn: chmlib folder not found + test -d $(CRENGINEDIR)/thirdparty/libpng && (make -C $(CRENGINEDIR)/thirdparty/libpng clean) || echo warn: libpng folder not found + test -d $(CRENGINEDIR)/crengine && (make -C $(CRENGINEDIR)/crengine clean) || echo warn: crengine folder not found + test -d $(KPVCRLIBDIR) && (make -C $(KPVCRLIBDIR) clean) || echo warn: kpvcrlib folder not found -rm -rf $(DJVUDIR)/build -rm -f $(MUPDFDIR)/fontdump.host -rm -f $(MUPDFDIR)/cmapdump.host From ae780a543b2ac57a29aa701a2c8e5277ca6aa8f9 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Sun, 15 Jul 2012 02:19:10 +0800 Subject: [PATCH 5/8] check mupdf's thirdparty libs' version --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b7098d4b3..bc1b6d9ce 100644 --- a/Makefile +++ b/Makefile @@ -143,7 +143,11 @@ fetchthirdparty: cd kpvcrlib/crengine/crengine/src && \ patch -N -p0 < ../../../lvrend_node_type_face.patch || true unzip mupdf-thirdparty.zip -d mupdf - # dirty patch in MuPDF's thirdparty liby for CREngine + # check mupdf's thirdparty libs' version, if not matched, remove the old one + # run make fetchthirdparty again to get the latest thirdparty libs. + test -d $(FREETYPEDIR) || ( echo "error: mupdf's thirdparty libs' version not match" ; \ + rm -rf mupdf-thirdparty.zip ; exit 1 ) + # dirty patch in MuPDF's thirdparty lib for CREngine cd mupdf/thirdparty/jpeg-*/ && \ patch -N -p0 < ../../../kpvcrlib/jpeg_compress_struct_size.patch &&\ patch -N -p0 < ../../../kpvcrlib/jpeg_decompress_struct_size.patch From 8ce1aef0af901f8a15429846a4b70fe4712a2050 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 11 Jun 2012 02:32:21 +0800 Subject: [PATCH 6/8] remove dependency on * and kill a warning --- djvu.c | 2 +- input.c | 9 +++++++++ input.h | 4 ---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/djvu.c b/djvu.c index d99f34431..53b1298ab 100644 --- a/djvu.c +++ b/djvu.c @@ -44,7 +44,7 @@ static int handle(lua_State *L, ddjvu_context_t *ctx, int wait) { const ddjvu_message_t *msg; if (!ctx) - return; + return -1; if (wait) msg = ddjvu_message_wait(ctx); while ((msg = ddjvu_message_peek(ctx))) diff --git a/input.c b/input.c index 86e53ca3f..87a1123fd 100644 --- a/input.c +++ b/input.c @@ -20,7 +20,12 @@ #include #include #include +#ifdef EMULATE_READER +#include +#define EV_KEY 0x01 +#else #include +#endif #include "input.h" #include #include @@ -138,6 +143,7 @@ static int openInputDevice(lua_State *L) { } static int closeInputDevices(lua_State *L) { +#ifndef EMULATE_READER int i; for(i=0; i -#endif - #include #include #include From e39bbd70775c0dd15d4c9d3c4c6cbad19afa186b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 9 Jun 2012 19:38:08 +0800 Subject: [PATCH 7/8] fixes for mac * per http://luajit.org/install.html, otherwise LuaJIT always fails to get desired memory chunk from mmap(2) * kill a warning of clang --- Makefile | 3 +++ pdf.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bc1b6d9ce..5a8bb3fe3 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,9 @@ ifdef EMULATE_READER -DEMULATE_READER_W=$(EMULATE_READER_W) \ -DEMULATE_READER_H=$(EMULATE_READER_H) EMU_LDFLAGS?=$(shell sdl-config --libs) + ifeq "$(shell uname -s -m)" "Darwin x86_64" + EMU_LDFLAGS += -pagezero_size 10000 -image_base 100000000 + endif else CFLAGS+= $(ARM_CFLAGS) endif diff --git a/pdf.c b/pdf.c index 4d9b086cd..0de2150d9 100644 --- a/pdf.c +++ b/pdf.c @@ -567,7 +567,7 @@ static int drawPage(lua_State *L) { } static int getCacheSize(lua_State *L) { - printf("## mupdf getCacheSize = %d\n", msize); + printf("## mupdf getCacheSize = %zu\n", msize); lua_pushnumber(L, msize); return 1; } From 77fece8ad932529deee62363d02022685150d031 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 13 Jun 2012 18:49:46 +0200 Subject: [PATCH 8/8] fix lua include path --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5a8bb3fe3..7561bbeb3 100644 --- a/Makefile +++ b/Makefile @@ -124,7 +124,7 @@ djvu.o: %.o: %.c $(CC) -c $(KPDFREADER_CFLAGS) -I$(DJVUDIR)/ $< -o $@ cre.o: %.o: %.cpp - $(CC) -c -I$(CRENGINEDIR)/crengine/include/ -Ilua/src $< -o $@ -lstdc++ + $(CC) -c -I$(CRENGINEDIR)/crengine/include/ -I$(LUADIR)/src $< -o $@ -lstdc++ lfs.o: $(LFSDIR)/src/lfs.c $(CC) -c $(CFLAGS) -I$(LUADIR)/src -I$(LFSDIR)/src $(LFSDIR)/src/lfs.c -o $@