diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2011-05-31 14:16:28 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2011-06-01 15:52:36 +0200 |
commit | 5aaae3d936afc0aa4ff999b42b5a754c40885f75 (patch) | |
tree | ecac21a3197ccb813d2bd7dc48d7c26666787685 | |
parent | 1323675852c82c8dbc79b46d7bfd882e3282edc0 (diff) | |
download | mupdf-5aaae3d936afc0aa4ff999b42b5a754c40885f75.tar.xz |
Fix android build; bug 692222.
Bring the MuPDF android build up to date with the latest source changes.
Many thanks to Dominic Battre for his helpful report in bug 692222.
-rw-r--r-- | android/ReadMe.txt | 17 | ||||
-rw-r--r-- | android/jni/Android.mk | 2 | ||||
-rw-r--r-- | android/jni/Core.mk | 108 | ||||
-rw-r--r-- | android/jni/ThirdParty.mk | 247 | ||||
-rw-r--r-- | android/jni/mupdf.c | 24 | ||||
-rw-r--r-- | android/local.properties | 2 | ||||
-rw-r--r-- | android/src/com/artifex/mupdf/MuPDFCore.java | 10 | ||||
-rw-r--r-- | android/src/com/artifex/mupdf/PixmapView.java | 12 | ||||
-rw-r--r-- | fitz/fitz.h | 1 | ||||
-rw-r--r-- | fitz/res_pixmap.c | 10 | ||||
-rw-r--r-- | pdf/mupdf.h | 2 | ||||
-rw-r--r-- | pdf/pdf_xref.c | 2 |
12 files changed, 218 insertions, 219 deletions
diff --git a/android/ReadMe.txt b/android/ReadMe.txt index 6ac64346..cbc470d5 100644 --- a/android/ReadMe.txt +++ b/android/ReadMe.txt @@ -50,14 +50,11 @@ Click 'Create AVD' and wait for a minute or so while it is prepared. Now you can exit the GUI. 6) Now we are ready to build mupdf for Android. Check out a copy of MuPDF -(but you've done that already, cos you're reading this, right?). Get the -thirdparty package from mupdf.com and unpack that into mupdf/thirdparty. -Also get the pregen package from the same place and unpack that into -mupdf/pregen. +(but you've done that already, cos you're reading this, right?). -7) Load local.properties into your favourite editor, and edit the sdk -path there as appropriate. This should be the only bit of localisation -you need to do. +7) Change into the android directory, and edit local.properties into your +favourite editor. Change the sdk path there as appropriate. This should be +the only bit of localisation you need to do. 8) Change into the android directory, and execute (in a Cygwin window on Windows!): @@ -68,6 +65,10 @@ This should build the native code portion. Then execute: ant debug +or on windows under cygwin: + + ant.bat debug + This should build the java wrapper. 9) Now start the emulator by executing: @@ -83,7 +84,7 @@ done once). With the emulator running type: adb push ../../MyTests/pdf_reference17.pdf /mnt/sdcard/Download/test.pdf (where obviously ../../MyTests/pdf_reference17.pdf is altered for your -machine). +machine). (adb lives in <sdk>/platform-tools if it's not on your path). 11) With the emulator running (see step 9), execute diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 0291cded..2e84204e 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -11,7 +11,7 @@ include $(CLEAR_VARS) LOCAL_C_INCLUDES := \ $(MUPDF_ROOT)/draw \ $(MUPDF_ROOT)/fitz \ - $(MUPDF_ROOT)/mupdf + $(MUPDF_ROOT)/pdf LOCAL_CFLAGS := LOCAL_MODULE := mupdf LOCAL_SRC_FILES := mupdf.c diff --git a/android/jni/Core.mk b/android/jni/Core.mk index 92da2734..4c3e75b5 100644 --- a/android/jni/Core.mk +++ b/android/jni/Core.mk @@ -6,13 +6,14 @@ MY_ROOT := ../.. LOCAL_C_INCLUDES := \ ../thirdparty/jbig2dec \ - ../thirdparty/openjpeg/libopenjpeg \ - ../thirdparty/jpeg \ - ../thirdparty/zlib \ - ../thirdparty/freetype/include \ + ../thirdparty/openjpeg-1.4/libopenjpeg \ + ../thirdparty/jpeg-8c \ + ../thirdparty/zlib-1.2.5 \ + ../thirdparty/freetype-2.4.4/include \ ../draw \ ../fitz \ - ../mupdf \ + ../pdf \ + ../scripts \ .. LOCAL_MODULE := mupdfcore @@ -22,13 +23,14 @@ LOCAL_SRC_FILES := \ $(MY_ROOT)/fitz/base_getopt.c \ $(MY_ROOT)/fitz/base_hash.c \ $(MY_ROOT)/fitz/base_memory.c \ + $(MY_ROOT)/fitz/base_object.c \ $(MY_ROOT)/fitz/base_string.c \ $(MY_ROOT)/fitz/base_time.c \ $(MY_ROOT)/fitz/crypt_aes.c \ $(MY_ROOT)/fitz/crypt_arc4.c \ $(MY_ROOT)/fitz/crypt_md5.c \ + $(MY_ROOT)/fitz/crypt_sha2.c \ $(MY_ROOT)/fitz/dev_bbox.c \ - $(MY_ROOT)/fitz/dev_draw.c \ $(MY_ROOT)/fitz/dev_list.c \ $(MY_ROOT)/fitz/dev_null.c \ $(MY_ROOT)/fitz/dev_text.c \ @@ -41,10 +43,7 @@ LOCAL_SRC_FILES := \ $(MY_ROOT)/fitz/filt_jpxd.c \ $(MY_ROOT)/fitz/filt_lzwd.c \ $(MY_ROOT)/fitz/filt_predict.c \ - $(MY_ROOT)/fitz/obj_array.c \ - $(MY_ROOT)/fitz/obj_dict.c \ $(MY_ROOT)/fitz/obj_print.c \ - $(MY_ROOT)/fitz/obj_simple.c \ $(MY_ROOT)/fitz/res_colorspace.c \ $(MY_ROOT)/fitz/res_font.c \ $(MY_ROOT)/fitz/res_path.c \ @@ -54,57 +53,46 @@ LOCAL_SRC_FILES := \ $(MY_ROOT)/fitz/stm_buffer.c \ $(MY_ROOT)/fitz/stm_open.c \ $(MY_ROOT)/fitz/stm_read.c \ - $(MY_ROOT)/draw/archport.c \ - $(MY_ROOT)/draw/blendmodes.c \ - $(MY_ROOT)/draw/glyphcache.c \ - $(MY_ROOT)/draw/imagedraw.c \ - $(MY_ROOT)/draw/imagescale.c \ - $(MY_ROOT)/draw/imagesmooth.c \ - $(MY_ROOT)/draw/imageunpack.c \ - $(MY_ROOT)/draw/meshdraw.c \ - $(MY_ROOT)/draw/pathfill.c \ - $(MY_ROOT)/draw/pathscan.c \ - $(MY_ROOT)/draw/pathstroke.c \ - $(MY_ROOT)/draw/porterduff.c \ - $(MY_ROOT)/mupdf/pdf_annot.c \ - $(MY_ROOT)/mupdf/pdf_build.c \ - $(MY_ROOT)/mupdf/pdf_cmap.c \ - $(MY_ROOT)/mupdf/pdf_cmap_load.c \ - $(MY_ROOT)/mupdf/pdf_cmap_parse.c \ - $(MY_ROOT)/mupdf/pdf_cmap_table.c \ - $(MY_ROOT)/mupdf/pdf_colorspace.c \ - $(MY_ROOT)/mupdf/pdf_crypt.c \ - $(MY_ROOT)/mupdf/pdf_debug.c \ - $(MY_ROOT)/mupdf/pdf_font.c \ - $(MY_ROOT)/mupdf/pdf_fontagl.c \ - $(MY_ROOT)/mupdf/pdf_fontenc.c \ - $(MY_ROOT)/mupdf/pdf_fontfile.c \ - $(MY_ROOT)/mupdf/pdf_fontmtx.c \ - $(MY_ROOT)/mupdf/pdf_function.c \ - $(MY_ROOT)/mupdf/pdf_image.c \ - $(MY_ROOT)/mupdf/pdf_interpret.c \ - $(MY_ROOT)/mupdf/pdf_lex.c \ - $(MY_ROOT)/mupdf/pdf_nametree.c \ - $(MY_ROOT)/mupdf/pdf_outline.c \ - $(MY_ROOT)/mupdf/pdf_page.c \ - $(MY_ROOT)/mupdf/pdf_pagetree.c \ - $(MY_ROOT)/mupdf/pdf_parse.c \ - $(MY_ROOT)/mupdf/pdf_pattern.c \ - $(MY_ROOT)/mupdf/pdf_repair.c \ - $(MY_ROOT)/mupdf/pdf_shade.c \ - $(MY_ROOT)/mupdf/pdf_store.c \ - $(MY_ROOT)/mupdf/pdf_stream.c \ - $(MY_ROOT)/mupdf/pdf_type3.c \ - $(MY_ROOT)/mupdf/pdf_unicode.c \ - $(MY_ROOT)/mupdf/pdf_xobject.c \ - $(MY_ROOT)/mupdf/pdf_xref.c \ - $(MY_ROOT)/pregen/cmap_unicode.c \ - $(MY_ROOT)/pregen/cmap_cns.c \ - $(MY_ROOT)/pregen/cmap_gb.c \ - $(MY_ROOT)/pregen/cmap_japan.c \ - $(MY_ROOT)/pregen/cmap_korea.c \ - $(MY_ROOT)/pregen/font_base14.c \ - $(MY_ROOT)/pregen/font_cjk.c + $(MY_ROOT)/draw/arch_arm.c \ + $(MY_ROOT)/draw/arch_port.c \ + $(MY_ROOT)/draw/draw_affine.c \ + $(MY_ROOT)/draw/draw_blend.c \ + $(MY_ROOT)/draw/draw_device.c \ + $(MY_ROOT)/draw/draw_edge.c \ + $(MY_ROOT)/draw/draw_glyph.c \ + $(MY_ROOT)/draw/draw_mesh.c \ + $(MY_ROOT)/draw/draw_paint.c \ + $(MY_ROOT)/draw/draw_path.c \ + $(MY_ROOT)/draw/draw_scale.c \ + $(MY_ROOT)/draw/draw_unpack.c \ + $(MY_ROOT)/pdf/pdf_annot.c \ + $(MY_ROOT)/pdf/pdf_cmap.c \ + $(MY_ROOT)/pdf/pdf_cmap_load.c \ + $(MY_ROOT)/pdf/pdf_cmap_parse.c \ + $(MY_ROOT)/pdf/pdf_cmap_table.c \ + $(MY_ROOT)/pdf/pdf_colorspace.c \ + $(MY_ROOT)/pdf/pdf_crypt.c \ + $(MY_ROOT)/pdf/pdf_encoding.c \ + $(MY_ROOT)/pdf/pdf_font.c \ + $(MY_ROOT)/pdf/pdf_fontfile.c \ + $(MY_ROOT)/pdf/pdf_function.c \ + $(MY_ROOT)/pdf/pdf_image.c \ + $(MY_ROOT)/pdf/pdf_interpret.c \ + $(MY_ROOT)/pdf/pdf_lex.c \ + $(MY_ROOT)/pdf/pdf_metrics.c \ + $(MY_ROOT)/pdf/pdf_nametree.c \ + $(MY_ROOT)/pdf/pdf_outline.c \ + $(MY_ROOT)/pdf/pdf_page.c \ + $(MY_ROOT)/pdf/pdf_parse.c \ + $(MY_ROOT)/pdf/pdf_pattern.c \ + $(MY_ROOT)/pdf/pdf_repair.c \ + $(MY_ROOT)/pdf/pdf_shade.c \ + $(MY_ROOT)/pdf/pdf_store.c \ + $(MY_ROOT)/pdf/pdf_stream.c \ + $(MY_ROOT)/pdf/pdf_type3.c \ + $(MY_ROOT)/pdf/pdf_unicode.c \ + $(MY_ROOT)/pdf/pdf_xobject.c \ + $(MY_ROOT)/pdf/pdf_xref.c LOCAL_LDLIBS := -lm -llog -ljnigraphics diff --git a/android/jni/ThirdParty.mk b/android/jni/ThirdParty.mk index 94c2c0ab..2a50b05f 100644 --- a/android/jni/ThirdParty.mk +++ b/android/jni/ThirdParty.mk @@ -6,11 +6,12 @@ MY_ROOT := ../.. LOCAL_C_INCLUDES := \ ../thirdparty/jbig2dec \ - ../thirdparty/openjpeg/libopenjpeg \ - ../thirdparty/jpeg \ - ../thirdparty/zlib \ - ../thirdparty/freetype/include \ - + ../thirdparty/openjpeg-1.4/libopenjpeg \ + ../thirdparty/jpeg-8c \ + ../thirdparty/zlib-1.2.5 \ + ../thirdparty/freetype-2.4.4/include \ + ../scripts + LOCAL_CFLAGS := \ -DFT2_BUILD_LIBRARY -DDARWIN_NO_CARBON -DHAVE_STDINT_H @@ -30,123 +31,123 @@ LOCAL_SRC_FILES := \ $(MY_ROOT)/thirdparty/jbig2dec/jbig2_mmr.c \ $(MY_ROOT)/thirdparty/jbig2dec/jbig2_image.c \ $(MY_ROOT)/thirdparty/jbig2dec/jbig2_metadata.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/bio.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/cio.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/dwt.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/event.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/image.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/j2k.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/j2k_lib.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/jp2.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/jpt.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/mct.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/mqc.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/openjpeg.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/pi.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/raw.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/t1.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/t2.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/tcd.c \ - $(MY_ROOT)/thirdparty/openjpeg/libopenjpeg/tgt.c \ - $(MY_ROOT)/thirdparty/jpeg/jaricom.c \ - $(MY_ROOT)/thirdparty/jpeg/jcapimin.c \ - $(MY_ROOT)/thirdparty/jpeg/jcapistd.c \ - $(MY_ROOT)/thirdparty/jpeg/jcarith.c \ - $(MY_ROOT)/thirdparty/jpeg/jccoefct.c \ - $(MY_ROOT)/thirdparty/jpeg/jccolor.c \ - $(MY_ROOT)/thirdparty/jpeg/jcdctmgr.c \ - $(MY_ROOT)/thirdparty/jpeg/jchuff.c \ - $(MY_ROOT)/thirdparty/jpeg/jcinit.c \ - $(MY_ROOT)/thirdparty/jpeg/jcmainct.c \ - $(MY_ROOT)/thirdparty/jpeg/jcmarker.c \ - $(MY_ROOT)/thirdparty/jpeg/jcmaster.c \ - $(MY_ROOT)/thirdparty/jpeg/jcomapi.c \ - $(MY_ROOT)/thirdparty/jpeg/jcparam.c \ - $(MY_ROOT)/thirdparty/jpeg/jcprepct.c \ - $(MY_ROOT)/thirdparty/jpeg/jcsample.c \ - $(MY_ROOT)/thirdparty/jpeg/jctrans.c \ - $(MY_ROOT)/thirdparty/jpeg/jdapimin.c \ - $(MY_ROOT)/thirdparty/jpeg/jdapistd.c \ - $(MY_ROOT)/thirdparty/jpeg/jdarith.c \ - $(MY_ROOT)/thirdparty/jpeg/jdatadst.c \ - $(MY_ROOT)/thirdparty/jpeg/jdatasrc.c \ - $(MY_ROOT)/thirdparty/jpeg/jdcoefct.c \ - $(MY_ROOT)/thirdparty/jpeg/jdcolor.c \ - $(MY_ROOT)/thirdparty/jpeg/jddctmgr.c \ - $(MY_ROOT)/thirdparty/jpeg/jdhuff.c \ - $(MY_ROOT)/thirdparty/jpeg/jdinput.c \ - $(MY_ROOT)/thirdparty/jpeg/jdmainct.c \ - $(MY_ROOT)/thirdparty/jpeg/jdmarker.c \ - $(MY_ROOT)/thirdparty/jpeg/jdmaster.c \ - $(MY_ROOT)/thirdparty/jpeg/jdmerge.c \ - $(MY_ROOT)/thirdparty/jpeg/jdpostct.c \ - $(MY_ROOT)/thirdparty/jpeg/jdsample.c \ - $(MY_ROOT)/thirdparty/jpeg/jdtrans.c \ - $(MY_ROOT)/thirdparty/jpeg/jerror.c \ - $(MY_ROOT)/thirdparty/jpeg/jfdctflt.c \ - $(MY_ROOT)/thirdparty/jpeg/jfdctfst.c \ - $(MY_ROOT)/thirdparty/jpeg/jfdctint.c \ - $(MY_ROOT)/thirdparty/jpeg/jidctflt.c \ - $(MY_ROOT)/thirdparty/jpeg/jidctfst.c \ - $(MY_ROOT)/thirdparty/jpeg/jidctint.c \ - $(MY_ROOT)/thirdparty/jpeg/jquant1.c \ - $(MY_ROOT)/thirdparty/jpeg/jquant2.c \ - $(MY_ROOT)/thirdparty/jpeg/jutils.c \ - $(MY_ROOT)/thirdparty/jpeg/jmemmgr.c \ - $(MY_ROOT)/thirdparty/jpeg/jmemansi.c \ - $(MY_ROOT)/thirdparty/zlib/adler32.c \ - $(MY_ROOT)/thirdparty/zlib/compress.c \ - $(MY_ROOT)/thirdparty/zlib/crc32.c \ - $(MY_ROOT)/thirdparty/zlib/deflate.c \ - $(MY_ROOT)/thirdparty/zlib/gzclose.c \ - $(MY_ROOT)/thirdparty/zlib/gzlib.c \ - $(MY_ROOT)/thirdparty/zlib/gzread.c \ - $(MY_ROOT)/thirdparty/zlib/gzwrite.c \ - $(MY_ROOT)/thirdparty/zlib/infback.c \ - $(MY_ROOT)/thirdparty/zlib/inffast.c \ - $(MY_ROOT)/thirdparty/zlib/inflate.c \ - $(MY_ROOT)/thirdparty/zlib/inftrees.c \ - $(MY_ROOT)/thirdparty/zlib/trees.c \ - $(MY_ROOT)/thirdparty/zlib/uncompr.c \ - $(MY_ROOT)/thirdparty/zlib/zutil.c \ - $(MY_ROOT)/thirdparty/freetype/src/autofit/autofit.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftbase.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftbbox.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftbdf.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftbitmap.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftdebug.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftgasp.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftglyph.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftgxval.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftinit.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftlcdfil.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftmm.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftotval.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftpfr.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftstroke.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftsynth.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftsystem.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/fttype1.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftwinfnt.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftxf86.c \ - $(MY_ROOT)/thirdparty/freetype/src/base/ftpatent.c \ - $(MY_ROOT)/thirdparty/freetype/src/bdf/bdf.c \ - $(MY_ROOT)/thirdparty/freetype/src/cache/ftcache.c \ - $(MY_ROOT)/thirdparty/freetype/src/cff/cff.c \ - $(MY_ROOT)/thirdparty/freetype/src/cid/type1cid.c \ - $(MY_ROOT)/thirdparty/freetype/src/gzip/ftgzip.c \ - $(MY_ROOT)/thirdparty/freetype/src/lzw/ftlzw.c \ - $(MY_ROOT)/thirdparty/freetype/src/pcf/pcf.c \ - $(MY_ROOT)/thirdparty/freetype/src/pfr/pfr.c \ - $(MY_ROOT)/thirdparty/freetype/src/psaux/psaux.c \ - $(MY_ROOT)/thirdparty/freetype/src/pshinter/pshinter.c \ - $(MY_ROOT)/thirdparty/freetype/src/psnames/psnames.c \ - $(MY_ROOT)/thirdparty/freetype/src/raster/raster.c \ - $(MY_ROOT)/thirdparty/freetype/src/smooth/smooth.c \ - $(MY_ROOT)/thirdparty/freetype/src/sfnt/sfnt.c \ - $(MY_ROOT)/thirdparty/freetype/src/truetype/truetype.c \ - $(MY_ROOT)/thirdparty/freetype/src/type1/type1.c \ - $(MY_ROOT)/thirdparty/freetype/src/type42/type42.c \ - $(MY_ROOT)/thirdparty/freetype/src/winfonts/winfnt.c + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/bio.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/cio.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/dwt.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/event.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/image.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/j2k.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/j2k_lib.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/jp2.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/jpt.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/mct.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/mqc.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/openjpeg.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/pi.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/raw.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/t1.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/t2.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/tcd.c \ + $(MY_ROOT)/thirdparty/openjpeg-1.4/libopenjpeg/tgt.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jaricom.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcapimin.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcapistd.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcarith.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jccoefct.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jccolor.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcdctmgr.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jchuff.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcinit.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcmainct.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcmarker.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcmaster.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcomapi.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcparam.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcprepct.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jcsample.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jctrans.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdapimin.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdapistd.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdarith.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdatadst.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdatasrc.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdcoefct.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdcolor.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jddctmgr.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdhuff.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdinput.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdmainct.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdmarker.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdmaster.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdmerge.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdpostct.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdsample.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jdtrans.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jerror.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jfdctflt.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jfdctfst.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jfdctint.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jidctflt.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jidctfst.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jidctint.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jquant1.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jquant2.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jutils.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jmemmgr.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jmemansi.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/adler32.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/compress.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/crc32.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/deflate.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/gzclose.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/gzlib.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/gzread.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/gzwrite.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/infback.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/inffast.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/inflate.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/inftrees.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/trees.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/uncompr.c \ + $(MY_ROOT)/thirdparty/zlib-1.2.5/zutil.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/autofit/autofit.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftbase.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftbbox.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftbdf.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftbitmap.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftdebug.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftgasp.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftglyph.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftgxval.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftinit.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftlcdfil.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftmm.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftotval.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftpfr.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftstroke.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftsynth.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftsystem.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/fttype1.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftwinfnt.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftxf86.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/base/ftpatent.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/bdf/bdf.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/cache/ftcache.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/cff/cff.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/cid/type1cid.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/gzip/ftgzip.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/lzw/ftlzw.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/pcf/pcf.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/pfr/pfr.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/psaux/psaux.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/pshinter/pshinter.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/psnames/psnames.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/raster/raster.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/smooth/smooth.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/sfnt/sfnt.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/truetype/truetype.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/type1/type1.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/type42/type42.c \ + $(MY_ROOT)/thirdparty/freetype-2.4.4/src/winfonts/winfnt.c include $(BUILD_STATIC_LIBRARY) diff --git a/android/jni/mupdf.c b/android/jni/mupdf.c index 77ff39a2..46858e1e 100644 --- a/android/jni/mupdf.c +++ b/android/jni/mupdf.c @@ -64,9 +64,9 @@ Java_com_artifex_mupdf_MuPDFCore_openFile(JNIEnv * env, jobject thiz, jstring jf LOGE("Cannot load page tree: '%s'\n", filename); return 0; } - LOGE("Done! %d pages", pdf_get_page_count(xref)); + LOGE("Done! %d pages", pdf_count_pages(xref)); - return pdf_get_page_count(xref); + return pdf_count_pages(xref); } JNIEXPORT void JNICALL @@ -74,7 +74,6 @@ Java_com_artifex_mupdf_MuPDFCore_gotoPageInternal(JNIEnv *env, jobject thiz, int { float zoom; fz_matrix ctm; - fz_obj *pageobj; fz_bbox bbox; fz_error error; fz_device *dev; @@ -91,10 +90,7 @@ Java_com_artifex_mupdf_MuPDFCore_gotoPageInternal(JNIEnv *env, jobject thiz, int currentPageList = NULL; } pagenum = page; - pageobj = pdf_get_page_object(xref, pagenum); - if (pageobj == NULL) - return; - error = pdf_load_page(¤tPage, xref, pageobj); + error = pdf_load_page(¤tPage, xref, pagenum); if (error) return; zoom = resolution / 72; @@ -144,6 +140,7 @@ Java_com_artifex_mupdf_MuPDFCore_drawPage(JNIEnv *env, jobject thiz, jobject bit fz_bbox bbox; fz_pixmap *pix; float xscale, yscale; + fz_bbox rect; LOGI("In native method\n"); if ((ret = AndroidBitmap_getInfo(env, bitmap, &info)) < 0) { @@ -167,12 +164,11 @@ Java_com_artifex_mupdf_MuPDFCore_drawPage(JNIEnv *env, jobject thiz, jobject bit LOGE("Rendering page=%dx%d patch=[%d,%d,%d,%d]", pageW, pageH, patchX, patchY, patchW, patchH); - pix = fz_new_pixmap_with_data(colorspace, - patchX, - patchY, - patchW, - patchH, - pixels); + rect.x0 = patchX; + rect.y0 = patchY; + rect.x1 = patchX + patchW; + rect.y1 = patchY + patchH; + pix = fz_new_pixmap_with_rect_and_data(colorspace, rect, pixels); if (currentPageList == NULL) { fz_clear_pixmap_with_color(pix, 0xd0); @@ -191,7 +187,7 @@ Java_com_artifex_mupdf_MuPDFCore_drawPage(JNIEnv *env, jobject thiz, jobject bit yscale = (float)pageH/(float)(bbox.y1-bbox.y0); ctm = fz_concat(ctm, fz_scale(xscale, yscale)); dev = fz_new_draw_device(glyphcache, pix); - fz_execute_display_list(currentPageList, dev, ctm); + fz_execute_display_list(currentPageList, dev, ctm, fz_infinite_bbox); fz_free_device(dev); fz_drop_pixmap(pix); LOGE("Rendered"); diff --git a/android/local.properties b/android/local.properties new file mode 100644 index 00000000..d0fd99a9 --- /dev/null +++ b/android/local.properties @@ -0,0 +1,2 @@ +#sdk.dir=/Library/android-sdk-mac_x86 +sdk.dir=C:\\Program Files\\android-sdk-windows diff --git a/android/src/com/artifex/mupdf/MuPDFCore.java b/android/src/com/artifex/mupdf/MuPDFCore.java index 28408516..d867b1b1 100644 --- a/android/src/com/artifex/mupdf/MuPDFCore.java +++ b/android/src/com/artifex/mupdf/MuPDFCore.java @@ -31,16 +31,16 @@ public class MuPDFCore { throw new Exception("Failed to open "+filename); } - pageNum = 1; + pageNum = 0; } /* Shim function */ public void gotoPage(int page) { - if (page > numPages) - page = numPages; - else if (page < 1) - page = 1; + if (page > numPages-1) + page = numPages-1; + else if (page < 0) + page = 0; gotoPageInternal(page); this.pageNum = page; this.pageWidth = getPageWidth(); diff --git a/android/src/com/artifex/mupdf/PixmapView.java b/android/src/com/artifex/mupdf/PixmapView.java index c7ba9d72..73e73eda 100644 --- a/android/src/com/artifex/mupdf/PixmapView.java +++ b/android/src/com/artifex/mupdf/PixmapView.java @@ -209,16 +209,16 @@ public class PixmapView extends SurfaceView implements SurfaceHolder.Callback { action = GOTOPAGE; if (delta == Integer.MIN_VALUE) - actionPageNum = 1; + actionPageNum = 0; else if (delta == Integer.MAX_VALUE) - actionPageNum = core.numPages; + actionPageNum = core.numPages-1; else { actionPageNum += delta; - if (actionPageNum < 1) - actionPageNum = 1; - if (actionPageNum > core.numPages) - actionPageNum = core.numPages; + if (actionPageNum < 0) + actionPageNum = 0; + if (actionPageNum > core.numPages-1) + actionPageNum = core.numPages-1; } if (wakeMe) { diff --git a/fitz/fitz.h b/fitz/fitz.h index 28306cfc..381ae919 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -612,6 +612,7 @@ fz_pixmap *fz_new_pixmap_with_limit(fz_colorspace *colorspace, int w, int h); fz_pixmap *fz_new_pixmap_with_data(fz_colorspace *colorspace, int w, int h, unsigned char *samples); fz_pixmap *fz_new_pixmap_with_rect(fz_colorspace *, fz_bbox bbox); +fz_pixmap *fz_new_pixmap_with_rect_and_data(fz_colorspace *, fz_bbox bbox, unsigned char *samples); fz_pixmap *fz_new_pixmap(fz_colorspace *, int w, int h); fz_pixmap *fz_keep_pixmap(fz_pixmap *pix); void fz_drop_pixmap(fz_pixmap *pix); diff --git a/fitz/res_pixmap.c b/fitz/res_pixmap.c index 09d6e1a4..27eac291 100644 --- a/fitz/res_pixmap.c +++ b/fitz/res_pixmap.c @@ -73,6 +73,16 @@ fz_new_pixmap_with_rect(fz_colorspace *colorspace, fz_bbox r) } fz_pixmap * +fz_new_pixmap_with_rect_and_data(fz_colorspace *colorspace, fz_bbox r, unsigned char *samples) +{ + fz_pixmap *pixmap; + pixmap = fz_new_pixmap_with_data(colorspace, r.x1 - r.x0, r.y1 - r.y0, samples); + pixmap->x = r.x0; + pixmap->y = r.y0; + return pixmap; +} + +fz_pixmap * fz_keep_pixmap(fz_pixmap *pix) { pix->refs++; diff --git a/pdf/mupdf.h b/pdf/mupdf.h index 30032798..6870edfc 100644 --- a/pdf/mupdf.h +++ b/pdf/mupdf.h @@ -91,7 +91,7 @@ fz_error pdf_open_stream(fz_stream **stmp, pdf_xref *, int num, int gen); fz_error pdf_open_stream_at(fz_stream **stmp, pdf_xref *xref, int num, int gen, fz_obj *dict, int stm_ofs); fz_error pdf_open_xref_with_stream(pdf_xref **xrefp, fz_stream *file, char *password); -fz_error pdf_open_xref(pdf_xref **xrefp, char *filename, char *password); +fz_error pdf_open_xref(pdf_xref **xrefp, const char *filename, char *password); void pdf_free_xref(pdf_xref *); /* private */ diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c index 0e29625c..6f85671a 100644 --- a/pdf/pdf_xref.c +++ b/pdf/pdf_xref.c @@ -917,7 +917,7 @@ pdf_update_object(pdf_xref *xref, int num, int gen, fz_obj *newobj) */ fz_error -pdf_open_xref(pdf_xref **xrefp, char *filename, char *password) +pdf_open_xref(pdf_xref **xrefp, const char *filename, char *password) { fz_error error; fz_stream *file; |